Create a redemption
POST/v1/redemptions
Holds one reward, wallet item or code for this cart while the guest pays. For a points reward the points are held, not yet spent. A wallet item or unique code becomes reserved. The hold lasts 15 minutes; it becomes final when you send the order with this redemption's id.
Permissions: Secret key with checkout:write, or a member token for its own member.
Guide
Checkout and ordersRequest headers#
Idempotency-KeystringRequiredRequired on this endpoint. Any string up to 255 characters; use a UUID v4. Missing returns400 idempotency_key_required.Max Length 255
Request body#
The cart, plus exactly one of:
member_idstring (uuid)location_idstring (uuid)RequiredchannelstringRequiredapporweb.One ofapp,webfulfillmentstringRequiredOne ofpickup,delivery,curbside,dine_incurrencystringRequiredISO 4217 code.USD.subtotal_centsintegerRequiredInteger cents.Min 0Show attributesCartItem
line_idstringRequiredYour id for the line, unique within the cart.pos_item_idstringSquare catalog item variation id.namestringRequiredquantityintegerRequiredMin 1unit_price_centsintegerRequiredInteger cents.Min 0pos_category_idsarray of stringmodifiersarray of objectShow attributesHide attributes
pos_modifier_idstringnamestringprice_centsintegerInteger cents.Min 0
reward_idstring (uuid)A catalog reward bought with points.wallet_item_idstring (uuid)Anavailableitem from the member's wallet.codestringA promo code. Works withoutmember_idfor guest checkout.
Create redemptions from your server, as here, so it charges with the confirmed discount_cents. Take it off the price, then charge the card. Once payment is captured, send the order with "redemption_ids": ["4b8d2f6a-9c1e-4a3d-b7f5-0e6c8a2d1b59"].
Warning If payment takes longer than 15 minutes, the hold expires and an order that includes it fails with 422 redemption_expired. Create the redemption right before you charge, not when the guest opens the cart.
Only one redemption can be used per order at launch. Stacking several rewards on one order is Coming soon.
Response fields#
Returns 201 with Redemption
idstring (uuid)Send it inredemption_idson the order.statusstringSee Redemption statuses.One ofreserved,captured,canceled,expired,reversedmember_idstring (uuid)Nullablenullfor a guest code.reward_idstring (uuid)NullableWhat was redeemed. One is set.wallet_item_idstring (uuid)NullableWhat was redeemed. One is set.codestringNullableWhat was redeemed. One is set.discount_centsintegerThe discount on the cart it was created for.Min 0points_costintegerPoints held, then spent on capture.0for wallet items and codes.affected_line_idsarray of stringCart lines the discount applies to.order_idstring (uuid)NullableThe order that captured it.expires_atstring (date-time)End of the hold, 15 minutes after creation.created_atstring (date-time)
Codes without a member#
For a guest who isn't signed in, leave out member_id and send code. Call it with your secret key, since there is no member token. The rest works the same.
Error descriptions#
The Idempotency-Key header is missing.
None, or more than one, of reward_id, wallet_item_id and code was sent.
, 404 location_not_found, 404 reward_not_found An id doesn't exist in your brand.
A request with this key is still running. Retry after a second.
The member can't afford the reward.
The reward or wallet item doesn't apply to this cart. Preview the cart to get the reason code and guest message.
The wallet item or reward has expired.
The wallet item or unique code was already used.
, 422 code_expired, 422 code_limit_reached The code doesn't exist, has ended, or has been used as many times as allowed.
This key was used with a different body.
Any endpoint can also return the common errors.