Subscription Callback
The Recurring Payment Confirmation API is used to call the merchant’s URL to confirm whether to charge a recurring amount from a customer, with the call initiated one or two days before the scheduled recurring payment date. The request must include the subscription ID, subscription amount, subscription date, and order ID. Upon receiving valid request details, the API returns a success response indicating whether the charge should proceed or not. If no response is received on the first callback attempt, the system will retry the following day before the recurring date. If no callback API is available, the recurring transaction is automatically considered approved for charging.
https://examplemerchantwebsite.eg/subscriptionChargebackApprovalHeader
Section titled “Header”| Parameter | Type Value | Description | Value Like |
|---|---|---|---|
| Content-Type required | String | The Content-Type header specifies the media type of the request or response body, allowing the receiver to correctly interpret the data. For XML data, use application/xml. | For JSON: application/json,For XML: application/xml |
Request Body
Section titled “Request Body”| Parameter | Type Value | Description | Value Like |
|---|---|---|---|
| subscription_id required | Number | airpay Subscription Id | 1000001 |
| sb_amount required | Number | Subscription charge amount | 2000.00 |
| sb_date required | Date | Subscription charge date (Ex : DD-MM-YYYY) | 12-12-2020 |
| order_id required | Alphanumeric (1-25) | Order ID | 32434235435365 |
| checksum required | Alphanumeric (10-200) | Checksum privatekey = hash(‘sha256’, secret.’@’.username.’: | :‘.password) Hash generated by: hash_hmac(‘sha256’, subscription_id+private_key+ merchant_id+sb_amount, <secret_key>) Note: Use the same secret key, username and password provided on payment kit to generate private key |
Success 200
Section titled “Success 200”| Parameter | Type Value | Description | Value Like |
|---|---|---|---|
| status required | Number | Status Code 200 : Approve, 400 : Reject | 200,400 |
| message required | String | Status Message 200 : Approve, 400 : Reject | Approve,Reject |
Request Example
Section titled “Request Example”{ "subscription_id" : "1000001", "order_id": "32434235435365", "sb_amount" : "2000.00", "sb_date" : "12-12-2020", "checksum" : "2e6cf436576f49276315b02c9fb02e75"}Success Response (Approve)
Section titled “Success Response (Approve)”HTTP/1.1 200 OK { "status" : "200", "message" : "Approve", }Success Response (Reject)
Section titled “Success Response (Reject)”HTTP/1.1 200 OK { "status" : "400", "message" : "Reject", }