Legacy Checkout Start
Create a provider checkout session for a logged-in user.
Legacy (v1) API. This page describes the Stripe-first legacy API. It stays supported for existing integrations but is frozen: new features ship only in v2. Prefer v2 for new work: v2 checkout reference.
POST /api/billstack/teams/{teamId}/projects/{projectId}/checkout/startAuth
Private API key.
Body
| Field | Required | Description |
|---|---|---|
externalId | Yes | Your app user ID |
email or phone | Yes | Customer contact |
name | No | Customer display name |
tier | Yes | pro, growth, or lifetime |
cycle | Yes | monthly, annual, yearly, or once |
provider | No | stripe or razorpay |
referralCode | No | Referral code to attach |
successUrl | Yes | Redirect after successful checkout |
cancelUrl | Yes | Redirect after checkout cancellation |
Response
Returns 201 Created.
{
"checkoutUrl": "https://checkout.stripe.com/c/pay/...",
"customerId": "pc_...",
"provider": "stripe",
"intentId": "cs_..."
}Errors
| Status | Meaning |
|---|---|
400 | A required field is missing (externalId, email/phone, tier, cycle, successUrl, or cancelUrl) |
400 | Business error from checkout, e.g. an invalid referralCode a provider that differs from the default region's provider, a team with no payment provider, or an unconfigured/misconfigured Razorpay account on a Razorpay default region |
409 | REGION_REQUIRES_V2: the customer is pinned to a non-default region; use the v2 checkout |
403 | Missing or invalid auth |
Notes
- Use logged-in checkout for referral attribution.
- Use
externalIdconsistently across checkout, entitlements, portal sessions, and referrals. - This v1 checkout serves the team's default region only, so it always uses the default payment provider (Stripe or Razorpay) and never takes a country.
provideris optional and, when sent, must match the default region's provider; otherwise the request fails with a400(PAYMENT_PROVIDER_CONFLICT).phoneis never used to pick a provider, and checkout never falls back to another provider. A team with no payment provider, or a default region on Razorpay whose project Razorpay config is missing or inactive, also fails with a400. A customer pinned to a non-default region gets409 REGION_REQUIRES_V2; regions and country routing are v2 only (see Multi-provider v2).
If you already hold an internal BillStack customerId and priceId (rather than your app's external IDs), use POST /api/billstack/teams/{teamId}/projects/{projectId}/checkout instead. It takes { customerId, priceId, quantity?, successUrl, cancelUrl, mode?, trialDays?, metadata? } and requires project admin access (session) or an API key.