{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tightly-io/json-schema/tightly-io-update-supplier-request-schema.json",
  "title": "UpdateSupplierRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tightly-io-openapi.json#/components/schemas/UpdateSupplierRequest",
  "properties": {
    "address1": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "address2": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "brand_ids": {
      "default": null,
      "items": {
        "type": "string"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "city": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "clear_variant_supplier_lead_time": {
      "default": null,
      "type": [
        "boolean",
        "null"
      ]
    },
    "contacts": {
      "default": null,
      "items": {
        "$ref": "#/$defs/SupplierContactPayload"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "container_type_id": {
      "default": null,
      "type": [
        "integer",
        "null"
      ]
    },
    "container_type_stated": {
      "default": false,
      "description": "Server-set: true when the body named container_type_id (even as null). Anything a client sends here is overwritten, so omit it.",
      "type": "boolean"
    },
    "country": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "currency": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "domains": {
      "default": null,
      "items": {
        "type": "string"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "edi": {
      "anyOf": [
        {
          "$ref": "#/$defs/SupplierEdiPayload"
        },
        {
          "type": [
            "object",
            "null"
          ]
        }
      ],
      "default": null
    },
    "edi_stated": {
      "default": false,
      "description": "Server-set: true when the body named edi (even as null). Anything a client sends here is overwritten, so omit it.",
      "type": "boolean"
    },
    "is_archived": {
      "default": null,
      "type": [
        "boolean",
        "null"
      ]
    },
    "kind": {
      "default": null,
      "enum": [
        "factory",
        "vendor",
        "distributor",
        null
      ],
      "type": [
        "string",
        "null"
      ]
    },
    "kind_stated": {
      "default": false,
      "description": "Server-set: true when the body named kind (even as null). Anything a client sends here is overwritten, so omit it.",
      "type": "boolean"
    },
    "lanes": {
      "default": null,
      "items": {
        "$ref": "#/$defs/SupplierLaneDto"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "lead_time": {
      "default": null,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "location_lead_times": {
      "default": null,
      "items": {
        "$ref": "#/$defs/SupplierLocationLeadTimeDto"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "min_order_value": {
      "default": null,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "name": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "payment_terms_days": {
      "default": null,
      "maximum": 365,
      "minimum": -365,
      "type": [
        "integer",
        "null"
      ]
    },
    "postal_code": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "primary_contact": {
      "anyOf": [
        {
          "$ref": "#/$defs/SupplierContactPayload"
        },
        {
          "type": [
            "object",
            "null"
          ]
        }
      ],
      "default": null
    },
    "province": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    }
  },
  "type": "object",
  "$defs": {
    "SupplierContactPayload": {
      "additionalProperties": false,
      "properties": {
        "city": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "department": {
          "default": null,
          "maxLength": 255,
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "default": null,
          "maxLength": 1024,
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "format": "email",
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "preferred_contact_method": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "role": {
          "default": null,
          "maxLength": 255,
          "type": [
            "string",
            "null"
          ]
        },
        "supplier_id": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "supplier_name": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "SupplierEdiPayload": {
      "additionalProperties": false,
      "properties": {
        "account_number": {
          "default": null,
          "maxLength": 255,
          "type": [
            "string",
            "null"
          ]
        },
        "trading_partner_id": {
          "default": null,
          "maxLength": 255,
          "type": [
            "string",
            "null"
          ]
        },
        "vendor_number": {
          "default": null,
          "maxLength": 255,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "SupplierLaneDto": {
      "additionalProperties": false,
      "properties": {
        "container_type_id": {
          "default": null,
          "type": [
            "integer",
            "null"
          ]
        },
        "freight_per_container_cents": {
          "default": null,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "lead_time": {
          "default": null,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "location_id": {
          "type": "string"
        },
        "road_limit_kg": {
          "default": null,
          "minimum": 1,
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "location_id"
      ],
      "type": "object"
    },
    "SupplierLocationLeadTimeDto": {
      "additionalProperties": false,
      "properties": {
        "lead_time": {
          "default": null,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "location_id": {
          "type": "string"
        }
      },
      "required": [
        "location_id"
      ],
      "type": "object"
    }
  }
}