OPay Refund Payment API
You can refund a payment by using our Refund Payment API.
OPay Refund Payment
You can refund a paid payment using this API.
For calling the API using the POST method you can use these endpoints URL:
In case you are still in the developing phase, use the following staging API endpoint URL
https://testapi.opaycheckout.com/api/v1/international/payment/refund/create
-Once you have a fully tested payment flow and you are ready for production, Use the following production API endpoint URL instead
https://liveapi.opaycheckout.com/api/v1/international/payment/refund/create
Request Parameters:
- Header: Authorization(API Calls Signature), MerchantId
- Json object containing the transaction information:
HTTP POST Parameters
Here is a detailed description for the parameters you need to complete the POST request:
An example call of payment refund API is as follows :
Header must contain the "Signature" , "MerchantId"
Signature is calculated using SHA-512 HMAC signed with your Private Key. See API Calls Signature section for more details.
OPay Refund Payment Response
Response Parameters:
The parameters contained in the response received whenever you call the Transaction Create API as a JSON Object.
Here is a detailed description for the parameters received in the response:
Parameter | type | Description | example | |
---|---|---|---|---|
reference | String |
Merchant's refund order number. | 03948512001 | |
originalReference | String |
Merchant's original order number. | 03948512 | |
orderNo | String |
OPay refund order number. | 211003140885499643 | |
originalOrderNo | String |
OPay original order number. | 10212100000034000 | |
refundAmount | ||||
total | Integer |
Refund amount(cent unit). | 400 | |
currency | String |
currency type.See full list here | NGN | |
country | String |
Country Code.See full list here | NG | |
orderStatus | enum |
[INITIAL, PENDING, SUCCESS, FAIL] |
SUCCESS |
Error Handling
After submitting an API call to OPay, you receive a response back to inform you that
your request was received and processed. A successful OPay API should return a status code 00
,
meanwhile, in a situation where any payment processing error occurred, you will receive an error code with a
message to describe the reason of the error. A sample error response can be found below.
Depending on the HTTP status code of the response, you should build some logic to handle any errors that a request or the system may return. A list of possible potential error codes that you may receive can be found below.
Error Code | Error Message |
---|---|
02000 | authentication failed. |
02001 | request params not valid. |
02006 | not found. |
02002 | merchant not configured with this function. |
02007 | merchant not available. |
50003 | service not available, please try again. |