---
title: Update the Amount
description: This API will be used by merchant to update the subscription amount to next recurring charge.
---

# SUBSCRIPTION - Update the Amount

This API will be used by merchant to update the subscription amount to next recurring charge. We must pass merchant id, subscription id, sb amount and action as "A"- Amount update in request. If the request has valid details, we will get a success response as “Subscription updated successfully.”.

## POST

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

## Header

| Field | Type | Description |
| --- | --- | --- |
| Content-Type | String | For JSON: application/json<br>For XML: application/xml |

## Parameter

| Field | Type | Description |
| --- | --- | --- |
| merchant_id | Number | Merchant Identification Number (required) |
| subscription_id | Number | Airpay Subscription Id (required) |
| sb_amount | Number | Amount (required) |
| action | String | Action (required)<br>"A"- Amount update |
| checksum | Alphanumeric | Checksum (length 10-200) (required)<br>privatekey = hash('sha256', secret.'@'.username.':|:'.password)<br>Hash generated by: hash_hmac('sha256', subscription_id+private_key+merchant_id+action+sb_amount, <secret_key>)<br>Note: Use the same secret key, username and password provided on payment kit to generate private key |

## Request-Example:

```
{
    "merchant_id": "11111",
    "subscription_id": "1000001",
    "sb_amount": "2000.00",
    "action": "A",
    "checksum": "2e6cf436576f49276315b02c9fb02e75"
}
```
## Request-Example: XML

```
  <?xml version="1.0" encoding="utf-8"?>
  <REQUEST>
        <SUBSCRIPTION>
                   <MERCHANT_ID><![CDATA[11111]]></MERCHANT_ID>
                   <SUBSCRIPTION_ID><![CDATA[1000001]]></SUBSCRIPTION_ID>
                   <ACTION><![CDATA[A]]></ACTION>
                   <CHECKSUM><![CDATA[92c617a556982a8d124ff2b7ce9eae3e]]></CHECKSUM>
        </SUBSCRIPTION>
</REQUEST>
```

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

```
    HTTP/1.1 200 OK
     {
	        "status" : "200",
	        "message" : "Subscription updated successfully.",
     }
```
## Failed-Response:

```
    HTTP/1.1 200 OK
     {
	        "status" : "400",
	        "message" : "Charge not possible on this Date.",
     }
```
## 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
```
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>
```
## 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
```