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

Select Remote Shipping Option

Sets the selected shipping option from the remote shipping option list.

Validation:

  • The selected shipping option must be in the list returned by the remote service

  • The remote service is queried again at submission time to ensure the option is still valid

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

post
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. Must be one of the options returned by the remote shipping service for the current checkout context.

Example: 1
Responses
200

Remote shipping option selected successfully

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=RemoteShippingOptionSelectionPage
POST /orders/checkout/?page=RemoteShippingOptionSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 21

"shipping_option=1"
200

Remote shipping option selected successfully

{
  "context_list": [
    {
      "page_name": "PaymentOptionSelectionPage",
      "page_slug": "paymentoptionselectionpage",
      "page_context": {
        "payment_options": [
          {
            "pk": 1,
            "name": "Credit Card",
            "slug": "credit-card",
            "payment_type": "credit_card",
            "payment_type_label": "Credit Card"
          }
        ],
        "unavailable_options": []
      }
    }
  ],
  "pre_order": {
    "basket": {
      "pk": 123,
      "total_amount": "150.00"
    },
    "shipping_option": {
      "pk": 1,
      "name": "Express Courier",
      "slug": "express-courier",
      "shipping_amount": "12.99"
    },
    "shipping_amount": "12.99",
    "payment_option": null
  },
  "errors": {},
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?