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

Submit Index Page (email and phone)

Submits user email and optional phone number for guest checkout. After successful submission, the system routes to the next appropriate page.

Configuration:

  • CAN_GUEST_PURCHASE: Controls whether guest checkout is allowed. If false, user must be authenticated.

  • USER_PHONE_FORMAT: Phone number format used for display hints and validation guidance (default: "05999999999")

Next Pages (determined dynamically):

  • If multiple delivery options exist: DeliveryOptionSelectionPage

  • If scheduled delivery is active: SlotSelectionPage

  • Otherwise: AddressSelectionPage

Guest phone verification (optional)

When the checkout-phone purpose is enabled in VERIFICATION_TOKEN_CONF, a guest submitting a phone_number must first prove they own it with an SMS code. Authenticated users are never affected, and neither is a guest who submits no phone_number.

Flow, before calling this endpoint:

  1. POST /users/verification/init/ with {"purpose": "checkout-phone", "channel": "sms", "target": "<the number>"} — returns request_id and sends the SMS. Both purpose and channel are fixed for this flow; the backend accepts no channel other than sms here, so no channel picker is needed.

  2. POST /users/verification/verify/ with the same purpose, channel and target, plus request_id and code — returns verification_token.

  3. Submit this page with that token in the X-Verification-Token header.

See the Verification & Step-up API document for those two endpoints.

The token must travel in the header. Unlike the DRF endpoints, this checkout view does not parse a verification_token body field.

Failure is reported as HTTP 200. An unverified number does not produce a 4xx: the response is 200 with errors.verification_token populated (["Phone number is not verified."]) and pre_order.phone_number left unset. Always inspect errors on the response instead of relying on the status code, and route the user back to the OTP step when that key is present.

The token is single-use, and burnt only on success. Re-submitting the same page after a different validation error does not consume it. Once the step succeeds the number is remembered for the session, so going back and re-submitting the same number needs no new verification — changing the number does.

The step cannot be skipped. While the number is unverified this step counts as neither valid nor done, so requesting a later page (e.g. ?page=AddressSelectionPage) routes back to IndexPage rather than advancing. Do not treat a context_list entry for IndexPage after such a request as an error — it means the guest still owes the verification.

post
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>)

X-Verification-TokenstringOptional

Single-use token from POST /users/verification/verify/, proving a guest owns the submitted phone_number. Required only when the checkout-phone purpose is enabled and a guest submits a phone number that is not already verified in this session. Must be sent as a header — this view does not read a verification_token body field.

Body
user_emailstring · emailRequired

User email address. Required for guest checkout.

phone_numberstringOptional

Optional phone number. Must match phone regex pattern if provided. When the checkout-phone purpose is enabled, a guest must prove ownership of this number with an SMS code first and pass the resulting token in X-Verification-Token; the same value must be used as the target throughout that flow.

Responses
200

Email submitted successfully

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=IndexPage
POST /orders/checkout/?page=IndexPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 62

"user_email='user@akinon.com'&phone_number='+15551234567'"
200

Email submitted successfully

{
  "context_list": [
    {
      "page_name": "DeliveryOptionSelectionPage",
      "page_slug": "deliveryoptionselectionpage",
      "page_context": {
        "delivery_options": [
          {
            "pk": 1,
            "name": "Home Delivery",
            "delivery_option_type": "customer",
            "is_active": true
          }
        ]
      }
    }
  ],
  "pre_order": {
    "user_email": "user@akinon.com",
    "phone_number": "+15551234567"
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?