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

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: 0

  • Maximum value: the amount value 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_rewards is populated with the chosen amounts keyed by RewardType enum values.

Backward Navigation:

  • When navigating backward, selected_rewards is reset to null.

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

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.

Other propertiesstring · decimalOptional

Amount of this reward type to apply. Between 0 and the maximum available for this type (12 digits, 2 decimal places).

Example: 25.00
Responses
200

Rewards applied or validation error

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=RewardSelectionPage
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'"
200

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?