Apply loyalty card points to the order
Submits the number of loyalty card points the user wishes to redeem for the current order. The selected amount is validated against the user's available balance and the basket constraints, then stored in the checkout session.
Required Fields:
selected_loyalty_amount: The points amount to apply. Must be a positive decimal value up to 12 digits with 2 decimal places.
Validation:
The selected amount must not exceed the user's available loyalty card points balance.
The selected amount is capped at
basket_total - MINIMUM_ORDER_AMOUNTplus any previously applied amount. Submitting a value above this cap returns a validation error.If
minimum_basket_amount_for_redeemis configured viaCUSTOMER_LOYALTY_CARD_SERVICE, the basket total must meet or exceed this threshold before any redemption is allowed.
State Update:
The selected points amount and its type are stored in the checkout session.
Backward Navigation:
Navigating backward from this page clears the selected loyalty amount from the checkout session.
Next Pages:
This is an independent step; the checkout flow continues based on the current checkout state.
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>)
The loyalty card points amount to apply to the order, as a decimal
value with up to 12 digits and 2 decimal places (e.g., "5.00").
Must not exceed the user's available points balance. The effective
maximum is basket_total - MINIMUM_ORDER_AMOUNT plus any previously
applied amount. Submitting a value above this cap or above the
available balance returns a validation error.
5.00Loyalty card points applied successfully
POST /orders/checkout/?page=LoyaltyCardPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 34
"selected_loyalty_amount='5.00'"Loyalty card points applied successfully
{
"context_list": [
{
"page_name": "LoyaltyCardPage",
"page_slug": "loyaltycardpage",
"page_context": {
"loyalty_total_amount": "50.00",
"loyalty_amount": "40.00",
"card_number": "1231234",
"applied_amount": "5.00",
"minimum_basket_amount": "50.00"
}
}
],
"pre_order": {
"user_email": "user@akinon.com"
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

