Skip to main content
POST
Purchase a reward on behalf of a customer, deducting the required points from their balance and generating a Shopify discount code.

Request body

Most rewards have a fixed points_cost, so the request only needs customer_identifier. For flexible rewards (redemption_mode: "flexible"), the customer chooses how many points to spend within the reward’s flexible_config range (see List rewards), and the discount is sized to match. Pass points for these:
On store-credit shops, only flexible rewards can be purchased. A standard fixed-cost reward returns 403 Forbidden with This reward cannot be redeemed in store credit mode. See Loyalty modes.

Validations

  • Customer must exist and not be excluded from the loyalty program
  • Reward must be active and not deleted
  • If the reward is restricted to a VIP tier, the customer must be on that tier
  • Customer must have enough points to cover the reward’s points_cost
  • For flexible rewards, points is required and must be between the reward’s configured minimum and maximum

Response

Returns 201 Created. The discount_code is the generated Shopify discount code for the customer to use, and expires_at is when that code stops working (null when the reward has no expiry configured). For flexible rewards, reward_name reflects the resolved discount (for example £2.50 off your order) and points_spent is the number of points the customer chose. The response carries loyalty_mode and currency. points_spent is a minor-unit amount on store-credit shops, where the response also includes a credit_spent companion (a major-unit decimal string) that is absent in points mode. See Loyalty modes.

Errors