Skip to content

Start the subscription

Request

Uses the payment info captured by the payment provider drop-in UI and create a customer with a recurring payment. When the payment provider responds successfully, the logged-in user will be temporarily granted all entitlements in the product's associated bundle.

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_idstring

Plan ID/slug

Example:"plan-5"
discount_codestring

Discount/promotion code

Example:"SAVE10"
vendor_fieldsobject

Parameters specific to the payment provider in-use.

Example:
{ "payment_nonce": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ==", "skip_trial_period": true, "start_date": "2021-01-01T00:00:00Z", "payment_method": "pm_123456789", "vault_payment_method": false }
{ "product_id": "premium-access-monthly-recurring", "plan_id": "plan-5", "discount_code": "SAVE10", "vendor_fields": { "payment_nonce": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ==", "skip_trial_period": true, "start_date": "2021-01-01T00:00:00Z", "payment_method": "pm_123456789", "vault_payment_method": false } }

Responses

OK

Headers
any
Bodyapplication/json
grant_idstring

New grant of product bundle to user.

Example:"33d576c7-d036-40e7-8141-8a91998a5c79"
client_secretstring

(Stripe) reference to Stripe payment required to process payment in front end.

Example:"src_client_secret_QfsM25CJ2uCMon72MiOmUNTj`"
payment_intent_idstring

(Stripe) reference to the payment intent if payment requires confirmation.

Example:"pi_1GYZYWLgUJT2XNPAYQMomeqf"
Response
{ "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79", "client_secret": "src_client_secret_QfsM25CJ2uCMon72MiOmUNTj`", "payment_intent_id": "pi_1GYZYWLgUJT2XNPAYQMomeqf" }