Adhoc charge
SUBSCRIPTION - Adhoc charge
Section titled “SUBSCRIPTION - Adhoc charge”Adhoc is generally additional amount charged by merchant or requested to be added by the customer. This API will be used by merchant to charge the Enach adhoc subscription. We must pass merchant id, subscription id, sb amount and action as “C”- adhoc in request. If the request has valid details, we will get a success response as “Recurring added successfully”.
https://kraken.airpay.co.in/airpay/api/updatesubscription.phpHeader
Section titled “Header”| Field | Type | Description |
|---|---|---|
| Content-Type | String | For JSON: application/json For XML: application/xml |
Parameter
Section titled “Parameter”| Field | Type | Description |
|---|---|---|
| merchant_id | Number | Merchant Identification Number (required) |
| subscription_id | Number | Airpay Subscription Id (required) |
| sb_amount | Number | Amount to be charged should not be greater than max amount (required) |
| sb_date | Date | is date when the customer is to be charged, which need greater than by minimum 2 days from date of initiation (Ex : DD-MM-YYYY) (required) |
| action | String | Action (required) “C”- adhoc |
| checksum | Alphanumeric | Checksum (length 10-200) (required) privatekey = hash(‘sha256’, secret.’@’.username.’: |
Request-Example:
Section titled “Request-Example:”{ "merchant_id": "29555", "subscription_id": "10062147", "sb_amount": "2000.00", "sb_date": "27-08-2022", "action": "C", "checksum": "86a1867e4d8728308c86930e35d7948f2cb8c314e8e5ce67db77ab54c4e05e5c"}Request-Example: XML
Section titled “Request-Example: XML” <?xml version="1.0" encoding="utf-8"?> <REQUEST> <SUBSCRIPTION> <MERCHANT_ID><![CDATA[29555]]></MERCHANT_ID> <SUBSCRIPTION_ID><![CDATA[10062147]]></SUBSCRIPTION_ID> <ACTION><![CDATA[C]]></ACTION> <SB_DATE><![CDATA[27-08-2022]]></SB_DATE> <CHECKSUM><![CDATA[86a1867e4d8728308c86930e35d7948f2cb8c314e8e5ce67db77ab54c4e05e5c]]></CHECKSUM> </SUBSCRIPTION></REQUEST>Success 200
Section titled “Success 200”| Field | Type | Description |
|---|---|---|
| status | Number | Status value will pass as per the condition |
| message | String | Status message value will pass as per the condition |
Success-Response:
Section titled “Success-Response:” HTTP/1.1 200 OK { "status" : "200", "message" : "Subscription updated successfully.", }Failed-Response:
Section titled “Failed-Response:” HTTP/1.1 200 OK { "status" : "400", "message" : "Sb Date should not be less than current date + 2 days.", }Success-Response: XML
Section titled “Success-Response: XML”HTTP/1.1 200 OK <?xml version="1.0" encoding="utf-8"?> <RESPONSE> <SUBSCRIPTION> <STATUS>200</STATUS> <MESSAGE>Subscription updated successfully.</MESSAGE> </SUBSCRIPTION> </RESPONSE>Failed-Response: XML
Section titled “Failed-Response: XML”HTTP/1.1 200 OK <?xml version="1.0" encoding="utf-8"?> <RESPONSE> <SUBSCRIPTION> <STATUS>400</STATUS> <MESSAGE>Sb Date should not be less than current date + 2 days.</MESSAGE> </SUBSCRIPTION> </RESPONSE>Status List:
Section titled “Status List:”200 - Subscription updated successfully533 - Error in unsubscription603 - Subscription is in Unsubscribed state604 - Amount should not be greater than <Your request amount>605 - Amount should be greater than or equal to 1619 - Subscription id is invalid620 - Subscription request was not accepted621 - Subscription action is invalid622 - Subscription is already set one skip recurring623 - Error in update amount subscription624 - Subscription is already in Subscribed state625 - Subscription is already in Paused state626 - No future recurring subscription627 - Error in pausing subscription628 - Error in resuming subscription