---
title: "Adjust a user's credit balance"
method: POST
path: "/users/{user_id}/billing/credits"
tags: ["Users", "Billing"]
---

# Adjust a user's credit balance

`POST /users/{user_id}/billing/credits`

Increases or decreases the credit balance for the specified user.
Each adjustment is recorded as a ledger entry. The idempotency_key parameter
ensures that duplicate requests are safely handled.

## Path parameters

- `user_id` string, required

## Request body

- AdjustCreditBalanceRequest
  - `amount` integer, required — The credit amount in cents. Must be greater than zero.
  - `action` 'increase' | 'decrease', required — Whether to increase or decrease the credit balance.
  - `currency` string — The currency code (e.g. "USD"). Defaults to USD if not provided.
  - `idempotency_key` string, required — A unique key to ensure the adjustment is applied only once. Repeated requests with the same key return the original ledger entry.
  - `note` string — An optional note to attach to the ledger entry.

## Response `200`

A credit ledger entry.

- CommerceCreditLedgerResponse
  - `object` string, required — String representing the object's type. Always "commerce_credit_ledger".
  - `id` string, required — Unique identifier for the ledger entry.
  - `payer_id` string, required — The ID of the payer whose balance was adjusted.
  - `amount` CommerceMoneyResponse, required
    - `amount` integer, required — The amount in cents.
    - `amount_formatted` string, required — The formatted amount as a string (e.g., "$49.99").
    - `currency` string, required — The currency code (e.g., "USD").
    - `currency_symbol` string, required — The currency symbol (e.g., "$").
  - `source_type` string, required — The type of source that originated the adjustment (e.g. "grant").
  - `source_id` string, required — The ID of the source that originated the adjustment.
  - `note` string, nullable — An optional note attached to the ledger entry.
  - `created_at` string, date-time, required — Timestamp when the ledger entry was created.

## Other responses

- `400` — Request was not successful
- `401` — Authentication invalid
- `403` — Authorization invalid
- `404` — Resource not found
- `409` — Request was not successful
- `422` — Invalid request parameters
- `500` — Request was not successful

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/versions/cf036e7951d3/schema)
