---
title: "Start a credit purchase via Stripe Checkout"
method: POST
path: "/billing/team/{team_id}/purchase-credits"
tags: ["billing"]
---

# Start a credit purchase via Stripe Checkout

`POST /billing/team/{team_id}/purchase-credits`

Create a Stripe Checkout session for a one-time credit purchase.

Credits are not granted here — the user is redirected to Stripe's hosted
checkout, and the ``checkout.session.completed`` webhook applies the
credits to the team's paid balance once payment is confirmed.

Requires MANAGE_BILLING (owner, admin, or billing role).

## Path parameters

- `team_id` string, required

## Request body

- PurchaseCreditsRequest — Request to start a credit purchase via Stripe Checkout.
  - `amount_usd` number, required — Amount in USD to purchase (max $500 per transaction)
  - `success_url` string, required — URL Stripe redirects to after a successful payment
  - `cancel_url` string, required — URL Stripe redirects to if the purchase is cancelled

## Response `200`

Successful Response

- PurchaseCreditsResponse — Response after starting a credit purchase. Credits are granted asynchronously by the ``checkout.session.completed`` webhook once Stripe confirms the payment, so this response only carries the hosted Checkout URL to redirect the user to.
  - `success` boolean, required
  - `checkout_url` string, nullable — Stripe-hosted Checkout URL to redirect the user to
  - `message` string — Human-readable status detail

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/revisions/b92f75fd3b61/schema)
