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

Get Shipping Option Selection Page context

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.

get
Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Shipping option selection page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=ShippingOptionSelectionPage
GET /orders/checkout/?page=ShippingOptionSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Accept: */*
200

Shipping option selection page context retrieved

{
  "context_list": [
    {
      "page_name": "ShippingOptionSelectionPage",
      "page_slug": "shippingoptionselectionpage",
      "page_context": {
        "shipping_options": [
          {
            "pk": 1,
            "name": "Standard Shipping",
            "slug": "standard-shipping",
            "logo": "https://cdn.akinon.com/logos/standard.png",
            "shipping_amount": "9.99",
            "description": "Delivery in 3-5 business days",
            "kwargs": {}
          },
          {
            "pk": 2,
            "name": "Express Shipping",
            "slug": "express-shipping",
            "logo": "https://cdn.akinon.com/logos/express.png",
            "shipping_amount": "19.99",
            "description": "Next day delivery",
            "kwargs": {}
          }
        ]
      }
    }
  ],
  "pre_order": {
    "basket": {
      "pk": 123,
      "total_amount": "150.00"
    },
    "shipping_address": {
      "pk": 10,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@akinon.com",
      "phone_number": "+15551234567",
      "line": "123 Main St",
      "country": {
        "pk": 1,
        "code": "US",
        "name": "United States"
      },
      "city": {
        "pk": 1,
        "name": "New York"
      },
      "township": {
        "pk": 1,
        "name": "Manhattan"
      }
    },
    "billing_address": {
      "pk": 10,
      "first_name": "John",
      "last_name": "Doe"
    },
    "billing_and_shipping_same": true,
    "delivery_option": {
      "pk": 1,
      "name": "Home Delivery",
      "slug": "home-delivery",
      "delivery_option_type": "customer",
      "sort_order": 1
    },
    "shipping_option": null,
    "shipping_amount": null,
    "payment_option": null,
    "notifications": [],
    "total_amount": "150.00",
    "unpaid_amount": "150.00",
    "loyalty_money": null,
    "currency_type_label": "USD",
    "installment": null,
    "redirect_to_three_d": null,
    "retail_store": null,
    "payment_choice": null,
    "user_email": "john@akinon.com",
    "phone_number": "+15551234567",
    "user_phone_number": "+15551234567",
    "gift_box": null,
    "delivery_range": null,
    "total_amount_with_interest": "150.00",
    "is_guest": false,
    "is_post_order": false,
    "data_source_shipping_options": null,
    "attribute_based_shipping_options": null
  },
  "errors": [],
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?