Update the details of a customer's existing subscription account with the specific subscription_id
. Successful request returns status_message
indicating that the subscription details are updated. You can also use the API to reactivate expired/dead subscriptions by updating the subscription's schedule.
Update Subscription Method
HTTP Method | Endpoint | Description |
---|---|---|
PATCH | BASE_URL/v1/subscriptions/{subscription_id} | Update subscription |
{
"name": "MONTHLY_2019",
"amount": "14000",
"currency": "IDR",
"token": "48111111sHfSakAvHvFQFEjTivUV1114",
"schedule": {
"interval": 1
},
"retry_schedule": {
"interval": 1,
"interval_unit": "day",
"max_interval": 3,
},
"gopay": {
"account_id": "0dd2cd90-a9a9-4a09-b393-21162dfb713b"
}
}
{
"status_message": "Subscription is updated."
}
{
"status_message": "Subscription doesn't exist."
}
{
"status_message": "Sorry, Our system is recovering from unexpected issues. Please retry."
}
Update Subscription Request
JSON Attribute | Description | Type | Required |
---|---|---|---|
name | Subscription name specified by you. Note: Allowed symbols are dash(-), underscore(_), tilde (~), and dot (.). | String(15) | Required |
amount | Amount specified by you for recurring charge. | String | Required |
currency | ISO-4217 representation of three-letter alphabetic currency code. Value: IDR .Note: Currently only IDR is supported. | String | Required |
token | Saved payment token. Note: For credit_card , use saved_token_id received in Charge response. | String | Required |
schedule | Update an ongoing subscription's schedule, or reactivate an expired subscription by updating the schedule. | Object | Optional |
retry_schedule | Update an ongoing subscription's retry schedule over failed charge. | Object | Optional |
gopay | GoPay subscription information. | Object | Optional |
Update Subscription Response
JSON Attribute | Description | Type |
---|---|---|
status_message | Message describing the status of the result of API request. | String |
Note
Payment method cannot be updated in the middle of subscription. If merchant wish to change the payment method of an active subscription, the subscription must be disabled first. After that, new subscription with same data can be created again with different payment method.
Inside
schedule
, onlyinterval
field can be updated.schedule.interval_unit
andschedule.max_interval
can not be updated.Any updates to the subscription interval schedule will only be effective after the next scheduled payment is processed. For example, consider a subscription scheduled to run at the end of this month. If you update the interval field in the middle of the month, change will take effect from the next month. For other parameters, the change will be effective starting from the next scheduled payment.
To reactivate dead subscriptions, simply update the subscription schedule with future dates. Subscription will then reactivate and resume charging the customer at the date specified at
next_execution_at
.