How to create a new Stripe subscription for the logged user
Calling this API will immediately charge the user (or after the trial has ended). Based on the subscription charge period, it will continue to charge the user.
For the subscription lifecycle please refer to Stripe documentationarrow-up-right
POST https://mburger.cloud/api/subscriptions
curl https://mburger.cloud/api/subscriptions -X POST -H "Accept: application/json" -H "X-MBurger-Token: <token>" -H "X-MBurger-Version: 3" -H "Authorization: Bearer <JWT>" -d '<data>'
Name
Type
Required
Description
subscription
string
Yes
Subscription identifier chosen on Stripe dashboard.
token
No
Source token provided by the Stripe SDK, it is not required if the user is already a customer and wants to use the default card.
discount_code
Identifier of discount code.
trial_days
int
Number of days before the first charge of the subscription.
quantity
Quantity of subscriptions you'll need to subscribe; generally 1 or no data.
meta
JSON
Additional data to save for the subscription.
When successful, a HTTP 200 and JSON like this is returned:
{ "status_code": 0 }
Last updated 5 years ago