Place a redemption a Shopify checkout applies
POST /checkout-redemptions
For a headless Shopify storefront: reserves the member’s points and arms the checkout discount, and returns the ref to carry on the cart. Secret key only: the merchant’s server vouches for the customer. The caller then sets the cart attributes tessera_redemption = ref and tessera_program = program TOGETHER (Storefront API cartAttributesUpdate replaces the whole attribute set, so merge with the cart’s existing attributes), and the cart’s buyer identity must carry that customer’s Customer Account API access token. The discount applies only when the checkout’s buyer is the customer the redemption was placed for. The member metafield the checkout reads is written before this returns; if that write fails the redemption is released and the answer is 503 redemption_unavailable. The Idempotency-Key header is REQUIRED; the same key with the same body replays the same hold, and with a different body is idempotency_key_reuse. A 503 redemption_unavailable spends its key: retry with a NEW Idempotency-Key. Only one redemption is active per membership: placing points over a points redemption replaces it, anything else is 409 not_stackable. A redemption that is never carried to a checkout holds its points until expires_at; cancel it. The hold is the one the Online Store’s own redeem places, so both planes share one redemption velocity limit.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”object
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.
The Shopify customer’s numeric id (not the gid:// form). The member must already be linked and enrolled in the programme.
Example
7894561230The points to spend on a Points value card. Send it, or option_id, and not both.
A Fixed reward card, placed at the price it fixes. A Product reward card is refused (422 card_not_placeable).
Required. The cart as the caller asserts it, as for POST /v1/redemptions. An empty array is accepted and answers 422 option_not_eligible (nothing_redeemable). The checkout prices the real cart, so an overstated line reserves points that never land and cannot move more than the redemption value.
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.
Responses
Section titled “ Responses ”Redemption placed and armed.
object
The redemption ref (the hold id). Set it as the cart attribute tessera_redemption, together with tessera_program = program.
The handle of the programme the redemption was placed in: the value of the cart attribute tessera_program.
Example
vvThe discount the checkout will apply, at most.
When the hold lapses. A cart that outlives it gets no discount. Null only if the hold was resolved before this response was built.
Equal to ref.
Missing Idempotency-Key header, a malformed body (lines is required with either option, as cart.lines is on POST /v1/redemptions), 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:write scope — a publishable key (publishable_key_forbidden), or an OAuth token, which is always read-only in v1 (insufficient_scope).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210No Shopify customer with that id is linked in this tenant (customer_not_found), the customer is not a member of the programme (not_enrolled), or the program names no programme of this workspace (not_found).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210The Idempotency-Key was used with a different request (idempotency_key_reuse), a per-customer limit was reached (cap_reached), the member already has an active redemption (not_stackable), the workspace has no connected Shopify store (shopify_not_connected), or this key was spent (conflict): This Idempotency-Key’s earlier attempt is already resolved: it was rolled back (you may not have received that 503), cancelled, used at checkout, or it expired. No redemption is pending under this key; to redeem again, place with a new key.
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210Insufficient balance (insufficient_balance), or nothing is redeemable (option_not_eligible, with details.reason, as for POST /v1/redemptions; a Product reward card is card_not_placeable: only a Points value or a Fixed reward card can be placed here, because /v1 has no live check of the reward product; card_not_at_checkout: the card is not at checkout yet, for example right after the store is connected or reconnected and before the checkout sync has run. Retry later).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210The member’s redemption velocity limit was reached (rate_limited, with Retry-After).
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210The checkout metafield could not be written (redemption_unavailable). Nothing is held. Retry with a NEW Idempotency-Key.
object
object
Example
not_foundExample
req_9f8e7d6c5b4a3210