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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
or
or
or
or
or
or
Responses
chevron-right
200

Step processed successfully

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
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
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
post
/orders/checkout/?page=PaymentOptionSelectionPage
200

Payment option selected successfully

Get BIN Number Page context

get

Returns the context for entering the card BIN (Bank Identification Number). This page captures the first 6-8 digits of the credit card to determine card type, bank, and available installment options.

Preconditions:

  • Payment option must be selected and must be credit card type (is_credit_card())

  • Basket must not be empty

BIN Number Validation:

  • BIN number must be 6 or 8 digits

  • System looks up the BIN in the BinNumber database to determine card type

  • If BIN not found, falls back to default card configuration

Card Information Extraction:

  • Card type (Visa, Mastercard, Amex, etc.)

  • Issuing bank

  • Available installment options

  • Card category (credit, debit, prepaid)

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

BIN Number page context retrieved

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
get
/orders/checkout/?page=BinNumberPage
200

BIN Number page context retrieved

Submit Card BIN Number

post

Submits the card BIN number to determine card type and available installments.

BIN Number Processing:

  1. Validates that BIN is 6 or 8 digits

  2. Looks up BIN in database to find matching card

  3. If found: Uses card configuration (bank, type, installments)

  4. If not found: Uses default card configuration

Card Info Object:

  • bin_number: The submitted BIN (first 6-8 digits)

  • card: Card model with bank, type, and installment relationships

Next Pages:

  • InstallmentSelectionPage

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
bin_numberstringRequired

First 6 or 8 digits of the credit card (BIN - Bank Identification Number). Used to determine card type, bank, and available installment options. Must contain only digits.

Example: 542119Pattern: ^\d{6,8}$
Responses
chevron-right
200

BIN number submitted successfully

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
post
/orders/checkout/?page=BinNumberPage
200

BIN number submitted successfully

Get Installment Selection Page context

get

Returns available installment options for the card. Displays installment options with interest rates and monthly payments.

Preconditions:

  • Card info must be entered (check_card_info_entered)

  • Basket must not be empty

Installment Calculation:

  • Installment options are retrieved from the card's installment configuration

  • Each installment includes:

    • Installment count (1, 3, 6, 9, 12, etc.)

    • Interest rate percentage

    • Total amount with interest

    • Monthly payment amount

  • Installment count of 1 means no installment (single payment)

Installment Filtering:

  • Installments are filtered through INSTALLMENT_FILTERS dynamic setting

  • Filters can restrict options based on:

    • Basket amount thresholds

    • User segmentation

    • Campaign eligibility

    • Currency requirements

  • Filter messages are returned to inform users of restrictions

Installment Messages:

  • Gateway-specific promotional messages

  • Installment availability notices

  • Special campaign information from payment gateway

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

Installment selection page context retrieved

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
get
/orders/checkout/?page=InstallmentSelectionPage
200

Installment selection page context retrieved

Select Installment Option

post

Sets the selected installment option for the credit card payment.

Validation:

  • Selected installment must belong to the card's available installments

  • Installment must be active

Interest Calculation:

  • Total amount is recalculated with selected installment's interest rate

  • Monthly payment amount is calculated (total / installment_count)

  • Interest-free installments may be available based on campaigns

Selected Campaign/Rewards Reset:

  • Selecting an installment clears previously selected campaigns

  • Clears previously selected rewards

  • Campaigns and rewards are re-evaluated based on new total with interest

Next Pages:

  • CreditCardConfirmationPage

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
installmentintegerRequired

Primary key of the selected installment option. Must be one of the installments available for the card. Installment count of 1 represents single payment (no installment).

Responses
chevron-right
200

Installment selected successfully

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
post
/orders/checkout/?page=InstallmentSelectionPage
200

Installment selected successfully

Get Credit Card Confirmation Page context

get

Returns the context for entering full credit card details and completing payment. This is the final step before payment processing or 3D Secure verification.

Preconditions:

  • Installment must be selected (check_installment_selected)

  • Basket must not be empty

Credit Card Fields Required:

  • Card number (full 16-digit number)

  • Card holder name

  • Expiration month and year

  • CVV/CVC security code

  • Card nickname (optional, for saving card)

Campaign and Rewards Integration:

  • Gateway may support bank-specific campaigns

  • Gateway may support loyalty rewards (points/miles)

  • Context indicates if these features are available

3D Secure Support:

  • Page checks if 3D Secure is required for the transaction

  • Browser information is collected for 3D Secure verification

  • If 3D Secure required, routes to CreditCardThreeDSecurePage

Save Card Feature:

  • Authenticated users can save card for future purchases

  • Guest users cannot save cards

  • Card details are tokenized and stored securely

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

Credit card confirmation page context retrieved

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
get
/orders/checkout/?page=CreditCardConfirmationPage
200

Credit card confirmation page context retrieved

Submit Credit Card Details and Process Payment

post

Submits full credit card details and processes the payment. May route to 3D Secure verification or complete order directly.

Required Fields:

  • card_number: Full 16-digit card number

  • card_holder: Cardholder name as printed on card

  • card_month: Expiration month (MM format, e.g., "01", "12")

  • card_year: Expiration year (YYYY format, e.g., "2026")

  • card_cvv: CVV/CVC security code (3-4 digits)

  • agreement: User must accept terms and conditions (boolean, must be true)

Optional Fields:

  • card_name: Nickname for saved card (required if save is true)

  • save: Whether to save card for future use (boolean, default false)

  • use_three_d: User preference for 3D Secure (may be overridden by rules)

  • client_time: Client-side timestamp for fraud detection

  • Browser information fields for 3D Secure:

    • browser_java_enabled: Boolean

    • browser_language: Language code (e.g., "en-US")

    • browser_color_depth: Screen color depth (e.g., "24")

    • browser_screen_height: Screen height in pixels

    • browser_screen_width: Screen width in pixels

    • browser_time_zone: Timezone offset in minutes

    • browser_header: Accept header (auto-captured)

    • browser_user_agent: User agent string (auto-captured)

Card Validation:

  • Card number validated using Luhn algorithm

  • Expiration date must be in the future

  • CVV must be 3-4 digits

  • Cardholder name validated against format rules

3D Secure Decision: System determines if 3D Secure is required based on:

  • Payment gateway configuration

  • Card type and BIN rules

  • Transaction amount thresholds

  • User risk profile

  • Bank requirements

Save Card Processing:

  • If save is true and user is authenticated: Card is tokenized and saved

  • Card details are encrypted and stored securely

  • Only token and last 4 digits are retained

  • Saved cards can be used in future checkouts

Identity Number Validation:

  • If IDENTITY_NUMBER_REQUIRED_AMOUNT setting is configured:

    • Validates shipping address has identity_number field

    • Required when order total exceeds configured threshold

3D Secure Decision Logic:

  • Master switch: THREE_D_SECURE_ENABLED must be true

  • If enabled, evaluates THREE_D_SECURE_RULES conditions:

    • Amount limits

    • Guest user checks

    • First order checks

    • POS terminal restrictions

    • Failed attempt limits per user/IP

    • Currency restrictions

  • If ANY rule returns true, 3D Secure is required

Next Pages:

  • If 3D Secure required: CreditCardThreeDSecurePage

  • If 3D Secure not required: ThankYouPage (order completed)

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 (16 digits). Validated using Luhn algorithm. Spaces are automatically removed.

Example: 5421190000000004Pattern: ^\d{16}$
card_holderstringRequired

Cardholder name as printed on the card. Must contain only letters and spaces. Validated against format rules.

Example: JOHN DOE
card_monthstringRequired

Card expiration month in MM format. Must be between 01 and 12.

Example: 12Pattern: ^(0[1-9]|1[0-2])$
card_yearstringRequired

Card expiration year in YYYY format. Must be current year or future.

Example: 2026Pattern: ^\d{4}$
card_cvvstringRequired

Card security code (CVV/CVC). Must be 3-4 digits depending on card type.

Example: 123Pattern: ^\d{3,4}$
card_namestringOptional

Nickname for the card if saving for future use. Required when save is true. Optional otherwise.

Example: My Visa Card
agreementboolean · enumRequired

User must accept terms and conditions to proceed. Must be true.

Possible values:
savebooleanOptional

Whether to save the card for future purchases. Only available for authenticated users. Guest users cannot save cards.

Default: false
use_three_dbooleanOptional

User preference for 3D Secure verification. May be overridden by system rules. Optional field.

client_timestring · date-timeOptional

Client-side timestamp for fraud detection

browser_java_enabledbooleanOptional

Whether Java is enabled in the browser

browser_languagestringOptional

Browser language code (e.g., "en-US", "tr-TR")

Example: en-US
browser_color_depthstringOptional

Screen color depth in bits (e.g., "24", "32")

Example: 24
browser_screen_heightstringOptional

Screen height in pixels

Example: 1080
browser_screen_widthstringOptional

Screen width in pixels

Example: 1920
browser_time_zonestringOptional

Timezone offset from UTC in minutes. Example: UTC-4 would be "240" (4 hours * 60 minutes)

Example: 240
Responses
chevron-right
200

Credit card details submitted successfully

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
post
/orders/checkout/?page=CreditCardConfirmationPage
200

Credit card details submitted successfully

Get Credit Card 3D Secure Page context

get

Returns the context for 3D Secure verification redirect. This page handles the redirect to the bank's 3D Secure authentication page and processes the return response.

3D Secure Flow:

  1. User is redirected to bank's 3D Secure page

  2. User completes authentication (SMS OTP, biometric, etc.)

  3. Bank redirects back with verification result

  4. System validates the response and completes payment

Redirect URL:

  • redirect_url: Internal endpoint that handles 3D Secure initiation

  • This endpoint generates the bank redirect form with necessary parameters

Cached Card Data:

  • Card details are temporarily cached during 3D Secure flow

  • Cache key is based on pre-order hash

  • Cached data is encrypted using Django's signing framework

Security Considerations:

  • Sensitive card data (number, CVV) marked with @sensitive_variables

  • Card data cleared from cache after successful verification

  • Failed verifications also clear cached 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>)

Responses
chevron-right
200

3D Secure page context retrieved

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
get
/orders/checkout/?page=CreditCardThreeDSecurePage
200

3D Secure page context retrieved

Process 3D Secure Return Response

post

Processes the return response from 3D Secure verification and completes payment. This endpoint is called when the bank redirects back after authentication.

Return Parameters: Gateway-specific parameters are passed back from the 3D Secure provider. Common parameters include:

  • three_d_secure: Verification status (boolean)

  • success: Transaction success status (boolean)

  • md: Merchant data passed through 3D Secure flow

  • xid: Transaction identifier from 3D Secure

  • eci: Electronic Commerce Indicator

  • cavv: Cardholder Authentication Verification Value

  • mdStatus: MD status code from provider

  • Additional gateway-specific parameters

MD Status Validation:

  • Gateway validates the mdStatus and other response parameters

  • Each gateway has specific validation logic via is_md_status_valid()

  • Failed validation returns user to payment page with error

Transaction Creation:

  • Successful 3D Secure verification creates order and transaction

  • Transaction ID format: 3D_RETURN_{order_number}_{suffix}

  • Sensitive parameters are filtered from transaction log

Cached Card Retrieval:

  • Card details are retrieved from cache using pre-order hash

  • If cache expired, payment fails and user must restart

  • Successful payment clears cached card data

Save Card After 3D Secure:

  • If user chose to save card, it's tokenized after successful payment

  • Save operation happens asynchronously via Celery task

Next Pages:

  • Success: ThankYouPage (order completed)

  • Failure: Redirects back to CreditCardConfirmationPage with error

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

3D Secure verification status. Must be true for successful verification.

Possible values:
successboolean · enumRequired

Transaction success status. Must be true for successful transaction.

Possible values:
mdstringOptional

Merchant data passed through 3D Secure flow

xidstringOptional

Transaction identifier from 3D Secure provider

ecistringOptional

Electronic Commerce Indicator from 3D Secure

cavvstringOptional

Cardholder Authentication Verification Value

liqpay_tokenstringOptional

LiqPay-specific token (gateway-specific)

statusstringOptional

Status from payment gateway

paymentIdstringOptional

Payment identifier from gateway

conversationDatastringOptional

Conversation data from gateway

conversationIdstringOptional

Conversation identifier from gateway

mdStatusstringOptional

MD status code from 3D Secure provider. Different values indicate authentication success/failure. Gateway-specific validation logic.

bodyobjectOptional

Additional gateway-specific response data

Responses
chevron-right
200

3D Secure verification processed

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
post
/orders/checkout/?page=CreditCardThreeDSecurePage
200

3D Secure verification processed

Get Funds Transfer Choice Page context

get

Returns available bank accounts for funds transfer (wire transfer/EFT) payment. User selects which bank account to transfer money to.

Preconditions:

  • Payment option must be selected and must be funds transfer type (is_funds_transfer())

  • Basket must not be empty

Bank Account Selection:

  • Lists all active bank accounts configured in the system

  • Each bank account includes: bank name, account holder, IBAN, currency

  • User selects one bank account for payment instructions

Auto-selection:

  • If only one bank account is available and no POS slug configured:

    • Bank account is automatically selected

    • Page is skipped

    • Routes directly to FundsTransferPage

Reference Code Generation:

  • Some payment gateways support reference codes for tracking

  • If gateway has has_reference_code capability:

    • Reference code is generated when bank account is selected

    • Reference code is stored in pre_order.data['funds_transfer']

    • Used to match customer payment with order

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

Funds transfer choice page context retrieved

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
get
/orders/checkout/?page=FundsTransferChoicePage
200

Funds transfer choice page context retrieved

Select Bank Account for Funds Transfer

post

Sets the selected bank account for funds transfer payment.

Validation:

  • Selected bank account must be active

  • Basket amount must be greater than or equal to zero

Reference Code Generation:

  • If payment gateway supports reference codes (has_reference_code):

    • Generates unique reference code for the order

    • Uses order number, amount, currency as input

    • Includes user email, addresses, and site domain

    • Stores reference code in pre_order.data['funds_transfer']['reference_code']

  • Reference code is displayed to user on next page for payment matching

Order Number Assignment:

  • Pre-order number is assigned at this step (if not already assigned)

  • Order number used in reference code generation

Bank Account Change Handling:

  • If user changes bank account selection:

    • Reference code is regenerated

    • Previous reference code is invalidated

Next Pages:

  • FundsTransferPage (display payment instructions)

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
bank_accountintegerRequired

Primary key of the selected bank account. Must be an active bank account configured in the system.

Responses
chevron-right
200

Bank account selected successfully

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
post
/orders/checkout/?page=FundsTransferChoicePage
200

Bank account selected successfully

Get Funds Transfer Page context

get

Returns payment instructions for funds transfer. Displays bank account details and reference code for customer to complete payment.

Preconditions:

  • Payment option must be funds transfer type

  • Bank account must be selected (funds_transfer_bank)

  • Basket must not be empty

Payment Instructions:

  • Bank account details (IBAN, account holder, bank name)

  • Order number for reference

  • Reference code (if gateway supports it)

  • Total amount to transfer

  • Currency information

Reference Code Context:

  • Retrieved from pre_order.data['funds_transfer']

  • Displayed prominently for customer to include in transfer

  • Used by payment reconciliation system to match transfers

Order Status:

  • Order is created in "pending" status

  • Waiting for payment confirmation

  • Payment team manually confirms transfer receipt

  • Order status updated to "confirmed" after 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
chevron-right
200

Funds transfer page context retrieved

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
get
/orders/checkout/?page=FundsTransferPage
200

Funds transfer page context retrieved

Complete Funds Transfer Order

post

Completes the order creation for funds transfer payment. Order is created in pending status, awaiting payment confirmation.

Required Fields:

  • agreement: User must accept terms and conditions (boolean, must be true)

Validation:

  • Basket amount must be greater than or equal to zero

  • Bank account must be selected

  • Payment option must be funds transfer type

Order Creation:

  • Order is created with status "pending_payment" or "awaiting_funds_transfer"

  • Order details include:

    • Selected bank account information

    • Reference code (if applicable)

    • Payment instructions

  • User receives confirmation email with payment details

  • Stock is reserved (depending on configuration)

Order Number:

  • Order number is NOT regenerated at this step

  • Uses existing pre-order number assigned in previous step

Payment Confirmation Flow:

  1. User completes bank transfer using provided details

  2. Payment team receives transfer notification

  3. Payment team matches transfer using reference code/order number

  4. Order status updated to "confirmed"

  5. Fulfillment process begins

Next Pages:

  • ThankYouPage (order completed, awaiting payment)

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 terms and conditions to proceed. Must be true.

Possible values:
Responses
chevron-right
200

Funds transfer order completed successfully

application/json
errorsone ofOptional
or
nullOptional
or
string[]Optional
template_namestringOptional
post
/orders/checkout/?page=FundsTransferPage
200

Funds transfer order completed successfully

Last updated

Was this helpful?