Get Voucher Code Page context
Returns the current voucher code set on the checkout session, if any. This page runs as an independent step, meaning it does not reset or block other checkout steps and can be submitted at any point once the precondition is satisfied.
Voucher vs Coupon:
CouponSelectionPagemanages user-specificBasketOffercouponsVoucherCodePagemanages a free-text voucher code stored onpre_order.voucher_codeThe voucher code is applied to the basket at order creation time via
OfferApplicator
Validation:
The submitted voucher code is validated by running the offer applicator in a dry-run mode (without modifying the basket)
If the code is not recognized or has already been used, a validation error is returned
Page Context:
voucher_code: The voucher code currently set, ornullif none
Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.
XMLHttpRequestPossible values: Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)
Voucher code page context retrieved
GET /orders/checkout/?page=VoucherCodePage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Accept: */*
Voucher code page context retrieved
{
"context_list": [
{
"page_name": "VoucherCodePage",
"page_slug": "vouchercodepage",
"page_context": {
"voucher_code": null
}
}
],
"errors": [],
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

