Passer au contenu principal
POST
JavaScript

Autorisations

Authorization
string
header
requis

Send your API key as a bearer token: Authorization: Bearer <api_key>. A test mode key starts with dodo_test_, for example dodo_test_AbCd1234EfGh5678.<secret>. A live mode key starts with dodo_live_. Use a test mode key on test.dodopayments.com and a live mode key on live.dodopayments.com. Keys from before these tags have no tag and operate as before.

Paramètres de chemin

credit_entitlement_id
string
requis

Credit Entitlement ID

customer_id
string
requis

Customer ID

Corps

application/json

Request to create a ledger entry (credit or debit)

amount
string
requis

Amount to credit or debit. Bounded to a NUMERIC(38,28) column, so the integer part must have fewer than 10 digits (< 10^10); larger values previously reached the DB and failed with a 22003 overflow surfaced as a 500.

entry_type
enum<string>
requis

Entry type: credit or debit

Options disponibles:
credit,
debit
expires_at
string<date-time> | null

Expiration for credited amount (only for credit type)

idempotency_key
string | null

Idempotency key to prevent duplicate entries

metadata
null | Metadata · object

Optional metadata (max 50 key-value pairs, key max 40 chars, value max 500 chars).

reason
string | null

Human-readable reason for the entry

Réponse

Ledger entry created successfully

Response for creating a ledger entry

amount
string
requis
balance_after
string
requis
balance_before
string
requis
created_at
string<date-time>
requis
credit_entitlement_id
string
requis
customer_id
string
requis
entry_type
enum<string>
requis
Options disponibles:
credit,
debit
id
string
requis
is_credit
boolean
requis
metadata
Metadata · object
requis

Metadata stored on this entry.

overage_after
string
requis
overage_before
string
requis
grant_id
string | null
reason
string | null
Dernière modification le 1 avril 2026