Select Shipping Options per Data Source
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 ofDataSourceShippingOptionprimary keysEach 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:
SampleProductPageIf retail store reservation is needed:
ReservationSelectionPageOtherwise:
PaymentOptionSelectionPage
Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.
XMLHttpRequestPossible values: Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)
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.
[10, 20, 30]Data source shipping options selected successfully
POST /orders/checkout/?page=DataSourceShippingOptionSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 43
"data_source_shipping_options='[10, 20]'"Data source shipping options selected successfully
{
"context_list": [
{
"page_name": "PaymentOptionSelectionPage",
"page_slug": "paymentoptionselectionpage",
"page_context": {
"checkout_url": "https://sandbox.akinon.com/checkout/token123",
"status_url": "https://sandbox.akinon.com/checkout/status/token123",
"payment_options": [],
"unavailable_options": []
}
}
],
"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": {
"pk": 1,
"name": "Standard Delivery",
"slug": "standard-delivery",
"logo": "https://cdn.akinon.com/logos/standard.png",
"shipping_amount": "13.98",
"description": null,
"kwargs": {}
},
"shipping_amount": "13.98",
"payment_option": null,
"notifications": [],
"total_amount": "163.98",
"unpaid_amount": "163.98",
"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": "163.98",
"is_guest": false,
"is_post_order": false,
"data_source_shipping_options": [
{
"pk": 10,
"shipping_amount": "5.99",
"shipping_option_name": "Standard Delivery",
"shipping_option_logo": "https://cdn.akinon.com/logos/standard.png",
"data_source": {
"pk": 1,
"title": "Supplier A"
},
"description": "3-5 business days"
},
{
"pk": 20,
"shipping_amount": "7.99",
"shipping_option_name": "Standard Delivery",
"shipping_option_logo": "https://cdn.akinon.com/logos/standard.png",
"data_source": {
"pk": 2,
"title": "Supplier B"
},
"description": "3-5 business days"
}
],
"attribute_based_shipping_options": null
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

