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

Gift Cards, Gift Boxes & Loyalty

Checkout Gift Cards, Gift Boxes & Loyalty

Apply supplementary payment methods and gifting options that adjust the order total or add items to the order.

Gift Cards let customers apply a pre-loaded card balance to their order. The flow supports OTP verification, multi-card application (when configured), amount adjustment, and removal.

Gift Boxes let customers add gift packaging to their order.

Loyalty Points let customers redeem accumulated points as a payment contribution.

Rewards present available reward options that the customer can apply to the order.

Authentication

These endpoints support both authenticated and anonymous sessions.

  • Authenticated users: Session cookie (sessionid) tracks checkout progress.

  • Anonymous users: Guest checkout is available when the CAN_GUEST_PURCHASE setting is enabled.

Request Format

Include the following header in all checkout requests:

  • x-requested-with: XMLHttpRequest

Dynamic Settings

GIFT_CARD_CONFIG

Configuration for the gift card feature:

  • multi_card_enabled — allows more than one gift card per order when enabled.

  • max_amount_per_order — maximum cumulative gift card amount per order (zero means no cap).

  • balance_cache_ttl — duration in seconds that a fetched card balance is cached.

  • otp_resend_cooldown — minimum interval in seconds between OTP resend requests.

  • void_task_countdown — delay in seconds before unused reservations are voided.

LOYALTY_MONEY_ENABLED

Master switch for the loyalty money payment feature. When disabled, the loyalty money step is not shown.

MINIMUM_ORDER_AMOUNT

Minimum order total required after loyalty points are applied. Redemption is capped so the remaining amount does not fall below this threshold.

CUSTOMER_LOYALTY_CARD_SERVICE

Configures the service used to retrieve loyalty point balances and the optional minimum basket amount required before redemption is available.

Get Gift Card Page context

get

Returns the list of active gift card providers and the currently applied gift card reservations. This is the entry point of the gift card sub-flow and is an independent step — submitting it does not reset other checkout steps.

Preconditions:

  • None beyond the standard basket and session checks

Skip Conditions:

  • None — this page is never auto-skipped; it is reached on demand

Configuration:

  • GIFT_CARD_CONFIG.multi_card_enabled: Controls whether a second card may be added while one is already applied.

Next Pages (determined after POST, not GET):

  • GiftCardOtpPage — when the gateway requires OTP verification for the card

  • GiftCardApplyPage — when the gateway does not require OTP

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

Responses
200

Gift Card Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftCardPage
200

Gift Card Page context retrieved

Submit a gift card number for balance check

post

Submits a gift card number and provider slug. The gateway verifies the card and returns its available balance.

Depending on the gateway response, the flow branches:

  • OTP required: The gateway sends an OTP to the cardholder's registered phone as part of the balance check. The flow continues to GiftCardOtpPage.

  • No OTP: The balance is immediately available and the flow continues directly to GiftCardApplyPage.

Re-submission guard: If the same card number is submitted while an OTP is still pending for that card, the request is accepted without a new gateway call and the flow returns to GiftCardOtpPage immediately.

Required Fields:

  • card_number: The gift card number (max 64 characters)

  • provider_slug: Slug of an active gift card provider

Validation:

  • provider_slug must match an active gift card provider

  • If GIFT_CARD_CONFIG.multi_card_enabled is false and a reservation already exists, a validation error is returned

Backward Navigation:

  • Navigating backward clears any pending card data from the session

Next Pages:

  • GiftCardOtpPage — when the gateway requires OTP for the submitted card

  • GiftCardApplyPage — when the gateway does not require OTP

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
card_numberstring · max: 64Required

The gift card number to look up. Leading and trailing whitespace is stripped automatically. Must not be blank.

Example: 1234-5678-9012-3456
provider_slugstring · max: 100Required

Slug of an active gift card provider. Returns a validation error if no active provider with this slug exists.

Example: provider-a
Responses
200

Gift card submitted; flow routed to OTP or apply page

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftCardPage
200

Gift card submitted; flow routed to OTP or apply page

Get Gift Card Apply Page context

get

Returns the card's masked number, available balance, and the maximum amount that can be applied given the current unpaid total and the global per-order cap. Reached after a successful balance check (no OTP) or after OTP verification.

Preconditions:

  • A pending gift card must be fully verified: balance is known and OTP has been confirmed if the gateway required it

Skip Conditions:

  • Page is skipped if the current candidate has already been consumed (converted to a reservation) and at least one reservation exists

Configuration:

  • GIFT_CARD_CONFIG.max_amount_per_order: Sets the global cap on cumulative gift card amounts. The max_applicable_amount returned in the context already reflects this cap and the remaining unpaid total.

Next Pages (after POST):

  • EmptyPage — the sub-flow is complete; the checkout state determines the next main-flow page

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

Responses
200

Gift Card Apply Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftCardApplyPage
200

Gift Card Apply Page context retrieved

Apply the verified gift card as a reservation

post

Applies the verified gift card as a reservation on the order. The submitted amount is capped by the following rules (in order):

  1. Cannot exceed the card's available balance

  2. Cannot exceed the remaining unpaid order total

  3. Cannot exceed the remaining headroom under GIFT_CARD_CONFIG.max_amount_per_order after subtracting already-applied card amounts

After the reservation is created, the previously selected payment method is reset so the payment step is re-evaluated with the updated totals.

Required Fields:

  • amount: Decimal amount to apply (must be greater than zero)

Validation:

  • amount must be greater than zero

  • If the final capped amount resolves to zero, a validation error is returned

Backward Navigation:

  • Navigating backward clears the pending card from the session

Next Pages:

  • EmptyPage — the gift card sub-flow is complete

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
amountstring · decimalRequired

Decimal amount to apply from the gift card (12 digits, 2 decimal places). Must be greater than zero. The actual reserved amount may be lower after caps are applied: available balance, remaining unpaid order total, and the headroom under GIFT_CARD_CONFIG.max_amount_per_order.

Example: 100.00
Responses
200

Gift card applied as reservation

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftCardApplyPage
200

Gift card applied as reservation

Get Gift Card OTP Page context

get

Returns the masked phone number and OTP expiry time for the pending gift card candidate. Displayed after GiftCardPage when the gateway required OTP verification during the balance check call.

Preconditions:

  • A pending gift card must exist in the session that requires OTP verification and has not yet been verified

Skip Conditions:

  • Page is skipped if the pending card's OTP has already been verified

Next Pages:

  • GiftCardApplyPage — after successful OTP verification

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

Responses
200

Gift Card OTP Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftCardOtpPage
200

Gift Card OTP Page context retrieved

Verify the OTP code for the pending gift card

post

Submits the OTP code entered by the user. The gateway verifies the code and, on success, returns the card's available balance. The flow then continues to GiftCardApplyPage.

Required Fields:

  • otp_code: The one-time password received by the user (max 16 characters)

Validation:

  • An unverified pending card must exist in the session

  • The OTP code must be accepted by the gateway; an invalid code returns a validation error

Backward Navigation:

  • If the OTP has not yet been verified, navigating backward clears the pending card and returns to GiftCardPage

  • If already verified, backward navigation goes to GiftCardApplyPage

Next Pages:

  • GiftCardApplyPage — always, after successful verification

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
otp_codestring · max: 16Required

The one-time password received by the user (SMS or similar channel). Leading and trailing whitespace is stripped. Maximum 16 characters.

Example: 482917
Responses
200

OTP verified; flow routed to GiftCardApplyPage

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftCardOtpPage
200

OTP verified; flow routed to GiftCardApplyPage

Get Gift Card OTP Resend Page context

get

A lightweight action page that triggers an OTP resend. The GET response returns an empty context; the resend itself is performed via POST.

Preconditions:

  • A gift card candidate must exist with otp_required=True and otp_verified=False

Next Pages (after POST):

  • GiftCardOtpPage — always, so the user can enter the newly sent code

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

Responses
200

OTP Resend Page context retrieved (empty)

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftCardOtpResendPage
200

OTP Resend Page context retrieved (empty)

Resend the OTP code for the pending gift card

post

Triggers a new OTP send to the cardholder's registered phone. On success, the pending card's phone and expiry information are updated with the new values. The flow always continues to GiftCardOtpPage so the user can enter the new code.

No request body fields are required — this is an action-only endpoint.

Cooldown enforcement: If the cooldown period defined by GIFT_CARD_CONFIG.otp_resend_cooldown has not elapsed since the last send, the request is rejected. The response includes a retry_after field (remaining seconds) in the errors object so the client can surface a countdown to the user.

Next Pages:

  • GiftCardOtpPage — always

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

Responses
200

OTP resent or cooldown error returned

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftCardOtpResendPage
200

OTP resent or cooldown error returned

Get Gift Card Payment Page context

get

A payment confirmation page reached when gift card reservations fully cover the order total (unpaid amount is zero) and the gift card payment option has been explicitly selected. Returns an empty context; the only user action required is accepting the agreement.

Preconditions (all must be satisfied):

  • At least one gift card reservation must exist

  • The remaining unpaid amount must be zero (gift cards fully cover the order)

  • The selected payment option must be of gift card type

Skip Conditions:

  • Page is skipped if the order has already been finalized

Next Pages (after POST):

  • ThankYouPage — order is placed

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

Responses
200

Gift Card Payment Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftCardPaymentPage
200

Gift Card Payment Page context retrieved

Place the order using gift card reservations

post

Confirms the user's agreement and places the order using the applied gift card reservations.

Required Fields:

  • agreement: Must be true. The user must explicitly accept the terms and conditions to proceed.

Validation:

  • agreement must be true; any other value returns a validation error

  • The basket total must be greater than zero

Backward Navigation:

  • Navigating backward returns to PaymentOptionSelectionPage

Next Pages:

  • ThankYouPage — after the order is successfully placed

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
agreementbooleanRequired

Must be true. The user must explicitly accept the terms and conditions to confirm the gift card payment. Any other value returns a validation error.

Example: true
Responses
200

Order placed or validation error returned

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftCardPaymentPage
200

Order placed or validation error returned

Get Gift Card Remove Page context

get

A management page for removing an already-applied gift card reservation. The GET response returns an empty context. This is an independent step that can be submitted at any point once gift cards are enabled.

Preconditions:

  • None beyond the standard basket and session checks

Next Pages (after POST):

  • GiftCardPage — so the user can add another card or proceed

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

Responses
200

Gift Card Remove Page context retrieved (empty)

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftCardRemovePage
200

Gift Card Remove Page context retrieved (empty)

Remove an applied gift card reservation

post

Removes the reservation identified by card_number_hash. No gateway call is made. After removal, the previously selected payment method is reset so the payment step is re-evaluated with the updated totals.

Required Fields:

  • card_number_hash: The hash of the card number to remove (max 255 characters)

Note: If the hash does not match any existing reservation, the request succeeds silently — the result is an unchanged (or already-empty) list.

Next Pages:

  • GiftCardPage

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
card_number_hashstring · max: 255Required

Hash of the gift card number that identifies the reservation to remove. Obtained from card_number_hash in the applied cards list returned by the Gift Card Page. If the hash does not match any reservation the request succeeds silently.

Example: abc123hash
Responses
200

Gift card reservation removed

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftCardRemovePage
200

Gift card reservation removed

Get Gift Card Update Amount Page context

get

A management page for adjusting the reserved amount of an already-applied gift card. Returns an empty context. This is an independent step that can be submitted at any point once gift cards are enabled and at least one reservation exists.

Preconditions:

  • At least one gift card reservation must exist

Next Pages (after POST):

  • EmptyPage

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

Responses
200

Gift Card Update Amount Page context retrieved (empty)

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftCardUpdateAmountPage
200

Gift Card Update Amount Page context retrieved (empty)

Update the reserved amount of an applied gift card

post

Updates the amount for the reservation identified by card_number_hash. The balance is read from cache to avoid a gateway round-trip.

The new amount is subject to the same caps as the apply step, with one adjustment: the card's current reserved amount is temporarily added back to the unpaid total so the calculation treats it as if the card were not yet applied.

  1. Cannot exceed the cached available balance

  2. Cannot exceed the unpaid total (including this card's current amount)

  3. Cannot push the cumulative gift card total above GIFT_CARD_CONFIG.max_amount_per_order

After the update, the previously selected payment method is reset so the payment step is re-evaluated.

Cache expiry: If the cached balance has expired, the reservation is automatically removed. The response returns an error asking the user to re-add the card.

Required Fields:

  • card_number_hash: Hash identifying the reservation to update (max 255 chars)

  • new_amount: New desired amount (decimal, must be greater than zero)

Validation:

  • new_amount must be greater than zero

  • If the final capped amount resolves to zero, a validation error is returned

  • If card_number_hash is not found among the applied cards, a validation error is returned

Next Pages:

  • EmptyPage

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
card_number_hashstring · max: 255Required

Hash of the gift card number identifying the reservation to update. Obtained from card_number_hash in the applied cards list returned by the Gift Card Page.

Example: abc123hash
new_amountstring · decimalRequired

New desired reserved amount (12 digits, 2 decimal places). Must be greater than zero. Subject to the same cap rules as the apply step, adjusted so the card's current reserved amount is treated as if it were not yet applied.

Example: 75.00
Responses
200

Gift card reservation amount updated

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftCardUpdateAmountPage
200

Gift card reservation amount updated

Get Gift Box Index Page context

get

Entry point for the gift box selection flow. Clears any previously selected gift box from the pre-order and routes immediately to GiftBoxPage.

This page is automatically processed (skipped) whenever its preconditions are met — it is never rendered directly. Upon access, the gift box selection is cleared and the response context reflects GiftBoxPage.

Preconditions:

  • GIFT_BOX_CONFIGURATIONS.is_active must be true

  • pre_order.user_email must be set

Skip Conditions:

  • Always auto-processed when preconditions are met (is_already_done returns true whenever GIFT_BOX_CONFIGURATIONS.is_active is true)

Configuration:

  • GIFT_BOX_CONFIGURATIONS: Controls whether the gift box flow is enabled. When is_active is false, this page and GiftBoxPage are both inaccessible.

Next Pages (determined dynamically):

  • GiftBoxPage — always, when preconditions are met

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

Responses
200

Gift box index page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftBoxIndexPage
200

Gift box index page context retrieved

Submit Gift Box Index Page

post

Clears the current gift box selection from the pre-order and proceeds to GiftBoxPage. This endpoint accepts no input fields.

Typically called during backward navigation to allow the user to re-select a gift box option.

State Update:

  • pre_order.gift_box is set to null, removing any previously selected gift box

Backward Navigation:

  • Submitting this page resets the gift box selection, allowing a fresh choice on GiftBoxPage

Next Pages:

  • GiftBoxPage

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

Responses
200

Gift box cleared, routed to GiftBoxPage

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftBoxIndexPage
200

Gift box cleared, routed to GiftBoxPage

Get Gift Box Page context

get

Presents the gift box selection form. The user may add an optional personal note, request a gift video, and confirm whether a gift video notification has been sent.

The page_context exposes the price of the gift box product so the storefront can display it to the user before confirmation.

Preconditions:

  • GIFT_BOX_CONFIGURATIONS.is_active must be true

  • pre_order.user_email must be set

Skip Conditions:

  • Page is auto-processed when a gift box selection already exists on the pre-order (i.e., pre_order.gift_box is not null)

Configuration:

  • GIFT_BOX_CONFIGURATIONS: Must have is_active: true. The sku field identifies the gift box product used to resolve the displayed price. When sku is null, the price is 0.00.

Next Pages (determined dynamically):

  • Proceeds to the next applicable checkout step once gift box selection is complete

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

Responses
200

Gift box page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=GiftBoxPage
200

Gift box page context retrieved

Submit Gift Box Page

post

Saves the gift box selection to the pre-order with the provided note and video preferences, then proceeds to the next checkout step.

All fields are optional. Submitting without any fields creates a gift box with no note and no video.

Required Fields:

  • None — all fields are optional

Validation:

  • note: maximum 160 characters; null and empty string are accepted

State Update:

  • pre_order.gift_box is populated with the submitted note, gift_video, and gift_video_notification_sent values. The gift box product is resolved from GIFT_BOX_CONFIGURATIONS.sku.

Backward Navigation:

  • Navigating back to GiftBoxIndexPage clears pre_order.gift_box, resetting the selection

Next Pages:

  • Proceeds to the next applicable checkout step

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
notestring · max: 160 · nullableOptional

An optional personal message to include with the gift box. Maximum 160 characters. Accepts null and empty string.

Example: Happy Birthday! Wishing you all the best.
gift_videobooleanOptional

When true, a gift video is requested for this order.

Example: true
gift_video_notification_sentbooleanOptional

Indicates whether the gift video notification has already been sent. Passed through from the client after the notification is dispatched.

Example: false
Responses
200

Gift box saved, proceeding to next checkout step

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=GiftBoxPage
200

Gift box saved, proceeding to next checkout step

Get Loyalty Card Page context

get

Returns the user's loyalty card balance and redeemable points information, enabling the user to select how many loyalty card points to apply toward the current order. This page runs as an independent step and is also available after order placement (available_for_post_order: true).

The redeemable amount displayed to the user is automatically capped so that the remaining order total does not fall below the MINIMUM_ORDER_AMOUNT threshold. The total available points on the card (loyalty_total_amount) and the effective redeemable amount after cap (loyalty_amount) may therefore differ.

If the user has no active loyalty card, all amount fields return 0 or null and card_number is null.

Preconditions:

  • User must be authenticated and have an active loyalty card associated with their account

Skip Conditions:

  • None

Configuration:

  • CUSTOMER_LOYALTY_CARD_SERVICE: Object — configures the custom service implementation that retrieves available loyalty card points and the optional minimum_basket_amount_for_redeem threshold.

  • MINIMUM_ORDER_AMOUNT: Decimal — the minimum order amount that must remain after loyalty card redemption. The redeemable points are capped at basket_total - MINIMUM_ORDER_AMOUNT.

Next Pages:

  • This is an independent step and does not determine the next checkout page.

available_for_post_order: true

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

Responses
200

Loyalty Card Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=LoyaltyCardPage
200

Loyalty Card Page context retrieved

Apply loyalty card points to the order

post

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_AMOUNT plus any previously applied amount. Submitting a value above this cap returns a validation error.

  • If minimum_basket_amount_for_redeem is configured via CUSTOMER_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.

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
selected_loyalty_amountnumber · decimalRequired

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.

Example: 5.00
Responses
200

Loyalty card points applied successfully

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=LoyaltyCardPage
200

Loyalty card points applied successfully

Get Loyalty Money Page context

get

Returns the context for the Loyalty Money Page, which presents a terms and conditions agreement to the user before finalizing a loyalty money payment. This page is reached when the loyalty money payment option has been selected and the loyalty balance fully covers the order total (no unpaid amount remains).

Preconditions:

  • The selected payment option must be of loyalty money type

  • The LOYALTY_MONEY_ENABLED dynamic setting must be true

  • The loyalty money balance must cover the full order amount (unpaid amount must be zero)

Skip Conditions:

  • Page is skipped if the loyalty money payment option is selected and the order has already been finalized

Configuration:

  • LOYALTY_MONEY_ENABLED: Controls whether the loyalty money payment method is available during checkout. Defaults to false.

available_for_post_order: true

Next Pages (determined dynamically):

  • ThankYouPage — after the order is placed

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

Responses
200

Loyalty Money Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=LoyaltyMoneyPage
200

Loyalty Money Page context retrieved

Confirm loyalty money payment and place the order

post

Submits the user's agreement to terms and conditions, confirming the loyalty money payment. On success, the order is placed using the available loyalty money balance, which must fully cover the order total.

Required Fields:

  • agreement: Must be true. The user must explicitly accept the terms and conditions to proceed.

Validation:

  • agreement must be true; any other value returns a validation error

  • The basket total must be greater than zero

State Update:

  • On success, the order is finalized using the loyalty money balance. The card and installment information in the pre-order are cleared as they are not applicable to loyalty money payments.

Backward Navigation:

  • Navigating backward from this page does not alter the pre-order state.

Next Pages:

  • The order is placed upon successful submission; the checkout flow advances to the order confirmation step.

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
agreementboolean · enumRequired

User must accept the terms and conditions to proceed with the loyalty money payment. Must be true.

Possible values:
Responses
200

Loyalty money payment confirmed and order placed

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=LoyaltyMoneyPage
200

Loyalty money payment confirmed and order placed

Get Loyalty Money Usage Page context

get

Returns the user's available loyalty money balance and a breakdown of account groups by label, enabling the user to specify how much loyalty money to apply toward the current order. This page runs as an independent step, meaning it does not reset or block other checkout steps and can be submitted at any point once the precondition is satisfied.

Preconditions:

  • The LOYALTY_MONEY_ENABLED dynamic setting must be true

Skip Conditions:

  • None

Configuration:

  • LOYALTY_MONEY_ENABLED: Controls whether the loyalty money feature is active during checkout. Defaults to false. When false, this page is excluded from the checkout flow entirely.

Next Pages:

  • This is an independent step and does not determine the next checkout page. The checkout flow proceeds based on the current checkout state.

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

Responses
200

Loyalty Money Usage Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=LoyaltyMoneyUsagePage
200

Loyalty Money Usage Page context retrieved

Set loyalty money amount to apply to the order

post

Specifies the amount of loyalty money the user wishes to apply to the current order. The submitted amount is stored in the checkout session and used when the payment is finalized.

Two input modes are supported:

  1. Legacy mode — submit loyalty_amount_to_use as a flat decimal amount. The system automatically distributes the debit across the user's accounts in label-priority order.

  2. Label-based mode — submit account_usages as a JSON-encoded array specifying the exact amount to debit from each account label.

When both fields are provided, loyalty_amount_to_use takes precedence and account_usages is discarded.

Required Fields:

  • At least one of loyalty_amount_to_use or account_usages must be present. Submitting null for loyalty_amount_to_use sets the applied amount to zero.

Validation:

  • Each entry in account_usages must reference a label the user owns.

  • The requested amount per label must not exceed the available balance for that label.

  • account_usages must be a valid JSON array; a malformed value returns a validation error.

State Update:

  • The selected payment option, card details, and installment selection are cleared from the checkout session, as loyalty money usage is evaluated independently of credit card payment flows.

  • loyalty_amount_to_use and loyalty_account_usages are updated with the submitted values.

Backward Navigation:

  • Navigating backward from this page does not alter the checkout state.

Next Pages:

  • This is an independent step; the checkout flow continues to the page determined by the current checkout state.

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
loyalty_amount_to_usenumber · nullableOptional

The flat loyalty money amount to apply to the order, as a decimal value with up to 12 digits and 2 decimal places (e.g., "50.00"). When provided alongside account_usages, this field takes precedence and account_usages is ignored. Submit 0 or null to remove any previously applied loyalty money amount.

Example: 50.00
account_usagesstring · nullableOptional

A JSON-encoded array specifying the loyalty money amount to debit from each account label. Each array item must contain:

  • label_id: integer primary key of the account label, or null for unlabeled accounts
  • amount: decimal string representing the amount to debit from that label group

The requested amount per label must not exceed the user's available balance for that label. Unlabeled accounts are referenced with "label_id": null. Malformed JSON returns a validation error.

Ignored when loyalty_amount_to_use is also provided.

Example: [{"label_id": 1, "amount": "25.00"}, {"label_id": null, "amount": "10.00"}]
Responses
200

Loyalty money usage amount set successfully

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=LoyaltyMoneyUsagePage
200

Loyalty money usage amount set successfully

Get Reward List Page context

get

Returns the context for the Reward List Page, which collects the user's full credit card details and queries the payment gateway for available rewards. This page is only reachable when a credit card payment option is selected, card info is present in the pre-order, and the active gateway has rewards enabled. This is an independent page — submitting it does not advance the checkout flow.

Preconditions:

  • Basket must not be empty

  • A credit card payment option must be selected (check_credit_card_selected)

  • Card information must be present in the pre-order (card_info is populated)

  • The active payment gateway must have enable_rewards = true and has_rewards() returning true

Skip Conditions:

  • Page is skipped if reward data has already been fetched (i.e., rewards is not null in pre-order)

Next Pages:

  • RewardSelectionPage — always, after reward data is fetched

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

Responses
200

Reward List Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=RewardListPage
200

Reward List Page context retrieved

Query available rewards for the selected credit card

post

Submits the full credit card details to the payment gateway and retrieves the list of available rewards. The returned reward list is stored in pre_order.rewards and used by the subsequent RewardSelectionPage. This is an independent page — submitting it does not advance the checkout flow.

Required Fields:

  • card_number: Full credit card number. Spaces are stripped before validation.

  • card_month: Card expiry month.

  • card_year: Card expiry year (4 digits).

  • card_cvv: Card security code.

Optional Fields:

  • card_holder: Cardholder name.

  • card_name: Alias or label for the card.

Validation:

  • card_number must be a valid card number (spaces stripped before check)

  • card_month must be a valid month value

  • card_year must be a 4-digit valid year

  • card_cvv must be a valid CVV format

  • Card must not be expired

State Update:

  • On success, rewards in the pre-order is populated with the list of reward objects returned by the gateway. If the gateway returns no rewards, rewards may be set to an empty list.

Backward Navigation:

  • When navigating backward from this page, rewards is reset to null.

Next Pages:

  • RewardSelectionPage

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
card_numberstringRequired

Full credit card number. Leading, trailing, and internal spaces are stripped before validation. Must pass card number format validation.

Example: 5400010000000004
card_monthstringRequired

Card expiry month. Must be a valid month value.

Example: 12
card_yearstring · min: 4 · max: 4Required

Card expiry year (4 digits). Must be a valid future year.

Example: 2027
card_cvvstringRequired

Card security code (CVV/CVC). Must pass CVV format validation.

Example: 123
card_holderstringOptional

Cardholder full name. Optional.

Example: John Doe
card_namestring · nullableOptional

Optional alias or label for the card.

Example: My Main Card
Responses
200

Rewards retrieved or validation error

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=RewardListPage
200

Rewards retrieved or validation error

Get Reward Selection Page context

get

Returns the list of available rewards fetched in the preceding RewardListPage step. The user selects how much of each reward type to apply to the order. This is an independent page — submitting it does not advance the checkout flow.

Preconditions:

  • Basket must not be empty

  • Reward data must have been fetched (i.e., rewards must not be null in pre-order)

Skip Conditions:

  • Page is skipped if rewards have already been selected (i.e., selected_rewards is not null)

Next Pages:

  • No further checkout page — this is a terminal reward step (EmptyPage)

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

Responses
200

Reward Selection Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=RewardSelectionPage
200

Reward Selection Page context retrieved

Apply selected reward amounts to the order

post

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)

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
200

Rewards applied or validation error

Last updated

Was this helpful?