Select Shipping Options per Attribute Value Group
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 IDsKeys are attribute values (the group keys from the GET response, e.g.,
"electronics","clothing","Nike;shoes")Values are
AttributeBasedShippingOptionprimary 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:
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 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.
{"electronics": 100, "clothing": 200}Attribute-based shipping options selected successfully
POST /orders/checkout/?page=AttributeBasedShippingOptionSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 80
"attribute_based_shipping_options='{\'electronics\': 100, \'clothing\': 200}'"Attribute-based 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": "9.98",
"description": null,
"kwargs": {}
},
"shipping_amount": "9.98",
"payment_option": null,
"notifications": [],
"total_amount": "159.98",
"unpaid_amount": "159.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": "159.98",
"is_guest": false,
"is_post_order": false,
"data_source_shipping_options": null,
"attribute_based_shipping_options": [
{
"pk": 100,
"shipping_option_name": "Standard Delivery",
"shipping_option_logo": "https://cdn.akinon.com/logos/standard.png",
"shipping_amount": "5.99",
"product_ids": [
1001,
1002,
1003
],
"attribute_value": "electronics",
"attribute_key": [
"category"
]
},
{
"pk": 200,
"shipping_option_name": "Economy Delivery",
"shipping_option_logo": "https://cdn.akinon.com/logos/economy.png",
"shipping_amount": "3.99",
"product_ids": [
2001,
2002
],
"attribute_value": "clothing",
"attribute_key": [
"category"
]
}
]
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

