Skip to content

Subscription Callback

| View as Markdown

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/subscriptionChargebackApproval
ParameterType ValueDescriptionValue Like
Content-Type requiredStringThe 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
ParameterType ValueDescriptionValue Like
subscription_id requiredNumberairpay Subscription Id1000001
sb_amount requiredNumberSubscription charge amount2000.00
sb_date requiredDateSubscription charge date
(Ex : DD-MM-YYYY)
12-12-2020
order_id requiredAlphanumeric
(1-25)
Order ID32434235435365
checksum requiredAlphanumeric
(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
ParameterType ValueDescriptionValue Like
status requiredNumberStatus Code
200 : Approve, 400 : Reject
200,400
message requiredStringStatus Message
200 : Approve, 400 : Reject
Approve,Reject
{
"subscription_id" : "1000001",
"order_id": "32434235435365",
"sb_amount" : "2000.00",
"sb_date" : "12-12-2020",
"checksum" : "2e6cf436576f49276315b02c9fb02e75"
}
HTTP/1.1 200 OK
{
"status" : "200",
"message" : "Approve",
}
HTTP/1.1 200 OK
{
"status" : "400",
"message" : "Reject",
}