> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/shipping-options/data-source-shipping-options/partially-update-a-data-source-shipping-option.md).

# Partially update a data source shipping option

Updates one or more fields of a data source shipping option. Every field is optional and only the fields included in the request body are changed. This is the method to use for a targeted change such as activating or deactivating a binding, or adjusting its evaluation order.

If the body re-points the record at a `shipping_option` and `data_source` pairing that another record already occupies, the request returns `400` with a uniqueness error.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Data Source Shipping Options","description":"Administrative endpoints for **data source shipping options** — per-seller delivery methods. Each record binds one shipping option to one data source (seller/warehouse) and gives that pairing its own **calculator** (how the shipping cost is computed) and **rule** (which baskets are eligible). This is what lets two sellers offer the same named delivery method at different prices or under different conditions. For the full list of available rule and calculator types with their fields and examples, see the [Shipping Rules & Calculators](https://docs.akinon.com/technical-guides/commerce/shipping-rules-calculator) technical guide.\n\nA shipping option can be bound to a given data source only once: the combination of `shipping_option` and `data_source` must be unique. Creating a second record for a pairing that already exists returns a validation error, so update the existing binding instead.\n\n## Core Capabilities\n\n**1. Listing & Filtering**\n* Retrieve a paginated list of data source shipping options.\n* Filter by identifier, by the shipping option or data source being bound, by active status, sort order, description, and creation or modification timestamp.\n* Order results with the `sort` parameter, which accepts the fields of the record itself: `pk`, `is_active`, `sort_order`, `shipping_option`, `data_source` and `description`.\n\n**2. Full CRUD**\n* Bind a shipping option to a data source with its own calculator and rule.\n* Fully or partially update an existing binding.\n* Deactivate a binding: the `DELETE` method performs a **soft delete** — it sets `is_active` to `false` and keeps the record, so a binding can be taken out of checkout and brought back later without losing its configuration.\n\n## Nested Objects in Responses\n\nRequests reference the shipping option and the data source by their identifiers, but responses expand both into objects:\n\n| Field | On write | On read |\n|-------|----------|---------|\n| `shipping_option` | Identifier of the shipping option to bind. | The shipping option object, returned in the default language of the installation. Its own `calculator` and `rule` are **omitted**, because at checkout the calculator and rule of this binding are used instead. |\n| `data_source` | Identifier of the data source to bind. | A compact reference to the data source: its identifier, name, title, slug and active status. Use the data source endpoints for the seller's full commercial and contact details. |\n\n## Checkout-Time Behaviour\n\nOnly bindings with `is_active` set to `true` are considered at checkout, and they are evaluated in ascending `sort_order`. For each data source represented in the basket, the eligible bindings are filtered by their rule and priced by their calculator. Give every data source at least one active binding whose rule accepts any basket, so that each seller in the basket always has a delivery method to offer.\n\n## Dynamic Settings & Environment Variables\n\nThe following dynamic settings do not change the behaviour of the administrative CRUD endpoints themselves — every setting below is read at checkout time. They determine whether the records managed here are used at all, and how their cost is calculated.\n\n| Key | Type | Default | Effect |\n|-----|------|---------|--------|\n| `CHECKOUT_SHIPPING_OPTION_SELECTION_PAGE` | string (choice) | `\"ShippingOptionSelectionPage\"` | Selects the checkout shipping flow. Set it to `\"DataSourceShippingOptionSelectionPage\"` to have the records managed here drive shipping selection at checkout; the other flows use their own configuration instead. Other values: `\"ShippingOptionSelectionPage\"`, `\"AttributeBasedShippingOptionSelectionPage\"`, `\"RemoteShippingOptionSelectionPage\"`. |\n| `USE_EXTERNAL_COST_CALCULATOR` | boolean | `false` | Applies only to bindings whose `calculator` is the remote cost calculator (`remote-cost-calculator`). When `true`, that calculator requests the shipping cost from the external service configured by `EXTERNAL_COST_CALCULATOR` instead of the platform's own cost service. Bindings using any other calculator are unaffected. |\n| `EXTERNAL_COST_CALCULATOR` | object `{host, token?}` | `{}` | Connection details for the external cost calculator: `host` (required) and `token` (optional). Only consulted when `USE_EXTERNAL_COST_CALCULATOR` is `true`. |\n\nThe remote cost calculator keeps checkout resilient: if the service it is configured against is unreachable, it applies the fallback amount defined in its own configuration so that the customer can still complete the order.\n\nThe settings `USE_BASKET_ITEM_ATTRIBUTES_FOR_ATTRIBUTE_BASED_SHIPPING`, `ATTRIBUTE_KEYS_FOR_ATTRIBUTE_BASED_SHIPPING_OPTION`, `REMOTE_SHIPPING_OPTION_PROVIDER` and `CHECKOUT_RETAIL_STORE_FILTERS` (described in the parent **Shipping Options** section) belong to other checkout selection flows or to store selection, and have no effect on the records managed here.\n\n**Environment variables:** No environment variables are read directly by these endpoints."}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"schemas":{"DataSourceShippingOptionPatchRequest":{"type":"object","description":"Fields for partially updating a data source shipping option. Every field is optional; only the fields sent are changed and all others keep their current values.","properties":{"shipping_option":{"type":"integer","description":"Identifier of the shipping option to bind. Must reference an existing shipping option."},"data_source":{"type":"integer","description":"Identifier of the data source to bind. Must reference an existing data source."},"is_active":{"type":"boolean","description":"Whether this binding is active. Only active bindings are evaluated at checkout."},"calculator":{"type":"object","description":"Calculator configuration for this binding. The object must contain a `slug` key identifying the calculator. See the [Shipping Rules & Calculators guide](https://docs.akinon.com/technical-guides/commerce/shipping-rules-calculator) for available calculators and their parameters."},"rule":{"type":"object","description":"Rule configuration for this binding. The object must contain a `slug` key identifying the rule. See the [Shipping Rules & Calculators guide](https://docs.akinon.com/technical-guides/commerce/shipping-rules-calculator) for available rules and their parameters."},"sort_order":{"type":"integer","description":"Order in which this binding is evaluated at checkout. Lower values are evaluated first."},"description":{"type":["string","null"],"description":"Optional description of this binding."}}},"DataSourceShippingOption":{"type":"object","description":"A data source shipping option returned by the API — one shipping option bound to one data source, with its own calculator and rule.","properties":{"pk":{"type":"integer","readOnly":true,"description":"Unique identifier of the data source shipping option."},"is_active":{"type":"boolean","description":"Whether this binding is active. Only active bindings are evaluated at checkout.","default":true},"calculator":{"type":"object","description":"Calculator configuration for this binding. Determines how the shipping cost is computed for this seller.\n\nThe object contains at minimum a `slug` key identifying the calculator. See the [Shipping Rules & Calculators guide](https://docs.akinon.com/technical-guides/commerce/shipping-rules-calculator) for available calculators and their parameters."},"rule":{"type":"object","description":"Rule configuration for this binding. Determines which baskets are eligible for this seller's delivery method.\n\nThe object contains a `slug` key identifying the rule. See the [Shipping Rules & Calculators guide](https://docs.akinon.com/technical-guides/commerce/shipping-rules-calculator) for available rules and their parameters."},"sort_order":{"type":"integer","description":"Order in which this binding is evaluated at checkout. Lower values are evaluated first.","default":0},"shipping_option":{"$ref":"#/components/schemas/ShippingOptionSummary"},"data_source":{"$ref":"#/components/schemas/DataSourceSummary"},"description":{"type":["string","null"],"description":"Optional description of this binding."}},"required":["pk","is_active","calculator","rule","sort_order","shipping_option","data_source","description"]},"ShippingOptionSummary":{"type":"object","description":"A shipping option as it appears nested inside a data source shipping option.\n\nThis is the shipping option object **without** its own `calculator` and `rule`. The calculator and rule stored on the data source shipping option take precedence at checkout, so those are the ones to read and write, and the shipping option's own pair is left out to keep the response unambiguous.","properties":{"pk":{"type":"integer","description":"Unique identifier of the shipping option."},"name":{"type":"string","description":"Display name, returned in the default language of the installation."},"slug":{"type":"string","description":"URL-friendly unique identifier."},"is_active":{"type":"boolean","description":"Whether the shipping option itself is active."},"sort_order":{"type":"integer","description":"Sort order defined on the shipping option."},"description":{"type":["string","null"],"description":"Optional description of the shipping option, returned in the default language of the installation."},"kwargs":{"$ref":"#/components/schemas/ShippingOptionKwargs"},"delivery_type":{"oneOf":[{"$ref":"#/components/schemas/ShippingOptionDeliveryTypeDetail"},{"type":"null"}],"description":"Delivery type of the shipping option."}},"required":["pk","name","slug","is_active","sort_order","description","kwargs","delivery_type"]},"ShippingOptionKwargs":{"type":"object","description":"Extra configuration for the shipping option.\n\n`required_fields` lists the keys that must be present in the checkout data when an order is created with this shipping option. At order creation time, the values for those keys are copied from the checkout data into `Order.extra_field`.","properties":{"required_fields":{"type":"array","description":"List of field keys that must be present in the checkout data.","items":{"type":"string"}}}},"ShippingOptionDeliveryTypeDetail":{"type":"object","description":"Read representation of a delivery type — includes the raw enum value and its human-readable label.","properties":{"value":{"type":"string","description":"Enum value."},"label":{"type":"string","description":"Human-readable label for the delivery type."}}},"DataSourceSummary":{"type":"object","description":"A data source (seller or warehouse) as it appears nested inside a data source shipping option.\n\nThis is a compact reference that carries just enough to identify and label the seller. Use the data source endpoints when you need the seller's full record, such as its supplier code, address, contact details or price and stock list bindings.","properties":{"pk":{"type":"integer","description":"Unique identifier of the data source."},"name":{"type":["string","null"],"description":"Name of the data source."},"title":{"type":["string","null"],"description":"Display title of the data source."},"slug":{"type":["string","null"],"description":"URL-friendly identifier of the data source."},"is_active":{"type":"boolean","description":"Whether the data source itself is active."}},"required":["pk","name","title","slug","is_active"]},"ValidationError":{"type":"object","description":"Returned when the request contains invalid or missing data. Errors are grouped by the field they apply to: each key is the name of a field from the request and its value is a list of one or more messages describing what is wrong with that field. Messages that do not belong to any single field are grouped under `non_field_errors`.","properties":{"non_field_errors":{"type":"array","description":"Error messages that apply to the request as a whole rather than to a specific field.","items":{"type":"string"}}},"additionalProperties":{"type":"array","description":"The list of error messages for the field named by the key.","items":{"type":"string"}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"ValidationError":{"description":"The request contains invalid or missing data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"DataSourceShippingOptionNotFound":{"description":"The requested data source shipping option does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/data_source_shipping_options/{id}/":{"patch":{"tags":["Data Source Shipping Options"],"operationId":"partialUpdateDataSourceShippingOption","summary":"Partially update a data source shipping option","description":"Updates one or more fields of a data source shipping option. Every field is optional and only the fields included in the request body are changed. This is the method to use for a targeted change such as activating or deactivating a binding, or adjusting its evaluation order.\n\nIf the body re-points the record at a `shipping_option` and `data_source` pairing that another record already occupies, the request returns `400` with a uniqueness error.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceShippingOptionPatchRequest"}}}},"responses":{"200":{"description":"The updated data source shipping option.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceShippingOption"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/DataSourceShippingOptionNotFound"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/shipping-options/data-source-shipping-options/partially-update-a-data-source-shipping-option.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
