Skip to content

Manage Subscription

| View as Markdown

This API will be used by merchant who wants to accept recurring payments via subscription model. Auto debit can be done based on the preference or interval. Unsubscribe allows to stop the subscription to no longer continue it, Pause allows you to pause the subscription for an interval and Resume allows you to again start the subscription after an interval.

https://kraken.airpay.co.in/airpay/api/updatesubscription.php
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
merchant_id requiredNumberMerchant Identification Number11111
subscription_id requiredNumberairpay Subscription Id1000001
action requiredStringRequest Type
”U” - Unsubscribe
”P” - Pause
”R” - Resume
U,P,R
sb_date requiredDateRequest date is future date when to update the subscription (Ex : DD-MM-YYYY)12-12-2020
checksum requiredAlphanumeric
(10-200)
Checksum
privatekey = hash(‘sha256’, secret.’@’.username.’:
:‘.password)
Hash generated by: hash_hmac(‘sha256’, subscription_id+private_key+ merchant_id+action+sb_date , <secret_key>)
Note: Use the same secret key, username and password provided on payment kit to generate private key
ParameterType ValueDescriptionValue Like
status requiredNumberStatus value will pass as per the condition200,533
message requiredStringStatus message value will pass as per the conditionSubscription updated successfully,Error in unsubscription
{
"merchant_id" : "11111",
"subscription_id" :"1000001",
"action" : "U",
"sb_date" : "12-12-2020",
"checksum" : "92c617a556982a8d124ff2b7ce9eae3e"
}
<?xml version="1.0" encoding="utf-8"?>
<REQUEST>
<SUBSCRIPTION>
<MERCHANT_ID><![CDATA[11111]]></MERCHANT_ID>
<SUBSCRIPTION_ID><![CDATA[11111]]></SUBSCRIPTION_ID>
<ACTION><![CDATA[U]]></ACTION>
<SB_DATE><![CDATA[12-12-2020]]></SB_DATE>
<CHECKSUM><![CDATA[92c617a556982a8d124ff2b7ce9eae3e]]></CHECKSUM>
</SUBSCRIPTION>
</REQUEST>
HTTP/1.1 200 OK
{
"status" : "200",
"message" : "Subscription updated successfully.",
}
HTTP/1.1 200 OK
{
"status" : "400",
"message" : "Charge not possible on this Date.",
}
HTTP/1.1 200 OK
<?xml version="1.0" encoding="utf-8"?>
<RESPONSE>
<SUBSCRIPTION>
<STATUS>200</STATUS>
<MESSAGE>Subscription updated successfully.</MESSAGE>
</SUBSCRIPTION>
</RESPONSE>
HTTP/1.1 200 OK
<?xml version="1.0" encoding="utf-8"?>
<RESPONSE>
<SUBSCRIPTION>
<STATUS>400</STATUS>
<MESSAGE>Charge not possible on this Date. </MESSAGE>
</SUBSCRIPTION>
</RESPONSE>
200 - Subscription updated successfully
533 - Error in unsubscription
603 - Subscription is in Unsubscribed state
604 - Amount should not be greater than <Your request amount>
605 - Amount should be greater than or equal to 1
619 - Subscription id is invalid
620 - Subscription request was not accepted
621 - Subscription action is invalid
622 - Subscription is already set one skip recurring
623 - Error in update amount subscription
624 - Subscription is already in Subscribed state
625 - Subscription is already in Paused state
626 - No future recurring subscription
627 - Error in pausing subscription
628 - Error in resuming subscription