Skip to main content
We recommend checking out the introductory section to understand the basics of direct charge first. This guide assumes you’ve read that.
Direct USSD charge allows you to collect payments via USSD. With a USSD charge, you call our API to initiate the payment, and your customer completes it by dialing their bank’s USSD code on their mobile phone. Once the payment is completed, we’ll notify you via a webhook. ussd

Initiating the Payment

First, you’ll need the customer’s payment details. Since it’s a USSD transaction, the only detail you need is the account_bank, the code matching the customer’s bank. You can provide a simple UI for the user to select their bank.

Supported Banks

USSD payments are currently only supported for the following banks:
Now, combine that with the rest of the payment details to create the payload and send to our charge USSD endpoint. You’ll need to specify amount, currency, email and a unique tx_ref. You can also specify more details, such as the customer’s fullname, phone_number, and custom meta information. See the endpoint documentation for details.

Handling the response

You’ll get a response that looks like this:
Success
Let’s break this down:
  • status is "successful", meaning that the charge was initiated successfully
  • data.status is "pending", meaning that the customer needs to authorize the transaction via USSD
  • data.payment_code contains a code for this transaction. For GTBank USSD payments, the user will be prompted to enter this after dialing the USSD code.
  • meta.authorization contains the important details to complete the payment. The note field holds the USSD code that the customer needs to dial from the mobile number linked to their bank account. Typically, it will be in the form *<bank_code>*xxx*<payment_code>#.
You should instruct your customer to dial the code in meta.authorization.note (and enter the payment_code) if necessary to complete the payment.

Completing the Payment

To complete the payment, the customer needs to dial the USSD code and authorize the charge.
Testing TipIn Test Mode, USSD transactions will automatically be paid (transition to “successful”) after a few seconds.
We’ll send you a webhook notification when the payment is completed. Here’s what that looks like:
In your webhook handler, you can then verify the payment and credit your customers with whatever they paid for. See our guide to transaction verification for details.
You’ll get a response that looks like this, and you can see that the data.status field is now "successful".
Payment Successful
All done.

Putting it Together

Here’s what a full implementation might look like: