Start a subscription
Create a Stripe Checkout link to subscribe the workspace to the Pro or Agency plan.
https://api.rankparse.com/v1/subscription/checkoutFreeAPI keyCreates a Stripe Checkout session for a Pro or Agency subscription on the key's workspace and returns its URL. Open it in a browser to pay. Only the workspace owner can subscribe. A workspace has at most one subscription; to change or cancel it, use Open the billing portal.
Subscription checkout is switched on separately from the rest of the API. While it is off, this route answers 404 subscriptions_not_enabled.
Body parameters
planstringrequiredpro or agency. Anything else returns 400 invalid_plan.
intervalstringrequiredmonth or year. Anything else returns 400 invalid_plan.
return_tostringWhere Stripe sends the owner back to. The only accepted value is onboarding (the dashboard onboarding wizard). Omitted, it is the plan page in the dashboard. Any other value returns 400 invalid_return_to.
Response
urlstringThe Stripe Checkout URL.
Behavior
- Prices and limits for each plan come from Get pricing.
- Plan credits: each paid invoice grants the plan's monthly credits as plan credits, which are spent first and expire. Yearly subscribers get them every month. See Two credit buckets.
- Founding offer: a workspace that holds the founding offer gets the founding Pro yearly price automatically.
- Promotion codes can be entered on the Stripe page.
- A lifetime workspace can also subscribe.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_plan | plan or interval is missing or not allowed. |
| 400 | invalid_return_to | return_to is present and not onboarding. |
| 401 | invalid_api_key | Missing, invalid or revoked API key. |
| 403 | capability_missing | Only the workspace owner can subscribe. |
| 404 | subscriptions_not_enabled | Subscription checkout is not switched on. |
| 404 | user_not_found | The person the key acts as no longer exists. |
| 409 | already_subscribed | The workspace already has an active, trialing, or past-due-in-grace subscription. |
| 500 | checkout_failed | Stripe could not create the session. |