Create Customer Credit Note

View as Markdown
Create a granular credit note for a customer with explicit reason, memo, amount, currency, and optional invoice association. Issues the ledger entry, creates a companion credit-note invoice, and refreshes the credit-balance cache. **Idempotency:** like every other POST/PUT under `/api/{account_id}/...`, this endpoint is idempotent via the standard `Idempotency-Key` header. Clients that may retry (network blips, ambiguous responses) MUST send a stable `Idempotency-Key`; the response is cached for 24 hours per (key, account, endpoint). Without the header there is no dedup — a double-submit will issue two credit notes.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

customer_idstringRequired
account_idstringRequired

Request

This endpoint expects an object.
reasonenumRequired

Machine-readable reason. PaymentKit writes auto_apply, debit_settlement and void_reversal itself for ledger bookkeeping; they cannot be set here.

amount_atomintegerRequired

Credit amount in smallest currency unit (positive)

currencyenumRequired

3-letter currency code

memostring or nullOptional<=500 characters

Optional human-readable note

invoice_idstring or nullOptional
Optional ID of the invoice this credit note is associated with.

Response

Successful Response
idstring
ID of the credit note
customer_idstring
ID of the customer
amount_atominteger

Positive = issued, negative = applied/voided

currencyenum
ISO 4217 currency codes.
typeenum
Transaction type
reasonstring

Machine-readable reason

created_atdatetime
updated_atdatetime
invoice_idstring or nullOptional
ID of the related invoice
memostring or nullOptional

Human-readable note

Errors

422
Unprocessable Entity Error