Update a data source shipping option
Updates a data source shipping option. The bound shipping option, the bound data source, the active status, the calculator and the rule must all be supplied.
Only the fields present in the request body are written. sort_order and description are optional, and leaving one out keeps its current value. To change one of them, include it in the body. Use the partial update method when you want to send only the fields you are changing.
The pairing of shipping_option and data_source must remain unique. Re-pointing the record at a pairing that another record already occupies returns 400 with a uniqueness error; keeping the pairing the record already holds is always accepted.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
The unique identifier of the data source shipping option.
Fields for updating a data source shipping option.
Only the fields present in the body are written; sort_order and description keep their current values when omitted.
Identifier of the shipping option to bind. Must reference an existing shipping option.
Identifier of the data source to bind. Must reference an existing data source.
Whether this binding is active. Only active bindings are evaluated at checkout. Required on update.
Calculator configuration for this binding. The object must contain a slug key identifying the calculator. See the Shipping Rules & Calculators guide for available calculators and their parameters.
{"slug":"fixed-price-calculator","fixed_price":"19.99"}Rule configuration for this binding. The object must contain a slug key identifying the rule. See the Shipping Rules & Calculators guide for available rules and their parameters.
Order in which this binding is evaluated at checkout. Lower values are evaluated first. Omit to keep the current value.
Optional description of this binding. Omit to keep the current value.
The updated data source shipping option.
A data source shipping option returned by the API — one shipping option bound to one data source, with its own calculator and rule.
Unique identifier of the data source shipping option.
Whether this binding is active. Only active bindings are evaluated at checkout.
trueCalculator configuration for this binding. Determines how the shipping cost is computed for this seller.
The object contains at minimum a slug key identifying the calculator. See the Shipping Rules & Calculators guide for available calculators and their parameters.
{"slug":"amount-based-calculator","upper_limit":"150.00","fixed_price":"14.99","discount_price":"0.00"}Rule configuration for this binding. Determines which baskets are eligible for this seller's delivery method.
The object contains a slug key identifying the rule. See the Shipping Rules & Calculators guide for available rules and their parameters.
{"slug":"any-rule","name":"Any Rule"}Order in which this binding is evaluated at checkout. Lower values are evaluated first.
0Optional description of this binding.
The request contains invalid or missing data.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
The requested data source shipping option does not exist.
PUT /api/v1/remote/1/data_source_shipping_options/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 166
{
"shipping_option": 4,
"data_source": 2,
"is_active": false,
"calculator": {
"slug": "fixed-price-calculator",
"fixed_price": "19.99"
},
"rule": {
"slug": "any-rule"
},
"sort_order": 2
}{
"pk": 12,
"is_active": true,
"calculator": {
"slug": "fixed-price-calculator",
"fixed_price": "14.99"
},
"rule": {
"slug": "any-rule",
"name": "Any Rule"
},
"sort_order": 0,
"shipping_option": {
"pk": 4,
"name": "Standard Shipping",
"slug": "standard-shipping",
"is_active": true,
"sort_order": 0,
"description": null,
"kwargs": {
"required_fields": []
},
"delivery_type": {
"value": "standard",
"label": "Standard Delivery"
}
},
"data_source": {
"pk": 2,
"name": "Main Warehouse",
"title": "Main Warehouse",
"slug": "main-warehouse",
"is_active": true
},
"description": "Flat rate for the main warehouse"
}Last updated
Was this helpful?

