{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tenet-industries/json-schema/tenet-industries-row-schema.json",
  "title": "Row",
  "description": "One BOM row, its MPN and every vendor's offers of it.",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tenet-industries-openapi.yml#/components/schemas/Row",
  "properties": {
    "refs": {
      "title": "Refs",
      "type": "string"
    },
    "qty_per_board": {
      "title": "Qty Per Board",
      "type": "integer"
    },
    "value": {
      "title": "Value",
      "type": "string"
    },
    "mpn": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mpn"
    },
    "manufacturer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Manufacturer"
    },
    "offers": {
      "items": {
        "$ref": "#/$defs/TenetOffer"
      },
      "title": "Offers",
      "type": "array"
    },
    "errors": {
      "additionalProperties": {
        "type": "string"
      },
      "title": "Errors",
      "type": "object"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "error_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Code"
    },
    "cells": {
      "additionalProperties": {
        "type": "string"
      },
      "default": {},
      "title": "Cells",
      "type": "object"
    },
    "candidates": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Part"
      },
      "title": "Candidates",
      "type": "array"
    },
    "category": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Category"
    },
    "tht": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tht"
    },
    "matches": {
      "additionalProperties": {
        "enum": [
          "Exact MPN",
          "Direct",
          "Upgrade"
        ],
        "type": "string"
      },
      "description": "Match category by vendor and SKU, with exact offers taking precedence.",
      "readOnly": true,
      "title": "Matches",
      "type": "object"
    }
  },
  "required": [
    "refs",
    "qty_per_board",
    "value",
    "mpn",
    "manufacturer",
    "offers",
    "errors",
    "error",
    "matches"
  ],
  "type": "object",
  "$defs": {
    "Incoming": {
      "additionalProperties": false,
      "description": "Delivery the vendor expects from the manufacturer.",
      "properties": {
        "date": {
          "format": "date",
          "title": "Date",
          "type": "string"
        },
        "qty": {
          "minimum": 1,
          "title": "Qty",
          "type": "integer"
        }
      },
      "required": [
        "date",
        "qty"
      ],
      "title": "Incoming",
      "type": "object"
    },
    "Part": {
      "description": "A part Digi-Key offers in place of a row's MPN, with every vendor's offers of it.",
      "properties": {
        "mpn": {
          "title": "Mpn",
          "type": "string"
        },
        "manufacturer": {
          "title": "Manufacturer",
          "type": "string"
        },
        "offers": {
          "default": [],
          "items": {
            "$ref": "#/$defs/TenetOffer"
          },
          "title": "Offers",
          "type": "array"
        },
        "fit": {
          "enum": [
            "Direct",
            "Upgrade"
          ],
          "title": "Fit",
          "type": "string"
        }
      },
      "required": [
        "mpn",
        "manufacturer",
        "fit"
      ],
      "title": "Part",
      "type": "object"
    },
    "PriceBreak": {
      "additionalProperties": false,
      "description": "Unit price from `qty` pieces up.",
      "properties": {
        "qty": {
          "minimum": 1,
          "title": "Qty",
          "type": "integer"
        },
        "unit_price": {
          "minimum": 0,
          "title": "Unit Price",
          "type": "number"
        },
        "currency": {
          "pattern": "^[A-Z]{3}$",
          "title": "Currency",
          "type": "string"
        }
      },
      "required": [
        "qty",
        "unit_price",
        "currency"
      ],
      "title": "PriceBreak",
      "type": "object"
    },
    "TenetOffer": {
      "additionalProperties": false,
      "description": "One vendor SKU of one component.\n\nA field the vendor doesn't give stays empty (`null`, `[]`, `{}`, status `unknown`), never guessed. Stock is never added up\nacross SKUs of one part: they share it.",
      "properties": {
        "vendor": {
          "description": "Vendor the listing is from, e.g. `Digi-Key`.",
          "title": "Vendor",
          "type": "string"
        },
        "mpn": {
          "title": "Mpn",
          "type": "string"
        },
        "manufacturer": {
          "title": "Manufacturer",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "detailed_description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The vendor's long description where it has one beside the short, e.g. Digi-Key's.",
          "title": "Detailed Description"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Component category, e.g. `Microcontrollers`.",
          "title": "Category"
        },
        "package": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Package as the vendor writes it, e.g. `0201 (0603 Metric)`, `SOT-23`.",
          "title": "Package"
        },
        "parameters": {
          "additionalProperties": {
            "type": "string"
          },
          "default": {},
          "description": "Parametric attributes, name to value.",
          "title": "Parameters",
          "type": "object"
        },
        "status": {
          "default": "unknown",
          "enum": [
            "active",
            "new",
            "nrnd",
            "eol",
            "obsolete",
            "unknown"
          ],
          "title": "Status",
          "type": "string"
        },
        "normally_stocked": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "The vendor normally keeps it in stock.",
          "title": "Normally Stocked"
        },
        "special_order": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "Only available on special order.",
          "title": "Special Order"
        },
        "other_packagings": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "description": "MPNs of the same part in other packaging.",
          "title": "Other Packagings"
        },
        "rohs": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rohs"
        },
        "reach": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reach"
        },
        "msl": {
          "anyOf": [
            {
              "enum": [
                "1",
                "2",
                "2a",
                "3",
                "4",
                "5",
                "5a",
                "6"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Moisture sensitivity level, JEDEC J-STD-020.",
          "title": "Msl"
        },
        "eccn": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Export control class.",
          "title": "Eccn"
        },
        "customs_code": {
          "additionalProperties": {
            "type": "string"
          },
          "default": {},
          "description": "Customs scheme to code.",
          "propertyNames": {
            "enum": [
              "TARIC",
              "EUCN",
              "USHTS",
              "CNHTS",
              "CAHTS",
              "JPHTS",
              "BRHTS",
              "KRHTS",
              "MXHTS"
            ]
          },
          "title": "Customs Code",
          "type": "object"
        },
        "country_of_origin": {
          "anyOf": [
            {
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "ISO country code, e.g. `PH`.",
          "title": "Country Of Origin"
        },
        "standard_package_qty": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Pieces per standard package.",
          "title": "Standard Package Qty"
        },
        "sku": {
          "description": "The vendor's own part number.",
          "title": "Sku",
          "type": "string"
        },
        "packaging": {
          "default": [],
          "description": "`Ammo`: tape folded in a box. `Bulk`: loose, bags, boxes. `Other`: not placeable (cable spools, kits, bottles).\n`[]`: the vendor didn't say.",
          "items": {
            "enum": [
              "Reel",
              "Ammo",
              "Re-reel",
              "Cut Tape",
              "Tray",
              "Tube",
              "Bulk",
              "Other"
            ],
            "type": "string"
          },
          "title": "Packaging",
          "type": "array"
        },
        "stock": {
          "description": "The vendor's own in-stock figure.",
          "minimum": 0,
          "title": "Stock",
          "type": "integer"
        },
        "stock_by_country": {
          "default": {},
          "description": "Pieces in stock per country.",
          "patternProperties": {
            "^[A-Z]{2}$": {
              "minimum": 0,
              "type": "integer"
            }
          },
          "title": "Stock By Country",
          "type": "object"
        },
        "incoming": {
          "default": [],
          "items": {
            "$ref": "#/$defs/Incoming"
          },
          "title": "Incoming",
          "type": "array"
        },
        "lead_time_days": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Factory lead time.",
          "title": "Lead Time Days"
        },
        "moq": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Moq"
        },
        "order_multiple": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "The order quantity must be a multiple of this.",
          "title": "Order Multiple"
        },
        "price_breaks": {
          "default": [],
          "items": {
            "$ref": "#/$defs/PriceBreak"
          },
          "title": "Price Breaks",
          "type": "array"
        },
        "fees_or_tariffs": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "description": "Extra fees or tariffs apply.",
          "title": "Fees Or Tariffs"
        },
        "product_url": {
          "anyOf": [
            {
              "format": "uri",
              "maxLength": 2083,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Product Url"
        },
        "datasheet_url": {
          "anyOf": [
            {
              "format": "uri",
              "maxLength": 2083,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Datasheet Url"
        },
        "image_url": {
          "anyOf": [
            {
              "format": "uri",
              "maxLength": 2083,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Image Url"
        }
      },
      "required": [
        "vendor",
        "mpn",
        "manufacturer",
        "sku",
        "stock"
      ],
      "title": "TenetOffer",
      "type": "object"
    }
  }
}