Skip to content
Ayra Docs

Checkout extensions

Reward redemption inside checkout is two Shopify extensions working together: a checkout UI extension that shows the customer’s balance and lets them pick a reward, and a discount Function that applies the matching discount to the cart. They are linked by a signed cart attribute: the UI extension asks Ayra for a redemption token, Ayra signs it, the Function verifies the signature before applying anything, and Ayra settles the wallet ledger when the order is created. The checkout UI extension needs Shopify Plus; stores on other plans redeem in the account hub, where points become Shopify store credit that checkout applies natively.

Account hub redemptionIn-checkout redemption
Available onEvery planShopify Plus (checkout UI extensions)
Where the customer choosesWallet tab in the account hubCheckout, in the order summary
What applies the discountShopify store credit (native)Ayra discount Function
ModuleLoyaltyLoyalty (Plus)
StatusLiveLive for Plus beta merchants

Both paths draw on the same Smart Wallet, and a customer can hold store credit from the hub and still see the in-checkout picker for points.

  1. Identify. The checkout UI extension runs for signed-in customers (and for guests Ayra can identify by email after the contact step). It calls Ayra’s extension endpoint for the customer’s redeemable balance and the reward options that fit the cart.
  2. Choose. The customer picks an option (for example “Use 500 points for $5 off”). The extension requests a redemption token for that exact choice.
  3. Sign. Ayra creates a token containing the customer ID, the reward (type and value), the cart’s expected total band, a nonce and a short expiry (minutes), and signs it with a secret shared only with the Function’s configuration. The token is written to the cart attribute _ayra_redemption.
  4. Verify and apply. The discount Function reads the attribute, verifies the signature and the expiry, checks the reward value against the cart, and returns the discount. An attribute without a valid signature produces no discount; nothing in the browser can mint one.
  5. Settle. When the order is created, Ayra’s order webhook reads _ayra_redemption, marks the nonce as used, deducts the ledger (store credit first, then points, per the wallet’s rules) and writes ayra.redemption on the order. If the checkout is abandoned, the token simply expires and nothing is deducted.
  6. Reverse. A refund or cancellation reverses the ledger entries and the timeline records it. Reward Shield applies the same checks as for any other reversal.

The attribute is prefixed with _ so it is hidden from the customer’s order confirmation and from most theme output.

  • Incentive Guard: a redemption is refused if it would stack on an incentive the customer already holds, in which case the picker explains why instead of silently failing.
  • Minimum order and excluded products from the loyalty settings.
  • Journey Guard is not involved; redemption is a customer action, not an outbound send.
  • The UI extension renders nothing for customers with a zero redeemable balance and for stores with Loyalty off.
  • Store credit applied natively by Shopify and an Ayra Function discount can coexist on one order; the ledger records the split.
  • Subscription contracts created at checkout do not carry the redemption into future billing cycles.

Something missing or wrong on this page? Ask us and we will fix the docs.