---
title: "Create a hosted Stripe checkout for credits"
method: POST
path: "/v1/credit-checkouts"
tags: ["Credits"]
---

# Create a hosted Stripe checkout for credits

`POST /v1/credit-checkouts`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/credit-checkouts`
- Auth: HTTP bearer

Creates a payment link, not a charge. Requires write permission and an Idempotency-Key. Uses only the credential workspace; team purchases require the active owner. Amount is USD before checkout taxes and discounts. No payment data is accepted. Reuse identical inputs and the same key after an uncertain result. Successful responses replay for 24 hours; the checkout URL can expire sooner. Only a verified successful payment webhook grants credits.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `amount_cents` integer, required: USD purchase amount in whole cents, from $10 to $10,000, before checkout taxes or discounts. Workspace comes from authentication.

## Response `201`

Hosted checkout; no payment taken

- object
  - `data` object, required
    - `id` string, required
    - `url` string, uri, required
    - `amount_cents` integer, required
    - `currency` 'usd', required
    - `credits` integer, required
    - `organization_id` string, uuid, nullable, required
    - `expires_at` integer, required
    - `status_url` string, required

## Other responses

- `400`: Invalid input or missing Idempotency-Key
- `401`: Authentication required
- `403`: Write permission or active team ownership required
- `404`: Checkout not found for this user and workspace
- `409`: Idempotency key reused with different input or request still in progress
- `500`: Checkout provider or database unavailable
- `503`: Idempotency receipt unavailable; retry only with the same key

---

[API](https://skmtc.dev/masko/apis/masko-api.md) · [All operations](https://skmtc.dev/masko/apis/masko-api/llms.txt) · [OpenAPI document](https://skmtc.dev/masko/apis/masko-api/revisions/91eb3006a92f?raw)
