---
title: "Change one supplier's terms, warehouses and lanes"
method: PUT
path: "/api/v1/inventory/suppliers/{supplier_id}"
tags: ["suppliers"]
---

# Change one supplier's terms, warehouses and lanes

`PUT /api/v1/inventory/suppliers/{supplier_id}`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/inventory/suppliers/{supplier_id}`
- Auth: HTTP bearer

Changes one supplier and answers it whole, as get_supplier_details serves it. Send only the fields that move: omitted or null is left alone, with the exceptions below.

`location_lead_times` is a list of `{location_id, lead_time}`; each entry replaces that warehouse's setting whole, null means no override, and warehouses not listed are untouched. `lanes` states a whole warehouse instead, lead time, box, freight quote and road limit in one object, each omitted field meaning none on file. A warehouse in both lists is refused 400 naming it.

`container_type_id` is the exception to "null is omitted": null clears it to "use the organisation default", not to "no container", so send the key to clear it and omit it to leave it.

`contacts` is ignored. `primary_contact` is not: `{"id": <contact id>}` makes an existing contact this supplier's main one, clearing the flag from whichever contact held it and linking that contact to the supplier if it was not linked. It creates and edits nothing, create_contact and update_contact are the only doors that write a person.

`is_archived` true suffixes the name " (Archived)" and re-points every variant this supplier is default for onto another of that variant's suppliers; false reverses the suffix. `clear_variant_supplier_lead_time` true drops the per-variant lead time across this supplier's variants. `domains` re-syncs supplier email in the background, after the answer.

An unknown supplier is refused 404 and an unknown container type 400.

Scope: `suppliers:write`, which includes `suppliers:read`.

## Path parameters

- `supplier_id` string, required

## Headers

- `Tightly-Version` string
- `Idempotency-Key` string

## Request body

- UpdateSupplierRequest
  - `address1` string, nullable
  - `address2` string, nullable
  - `brand_ids` string[], nullable
  - `city` string, nullable
  - `clear_variant_supplier_lead_time` boolean, nullable
  - `contacts` SupplierContactPayload[], nullable
    - `city` string, nullable
    - `country` string, nullable
    - `department` string, nullable
    - `description` string, nullable
    - `email` string, email, nullable
    - `id` string, nullable
    - `name` string, nullable
    - `phone` string, nullable
    - `preferred_contact_method` string, nullable
    - `role` string, nullable
    - `supplier_id` string, nullable
    - `supplier_name` string, nullable
  - `container_type_id` integer, nullable
  - `container_type_stated` boolean: Server-set: true when the body named container_type_id (even as null). Anything a client sends here is overwritten, so omit it.
  - `country` string, nullable
  - `currency` string, nullable
  - `domains` string[], nullable
  - `edi` union
    - SupplierEdiPayload
      - `account_number` string, nullable
      - `trading_partner_id` string, nullable
      - `vendor_number` string, nullable
    - object, nullable
  - `edi_stated` boolean: Server-set: true when the body named edi (even as null). Anything a client sends here is overwritten, so omit it.
  - `is_archived` boolean, nullable
  - `kind` 'factory' | 'vendor' | 'distributor' | 'null', nullable
  - `kind_stated` boolean: Server-set: true when the body named kind (even as null). Anything a client sends here is overwritten, so omit it.
  - `lanes` SupplierLaneDto[], nullable
    - `container_type_id` integer, nullable
    - `freight_per_container_cents` integer, nullable
    - `lead_time` integer, nullable
    - `location_id` string, required
    - `road_limit_kg` integer, nullable
  - `lead_time` integer, nullable
  - `location_lead_times` SupplierLocationLeadTimeDto[], nullable
    - `lead_time` integer, nullable
    - `location_id` string, required
  - `min_order_value` integer, nullable
  - `name` string, nullable
  - `payment_terms_days` integer, nullable
  - `postal_code` string, nullable
  - `primary_contact` union
    - SupplierContactPayload
      - `city` string, nullable
      - `country` string, nullable
      - `department` string, nullable
      - `description` string, nullable
      - `email` string, email, nullable
      - `id` string, nullable
      - `name` string, nullable
      - `phone` string, nullable
      - `preferred_contact_method` string, nullable
      - `role` string, nullable
      - `supplier_id` string, nullable
      - `supplier_name` string, nullable
    - object, nullable
  - `province` string, nullable

## Response `200`

The supplier as it now stands, in the shape `get_supplier_details` serves.

- GetSupplierDetailsResponse
  - `data` union
    - SupplierDetailsWithContacts
      - `address1` string, nullable
      - `address2` string, nullable
      - `average_lead_time` union
        - InventoryCardItem
          - `info` string, nullable
          - `key` string, required
          - `unit` string, required
          - `value` unknown
        - object, nullable
      - `brands` SupplierBrandRef[]
        - `brand_id` string, required
        - `name` string, required
        - `owned` boolean
      - `city` string, nullable
      - `contacts` ContactPayload[]
        - `city` string, nullable
        - `country` string, nullable
        - `department` string, nullable
        - `description` string, nullable
        - `email` string, nullable
        - `id` string, required
        - `is_primary_contact` boolean, nullable
        - `name` string, nullable
        - `phone` string, nullable
        - `preferred_contact_method` string, nullable
        - `role` string, nullable
        - `supplier_id` string, nullable
        - `supplier_name` string, nullable
      - `container_type_id` integer, nullable
      - `country` string, nullable
      - `currency` string, nullable
      - `domains` string[], nullable
      - `edi` union
        - SupplierEdi
          - `account_number` string, nullable
          - `trading_partner_id` string, nullable
          - `vendor_number` string, nullable
        - object, nullable
      - `id` string, required
      - `in_full` number, nullable
      - `integrations` object, nullable
      - `is_archived` boolean, nullable
      - `kind` string, nullable
      - `lanes` SupplierLane[], nullable
        - `basis` string, nullable
        - `container_name` string, nullable
        - `container_type_id` integer, nullable
        - `freight_per_container_cents` integer, nullable
        - `internal_cbm` number, nullable
        - `lead_time` integer, nullable
        - `lead_time_source` string, nullable
        - `location_id` string, required
        - `location_name` string, nullable
        - `pallet_positions` integer, nullable
        - `payload_kg` integer, nullable
        - `resolved_container_type_id` integer, nullable
        - `road_limit_kg` integer, nullable
        - `usable_pct` number, nullable
      - `lead_time` integer, nullable
      - `lead_time_source` string, nullable
      - `location_lead_times` SupplierLocationLeadTime[], nullable
        - `lead_time` integer, nullable
        - `location_id` string, required
        - `location_name` string, nullable
        - `source` string, nullable
      - `min_order_value` integer, nullable
      - `name` string, required
      - `on_time` number, nullable
      - `otif_score` number, nullable
      - `payment_terms_days` integer, nullable
      - `postal_code` string, nullable
      - `primary_contact` union
        - ContactPayload
          - `city` string, nullable
          - `country` string, nullable
          - `department` string, nullable
          - `description` string, nullable
          - `email` string, nullable
          - `id` string, required
          - `is_primary_contact` boolean, nullable
          - `name` string, nullable
          - `phone` string, nullable
          - `preferred_contact_method` string, nullable
          - `role` string, nullable
          - `supplier_id` string, nullable
          - `supplier_name` string, nullable
        - object, nullable
      - `province` string, nullable
    - object, nullable
  - `message` ApiMessage
    - `desc` string
    - `service` string
    - `severity` 'SUCCESS' | 'INFO' | 'ERROR' | 'WARNING'

## Other responses

- `400`: A warehouse is in both `lanes` and `location_lead_times`, or a named container type does not exist.
- `401`: No usable key: malformed, unknown, revoked, expired or stopped. One refusal covers all five, telling a caller which is which maps the surface for them. A request with no Authorization header at all is refused 400 before any key is looked for.
- `403`: The key may not reach this operation. `scope_missing` when the key does not hold Suppliers; `ip_not_allowed` when the caller's address is outside the key's allowlist. There is no `organization_mismatch` on this resource: no supplier or contact route names an organisation in its path, so there is nothing for a key to disagree with.
- `404`: No supplier of this organisation has that id.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
