v1

latestOpenAPI 3.1.02026-07-24120106.5 KB

Update subscription

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

put/billing/subscriptions/{subscriptionId}

Path parameters

subscriptionIdstring required

Id of existing subscription that needs to be updated

Headers

merchantstring required

Merchant ID

Request body

accountingCodestring

Specify an accounting code to categorise revenue collected from the subscription's payment. Max of 50 characters.

namestring

The name of the plan to subscribe the customer to. Max of 50 characters

billingEndstring

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.

billingEndValuestring

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

startDatestring

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.

billingIntervalstring

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

billingIntervalValuestring

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

autoPaymentboolean

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.

metadataobject

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

OR
OR
OR
OR
OR
OR

Example response

{
  "id": "e76fa3bb-8980-478f-bb20-a1992607c4ea",
  "customerId": "8369b0a9-1856-4e54-91c8-1630080ae723",
  "planId": "516f4f24-d293-4f2a-ba44-e0da87817804",
  "name": "Test Plan 1627260763_ES13",
  "status": "PAST_DUE",
  "startDate": "2021-07-26",
  "endDate": "2021-08-04",
  "paymentMethodToken": "fa22e0ad-b7cb-4087-a834-de14dee23500",
  "accountingCode": "test_accountingcode",
  "tax": {
    "rate": 50
  },
  "nextBillingDate": "2021-07-27",
  "totalPaid": {
    "currency": "AUD"
  },
  "totalBillingCycles": 1,
  "remainingToPay": {
    "currency": "NZD",
    "value": 1000
  },
  "endTargetAmount": {
    "currency": "NZD",
    "value": 1000
  },
  "totalPastDue": {
    "currency": "NZD",
    "value": 100
  },
  "totalDiscounted": {
    "currency": "NZD"
  },
  "createdOn": "2021-07-26T00:52:59.161",
  "autoPayment": true
}