billing

Create Checkout Session

Start a paid subscription, or move an existing one to a different plan.

Three outcomes:

  • DevUpgradeResponse — dev mode (no Stripe key): instant Pro upgrade.
  • PlanChangeResponse — the customer already holds a billable Stripe subscription, so the requested tier/cadence is applied to THAT subscription and no Checkout session exists. See _select_plan_change_target.
  • CheckoutResponse — no live subscription: a normal Stripe Checkout session to redirect to.

The middle case is the whole point. Stripe Checkout in mode: subscription can only ever CREATE a subscription, so sending a paying customer through it to change tiers charges them twice and leaves two subscriptions' webhooks fighting over one plan column.

post/api/v1/billing/checkout

Request

  • Base URL: https://api.badgeia.com
  • URL: https://api.badgeia.com/api/v1/billing/checkout
  • Auth: none declared

Request body

price_idstring
annualboolean
plan'pro' | 'team' nullable

Response

Successful Response

OR
OR

Example response

{
  "user": {
    "email": "user@example.com"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.