Reward by Order
Calculates the cashback amount that a given order is eligible for. This endpoint operates in two modes: Private and Public. Pick the mode that matches your use case below.
Try-it values populated from environment ACME (Demo)
Returns customer data, redeemable reward information and a confirmation token
you can later send to confirmOrder. Requires a valid user token.
Authentication
Token
Send your user token in the x-guper-authorization header. Endpoints that
support a Public mode (e.g. acúmulo and resgate previews) accept the same
request without the header — Private mode adds customer data and a
confirmation token to the response.
Headers
Request body
Content-Type:
application/json
Responses
Notes
Redemption blocked by the wallet rule. When the wallet has a dynamic
minimum (minOrderRate), the customer's balance can only be used if the
order is worth N times that balance — 3 with a $30.00 balance requires a
$90.00 purchase. It is all-or-nothing: below that, nothing is redeemed, not
even part of it.
In that case redeemable.total comes back 0 and redeemable.blocked says
why:
"redeemable": {
"total": 0,
"item": [],
"blocked": [
{
"wallet": 60,
"reason": "minOrderRate",
"rate": 3,
"balance": 3000,
"required": 9000,
"missing": 1500
}
]
}
wallet is the policy id, rate the multiplier, balance the balance
considered, required what the order would have to be worth and missing
what is left (required − order total). Amounts in cents.
The balance itself is untouched — userBalance still shows it, and the same
customer redeems normally on a bigger cart. Show missing to the customer:
"$15.00 more to use your balance". The same block shows up in
Update transaction,
which re-applies the rule when the cart changes.