Skip to main content
POST
Preview Order Rewards
Combined order preview: the order cashback quote (identical calculation to Calculate Order Cashback) plus a preview of the event-based campaigns the order would trigger (the order is evaluated as the same place_order event a real order submission fires). Use this on cart and checkout pages to show everything the order will earn in one call. This endpoint is a read-only quote:
  • No points are awarded and no coupons are generated.
  • Nothing appears in the customer’s activity or history.
  • Campaign budgets and frequency limits are not consumed.
  • Calling a preview any number of times has no side effects.
Security: Provide apikey header. secretkey is required on v4.1; on v4.0 required when High Security Mode is enabled.

Customer handling

The cashback quote works without an existing customer (useful for guest checkout). Campaign eligibility requires an existing customer:
  • When the customer is found: customerFound is true and eventRewards includes the place_order campaign breakdown.
  • When the customer is missing or inactive: customerFound is false, the cashback quote is still returned, and eventRewards is null.

Localization

Send the optional lang header to localize eventRewards.campaigns[].campaignName. Cashback campaignName values use the campaign’s internal name (matching Calculate Order Cashback) and are not affected by lang. For event campaign reason values and other machine-readable fields, see Preview Event Rewards.

Notes and limitations

  • Previews are point-in-time quotes. A concurrent real order for the same customer can change eligibility between the preview and the actual submission.
  • Campaign budgets are not checked. A campaign whose budget is exhausted may preview rewards that a real submission would reject.
  • Coupons are described, never created. Actual coupon codes are generated only by real orders.
  • The order preview evaluates the order-level place_order event only. Campaigns built on the internal per-item purchase event are not included.
  • The order preview has no orderId (same as Calculate Order Cashback), so campaign conditions that reference the order_id metadata key will not match in a preview.
  • Unknown metadata keys are ignored by previews.
  • Streak badges and mission step rewards are not included in preview results.
For custom (non-order) events, use Preview Event Rewards.

Authorizations

apikey
string
header
required

Headers

lang
string

Language code for localized campaign names in eventRewards.campaigns[] (e.g., en, ar, fr). If omitted or not configured in your account, the response falls back to your account's default language.

Body

application/json
totalPaid
number
required

Amount actually paid.

Required range: x >= 0
Example:

90

customerId
string

The customer's unique ID. The cashback part works without it (quote for a new customer); the campaigns part requires an existing customer — see customerFound.

Maximum string length: 100
Example:

"1214"

email
string

Used only to help locate the customer (channel merge).

mobile
string

Used only to help locate the customer (channel merge).

totalPrice
number

Order total before discounts.

Required range: x >= 0
Example:

100

totalDiscount
number

Total discount applied.

Required range: x >= 0
Example:

10

totalShipping
number

Shipping total.

Required range: x >= 0
totalTax
number

Tax total.

Required range: x >= 0
lineItems
object[]

Order line items.

merchant
object

Merchant/branch info for multi-merchant setups.

channel
string

Order channel (e.g. web, pos, mobile).

Example:

"web"

extra
object

Custom key/value attributes — usable in campaign conditions.

Response

Order reward preview calculated successfully

customerId
string

Echo of the request.

customerFound
boolean

false when the customer does not exist or is inactive. The cashback quote is still returned; eventRewards is null (campaign eligibility can't be evaluated without an existing customer).

totalPoints
integer

Grand total: cashback points + points from event campaigns the order would achieve now.

totalCoupons
integer

Number of coupons the order's event campaigns would grant (one per achievement of a coupon-reward campaign).

cashback
object

The cashback quote — same shape as the Calculate Order Cashback response. Note: campaignName here is the campaign's internal name and is not affected by the lang header.

eventRewards
object | null

The place_order event preview — exactly one entry with the same shape as an events[] entry of Preview Event Rewards.