Apply selected reward amounts to the order
Accepts the user's reward amount selections and stores them in pre_order.selected_rewards. The request body is dynamic: each field name corresponds to a RewardType enum value present in the rewards list returned by RewardListPage. Each value is a decimal amount the user chooses to apply, between 0 and the maximum available for that type. This is an independent page — submitting it does not advance the checkout flow.
Dynamic Fields:
One field per reward type (e.g.,
general,special).Field type: decimal with up to 12 digits and 2 decimal places.
Minimum value:
0Maximum value: the
amountvalue for that reward type from the pre-order state.
Validation:
The sum of all selected reward amounts must not exceed the order total (
pre_order.get_total_amount_with_interest()). If it does, a validation error is returned.
State Update:
On success,
selected_rewardsis populated with the chosen amounts keyed byRewardTypeenum values.
Backward Navigation:
When navigating backward,
selected_rewardsis reset tonull.
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>)
Dynamic input schema — the fields are determined at runtime based on the reward
types returned by the payment gateway in the preceding RewardListPage step.
Each field name is a RewardType enum value (general or special) and
each value is a decimal amount between 0 and the maximum available for that type.
The sum of all submitted amounts must not exceed the order total.
Amount of this reward type to apply. Between 0 and the maximum available for this type (12 digits, 2 decimal places).
25.00Rewards applied or validation error
POST /orders/checkout/?page=RewardSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 37
"general='25.00'&special='10.00'"Rewards applied or validation error
{
"context_list": [
{
"page_name": "RewardSelectionPage",
"page_slug": "rewardselectionpage",
"page_context": {
"rewards": [
{
"amount": "50.00",
"type": "general"
},
{
"amount": "30.00",
"type": "special"
}
]
}
}
],
"pre_order": {
"user_email": "user@akinon.com",
"selected_rewards": {
"general": "25.00",
"special": "10.00"
}
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

