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

Submit custom extra field value for the order

Accepts a JSON value for the extra_field on the order, validates it against the Order model's attribute configuration, and stores it in pre_order.data. This is an independent page — submitting it does not advance the checkout flow.

Fields:

  • extra_field: A JSON value that must conform to the schema defined for the Order model's extra_field attribute. Validated via Order.get_attribute_config('extra_field'). If no attribute config exists, the value is stored as-is.

Validation:

  • If an attribute config for extra_field exists and attribute.validate_value() raises AttributeConfigNotFoundException or AttributeInputTypeNotValidException, a validation error is returned.

State Update:

  • On success, pre_order.data['extra_field'] is set to the validated value.

Backward Navigation:

  • When navigating backward, extra_field is removed from pre_order.data.

Next Pages:

  • No further checkout page (EmptyPage)

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

Body
extra_fieldanyRequired

A JSON value for the Order model's extra_field attribute. Must conform to the schema defined by the Order model's attribute configuration (accessible via the schema key in the GET page context). Validated via Order.get_attribute_config('extra_field'). If no attribute config is registered, the value is stored as-is without additional validation.

Example: {"preference":"gift"}
Responses
200

Extra field saved or validation error

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

"extra_field={'preference':'gift'}"
200

Extra field saved or validation error

{
  "context_list": [
    {
      "page_name": "OrderSelectionPage",
      "page_slug": "orderselectionpage",
      "page_context": {
        "schema": {
          "type": "object",
          "properties": {
            "preference": {
              "type": "string"
            }
          }
        }
      }
    }
  ],
  "pre_order": {
    "user_email": "user@akinon.com"
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?