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:

  • 1
    Call the Create Payment endpoint to initiate a payment transaction.
  • 2
    Call the Make Payment endpoint with the necessary details to complete the payment.
  • 3
    Input the provider response into your USSD device to proceed with the payment.
  • 4
    If a callbackUrl is provided in the Create Payment payload, you will receive transaction notifications
  • 5
    To retrieve payment details, call the Get Payment Details endpoint.

AUTHORIZATION

UsernamePassword
Username{{USERNAME}}
Password{{SECRETKEY}}

BODY PARAMS

{
  "reference":"rexpaydocUSSD",
  "userId":"08102164545",
  "amount":50,
  "currency":"NGN",
  "callbackUrl":"http://pgs.com",
  "paymentChannel":"USSD"
}

Request Parameters

NameTypeDescriptionOptional Mandatory
referenceStringReference Idtrue
userIdStringUser Identification numbertrue
amountNumberTransaction amounttrue
currencyStringTransaction currencytrue
callbackUrlStringURL returned after paymenttrue
paymentChannelStringMedium of paymenttrue

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

NameTypeDescriptionOptional Mandatory
referenceStringReference Idtrue
clientIdStringClient Identification numbertrue
paymentUrlStringURL for paymenttrue
statusStringTransaction statustrue
paymentChannelStringChannel of paymenttrue
providerResponseStringResponsetrue
paymentUrlReferenceStringUnique URL for paymenttrue
providerExtraInfoStringProvider extra responsetrue
externalPaymentReferenceNumberUnique external payment reference numbertrue
feesNumberTransaction charge feetrue
currencyStringTransaction currencytrue

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?