---
title: Adhoc Charge
description: Charge an adhoc amount on an Enach subscription.
---

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".

#### POST

```
https://kraken.airpay.co.in/airpay/api/updatesubscription.php
```

## 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

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| merchant_id  required | Number | Merchant Identification Number | `29555` |
| subscription_id  required | Number | airpay Subscription Id | `10062147` |
| sb_amount  required | Number | Amount to be charged should not be greater than max amount | `2000.00` |
| sb_date  required | Date | Subscription 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) | `27-08-2022` |
| action  required | String | Action<br>"C"- adhoc | `C` |
| checksum  required | Alphanumeric  <br>(10-200) | Checksum<br>privatekey = hash('sha256', secret.'@'.username.':|:'.password)<br>Hash generated by: hash_hmac('sha256', subscription_id+private_key+merchant_id+action+sb_date+sb_amount, <secret_key>)<br>Note: Use the same secret key, username and password provided on payment kit to generate private key | `86a1867e4d8728308c86930e35d7948f2cb8c314e8e5ce67db77ab54c4e05e5c` |

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| status  required | Number | Status value will pass as per the condition | `200,533` |
| message  required | String | Status message value will pass as per the condition | `Subscription updated successfully,Error in unsubscription` |

## Request Example (JSON)

```json
{
    "merchant_id" : "29555",
    "subscription_id" : "",
    "sb_amount": "2000.00",
    "sb_date" : "27-08-2022",
    "action" : "C",
    "checksum" : "86a1867e4d8728308c86930e35d7948f2cb8c314e8e5ce67db77ab54c4e05e5c"
}
```

## Request Example (XML)

```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 Response (JSON)

```json
HTTP/1.1 200 OK
 {
        "status" : "200",
        "message" : "Subscription updated successfully.",
 }
```

### Error Response (JSON)

```json
HTTP/1.1 200 OK
 {
        "status" : "400",
        "message" : "Sb Date should not be less than current date + 2 days.",
 }
```

### Success Response (XML)

```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>
```

### Error Response (XML)

```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

```
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
```