Klasha Wire API
Summary
Give merchants the ability to send out funds from their collection balance via API using our internal Klasha rates.
Coverage
See all available currencies here
You can transfer money in four easy steps:
Generate a bearer token
Create a beneficiary
Generate a quote for the beneficiary
Initiate a payment
Integration step
Generate a bearer token
Using the Token endpoint on the Postman collection, the token can be obtained from the headers under the header name: token
POST
{{env_url}}/auth/account/v2/login
Request Body
Name | Type | Description |
---|---|---|
username* | username | |
password* | password |
Create a beneficiary
Make a POST call to the Create Merchant Beneficiary API to create your beneficiary
POST
{{env_url}}/merchant/merchantbeneficiary/create
Make a POST call to the Create Merchant Beneficiary API to create your beneficiary. See an example of the payload you need to encrypt and send in order to create a beneficiary
The encrypted JSON body for the request can be found in the Postman link.
You’d need to pass, as header the x-auth-token
. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
Headers
Name | Value |
---|---|
Authorization* | Bearer {{token}} |
x-auth-token | MERCHANT PUBLIC KEY |
Request Body
Name | Type | Description |
---|---|---|
accountNumber* | 1234567890 | |
accountNumberCurrency* | USD | |
bankName* | Bank Name | |
bankAddress* | Bank Address | |
beneficiaryName* | Beneficiary Name | |
beneficiaryAddress* | Beneficiary Address | |
country* | Country Name | |
countryCode* | USD | |
currency* | USD | |
phone* | phone number | |
swiftCode* | SWFT1234 | |
narration* | clothes | |
email* | your.email@example.com | |
routingNumber* | 12345 | |
iban* | 045 |
Generate a quote
Make a POST call to the Create Quote API to generate your quote
POST
{{env_url}}/wallet/wire/generate/quote
Make a POST call to the Create Quote API to generate your quote. See an example of the payload you need to encrypt and send in order to generate your quote.
The encrypted JSON body for the request can be found in the Postman link as well as other APIs.
You’d need to pass, as header the x-auth-token
. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
Headers
Name | Value |
---|---|
Authorization | Bearer {{token}} |
x-auth-token | MERCHANT PUBLIC KEY |
Request Body
Name | Type | Description |
---|---|---|
sourceCurrency* | NGN | |
destinationCurrency* | USD | |
beneficiary* | beneficiar87954c4f-736a-4e09-b588-76ab9c13bafeyId | |
destinationAmount* | 1000.00 |
Initiate a payment
Make a POST call to the Initiate Payment API
POST
{{env_url}}/wallet/wire/initiate
Make a POST call to the Initiate Payment API to convert your quote into an initialised payment.
See an example of the payload you need to encrypt and send in order to generate your quote.
The encrypted JSON body for the request can be found in the Postman link as well as other APIs
You’d need to pass, as header the x-auth-token
. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
Headers
Name | Value |
---|---|
Authorization | Bearer {{token}} |
x-auth-token | MERCHANT PUBLIC KEY |
Request Body
Name | Type | Description |
---|---|---|
quoteToken* | 842dcd42-8f95-4a3b-a5f3-07a3d0416119 | |
beneficiary* | 87954c4f-736a-4e09-b588-76ab9c13bafe | |
narration* | School fees | |
invoiceUrl* | www.invoiceURL.com |
Fetch all your payments
Make a GET call to the Fetch All API
GET
{{env_url}}/wallet/wire/fetch/all
Make a GET call to the Fetch All API to retrieve all your previously initiated wire payments.
The URL can be found in the Postman link well as other APIs
You’d need to pass, as header the x-auth-token
. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
Headers
Name | Value |
---|---|
Authorization | Bearer {{token}} |
x-auth-token | MERCHANT PUBLIC KEY |
Fetch a single payment by reference
Fetch by reference API to retrieve all your previously initiated wire payments.
GET
{{env_url}}/wallet/wire/fetch/by/reference/<ref>
Make a GET call to the Fetch by reference API to retrieve all your previously initiated wire payments.
The URL can be found in the Postman link well as other APIs
You’d need to pass the transactionReference
you obtained when you initiated the payment, as a path variable.
You’d need to pass, as header the x-auth-token
. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.
Headers
Name | Value |
---|---|
Authorization | Bearer {{token}} |
x-auth-token | MERCHANT PUBLIC KEY |
Notes
Klasha Wire Statuses
When you generate a quote and initiate a payment, one of the field in the response body is klashaWireStatus
, here you can find all the possible cases and explanation:
PENDING: this is the status when a payment just get initialised through the API. This is not a final status.
PROCESSING: this is when Klasha is actually processing the payment itself. This is not a final status.
SUCCESSFUL: the klasha wire payment was executed successfully. Final status.
CANCELLED: The payment has been cancelled from the Klasha finance/operation team, in result of previous communication with the merchant. Final status.
FAILED: the initiated wire payments failed to be executed. Final status.
Quote expiry logic
After you proceeded generating your quote, you can now convert that quote into an initiated payment.
The initiation would be successful if the quote is NOT expired.
A quote does not expire because of time but just if the rate in our system changed.
Example
If you generate a quote on 1st Oct at 11am and at 3pm the rate changes, you can convert your quote into a initiated payment until 2:59:59pm. Right after, then the rate get updated at 3pm, you won’t be able to initiate a payment with that quote and you’d have to generate a new quote.
In case you try to initiate a payment with an expired quote, you’d have a Bad Request response with the the following body:
Last updated