{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tenet-industries/json-schema/tenet-industries-tenet-shipping-schema.json",
  "title": "TenetShipping",
  "description": "One parcel of a vendor order.\n\nA field the carrier doesn't give stays empty, never guessed. Times are ISO 8601 in UTC unless noted.",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tenet-industries-openapi.yml#/components/schemas/TenetShipping",
  "additionalProperties": false,
  "properties": {
    "vendor": {
      "description": "Vendor the parcel comes from, e.g. `Digi-Key`.",
      "title": "Vendor",
      "type": "string"
    },
    "carrier": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Carrier, e.g. `FedEx`.",
      "title": "Carrier"
    },
    "status": {
      "description": "`pending`: no carrier scan yet. `delayed`: a failed delivery with a new date ahead.",
      "enum": [
        "pending",
        "in_transit",
        "out_for_delivery",
        "ready_for_pickup",
        "delivered",
        "delayed",
        "problem"
      ],
      "title": "Status",
      "type": "string"
    },
    "eta": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Estimated delivery, in the carrier's zone.",
      "title": "Eta"
    },
    "milestones": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Milestone"
      },
      "title": "Milestones",
      "type": "array"
    },
    "scans": {
      "default": [],
      "description": "Newest first.",
      "items": {
        "$ref": "#/$defs/Scan"
      },
      "title": "Scans",
      "type": "array"
    }
  },
  "required": [
    "vendor",
    "status"
  ],
  "type": "object",
  "$defs": {
    "Address": {
      "additionalProperties": false,
      "description": "Where a carrier scan happened, as far as the carrier tells.",
      "properties": {
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Country"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "street": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Street"
        },
        "postal_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Postal Code"
        }
      },
      "title": "Address",
      "type": "object"
    },
    "Milestone": {
      "additionalProperties": false,
      "description": "A key step the parcel reached, and when (UTC).",
      "properties": {
        "stage": {
          "enum": [
            "label_created",
            "picked_up",
            "departed",
            "arrived",
            "ready_for_pickup",
            "out_for_delivery",
            "delivered",
            "returning",
            "returned"
          ],
          "title": "Stage",
          "type": "string"
        },
        "at": {
          "title": "At",
          "type": "string"
        }
      },
      "required": [
        "stage",
        "at"
      ],
      "title": "Milestone",
      "type": "object"
    },
    "Scan": {
      "additionalProperties": false,
      "description": "One carrier scan: when (UTC), where, and the carrier's own words.",
      "properties": {
        "at": {
          "title": "At",
          "type": "string"
        },
        "place": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Place"
        },
        "address": {
          "anyOf": [
            {
              "$ref": "#/$defs/Address"
            },
            {
              "type": "null"
            }
          ]
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "at",
        "text"
      ],
      "title": "Scan",
      "type": "object"
    }
  }
}