For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

  • CouponSelectionPage manages user-specific BasketOffer coupons

  • VoucherCodePage manages a free-text voucher code stored on pre_order.voucher_code

  • The 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, or null if none

get
Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Voucher code page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=VoucherCodePage
GET /orders/checkout/?page=VoucherCodePage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Accept: */*
200

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?