docs

Vouchers (hidden)

Vouchers can be applied during the checkout process to provide discounts on orders. Once a voucher is successfully applied:

  • The order total in the state response will reflect the updated price, including original prices and strike-through prices.
  • The basket section will show how the discount is distributed across individual items.

Showing the active Voucher Code

The currently attached voucher is included in the state response.

Location in State

Available under: orderState.vouchers

Add Voucher Code

The Add Voucher Code endpoint allows customers to apply a voucher code to their order. This includes a built-in validation step. If the voucher is valid, the discount will be immediately reflected in the order’s pricing details within the updated state response.

Remove Voucher Code

The Remove Voucher Code endpoint enables customers to remove a previously applied voucher. Once removed, the order total and item-level prices will update to exclude the voucher’s discount.