API Basics

Request Methods

For the majority of our integration options (excluding via USB and APP installation), we utilize the HTTPS request methods (POST, GET, PUT, DELETE). The specific request method required for each endpoint will be clearly indicated.

HOST URL

The base URL for accessing our API endpoints is: https://payapi.opayweb.com

Data Format

Both the request body and the response data are formatted in JSON.

Integration Support

To facilitate the integration process, we offer data samples for each endpoint and authentication samples in various popular programming languages. You can simply copy these samples and replace the placeholder parameters with your own data.

Common Parameters

Common parameters must be included in all API requests.

Request Header

ParameterTypeRequiredDescription
clientAuthKeyString[32]YesOPay provides a unique KEY for each Business. One business account will only have one clientAuthKey.
versionString[20]YesCurrent version: V1.0.1
bodyFormatString[20]YesFormat of request body before encryption: JSON.
timestampString[15]YesThe timestamp is the number of milliseconds since January 1, 1970 (midnight UTC/GMT). The validity period is 5 minutes.

Request Body

ParameterTypeRequiredDescription
paramContentString[BIG]YesEncrypted JSON
signString[64]YesSplice a timestamp to the paramContent to get the signature
Request Demo
{
  "paramContent": "gkFFz97z1sEbbOeVPdoR+cHkf4Ib........",
  "sign": "ORDVpacVCNW0yiSviNeow......"
}
1
2
3
4

Request

ParameterTypeRequiredDescription
codeString[4]Yes00000 means response successful, otherwise failed
messageString[512]Yes
signString[64]YesSignature of message authentication returned by OPay
timestampString[15]YesTime Stamp
dataString[BIG]YesThe response to the encrypted JSON string. You must decrypt the "data" to obtain the parameters in plaintext.
Response Before Decryption
{
  "code": "00000",
  "message": "SUCCESSFUL",
  "sign":"yUJrerHr9GqKP7y......",
  "timestamp":"1283203360637",
  "data":"KshnV6Y4kfAXUvwPNb......" 
}
1
2
3
4
5
6
7
Response After Decryption
{
  "code": "00000",
  "message": "SUCCESSFUL",
  "sign":"yUJrerHr9GqKP7y......",
  "timestamp":"1283203360637",
  "data": {
      "param1": "XXXXXXX",
      "param2": "XXXXXXX"
  }
}
1
2
3
4
5
6
7
8
9
10

Webhooks

Webhook URL Configuration

To enable this feature, please add your webhook URL on your OPay Business Dashboard using the Super Admin role. Please ensure that your webhook URL is publicly accessible and can receive incoming requests. OPay Business Dashboard > "Integration" Menu > "Developer Tools" page > POS & Others > Add Webhook URL

Response Time

The standard response time for webhooks is set at 5 seconds. If your system requires more time to process long-running tasks, we strongly advise you to send an acknowledgement of receipt to us before proceeding with your own tasks.

Failure and Resend Policy

If we do not receive a timely response, we will consider the webhook attempt as failed. In such cases, we will automatically retry sending the webhook after 5 seconds. Between every 5 subsequent attempts, the interval between retries will increase.

Transaction Status

StatusDescription
SUCCESSPayment is successful and the money is credited to your dedicated account.
FAILPayment is failed and the money is not with OPay.
CLOSEPayment is closed due to timeout.
CANCELPayment is cancelled by the operator.
PENDINGAwaiting payment from customers. This status only occurs when you call the endpoint to query transaction status.

Common Response Codes

Response CodeDescription
00000Response successful.
00004Invalid request parameters. Please check your common request header & body parameters.
00005Duplicate business order number for initiating transactions, please check again.
10000System busy, please try again.
11004Response blocked due to system error, please try again later.
11005Response data is null due to system error, please try again later.
A_1001Request expired. Please try again.
C1004Invalid request as the recipientBankCode is null.
C1009The bank code is not supported, please check your bank code.
C_1111Fail to query merchant key. Please reconfirm you have submitted the key or try again later.
Show more parameters
Last Updated: 11/7/2024, 2:29:28 AM