Payout

Summary

Send money locally with Klasha to bank accounts and mobile money wallets in Africa.

Coverage

  • NGN

  • GHS (beta)

  • KES (beta)

You can transfer money in four easy steps:

  1. Verify the account number

  2. Create transfer recipient

  3. Initiate a transfer

  4. Listen for status.


circle-info

Before you begin!

chevron-rightGenerate bearer tokenhashtag

Using the Token endpointarrow-up-right to generate a bearer token. The token obtained from the api should be passed in the used to authenticate the requests below.

chevron-rightFetch bank codeshashtag

Use the API below to fetch the available bank codes.

GET: {{base_url}}/wallet/merchant/bank/transfer/request/banks/:currency

chevron-rightVerify account numberhashtag

Using the Resolve account number endpoint on the Postman collection herearrow-up-right, verify the account number by making use of the bank codes gotten from here. See an example in the screenshot below

Generate a transfer reference

It’s a unique reference sent as requestId that can be used to uniquely identify a transfer.

Initiate a transfer

chevron-rightCreate payloadhashtag
  • Serialize the payload

Encryption Algorithm

You need to encrypt the entire create transfer payload that we specify on the previous point (here). In order to encrypt the body correctly, you’d need the encryptionKey (that you can obtain following this guide here). Find an encryption algorithm code snippet below:

chevron-rightEncrypted Payloadhashtag

The result of the encryption of the payload that we specified here have to be used with the Merchant payout endpoint as shown below:

Merchant Payout request

Make a POST call to the Merchant payout request API

POST {{env_url}}/wallet/merchant/{businessId}/bank/transfer/v2/request

You would need to pass, as a header the x-auth-token. This can be obtained from your merchant dashboard → Settings → Generate API keys → Merchant public key.

Headers

Key
Value

Content-Type

application/json

x-auth-token

Your merchant public key

Authorization

Bearer <token here>

Request body (encrypted):

Listen for a status response

When a transfer is initiated, it could take a few seconds or minutes to be processed. This is why we recommend relying on webhooks for verification as opposed to polling.

Once a transfer is processed, we send the final status of the transfer as a POST request to your webhook URL (see webhookarrow-up-right details here).

Get wallet balance

To get your wallet balance you would need to make a GET request to the API below:

GET {{env_url}}/nucleus/business/api/wallets

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

x-auth-token

<public key>

Response

The possible statuses are listed and described in the following table:

Status
Description

successful

This is sent when the transfer is successful

failed

This is sent when the transfer fails

pending

This transfer is still in progress. Please wait for either success or failed.

Polling transfer statuses

  • You can fetch the transfer from the Find by ref API on the Postman collection to know the status. See example in the below screenshot.

Source wallet

All transfers would be debited from NGN Wallet balance. Ensure you have sufficient balance before making any transfer request.

Last updated