Credit & debit points
Credit & debit points
Credit & debit points
Every credit or debit in the Loyalty API goes through a two-phase lifecycle:
pending. The member’s balance is not yet updated.This pattern mirrors real-world eCommerce flows: credit points only when a purchase is confirmed, not when it is merely placed — and cancel the credit if the order is cancelled or returned.
Endpoint: POST https://api.brevo.com/v3/loyalty/balance/programs/{pid}/transactions
Use this for non-purchase events: sign-up bonuses, birthday credits, manual adjustments, referral rewards.
Request parameters
Response (200)
Always persist the id returned by Create transaction. You need it to call /complete or /cancel. If you lose it, you will need to query the transaction list to retrieve it.
Endpoint: POST https://api.brevo.com/v3/loyalty/balance/programs/{pid}/transactions/{tid}/complete
Completing a transaction finalizes the credit or debit: the member’s balance is updated, tiers are re-evaluated, and reward rules are checked.
Path parameters
Response (200)
What happens after completion:
real_time: tier thresholds are evaluated and the member may be upgradedbalance_value_updated is firedtier_association_updated is firedWhen to call Complete:
Endpoint: POST https://api.brevo.com/v3/loyalty/balance/programs/{pid}/transactions/{tid}/cancel
Cancelling a transaction voids it entirely. The member’s balance is not affected.
Response (200)
When to call Cancel:
Handling returns after delivery (balance already completed):
A completed transaction cannot be cancelled. Instead, create a new transaction with a negative amount (debit) and complete it.
Endpoint: POST https://api.brevo.com/v3/loyalty/balance/programs/{pid}/create-order
A balance order is the right tool for crediting points on a purchase. It creates a single tracked event tied to a business order, which you later complete or cancel as one unit.
Request parameters
Response (200)
The order returns a transactionid. Use this to call /complete or /cancel when the purchase status is resolved.
Transaction vs. balance order: A direct transaction is for a single credit or debit event on a single balance. A balance order is intended for purchase flows where you want to track the originating business event (the order) independently from the balance operation.