Comment on page
Klasha Wire API
Give merchants the ability to send out funds from their collection balance via API using our internal Klasha rates.
Coverage
You can transfer money in four easy steps:
- 1.Generate a bearer token
- 2.Create a beneficiary
- 3.Generate a quote
- 4.Initiate a payment
- 5.Update a payment
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/auth/login
Create a beneficiary
post
{{env_url}}/merchant/merchantbeneficiary/create
Make a POST call to the Create Merchant Beneficiary API to create your beneficiary
Generate a quote
post
{{env_url}}/wallet/wire/generate/quote
Make a POST call to the Create Quote API to generate your quote
Initiate a payment
post
{{env_url}}/wallet/wire/initiate
Make a POST call to the Initiate Payment API
Fetch all your payments
get
{{env_url}}/wallet/wire/fetch/all
Make a GET call to the Fetch All API
Fetch a single payment by reference
get
{{env_url}}/wallet/wire/fetch/by/reference/<ref>
Fetch by reference API to retrieve all your previously initiated wire payments.
Get all currency pair rates
get
{{env_url}}/nucleus/general/exchange/all/public
Make a GET call to the following URL to retrieve the rates:
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:
{
"message": "Quote has expired or does not exist!",
"error": "QuoteNotFoundException",
"data": null
}
Last modified 8d ago