How transactions work
Every time you add or remove credits, a transaction is created. Transactions are permanent β you always have a complete history of what happened and why.Credit
Add credits to an account
Debit
Remove credits from an account
Reverse
Undo a previous transaction
Credit β add credits
Use this when a customer earns credits, buys a credit pack, or receives a reward.Parameters
Debit β remove credits
Use this when a customer spends credits, uses a feature, or redeems a reward."side": "debit" in the entry.
The API prevents negative balances β if a debit would bring the balance below zero, it returns an
insufficient_balance error. Check the balance first if you want to show your users a friendly message.Reverse β undo a transaction
Made a mistake? Order cancelled? Reverse a transaction to undo it. The original transaction stays in the history β a new opposite transaction is created so you always have a complete paper trail."reversal_of": "cct_3mNpK8rW2xY" linking back to the original.
Viewing history
See every credit and debit on an account, newest first.sideβ"credit"(added) or"debit"(removed)amountβ how many creditstransaction_idβ links back to the transaction (which has thereferenceandidempotency_key)
Multi-entry transactions β move credits between accounts
Credit and debit touch one account at a time. When one business event should move credits between accounts atomically β a transfer between two customers, or a bundle that debits a pool and credits several sub-accounts β post a single transaction with several entries. Entries must balance: total debits must equal total credits, and a transaction needs at least two entries.422, and a frozen or closed account anywhere in the entries returns a 409.
Working with transactions directly
Every credit, debit, reversal, and multi-entry post is a transaction with an ID (cct_β¦). You can fetch, reverse, and search them without going through an account.
Retrieve a transaction
Reverse a transaction by ID
Reverses the whole transaction β every entry β without naming the account. Use this when you hold the transaction ID from an earlier response and the transaction spans several accounts./accounts/{account_id}/reverse endpoint above does the same for a transaction you know by account; both preserve the original and link the reversal through reversal_of.
Find every transaction for a reference
Because you setreference on each write, you can list everything Creem recorded for one event in your system β an order, a campaign, a support ticket.
What is an idempotency_key?
An idempotency_key is a unique string you include with every credit or debit request. Itβs your safety net against accidental duplicates.
Imagine your app credits a customer 500 points for an order. The request goes through, but your app doesnβt get the response back (network hiccup, timeout, server restart). Without protection, retrying would give the customer 1,000 points instead of 500.
The idempotency_key prevents this. When you retry with the same key, Creem recognizes itβs the same request and returns the original result β no double-crediting.
How it works
Next steps
Accounts
Create, freeze, and manage accounts.
Recipes
Step-by-step guides for common patterns.
API Reference
Full endpoint schemas.
Introduction
Back to overview.