Start a payment for a plan
POST /v1/billing/checkout
Returns a URL to send the customer to. Opening it changes nothing: the plan moves only when Stripe confirms a subscription over the webhook.
Credential. A dashboard session token belonging to an owner of the organisation.
curl --fail-with-body -X POST "https://api-833252724876.us-central1.run.app/v1/billing/checkout" \
-H "Authorization: Bearer $JEAN_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"plan": "dev"
}'
Body
| Field | Type | Required | Notes |
|---|---|---|---|
plan | "dev", "team" | yes | The plan to buy. free is not bought. |
Response · 201
{
"url": "https://checkout.stripe.com/c/pay/cs_test_..."
}
Errors
| Status | Meaning |
|---|---|
400 | The plan is not one this deployment sells. |
401 | Unauthenticated, invalid token or revoked key. |
403 | Forbidden, session required or org required. |
422 | Validation failed. |
429 | Quota or rate limit exceeded; error.details says which, and when. |
500 | Internal error; quote error.request_id when reporting it. |
503 | Billing is not configured in this environment. |
Every one carries the same envelope.