---
title: "Update subscription"
method: PUT
path: "/billing/subscriptions/{subscriptionId}"
---

# Update subscription

`PUT /billing/subscriptions/{subscriptionId}`

Updates an existing subscription for a customer. A subscription can be of Pending, Future or Active status. Please refer to documentation for values and updatable subscription status typePlease refer Integration document for more information : https://developer.ezypay.com/docs/subscription-payment-scenarios

## Path parameters

- `subscriptionId` string, required

## Headers

- `merchant` string, required

## Request body

- object
  - `accountingCode` string — Specify an accounting code to categorise revenue collected from the subscription's payment. Max of 50 characters.
  - `name` string — The name of the plan to subscribe the customer to. Max of 50 characters
  - `amount` object — The gross amount charged to the customer, inclusive of tax. Supports decimal values for cents. For example, $24.50 would be 24.50.
    - `currency` string, required — Three letter ISO 4217 currency code for the amount.
    - `value` number, double, required — The value of the amount. Must be positive value greater than zero.
    - `type` string — The type of the amount value. Supported values are: `percentage`, `fixed_amount`
  - `billingEnd` string — Specifies the rules to automate when a subscription ends. Supported value are: `amount_collected` and `end_date` - Subscriptions will end when a specified amount is collected or when the end date is reached as defined in `billingEndValue`. Applicable only for `TAC(amount_collected)` and `END_DATE(end_date)` subscription types.
  - `billingEndValue` string — Specifies the values for `billingEnd` rule. This value is only applicable for `TAC(amount_collected)` and ` END_DATE(end_date)` billing interval type subscriptions.Acceptable values for `amount_collected` is values with decimal format and end date is in `YYYY-mm-dd` format date string
  - `startDate` string — Specifies the start date value of subscription. The date format that needs to be passed is `yyyy-MM-dd`. The start date can be edited only for `FUTURE` subscriptions.
  - `billingInterval` string — specifies the billing interval of the subscription. The acceptable values are for Weekly Subscriptions, the value is `DAY_OF_WEEK` and for monthly subscriptions, the value is `DAY_OF_MONTH`. Intervals can be edited only for `ACTIVE` subscriptions
  - `billingIntervalValue` string — Specifies the billing interval value of a subscription interval. Two sets of acceptable values, If `BillingInterval` is `DAY_OF_WEEK`, then acceptable values are `MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY` and `DAY_OF_MONTH`, acceptable values are Numbers between `1 and 31`.Intervals can be edited only for `ACTIVE` subscriptions
  - `autoPayment` boolean — Specify if auto payment processing occurs for invoices generated from the subscription. Supported value are: `true` - Invoices generated will automatically proceed to payment processing. `false` - Invoices are generated but will not automatically proceed to payment processing.
  - `metadata` object — Store additional data about the subscription object using key/value pairs format. Max of 40 characters for key name and 255 characters for key value.

## Response `200`

200

- union
  - object
    - `id` string
    - `customerId` string
    - `planId` string
    - `name` string
    - `status` string
    - `startDate` string
    - `endDate` string
    - `paymentMethodToken` string
    - `accountingCode` string
    - `amount` unknown
    - `tax` object
      - `rate` integer
    - `nextBillingDate` string
    - `nextFutureInvoice` unknown
    - `interval` integer
    - `intervalUnit` unknown
    - `totalPaid` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalBillingCycles` integer
    - `remainingToPay` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `remainingBillingCycles` unknown
    - `endTargetAmount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `endTargetBillingCycles` unknown
    - `cancelledDate` unknown
    - `failedPaymentHandling` unknown
    - `failedAttemptsCount` integer
    - `totalPastDue` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalDiscounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `metadata` unknown
    - `createdOn` string
    - `autoPayment` boolean
    - `setupPayments` unknown
    - `paymentMethodInvalidReason` unknown
    - `paymentMethodInvalidDescription` unknown
    - `paymentMethodInvalid` boolean
  - object
    - `id` string
    - `customerId` string
    - `planId` string
    - `name` string
    - `status` string
    - `startDate` string
    - `endDate` string
    - `paymentMethodToken` string
    - `accountingCode` string
    - `amount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `tax` object
      - `rate` integer
    - `nextBillingDate` string
    - `nextFutureInvoice` unknown
    - `interval` integer
    - `intervalUnit` string
    - `totalPaid` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalBillingCycles` integer
    - `remainingToPay` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `remainingBillingCycles` unknown
    - `endTargetAmount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `endTargetBillingCycles` unknown
    - `cancelledDate` unknown
    - `failedPaymentHandling` unknown
    - `failedAttemptsCount` integer
    - `totalPastDue` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalDiscounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `metadata` unknown
    - `createdOn` string
    - `autoPayment` boolean
    - `setupPayments` unknown
    - `paymentMethodInvalidReason` unknown
    - `paymentMethodInvalidDescription` unknown
    - `paymentMethodInvalid` boolean
  - object
    - `id` string
    - `customerId` string
    - `planId` string
    - `name` string
    - `status` string
    - `startDate` string
    - `endDate` string
    - `paymentMethodToken` string
    - `accountingCode` string
    - `amount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `tax` object
      - `rate` integer
    - `nextBillingDate` string
    - `nextFutureInvoice` unknown
    - `interval` integer
    - `intervalUnit` string
    - `totalPaid` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalBillingCycles` integer
    - `remainingToPay` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `remainingBillingCycles` unknown
    - `endTargetAmount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `endTargetBillingCycles` unknown
    - `cancelledDate` unknown
    - `failedPaymentHandling` unknown
    - `failedAttemptsCount` integer
    - `totalPastDue` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalDiscounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `metadata` unknown
    - `createdOn` string
    - `autoPayment` boolean
    - `setupPayments` unknown
    - `paymentMethodInvalidReason` unknown
    - `paymentMethodInvalidDescription` unknown
    - `paymentMethodInvalid` boolean
  - object
    - `id` string
    - `customerId` string
    - `planId` string
    - `name` string
    - `status` string
    - `startDate` string
    - `endDate` string
    - `paymentMethodToken` string
    - `accountingCode` string
    - `amount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `tax` object
      - `rate` integer
    - `nextBillingDate` string
    - `nextFutureInvoice` unknown
    - `interval` integer
    - `intervalUnit` string
    - `totalPaid` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalBillingCycles` integer
    - `remainingToPay` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `remainingBillingCycles` unknown
    - `endTargetAmount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `endTargetBillingCycles` unknown
    - `cancelledDate` unknown
    - `failedPaymentHandling` unknown
    - `failedAttemptsCount` integer
    - `totalPastDue` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalDiscounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `metadata` unknown
    - `createdOn` string
    - `autoPayment` boolean
    - `setupPayments` unknown
    - `paymentMethodInvalidReason` unknown
    - `paymentMethodInvalidDescription` unknown
    - `paymentMethodInvalid` boolean
  - object
    - `id` string
    - `customerId` string
    - `planId` string
    - `name` string
    - `status` string
    - `startDate` string
    - `endDate` string
    - `paymentMethodToken` string
    - `accountingCode` string
    - `amount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `tax` object
      - `rate` integer
    - `nextBillingDate` string
    - `nextFutureInvoice` unknown
    - `interval` integer
    - `intervalUnit` string
    - `totalPaid` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalBillingCycles` integer
    - `remainingToPay` unknown
    - `remainingBillingCycles` unknown
    - `endTargetAmount` unknown
    - `endTargetBillingCycles` unknown
    - `cancelledDate` unknown
    - `failedPaymentHandling` unknown
    - `failedAttemptsCount` integer
    - `totalPastDue` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalDiscounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `metadata` unknown
    - `createdOn` string
    - `autoPayment` boolean
    - `setupPayments` unknown
    - `paymentMethodInvalidReason` unknown
    - `paymentMethodInvalidDescription` unknown
    - `paymentMethodInvalid` boolean
  - object
    - `id` string
    - `customerId` string
    - `planId` string
    - `name` string
    - `status` string
    - `startDate` string
    - `endDate` string
    - `paymentMethodToken` string
    - `accountingCode` string
    - `amount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `tax` object
      - `rate` integer
    - `nextBillingDate` string
    - `nextFutureInvoice` unknown
    - `interval` integer
    - `intervalUnit` string
    - `totalPaid` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalBillingCycles` integer
    - `remainingToPay` unknown
    - `remainingBillingCycles` unknown
    - `endTargetAmount` unknown
    - `endTargetBillingCycles` unknown
    - `cancelledDate` unknown
    - `failedPaymentHandling` unknown
    - `failedAttemptsCount` integer
    - `totalPastDue` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalDiscounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `metadata` unknown
    - `createdOn` string
    - `autoPayment` boolean
    - `setupPayments` unknown
    - `paymentMethodInvalidReason` unknown
    - `paymentMethodInvalidDescription` unknown
    - `paymentMethodInvalid` boolean
  - object
    - `id` string
    - `customerId` string
    - `planId` string
    - `name` string
    - `status` string
    - `startDate` string
    - `endDate` unknown
    - `paymentMethodToken` string
    - `accountingCode` string
    - `amount` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `tax` object
      - `rate` integer
    - `nextBillingDate` string
    - `nextFutureInvoice` unknown
    - `interval` integer
    - `intervalUnit` string
    - `totalPaid` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalBillingCycles` integer
    - `remainingToPay` unknown
    - `remainingBillingCycles` unknown
    - `endTargetAmount` unknown
    - `endTargetBillingCycles` unknown
    - `cancelledDate` unknown
    - `failedPaymentHandling` unknown
    - `failedAttemptsCount` integer
    - `totalPastDue` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `totalDiscounted` object
      - `currency` string
      - `value` integer
      - `type` unknown
    - `metadata` unknown
    - `createdOn` string
    - `autoPayment` boolean
    - `setupPayments` unknown
    - `paymentMethodInvalidReason` unknown
    - `paymentMethodInvalidDescription` unknown
    - `paymentMethodInvalid` boolean

## Other responses

- `400` — 400

---

[API](https://skmtc.dev/ezypay/apis/vault.md) · [All operations](https://skmtc.dev/ezypay/apis/vault/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ezypay/vault/revisions/2ca692551cdf/schema)
