Checkout Pages

Individual checkout page endpoints. Each page represents a step in the checkout flow.

Get current checkout state

get

Returns the current checkout state and determines which page should be displayed. The response includes a list of completed pages and the current page context.

If the page query parameter is provided, it forces the display of that specific page. Otherwise, the system automatically determines the appropriate page based on checkout progress.

Query parameters
pagestring · enumOptional

Optional page name to force display a specific page

Possible values:
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
chevron-right
200

Checkout state retrieved

application/json
get
/orders/checkout/

Process checkout step

post

Processes form submission for the current checkout step. The page parameter determines which page's data is being submitted.

Processing Flow:

  1. Validates preconditions for the specified page

  2. Validates submitted data according to page-specific rules

  3. Updates pre-order state if validation succeeds

  4. Recalculates campaigns and discounts

  5. Determines next page and returns updated checkout state

Error Handling:

  • Validation errors are returned in the errors object

  • User remains on the current page when errors occur

  • Previously entered valid data is preserved

Query parameters
pagestring · enumRequired

Page name to process (e.g., "IndexPage", "AddressSelectionPage")

Possible values:
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
or
or
or
or
or
or
or
or
Responses
chevron-right
200

Step processed successfully

application/json
post
/orders/checkout/

Get Index Page context

get

Returns the context for the Index Page, which collects user email and optional phone number. This page is skipped for authenticated users.

Preconditions:

  • Basket must not be empty

  • If CAN_GUEST_PURCHASE is false, user must be authenticated

Skip Conditions:

  • Page is skipped if user is already logged in

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
chevron-right
200

Index page context retrieved

application/json
get
/orders/checkout/?page=IndexPage
200

Index page context retrieved

Submit Index Page (email and phone)

post

Submits user email and optional phone number for guest checkout. After successful submission, the system routes to the next appropriate page.

Configuration:

  • CAN_GUEST_PURCHASE: Controls whether guest checkout is allowed. If false, user must be authenticated.

  • USER_PHONE_FORMAT: Phone number format used for display hints and validation guidance (default: "05999999999")

Next Pages (determined dynamically):

  • If multiple delivery options exist: DeliveryOptionSelectionPage

  • If scheduled delivery is active: SlotSelectionPage

  • Otherwise: AddressSelectionPage

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
user_emailstring · emailRequired

User email address. Required for guest checkout.

phone_numberstringOptional

Optional phone number. Must match phone regex pattern if provided.

Responses
chevron-right
200

Email submitted successfully

application/json
post
/orders/checkout/?page=IndexPage
200

Email submitted successfully

Get Delivery Option Selection Page context

get

Returns available delivery options for selection. This page is automatically skipped if only one active delivery option exists.

Preconditions:

  • User email must be set

  • Basket must not be empty

Skip Conditions:

  • Page is skipped if only one active delivery option exists

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
chevron-right
200

Delivery options retrieved

application/json
get
/orders/checkout/?page=DeliveryOptionSelectionPage
200

Delivery options retrieved

Set Delivery Option

post

Sets the selected delivery option to the current pre-order.

Configuration:

  • CHECKOUT_DELIVERY_OPTION_SELECTION_PAGE: Determines which delivery option selection page is used. Can be set to DeliveryOptionSelectionPage or RemoteDeliveryOptionSelectionPage.

Next Pages (based on selected delivery option):

  • If scheduled delivery is active: SlotSelectionPage

  • If pickup location selected: PickupLocationSelectionPage

  • If retail store selected: RetailStoreSelectionPage

  • Otherwise: AddressSelectionPage

Cascading Invalidation:

  • Changing delivery option with clear=true resets shipping and billing addresses

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
delivery_optionintegerRequired

Primary key of the selected delivery option

clearbooleanOptional

If true, clears shipping and billing addresses when changing delivery option

Default: false
Responses
chevron-right
200

Delivery option set successfully

application/json
post
/orders/checkout/?page=DeliveryOptionSelectionPage
200

Delivery option set successfully

Get Remote Delivery Option Selection Page context

get

Returns available delivery options fetched from a remote service. Extends DeliveryOptionSelectionPage to use RemoteDeliveryOptionService.

Configuration:

  • Requires REMOTE_DELIVERY_OPTION_PROVIDER dynamic setting to be configured

  • The provider fetches delivery options from an external service based on the configuration

  • Used when CHECKOUT_DELIVERY_OPTION_SELECTION_PAGE is set to RemoteDeliveryOptionSelectionPage

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
chevron-right
200

Remote delivery options retrieved

application/json
get
/orders/checkout/?page=RemoteDeliveryOptionSelectionPage
200

Remote delivery options retrieved

Set Remote Delivery Option

post

Sets the selected remote delivery option. Validates that the selected option is available from the remote service.

Configuration:

  • Requires REMOTE_DELIVERY_OPTION_PROVIDER dynamic setting to be configured

  • The provider fetches delivery options from an external service based on the configuration

  • Used when CHECKOUT_DELIVERY_OPTION_SELECTION_PAGE is set to RemoteDeliveryOptionSelectionPage

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
delivery_optionintegerRequired

Primary key of the selected delivery option

clearbooleanOptional

If true, clears shipping and billing addresses when changing delivery option

Default: false
Responses
chevron-right
200

Remote delivery option set successfully

application/json
post
/orders/checkout/?page=RemoteDeliveryOptionSelectionPage
200

Remote delivery option set successfully

Get Address Selection Page context

get

Returns available addresses for selection (billing and shipping). Supports both authenticated users (shows saved addresses) and anonymous users (shows addresses stored in session).

Preconditions:

  • User email must be set

  • Delivery option must be selected and must be customer type (is_customer())

  • Basket must not be empty

Address Sources:

  • Authenticated users: Addresses from their account, ordered by primary status and modification date

  • Anonymous users: Addresses stored in session via AnonymousUserAddressService

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
chevron-right
200

Address selection page context retrieved

application/json
get
/orders/checkout/?page=AddressSelectionPage
200

Address selection page context retrieved

Send User's Billing and Shipping Addresses

post

Sets the billing and shipping addresses for the order.

Configuration:

  • REMOTE_PRICE_ATTRIBUTE_KEY: Product attribute key (default: "has_remote_price") that indicates a product requires remote price calculation. If any basket item has this attribute set to "true", the checkout flow routes to RemotePriceCalculationPage after address selection.

  • IDENTITY_NUMBER_REQUIRED_AMOUNT: Order amount threshold that requires identity number validation. If set and order total (with interest) exceeds this amount, shipping address must have identity_number field populated, otherwise validation fails.

  • DEFAULT_COUNTRY_CODE: Default country code used to populate country field in address contexts.

Remote Price Detection:

  • Checks if any basket item has REMOTE_PRICE_ATTRIBUTE_KEY attribute set to "true"

  • If detected, routes to RemotePriceCalculationPage next

Next Pages:

  • If remote price calculation needed: RemotePriceCalculationPage

  • Otherwise: Shipping option selection page

Validation:

  • If IDENTITY_NUMBER_REQUIRED_AMOUNT is set and order total exceeds threshold, shipping address must have identity_number populated

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
billing_addressintegerRequired

Primary key of the billing address

shipping_addressintegerRequired

Primary key of the shipping address

Responses
chevron-right
200

Addresses set successfully

application/json
post
/orders/checkout/?page=AddressSelectionPage
200

Addresses set successfully

Get Retail Store Selection Page context

get

Returns available retail stores for click-and-collect orders. Only displayed when delivery option type is retail store.

Preconditions:

  • Delivery option must be selected and must be retail store type (is_retail_store())

  • Basket must not be empty

Retail Store Filtering:

  • If CHECKOUT_LIST_RETAIL_STORES is False, no stores are listed

  • If CHECKOUT_RETAIL_STORE_FILTERS.by_stock is True, only stores with available stock for basket items are shown

  • Otherwise, all active retail stores with click_and_collect=True are displayed

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
chevron-right
200

Retail store selection page context retrieved

application/json
get
/orders/checkout/?page=RetailStoreSelectionPage
200

Retail store selection page context retrieved

Select Retail Store

post

Sets the selected retail store for click-and-collect order.

Configuration:

  • CHECKOUT_LIST_RETAIL_STORES: Controls whether retail stores are listed (static setting, default: True). When False, no stores are fetched or displayed.

  • CHECKOUT_RETAIL_STORE_FILTERS: Filtering options for retail stores (default: {"by_stock": false}). When by_stock is true, only retail stores with available stock for basket items are shown. When false, all active retail stores with click_and_collect=True are displayed.

  • DEFAULT_COUNTRY_CODE: Default country code used to populate country field in address contexts.

Address Handling:

  • Creates a RetailStoreAddress object from the selected retail store

  • Uses billing address details (first name, last name) and user email

  • Sets billing_and_shipping_same to false

Next Pages:

  • Shipping option selection 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>)

Body
billing_addressintegerRequired

Primary key of the billing address

retail_storeintegerRequired

Primary key of the selected retail store

Responses
chevron-right
200

Retail store selected successfully

application/json
post
/orders/checkout/?page=RetailStoreSelectionPage
200

Retail store selected successfully

Get Pickup Location Selection Page context

get

Returns context for pickup location selection. Only displayed when delivery option type is pickup location.

Preconditions:

  • Delivery option must be selected and must be pickup location type (is_pickup_location())

  • Basket must not be empty

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
chevron-right
200

Pickup location selection page context retrieved

application/json
get
/orders/checkout/?page=PickupLocationSelectionPage
200

Pickup location selection page context retrieved

Select Pickup Location

post

Sets the selected pickup location for the order.

Configuration:

  • DEFAULT_COUNTRY_CODE: Default country code used to populate country field in address contexts.

Pickup Location Handling:

  • Uses PickupLocationService to fetch location by remote_id

  • Creates a PickupLocationAddress object

  • Validates that the remote location exists

Next Pages:

  • Shipping option selection 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>)

Body
remote_idstringRequired

Remote identifier for the pickup location

billing_addressintegerRequired

Primary key of the billing address

Responses
chevron-right
200

Pickup location selected successfully

application/json
post
/orders/checkout/?page=PickupLocationSelectionPage
200

Pickup location selected successfully

Get Address Clear Page context

get

A utility page that clears all address-related data from the pre-order. Used internally to reset checkout state. Does not require user interaction.

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
chevron-right
200

Address clear page context

application/json
get
/orders/checkout/?page=AddressClearPage
200

Address clear page context

Clear Address Data

post

Clears shipping address, billing address, billing_and_shipping_same, and retail_store from the pre-order. Routes to EmptyPage after completion.

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
chevron-right
200

Address data cleared successfully

application/json
post
/orders/checkout/?page=AddressClearPage
200

Address data cleared successfully

Get Shipping Option Selection Page context

get

Returns available shipping options for the selected shipping address. This is the default shipping option selection page when CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE dynamic setting is set to ShippingOptionSelectionPage (default).

Preconditions:

  • Shipping address must be selected (check_address_selected)

  • Basket must not be empty

Shipping Option Rules: Shipping options are filtered based on configured rules that determine availability. Each shipping option can have multiple rules attached, and all rules must pass for the option to be available.

  • Rules are evaluated against the current checkout context (basket, address, user, etc.)

  • Common rule types include:

    • Geographic rules: Filter by country, city, township, or district

    • Basket rules: Filter by basket total amount, item count, or weight

    • Product rules: Filter by product attributes, categories, or data sources

    • User rules: Filter by user segment, membership status, or order history

    • Time-based rules: Filter by day of week, time windows, or date ranges

  • If no rules pass for any shipping option, checkout cannot proceed

  • Rule configurations are managed through the admin interface

Shipping Amount Calculators: Each shipping option has a configured calculator that determines the shipping cost dynamically.

  • Calculator Types:

    • FreeShippingCalculator: Always returns zero shipping cost

    • FixedPriceCalculator: Returns a fixed shipping amount configured on the shipping option

    • WeightBasedCalculator: Calculates cost based on total basket weight and configured weight tiers

    • PriceBasedCalculator: Calculates cost based on basket total amount and configured price tiers

    • QuantityBasedCalculator: Calculates cost based on total item quantity in basket

    • RemoteCalculator: Fetches shipping cost from an external service/API

    • DataSourceCalculator: Calculates cost per data source (vendor/supplier)

  • Calculators receive basket contents, shipping address, and currency as input

  • Calculator results are cached per request for performance

  • Custom calculators can be implemented by extending the base calculator class

Auto-selection:

  • If AUTOSELECT_SHIPPING setting is True and only one shipping option is available, it is automatically selected and the page is skipped

Configuration:

  • CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE: Determines which shipping option selection page is used. Can be set to ShippingOptionSelectionPage (default), DataSourceShippingOptionSelectionPage, AttributeBasedShippingOptionSelectionPage, or RemoteShippingOptionSelectionPage.

  • AUTOSELECT_SHIPPING: When True, automatically selects the shipping option if only one is available.

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
chevron-right
200

Shipping option selection page context retrieved

application/json
get
/orders/checkout/?page=ShippingOptionSelectionPage
200

Shipping option selection page context retrieved

Select Shipping Option

post

Sets the selected shipping option for the order.

Validation:

  • The selected shipping option must be in the list of available shipping options

  • The shipping option's rules are re-evaluated to ensure it's still valid

  • If the shipping option has required_fields in its kwargs, those fields must be provided

Rule Re-evaluation:

  • Rules are checked again at submission time to prevent race conditions

  • If basket contents changed since page load, rules may now fail

  • If address changed since page load, geographic rules are re-evaluated

  • Failed rule validation returns an error and the user must select a different option

Shipping Amount Calculation:

  • Amount is calculated using the shipping option's configured calculator

  • Calculator receives current basket contents, shipping address, and currency

  • Available calculator types:

    • FreeShippingCalculator: Zero cost

    • FixedPriceCalculator: Fixed amount from shipping option configuration

    • WeightBasedCalculator: Cost based on basket weight tiers

    • PriceBasedCalculator: Cost based on basket amount tiers

    • QuantityBasedCalculator: Cost based on item quantity

    • RemoteCalculator: Cost from external service

    • DataSourceCalculator: Cost per vendor/supplier

  • Calculated amount is stored in pre-order and added to order total

Next Pages:

  • If sample product discounts are available: SampleProductPage

  • If retail store reservation is needed: ReservationSelectionPage

  • Otherwise: PaymentOptionSelectionPage

Cascading Invalidation:

  • Changing shipping option resets any previously selected payment option

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
shipping_optionintegerRequired

Primary key of the selected shipping option

Other propertiesstringOptional

Additional required fields defined in the shipping option's kwargs.required_fields. These fields vary based on the shipping option configuration and may include fields like delivery_date, time_slot, etc.

Responses
chevron-right
200

Shipping option selected successfully

application/json
post
/orders/checkout/?page=ShippingOptionSelectionPage
200

Shipping option selected successfully

Get Data Source Shipping Option Selection Page context

get

Returns available shipping options grouped by data source (supplier/vendor). Used when products in the basket come from different data sources and each data source requires separate shipping option selection.

This page is used when CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE dynamic setting is set to DataSourceShippingOptionSelectionPage.

Preconditions:

  • Shipping address must be selected (check_address_selected)

  • Basket must not be empty

Data Source Grouping:

  • Products are grouped by their data source (supplier/vendor)

  • Each data source has its own set of available shipping options

  • User must select a shipping option for each data source

Configuration:

  • CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE: Must be set to DataSourceShippingOptionSelectionPage to enable this page.

Error Handling:

  • Raises NoDataSourceShippingOptionAvailable exception if no shipping options are available for the basket and shipping address combination

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
chevron-right
200

Data source shipping option selection page context retrieved

application/json
get
/orders/checkout/?page=DataSourceShippingOptionSelectionPage
200

Data source shipping option selection page context retrieved

Select Shipping Options per Data Source

post

Sets the shipping options for each data source in the basket. Each data source in the basket must have exactly one shipping option selected.

Input Format:

  • data_source_shipping_options: JSON-encoded array of DataSourceShippingOption primary keys

  • Each ID in the array corresponds to a shipping option selected for a specific data source

  • The array must contain exactly one shipping option ID per data source in the basket

Example: If a basket contains products from 2 data sources (Vendor A and Vendor B), and the available shipping options are:

  • Data Source "Vendor A": Standard Shipping (ID: 10), Express Shipping (ID: 11)

  • Data Source "Vendor B": Standard Shipping (ID: 20), Economy Shipping (ID: 21)

To select Standard Shipping for Vendor A and Economy Shipping for Vendor B:

data_source_shipping_options: "[10, 21]"

Validation:

  • All data sources in the basket must have a shipping option selected

  • Selected options must be available for the current basket and shipping address

  • Shipping amounts are recalculated to ensure consistency

Shipping Amount:

  • Total shipping amount is the sum of all selected data source shipping option amounts

Next Pages:

  • If sample product discounts are available: SampleProductPage

  • If retail store reservation is needed: ReservationSelectionPage

  • Otherwise: PaymentOptionSelectionPage

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
data_source_shipping_optionsstringRequired

JSON-encoded array of data source shipping option IDs. Each ID is the primary key of a DataSourceShippingOption model. One shipping option must be selected for each data source in the basket.

Example: [10, 20, 30]
Responses
chevron-right
200

Data source shipping options selected successfully

application/json
post
/orders/checkout/?page=DataSourceShippingOptionSelectionPage
200

Data source shipping options selected successfully

Get Attribute-Based Shipping Option Selection Page context

get

Returns available shipping options grouped by product attribute values. Products are grouped based on configured attribute keys, and each group can have different shipping options available.

This page is used when CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE dynamic setting is set to AttributeBasedShippingOptionSelectionPage.

Preconditions:

  • Shipping address must be selected (check_address_selected)

  • Basket must not be empty

Attribute-Based Grouping: Products are grouped by their attribute VALUES (not keys). The grouping mechanism works as follows:

  1. Rule Evaluation: The system evaluates rules from ATTRIBUTE_KEYS_FOR_ATTRIBUTE_BASED_SHIPPING_OPTION setting in sort_order priority (lower values first). Each rule is evaluated against the shipping address using location-based conditions (country, city, township, district).

  2. First Match Wins: The first rule that matches the shipping address determines which group_attribute_key is used for grouping. Remaining rules are ignored.

  3. Grouping by Attribute Value: Products are then grouped by the value of the selected attribute key. For example, if group_attribute_key is "warehouse_location":

    • Product A with warehouse_location: "istanbul" → Group: "istanbul"

    • Product B with warehouse_location: "istanbul" → Group: "istanbul" (same group)

    • Product C with warehouse_location: "ankara" → Group: "ankara"

  4. Missing Attributes: Products without the specified attribute are grouped under "None". A default shipping option (with is_default=True) typically handles these products.

  5. Multiple Attribute Keys: If group_attribute_key is a list (e.g., ["brand", "category"]), products are grouped by composite keys with semicolon separator:

    • Product with brand: "Nike", category: "shoes" → Group: "Nike;shoes"

    • Product with only brand: "Nike" → Group: "Nike;None"

Available Rules for Rule Configuration:

Rule Slug
Description
Parameters

any-rule

Always matches (fallback rule)

none

country-rule

Matches addresses in specified countries

countries: list of country IDs, exclude: boolean

city-rule

Matches addresses in specified cities

cities: list of city IDs, exclude: boolean

township-rule

Matches addresses in specified townships

townships: list of township IDs, exclude: boolean

district-rule

Matches addresses in specified districts

districts: list of district IDs, exclude: boolean

postal-code-rule

Matches addresses with specified postal codes

postal_codes: list of postal code strings, exclude: boolean

not-rule

Negates a child rule

child: child rule object

and-rule

All children must match

children: list of child rule objects

or-rule

Any child must match

children: list of child rule objects

Configuration Example:

In this example:

  • For addresses in countries 1 or 2: Products are grouped by warehouse_location

  • For addresses in city 5 (if not in countries 1, 2): Products are grouped by brand;category

  • For all other addresses: Products are grouped by supplier

Segment Support:

  • Available shipping options can vary based on user segment

  • Segment-specific pricing and availability rules are applied

Configuration:

  • CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE: Must be set to AttributeBasedShippingOptionSelectionPage

  • ATTRIBUTE_KEYS_FOR_ATTRIBUTE_BASED_SHIPPING_OPTION: List of attribute key configurations that define how products are grouped

Error Handling:

  • Raises NoAttributeBasedShippingOptionAvailable exception if no shipping options are available for the basket and shipping address combination

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
chevron-right
200

Attribute-based shipping option selection page context retrieved

application/json
get
/orders/checkout/?page=AttributeBasedShippingOptionSelectionPage
200

Attribute-based shipping option selection page context retrieved

Select Shipping Options per Attribute Value Group

post

Sets the shipping options for each attribute value group in the basket. Each attribute value group must have exactly one shipping option selected.

Input Format:

  • attribute_based_shipping_options: JSON-encoded object mapping attribute values to shipping option IDs

  • Keys are attribute values (the group keys from the GET response, e.g., "electronics", "clothing", "Nike;shoes")

  • Values are AttributeBasedShippingOption primary keys (integers)

Example: If the GET response returns the following attribute-based shipping options:

{
  "electronics": {
    "attribute_based_shipping_options": [
      {"pk": 100, "shipping_option_name": "Standard Delivery", "shipping_amount": "5.99"},
      {"pk": 101, "shipping_option_name": "Express Delivery", "shipping_amount": "15.99"}
    ],
    "product_ids": [1001, 1002, 1003],
    "attribute_key": ["category"]
  },
  "clothing": {
    "attribute_based_shipping_options": [
      {"pk": 200, "shipping_option_name": "Economy Delivery", "shipping_amount": "3.99"},
      {"pk": 201, "shipping_option_name": "Standard Delivery", "shipping_amount": "8.99"}
    ],
    "product_ids": [2001, 2002],
    "attribute_key": ["category"]
  }
}

To select Standard Delivery (ID: 100) for electronics and Economy Delivery (ID: 200) for clothing:

Composite Group Keys: If products are grouped by multiple attributes (e.g., ["brand", "category"]), the group keys will be composite values separated by semicolons:

Validation:

  • All attribute value groups must have a shipping option selected

  • Selected options must be available for the current basket, shipping address, and segment

  • Product IDs must match the expected grouping

  • Shipping amounts are recalculated to ensure consistency

Shipping Amount:

  • Total shipping amount is the sum of all selected attribute-based shipping option amounts

Address Validation:

  • Validates that the shipping address hasn't changed since options were loaded

  • If address changed, options are recalculated

Next Pages:

  • If sample product discounts are available: SampleProductPage

  • If retail store reservation is needed: ReservationSelectionPage

  • Otherwise: PaymentOptionSelectionPage

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
attribute_based_shipping_optionsstringRequired

JSON-encoded object mapping attribute values to shipping option IDs. Keys are attribute values (e.g., "electronics", "clothing", "warehouse_a"). Values are primary keys of AttributeBasedShippingOption models. One shipping option must be selected for each attribute value group.

Example: {"electronics": 100, "clothing": 200}
Responses
chevron-right
200

Attribute-based shipping options selected successfully

application/json
post
/orders/checkout/?page=AttributeBasedShippingOptionSelectionPage
200

Attribute-based shipping options selected successfully

Get Payment Option Selection Page context

get

Returns available payment options for the order. Payment options are filtered based on configured rules and user context.

Preconditions:

  • Shipping option must be selected (check_shipping_option_selected)

  • Basket must not be empty

Payment Option Availability:

  • Each payment option has associated rules that determine availability

  • Rules can check basket contents, user status, order amount, and more

  • Unavailable options are returned separately with error codes and messages

Checkout URLs:

  • checkout_url: URL for checkout with token (used for external payment flows)

  • status_url: URL to check checkout status (used for polling payment status)

  • Generated by CheckoutWithTokenService

Payment Types: Payment options can have different types that determine the next page flow:

  • credit_card: Routes to BinNumberPage

  • funds_transfer: Routes to FundsTransferChoicePage

  • bkm_express: Routes to BexSelectionPage

  • loyalty_money: Routes to LoyaltyMoneyPage

  • cash_register: Routes to CashRegisterPage

  • gpay: Routes to GPaySelectionPage

  • redirection: Routes to RedirectionPaymentSelectedPage

  • stored_card: Routes to MobilExpressSelectionPage

  • masterpass: Routes to MasterpassBinNumberPage

  • masterpass_rest: Routes to MasterpassRestBinNumberPage

  • credit_payment: Routes to CreditPaymentSelectionPage

  • pay_later: Routes to PayLaterCompletePage

  • saved_card: Routes to SavedCardSelectionPage

  • confirmation: Routes to ConfirmationPaymentAgreementCheckPage

  • b2b: Routes to B2BPage

  • wallet: Routes to WalletSelectionPage

  • pay_on_delivery: Routes to PayOnDeliveryPaymentChoicePage or PayOnDeliveryPage

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
chevron-right
200

Payment option selection page context retrieved

application/json
get
/orders/checkout/?page=PaymentOptionSelectionPage
200

Payment option selection page context retrieved

Select Payment Option

post

Sets the selected payment option for the order.

Validation:

  • The selected payment option must be active

  • The selected payment option must pass its availability rules

Payment Option Processing:

  • If payment option is pay-on-delivery type, installment and card_info are cleared

  • Previous MobilExpress data (keys starting with me_) is cleared

  • Payment choice is reset

Next Pages: Based on the selected payment option type, the user is routed to the appropriate page:

  • credit_card: BinNumberPage (enter card bin number)

  • funds_transfer: FundsTransferChoicePage (select bank account)

  • bkm_express: BexSelectionPage (BKM Express flow)

  • loyalty_money: LoyaltyMoneyPage (use loyalty points)

  • cash_register: CashRegisterPage (cash register payment)

  • gpay: GPaySelectionPage (Google Pay flow)

  • redirection: RedirectionPaymentSelectedPage (redirect to payment provider)

  • stored_card: MobilExpressSelectionPage (use stored card)

  • masterpass: MasterpassBinNumberPage (Masterpass flow)

  • masterpass_rest: MasterpassRestBinNumberPage (Masterpass REST API flow)

  • credit_payment: CreditPaymentSelectionPage (credit/installment payment)

  • pay_later: PayLaterCompletePage (buy now pay later)

  • saved_card: SavedCardSelectionPage (use saved card)

  • confirmation: ConfirmationPaymentAgreementCheckPage (confirmation required)

  • b2b: B2BPage (B2B payment)

  • wallet: WalletSelectionPage (digital wallet)

  • pay_on_delivery: If multiple payment choices available: PayOnDeliveryPaymentChoicePage, otherwise: PayOnDeliveryPage

Cascading Invalidation:

  • Selecting a new payment option clears previous payment-related data

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
payment_optionintegerRequired

Primary key of the selected payment option. Must be an active payment option that passes availability rules.

Responses
chevron-right
200

Payment option selected successfully

application/json
post
/orders/checkout/?page=PaymentOptionSelectionPage
200

Payment option selected successfully

Last updated

Was this helpful?