What the payload handles
A single transaction payload can do any combination of the following in one call:- Campaign collection — Applicable campaigns on the selected
cardrun; balances update and reward coupons are granted when thresholds are reached. - Coupon redemption — Coupon instance ids passed as
rewardon a line item or at the order level are redeemed. - Point spend —
pointsToSpendis deducted from the card’s point balance.
Key concepts
A transaction payload represents a single basket. You construct and submit one payload per customer interaction. Product, user, and branch IDs in the payload are opaque IDs, your external system identifiers. BrandWallet resolves them to internal references.user and branch default to the authenticated API user and its branch when omitted.
Discount amounts (discountAmount / discountedAmount, per-line and order-level) are calculated by your system and stored as-is. To preview the discount a point spend would produce before committing, call POST /v1/transactions/validate with the same body.
Required fields
Every transaction payload must include:customer— Customer id from GET /v1/customers/find.card— Selected card (customerpass id). The campaigns run come from this card.
Payload flow
1
Identify the customer
Call GET /v1/customers/find with the customer’s phone, email, or card barcode. Save the returned
id (customer id) and the cards[].id (customerpass id).2
(Optional) Preview the discount
Call POST /v1/transactions/validate with the basket and
pointsToSpend to preview the discount before committing.3
Commit the basket
Call POST /v1/transactions/process with the same body to commit. BrandWallet returns the updated loyalty state in
executedActions, including new balances and any coupons granted.
