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

Get Remote Shipping Option Selection Page context

Returns available shipping options fetched from an external remote service. This page is used as an alternative to ShippingOptionSelectionPage when shipping option data must be sourced from a third-party API rather than the local database.

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

Preconditions:

  • Shipping address must be selected (check_address_selected)

  • Basket must not be empty

Remote Shipping Options:

  • Shipping options are fetched via RemoteShippingOptionService using the REMOTE_SHIPPING_OPTION_PROVIDER setting

  • The remote service is called with the current pre-order context (basket, address, etc.)

  • Options returned from the remote service are matched against local ShippingOption records

Configuration:

  • CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE: Must be set to RemoteShippingOptionSelectionPage

  • REMOTE_SHIPPING_OPTION_PROVIDER: The remote shipping option provider configuration

Auto-selection:

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

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

Remote shipping option selection page context retrieved

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

Remote shipping option selection page context retrieved

{
  "context_list": [
    {
      "page_name": "RemoteShippingOptionSelectionPage",
      "page_slug": "remoteshippingoptionselectionpage",
      "page_context": {
        "shipping_options": [
          {
            "pk": 1,
            "name": "Express Courier",
            "slug": "express-courier",
            "logo": "https://cdn.akinon.com/logos/express.png",
            "shipping_amount": "12.99",
            "description": "Next day delivery",
            "kwargs": {}
          },
          {
            "pk": 2,
            "name": "Standard Courier",
            "slug": "standard-courier",
            "logo": "https://cdn.akinon.com/logos/standard.png",
            "shipping_amount": "5.99",
            "description": "3-5 business days",
            "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,
    "shipping_option": null,
    "shipping_amount": null,
    "payment_option": null
  },
  "errors": [],
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?