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 theOrdermodel'sextra_fieldattribute. Validated viaOrder.get_attribute_config('extra_field'). If no attribute config exists, the value is stored as-is.
Validation:
If an attribute config for
extra_fieldexists andattribute.validate_value()raisesAttributeConfigNotFoundExceptionorAttributeInputTypeNotValidException, 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_fieldis removed frompre_order.data.
Next Pages:
No further checkout page (
EmptyPage)
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>)
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.
{"preference":"gift"}Extra field saved or validation error
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'}"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?

