v13

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-04237161688.6 KB
Organizations
Billing

Adjust an organization's credit balance

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

post/organizations/{organization_id}/billing/credits

Path parameters

organization_idstring required

The ID of the organization whose credit balance to adjust

Request body

amountinteger required

The credit amount in cents. Must be greater than zero.

action'increase' | 'decrease' required

Whether to increase or decrease the credit balance.

currencystring

The currency code (e.g. "USD"). Defaults to USD if not provided.

idempotency_keystring required

A unique key to ensure the adjustment is applied only once. Repeated requests with the same key return the original ledger entry.

notestring

An optional note to attach to the ledger entry.

Response

A credit ledger entry.

objectstring required

String representing the object's type. Always "commerce_credit_ledger".

idstring required

Unique identifier for the ledger entry.

payer_idstring required

The ID of the payer whose balance was adjusted.

source_typestring required

The type of source that originated the adjustment (e.g. "grant").

source_idstring required

The ID of the source that originated the adjustment.

notestring nullable

An optional note attached to the ledger entry.

created_atstring date-time required

Timestamp when the ledger entry was created.