Charge By USSD
{{URL}}/api/pgs/payment/v1/makePayment
USSD PAYMENT METHOD
The USSD payment method allows users to make payments using Unstructured Supplementary Service Data (USSD) technology. The following steps outline the process:
- 1Call the Create Payment endpoint to initiate a payment transaction.
- 2Call the Make Payment endpoint with the necessary details to complete the payment.
- 3Input the provider response into your USSD device to proceed with the payment.
- 4If a callbackUrl is provided in the Create Payment payload, you will receive transaction notifications
- 5To retrieve payment details, call the Get Payment Details endpoint.
AUTHORIZATION
Username | Password |
Username | {{USERNAME}} |
Password | {{SECRETKEY}} |
BODY PARAMS
{ "reference":"rexpaydocUSSD", "userId":"08102164545", "amount":50, "currency":"NGN", "callbackUrl":"http://pgs.com", "paymentChannel":"USSD" }
Request Parameters
Name | Type | Description | Optional Mandatory |
reference | String | Reference Id | true |
userId | String | User Identification number | true |
amount | Number | Transaction amount | true |
currency | String | Transaction currency | true |
callbackUrl | String | URL returned after payment | true |
paymentChannel | String | Medium of payment | true |
Example Request
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "reference": "rexpaydocUSSD", "userId": "08102164545", "amount": 50, "currency": "NGN", "callbackUrl": "http://pgs.com", "paymentChannel": "USSD" }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("{{URL}}/api/pgs/payment/v1/makePayment", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
Response Parameters
Name | Type | Description | Optional Mandatory |
reference | String | Reference Id | true |
clientId | String | Client Identification number | true |
paymentUrl | String | URL for payment | true |
status | String | Transaction status | true |
paymentChannel | String | Channel of payment | true |
providerResponse | String | Response | true |
paymentUrlReference | String | Unique URL for payment | true |
providerExtraInfo | String | Provider extra response | true |
externalPaymentReference | Number | Unique external payment reference number | true |
fees | Number | Transaction charge fee | true |
currency | String | Transaction currency | true |
Example Response
{ "reference": "rexpaydocUSSD", "clientId": "gaprodtest", "paymentUrl": "https://checkout.myrexpay.ng/pay/16965549p3a6Dbdm6I", "status": "ONGOING", "paymentChannel": "USSD", "providerResponse": "1589#", "paymentUrlReference": "16965549p3a6Dbdm6I", "providerExtraInfo": "4001GPG1**4001GPG10000001", "externalPaymentReference": "16965549p3a6Dbdm6I", "fees": 0.75, "currency": "NGN" }
Did you find this page helpful?