Skip to Content
Account

Start a subscription

Create a Stripe Checkout link to subscribe the workspace to the Pro or Agency plan.

POSThttps://api.rankparse.com/v1/subscription/checkoutFreeAPI key

Creates 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

planstringrequired

pro or agency. Anything else returns 400 invalid_plan.

intervalstringrequired

month or year. Anything else returns 400 invalid_plan.

return_tostring

Where 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

urlstring

The 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

HTTPCodeWhen
400invalid_planplan or interval is missing or not allowed.
400invalid_return_toreturn_to is present and not onboarding.
401invalid_api_keyMissing, invalid or revoked API key.
403capability_missingOnly the workspace owner can subscribe.
404subscriptions_not_enabledSubscription checkout is not switched on.
404user_not_foundThe person the key acts as no longer exists.
409already_subscribedThe workspace already has an active, trialing, or past-due-in-grace subscription.
500checkout_failedStripe could not create the session.