Create Customer Credit Note
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.
This endpoint only ADDS credit — it cannot reduce a balance. amount_atom must be greater than zero, so a negative amount is rejected with 422 rather than posting a debit. To take credit off a balance use POST /customers/{customer_id}/credit-balance/reduce, which adds the balance precondition and overdraw refusal this endpoint has no need for.
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 of at least 8 characters; the response is replayed for the same (key, account, endpoint) for 24 hours — do not rely on it beyond that, and never reuse a key for a new credit note. The customer id is not part of the replay scope, so a key reused across two customers replays the first customer’s note for the second: key per customer. Without the header there is no dedup — a double-submit will issue two credit notes.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Path parameters
Headers
Request
Machine-readable reason. PaymentKit writes auto_apply, debit_settlement, void_reversal and credit_expired itself for ledger bookkeeping, and expiry_clawback describes credit being reclaimed rather than issued; none of the five can be set here.
Credit amount in smallest currency unit (positive)
3-letter currency code
Optional human-readable note
Optional. When this credit stops being spendable. Must be a timezone-aware timestamp in the future. From that instant the credit is excluded from invoice application, and PaymentKit reclaims whatever is still unused, writing a credit_expired ledger entry and emitting a credit_note.expired event, which you can subscribe to directly as credit_note.expired or through the credit_note.* prefix. Omit for credit that never expires — the default, and unchanged behaviour. Accepted only where the credit-expiry feature is enabled; otherwise 422.
Response
Positive = issued, negative = applied/voided
Machine-readable reason
Human-readable note
When this credit stops being spendable. Null = never.
When PaymentKit reclaimed the unused remainder of this credit. Null = not (yet) expired. Only ever set on entries that carry an expires_at.
How much of this credit is still unused, in the smallest currency unit. Reported only for entries whose consumption has been tracked from the moment they were issued (every entry with an expires_at, and every entry issued after the customer first held expiring credit in that currency), excluding debit settlements. Null otherwise. Credit past its expires_at is no longer applicable even while this still reports a value; it becomes 0 once PaymentKit closes the entry out, whatever the reclaim was able to take.
Context PaymentKit attached when it wrote this entry itself; you cannot set it. Null on most entries. Known keys: refund_id (the refund behind a refund_reversal), restored_from_credit_note (the expiring grant a void_reversal or refund_reversal puts credit back on), expired_credit_note (the grant a credit_expired entry closed out). Treat the set of keys as open. Who made a manual entry is reported as created_by, not here.
This entry’s place in the customer’s credit history, 1 being the oldest (all currencies), in the order the entries were created. An entry whose write started earlier but committed later moves the numbers after it. Set on the customer’s credit-notes list; null elsewhere.
The customer’s balance in this currency right after this entry, in the smallest currency unit: the running sum of the credit history, oldest first (so it moves with entry_number). Negative is a debit balance. Set on the customer’s credit-notes list and on the credit-balance/reduce response; null elsewhere (for example, the POST credit-notes response).
Who made this entry, as a display label, not an identifier: the dashboard user’s current email (else their name, or their user id if the user was deleted), or ‘API key “<description>”’ (‘API key’ when it has none). Null for an entry PaymentKit wrote itself (applying credit to an invoice, an expiry) and for an entry made before this was recorded. Filled on the customer’s credit-notes list; other responses may leave it null (the credit-balance reduce response fills it). Do not parse it.