---
title: "Purchase credits"
method: POST
path: "/billing/credits/purchase"
tags: ["Billing"]
---

# Purchase credits

`POST /billing/credits/purchase`

## Request

- Base URL: `https://api.sazabi.com/v1`
- URL: `https://api.sazabi.com/v1/billing/credits/purchase`
- Auth: none declared

Purchase a one-time amount of credits against the saved payment method. Requires a user credential with `billing:manage` and a stable idempotency key.

## Request body

- object
  - `organizationId` string: Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).
  - `amount` string, required: Amount to charge in the account currency; adds the same amount of credits.
  - `idempotencyKey` string, required: Client-generated key. Repeating a request with the same key returns the original purchase instead of charging again.

## Response `200`

OK

- object
  - `status` 'paid' | 'pending_payment', required
  - `billingInvoiceId` string, required
  - `topUpAmount` string, required
  - `creditsToGrant` string, required
  - `currency` string, required

---

[API](https://skmtc.dev/sazabi/apis/sazabi-public-api.md) - [All operations](https://skmtc.dev/sazabi/apis/sazabi-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sazabi/apis/sazabi-public-api/revisions/965b6230cf45?raw)
