Billing
Create a top-up checkout
Generate a hosted checkout URL to add credits to your personal balance or your team’s shared credit pool.
POST
Create a top-up checkout
Top up credits against the caller’s personal balance or an organization’s
shared team billing pool. Returns a hosted checkout URL your application
opens in a new tab or redirects the user to.
Authentication
Requires a Bearer token with thebilling scope. See
Authentication.
Body
Amount to add, in cents. Minimum
500 (1,000.00)."user" (default when personal) or "org" (default when the caller is
inside a team and holds manageBilling). When "org", the top-up
lands on the team’s shared credit pool at
organizations.polar_customer_id and all subsequent team-scoped API
usage draws from that pool until it’s depleted.Optional. URL to redirect the user to after successful checkout.
Defaults to
/dashboard/billing?topup=success (or
/dashboard/billing?topup=success&scope=team when scope: "org").Example: personal top-up
curl
Example: team top-up
curl
SDK
Response
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | missing_amount | amount_cents missing or not an integer. |
| 400 | amount_too_low | Below the $5.00 minimum. |
| 400 | amount_too_high | Above the $1,000.00 maximum. |
| 400 | org_context_required | Requested scope: "org" without an active team. |
| 402 | team_payment_method_required | Team key creation blocked until the team funds billing. Retry after a checkout. |
| 403 | permission_denied | Caller lacks manageBilling in the active team. |
| 503 | billing_unavailable | Billing isn’t configured on this deployment. |
Lifecycle
- Client calls this endpoint with
amount_centsand optionalscope. - The billing service reserves the right customer (personal or team),
creates a checkout session, and returns
checkout_url. - The user completes checkout.
- A background webhook routes the top-up to the correct credit pool (user vs team) and marks the customer as having a payment method on file.
- Subsequent API usage drafts from the funded pool.
Create a top-up checkout
