{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/americold-realty-trust/refs/heads/main/json-schema/americold-i-3pl-inventory-snapshot-schema.json",
  "title": "AmericoldI3plInventorySnapshot",
  "description": "A point-in-time inventory snapshot from the Americold i-3PL platform reporting on-hand quantities, lot status, and storage conditions for a depositor's product across one or more Americold cold storage facilities.",
  "type": "object",
  "properties": {
    "snapshotId": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for this inventory snapshot",
      "example": "f7c1a08e-2b3c-4d5e-9a17-3e2c84a9b001"
    },
    "snapshotDate": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp the snapshot was generated by i-3PL",
      "example": "2026-05-05T06:00:00Z"
    },
    "depositorId": {
      "type": "string",
      "description": "Americold-assigned depositor account identifier",
      "example": "DEP-49021"
    },
    "depositorName": {
      "type": "string",
      "description": "Depositor (customer) name",
      "example": "Sunrise Frozen Foods, Inc."
    },
    "facilityCode": {
      "type": "string",
      "description": "Americold facility code where inventory is held",
      "example": "ATL-04"
    },
    "facilityName": {
      "type": "string",
      "description": "Americold facility name",
      "example": "Americold Atlanta Forest Park"
    },
    "temperatureZone": {
      "type": "string",
      "description": "Storage temperature zone for the inventory",
      "enum": ["Frozen", "Refrigerated", "Cooler", "Ambient", "Deep Frozen"],
      "example": "Frozen"
    },
    "lots": {
      "type": "array",
      "description": "Lot-level inventory positions in the snapshot",
      "items": {
        "$ref": "#/$defs/InventoryLot"
      }
    },
    "totalCases": {
      "type": "integer",
      "description": "Total cases on hand across all lots in the snapshot",
      "example": 12480
    },
    "totalPallets": {
      "type": "integer",
      "description": "Total pallets on hand across all lots in the snapshot",
      "example": 520
    },
    "totalWeightLbs": {
      "type": "number",
      "description": "Total weight on hand in pounds",
      "example": 249600.0
    }
  },
  "required": ["snapshotId", "snapshotDate", "depositorId", "facilityCode", "lots"],
  "$defs": {
    "InventoryLot": {
      "type": "object",
      "description": "A single lot-level inventory position within an i-3PL snapshot",
      "properties": {
        "sku": {"type": "string", "description": "Depositor SKU or item code", "example": "SKU-FROZEN-CHKN-12CT"},
        "gtin": {"type": "string", "description": "Global Trade Item Number (UPC/EAN)", "example": "00819472003217"},
        "productDescription": {"type": "string", "example": "Frozen Chicken Breast 12ct Case"},
        "lotNumber": {"type": "string", "description": "Lot or batch number", "example": "LOT-26W18-0042"},
        "manufactureDate": {"type": "string", "format": "date", "example": "2026-04-30"},
        "expirationDate": {"type": "string", "format": "date", "example": "2027-02-15"},
        "casesOnHand": {"type": "integer", "description": "Cases currently on hand for the lot", "example": 1240},
        "casesAvailable": {"type": "integer", "description": "Cases available to ship (on hand minus committed/holds)", "example": 1180},
        "casesCommitted": {"type": "integer", "description": "Cases committed to open orders", "example": 60},
        "casesOnHold": {"type": "integer", "description": "Cases on quality, regulatory, or customer hold", "example": 0},
        "weightLbs": {"type": "number", "description": "Weight on hand in pounds", "example": 24800.0},
        "status": {
          "type": "string",
          "description": "Lot status",
          "enum": ["Available", "Committed", "Hold", "Damaged", "Quarantined", "Recalled"],
          "example": "Available"
        },
        "lastReceivedDate": {"type": "string", "format": "date-time", "example": "2026-05-01T11:14:00Z"}
      },
      "required": ["sku", "lotNumber", "casesOnHand", "status"]
    }
  }
}
