Skip to main content

Initiate USSD Payment with Reference

POST /payments/webhook/{paymentmethod}

Description​

Initiate a USSD payment with a reference for a specific user.

Required Headers​

TypeDescription
apiKeystring(Required). Wallet API key for authentication. Include in the request header.
Authorizationstring(Required). Authentication token. Include in the request header using the "Bearer" scheme. Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NGQ2Nm...

Request Body​

  • Media Type: application/json
NameTypeDescription
requestId*string(Required) Unique identifier for the USSD request.
accountId*string(Required) Identifier for the user's account.
userId*string(Required) Identifier for the user initiating the USSD payment.
amount*number(Required) Amount to be paid using USSD.
bankCode*string(Required) Bank code for processing the USSD payment.

Example​

Request Body​
{
"requestId": "ussd_request_123",
"accountId": "user_account_456",
"userId": "user_id_789",
"amount": 100,
"bankCode": "bank_code_xyz"
}

Try yourself;

cURL

curl --location 'http://20.87.230.105/platform/wallets///payments/ussd/invokereference' \
--header "apiKey: yourApiKey" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer yourAccessToken" \
--data '{
"requestId": "ussd_request_123",
"accountId": "user_account_456",
"userId": "user_id_789",
"amount": 100,
"bankCode": "bank_code_xyz"
}'

Success Response (200)​

FieldTypeDescription
statusBooleanIndicates the success of the USSD payment request.
statusCodeIntegerNumeric code representing the status of the response (e.g., 0 for success).
messageStringA message indicating the outcome of the operation.
dataObjectAn empty object, as no additional data is returned in a successful response.
errorsArrayAn array of objects providing details about any errors encountered during the request.

Example:

json{
"status": true,
"statusCode": 0,
"message": "USSD payment request initiated successfully",
"data": {},
"errors": []
}

Error Response​

FieldTypeDescription
statusBooleanIndicates the success of the USSD payment request.
statusCodeIntegerNumeric code representing the status of the response (e.g., 400 for client error).
messageStringA message indicating the type of error.
dataObjectAn empty object, as no additional data is returned in an error response.
errorsArrayAn array of objects providing details about specific errors encountered during the request.

Example:

{
"status": false,
"statusCode": 400,
"message": "Validation Error",
"data": {},
"errors": [
{
"message": "Invalid amount",
"descriptiveMessage": "The 'amount' parameter should be a positive integer."
},
{
"message": "Invalid bank code",
"descriptiveMessage": "The specified 'bankCode' is not valid."
}
]
}

Method: POST​

>http://20.87.230.105/platform/wallets///payments/ussd/invokereference

Headers​

Content-TypeValue
apiKey{{apiKey}}

Body (raw)​

{
"requestId": "ussd_request_123",
"accountId": "user_account_456",
"userId": "user_id_789",
"amount": 100,
"bankCode": "bank_code_xyz"
}

🔑 Authentication bearer​

ParamvalueType
token{{accessCode}}string

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request POST \ 
--url /payments/webhook/{paymentmethod} \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!