Skip to content

Update the subscription

Request

Updates an existing subscription to change the associated product and plan. Updating the subscription may modify the price of the subscription, and if so the balance will be billed immediately at a pro-rated amount. Parameters specific to the vendor may be specified to change the payment method for the subscription. Changing to a plan with a different billing frequency from the existing subscription is not supported for some payment providers (Braintree).

Security
CookieBlaizeSession or JwtQuery or JwtHeaderXBlaizeJwt or JwtHeaderXZephrJwt or JwtBearer or JwtCookie
Headers
cookiestring

The session cookie.

Example:`blaize_session=...` (string)
Bodyapplication/json
product_idstringrequired

Product Id/slug

Example:"premium-access-monthly-recurring"
plan_idstringrequired

Plan Id/slug

Example:"plan-5"
vendor_fieldsobjectrequired

Parameters specific to the payment provider in-use.

Example:
{ "payment_nonce": "eyJ2ZXmsaW5nQWdyZWmVubW8iOiJvZmYifQ==" }
navigated_fromstring

Specify where the request was made from. Used as data to pass to change subscription webhooks.

Example:"/some/path"
{ "product_id": "premium-access-monthly-recurring", "plan_id": "plan-5", "vendor_fields": { "payment_nonce": "eyJ2ZXmsaW5nQWdyZWmVubW8iOiJvZmYifQ==" }, "navigated_from": "/some/path" }

Responses

OK

Headers
any
Bodyapplication/json
grant_idstring

New grant of product bundle to user.

Example:"33d576c7-d036-40e7-8141-8a91998a5c79"
Response
{ "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79" }