Evaluate a member's cart against the spend programme
POST /discounts/evaluate
For a sale on a non-Shopify channel: the automatic discounts the spend programme in force gives this member’s cart, and for each redeemable card what it takes off the cart now and which automatic discounts redeeming it would remove. Writes nothing.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”object
The member, by the channel their external id lives on.
object
The channel the sale happens on; the lines’ product and collection ids belong to it. Not shopify: a Shopify checkout is priced by the checkout itself.
The programme to act in: its handle (for example vv) or its lower-case id. Optional on a workspace with one programme; on a workspace with several, a call that names none is refused with 400 program_required. A programme that is not this workspace’s is 404 not_found.
object
object
Null = membership unknown (never eligible).
The variant’s compare-at price per unit (minor units). Omitted means the line has none: a percentage card priced on compare-at takes its percentage of the selling price.
The shipping charge a 0-point Free shipping card would remove. Default 0.
Responses
Section titled “ Responses ”The evaluation.
object
The spend programme version in force that was evaluated.
object
The automatic discount each line gets, when no points are redeemed.
object
object
object
object
object
object
object
The spend card kind.
Whether POST /v1/redemptions can place this card (Points value cards, and Fixed reward cards the programme can price).
A Product reward’s product, one unit of which the reward frees; null for every other kind.
object
The product’s id on channel.
The product’s name as saved on the card.
The channel the product id belongs to.
What redeeming this card takes off this cart now (0 = not redeemable now). For a Product reward, the price of the one unit it frees: the highest per-unit price (line subtotal ÷ quantity, rounded down) among the lines of its product. null for a Free shipping or Perk card.
The automatic discounts that redemption would remove.
object
A malformed body, channel shopify, or the program is malformed (not a lower-case programme id or a programme handle), or a workspace with several programmes was given none (program_required).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210Missing or invalid API key or OAuth credential.
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210The credential lacks the loyalty:read scope — a publishable key (publishable_key_forbidden).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210No such customer in this tenant, or the program names no programme of this workspace (not_found).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210No spend programme is in force (option_not_eligible, details.reason: no_spend_programme).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210