Loyalty Checkout Flow
The order in which a POS calls the Loyalty & Rewards Open APIs during checkout
Steps
- Get customer rewards. Call Get customer rewards with
orderat checkout (required). The response carries the customer's rewards, each priced for the cart inapplied_discount, and the points the order would earn inloyalty.earn_preview. - Sign up (optional). If the customer is not a loyalty member and agrees to join, collect their
phoneon the POS and call Sign up for loyalty. - Redeem rewards. When the customer uses rewards, call Redeem rewards on order once the order is final. Redeem before you apply, so loyalty is applied correctly. Rewards that cannot be redeemed, including invalid
reward_ids, are returned inrewards.unavailable_rewardswith a reason, and the rest are still redeemed. - Take payment. Charge the order with your own payment provider. This is not a DoorDash API.
- Apply the order. Once payment succeeds, call Apply rewards on order once to earn points. Customers earn points whether or not they are opted in, and points earned on an order can't be spent on it.
- Void on failure. Redeem, payment and apply are atomic: treat them as one unit. If payment or apply fails, call Void rewards on order with the
order_idto void the redeem, and the apply if it went through, in one call.
Safe retries
- An order is redeemed once and applied once.
order.id(order_idfor a void) is the idempotency key for apply, redeem and void. If a call times out, retry with the same id and the same body to get the original response. The same id with a different body returns 409.- Do not retry 400, 401, 403, 404, 409 or 422 unchanged. See Error codes and reasons for what each code means.
To see how a location is set up, including the loyalty program structure and whether in-store rewards are enabled, call Get location configuration before checkout.
Was this page helpful?