anon_email
API referenceBilling

Start a card checkout

POST
/billing/checkout

Creates a hosted Polar checkout for a paid plan and returns its URL; the caller redirects the browser there. Polar is the merchant of record and files applicable sales tax/VAT.

Plan changes are applied only by the provider webhook, never by this call: a checkout that is never paid changes nothing.

Authorization

CognitoUserPool
headerAuthorizationBearer <token>

Cognito user pool ID token. API Gateway validates the token (identity token: no OAuth scopes are configured on the authorizer) and forwards its claims; the sub claim is the tenant key.

Request Body

application/json
  1. body
plan*string

Paid tier to check out.

Value in"lite""pro"

Response Body

Hosted checkout URL.

application/json
  1. response
checkout_url*string

Hosted checkout or customer-portal URL to redirect to.

Formaturi
curl -X POST "https://example.com/billing/checkout" \  -H "Content-Type: application/json" \  -d '{    "plan": "lite"  }'
{  "checkout_url": "http://example.com"}