Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Loyalty Checkout Flow

The order in which a POS calls the Loyalty & Rewards Open APIs during checkout​

Steps​

  1. Get customer rewards. Call Get customer rewards with order at checkout (required). The response carries the customer's rewards, each priced for the cart in applied_discount, and the points the order would earn in loyalty.earn_preview.
  2. Sign up (optional). If the customer is not a loyalty member and agrees to join, collect their phone on the POS and call Sign up for loyalty.
  3. 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 in rewards.unavailable_rewards with a reason, and the rest are still redeemed.
  4. Take payment. Charge the order with your own payment provider. This is not a DoorDash API.
  5. 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.
  6. 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_id to 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_id for 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?