Skip to content

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.

object
program

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.

string
customer_external_id
required

The Shopify customer’s numeric id (not the gid:// form). The member must already be linked and enrolled in the programme.

string
/^[1-9][0-9]{0,19}$/
Example
7894561230
requested_points

The points to spend on a Points value card. Send it, or option_id, and not both.

integer
> 0 <= 1000000
option_id

A Fixed reward card, placed at the price it fixes. A Product reward card is refused (422 card_not_placeable).

string format: uuid
lines
required

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.

Array<object>
<= 500 items
object
line_id
required
string
product_id
required
string
collection_ids
required

Null = membership unknown (never eligible).

array | null
quantity
required
integer
> 0
line_subtotal_cents
required
integer
compare_at_price_cents

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.

integer

Redemption placed and armed.

object
ref
required

The redemption ref (the hold id). Set it as the cart attribute tessera_redemption, together with tessera_program = program.

string format: uuid
program
required

The handle of the programme the redemption was placed in: the value of the cart attribute tessera_program.

string
Example
vv
kind
required
string
Allowed values: points fixed_reward
value_cents
required

The discount the checkout will apply, at most.

integer
> 0
expires_at
required

When the hold lapses. A cart that outlives it gets no discount. Null only if the hold was resolved before this response was built.

string | null format: date-time
redemption_id
required

Equal to ref.

string format: uuid

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
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

Missing or invalid API key or OAuth credential.

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

The 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
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

No 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
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

The 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
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

Insufficient 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
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

The member’s redemption velocity limit was reached (rate_limited, with Retry-After).

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210

The checkout metafield could not be written (redemption_unavailable). Nothing is held. Retry with a NEW Idempotency-Key.

object
error
required
object
code
required
string
Example
not_found
message
required
string
details
request_id
required
string
Example
req_9f8e7d6c5b4a3210