v2

latestOpenAPI 3.1.12026-08-06856719.6 KB

Update Subscription Plan

Use this API to update the subscription plan, changes made to the plan will not affect current subscription. If you would like to make changes to the current subscriptions use the Update Recurring Billing API.

put/v1/subscription-plan/{plan_id}

Path parameters

plan_idstring required

Headers

X-BUSINESS-API-KEYstring required
Example:b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d

Request body

namestring required

Plan name. It's required field

descriptionstring

The description of subscription plan

cycle'weekly' | 'monthly' | 'yearly' | 'custom' | 'save_card' required

Billing frequency (weekly / monthly / yearly / custom / save_card). If cycle = custom then the user has to send the fields cycle_repeat and cycle_frequency

cycle_frequency'day' | 'week' | 'month' | 'year'

[This field is only applicable when cycle = custom] It's the frequency of the cycle [day / week / month / year]

cycle_repeatinteger

[This field is only applicable when cycle = custom] It's the number of times the cycle will repeat.

currencystring
referencestring

Arbitrary reference number that you can map to your internal reference number. This value cannot be edited by the customer

redirect_urlstring

The redirected URL after the payment

start_date_method'sign_up_date' | 'customer_select_date' | 'fixed_date'
fixed_datenumber

it's required if start_date_method = fixed_date

times_to_be_chargednumber

Example request

{
  "currency": "SGD"
}

Response

200

idstring
namestring
descriptionstring
cyclestring
{"stackTrail":"paths:/v1/subscription-plan/{plan_id}:put:responses:200:content:application/json:schema:properties:cycle_repeat","oasType":"schema","type":"unknown"}
{"stackTrail":"paths:/v1/subscription-plan/{plan_id}:put:responses:200:content:application/json:schema:properties:cycle_frequency","oasType":"schema","type":"unknown"}
currencystring
amountnumber
referencestring
created_atstring
updated_atstring

Example response

{
  "id": "973ee344-6737-4897-9929-edbc9d7bf433",
  "name": "Spotify Premium",
  "description": "Spotify Monthly Subscription",
  "cycle": "monthly",
  "currency": "sgd",
  "amount": 12.9,
  "reference": "spotify_premium_2022",
  "created_at": "2022-09-13T12:34:13",
  "updated_at": "2022-09-13T12:34:13"
}