POST /api/public/v1/orders/applyStampReward

Changed on

Uses one of the order customer's ready stamp rewards, as customers.tillStampRewards offers them, on an unpaid order, on the line itemId names, one of the live, priced lines among the reward row's reward items or categories, archived row included; without itemId the reward goes on the cheapest of those lines that no pass covers. The line becomes free at its base size's price, its discount named after the row, replacing the cashier's discount on that line; an order-level discount applies after it. With itemId, a pass on that line leaves it, for another line the pass covers or for none, its use not spent, and the server keeps the reward on that line on every re-derivation of the totals, never moving it and never giving it to a pass: a removed or voided line, or one that no longer fits, gives the reward back to the guest. Without itemId, the reward moves to the cheapest fitting line no pass covers on every re-derivation, and a pass takes its line first. The covering payment marks the reward used. Refused with BAD_REQUEST as stampRewardOrderPaid once the order took a payment or is closed, stampRewardUnavailable for a reward that is not a ready, unexpired one of the order customer's, stampRewardOnePerOrder while the order holds another reward, stampRewardNoLine when no line of the order is one the reward gives, or, without itemId, when a pass covers each of them, and stampRewardLineNotOffered when itemId is not one of those lines; with CONFLICT as stampRewardTaken while another unpaid order holds it. Refused before the order is read, as a points spend is: with FORBIDDEN as loyaltyDisabled, featureRestrictedByPlan or featureNotEntitled while the business takes no new Loyalty work, with the billing refusals while its standing admits no new commitment, and as stampsDisabled while its program is not live, its Stamps are off or the stamps flag is off. Refused with shiftClosed once the order's shift has closed (FORBIDDEN; BAD_REQUEST when creating under it) and with FORBIDDEN notShiftParticipant for a caller not taking part in the shift. Refused with FORBIDDEN as paywallLocked when the caller is an Owner or Manager of a business the merchant Paywall locks: one with no verified subscription that has taken 5 orders while the Paywall's rollout reaches it, an order counting from its first saved line, whether or not it is paid or completed, until it is archived or cancelled before activation. Nothing is read or written; a verified subscription lifts the lock.

Request

  • Base URL
    https://app.fortuneos.ai
  • Auth
    none declared

Request body

object required
orderId, string required
rewardId, string required
itemId, string

Response

OK

object required
id, string required

Changes