{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/green-check-verified/main/json-schema/green-check-verified-paged-locations-schema.json",
  "title": "PagedLocations",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/green-check-verified-crb-inventory-locations-api-openapi.yml#/components/schemas/PagedLocations",
  "properties": {
    "metadata": {
      "properties": {
        "total": {
          "$ref": "#/$defs/PositiveInteger"
        },
        "count": {
          "type": "string",
          "description": "Range of items returned"
        }
      },
      "required": [
        "total",
        "count"
      ],
      "type": "object"
    },
    "data": {
      "items": {
        "$ref": "#/$defs/Location"
      },
      "type": "array"
    }
  },
  "required": [
    "metadata",
    "data"
  ],
  "type": "object",
  "additionalProperties": false,
  "$defs": {
    "FriendlyPosName": {
      "type": "string",
      "enum": [
        "Alleaves",
        "Dutchie",
        "Dutchie Wholesale",
        "Cova",
        "Meadow",
        "MJ Freeway",
        "MJ Freeway Wholesale",
        "Greenbits",
        "GrowFlow",
        "GrowFlow Wholesale",
        "Portal42",
        "Metrc S2S",
        "Metrc S2S Wholesale",
        "Flourish",
        "Flourish Wholesale",
        "Flowhub",
        "BioTrack",
        "BioTrack Wholesale",
        "Treez",
        "Blaze",
        "Quickbooks",
        "Sage Intacct",
        "Canix",
        "Brytemap",
        "POSaBIT",
        "Proteus420",
        "IndicaOnline",
        "Sweed",
        "Weave",
        "Jane",
        "Manual Upload Wholesale",
        "Cova Test Account",
        "Leaf Logix Test Account",
        "BioTrack Test Account",
        "Mj Freeway Test Account",
        "Treez IO Test Account",
        "Green Bits Test Account",
        "Manual Upload Retail",
        "Not Configured",
        "Unsupported",
        "CRBMonitor",
        "Plaid"
      ]
    },
    "Location": {
      "properties": {
        "id": {
          "$ref": "#/$defs/UUID",
          "description": "ID for the Location"
        },
        "crb_id": {
          "$ref": "#/$defs/UUID",
          "description": "ID of the CRB"
        },
        "name": {
          "type": "string",
          "description": "Name of the location"
        },
        "pos_type": {
          "$ref": "#/$defs/FriendlyPosName",
          "description": "The POS type that the Location data was populated from"
        },
        "pos_location_id": {
          "type": "string",
          "description": "POS location ID"
        },
        "pos_location_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "POS location type. May or may not be provided by the POS"
        },
        "pos_updated_date": {
          "$ref": "#/$defs/NullableUtcDateTime",
          "description": "Timestamp reported by the pos for the last update to this record. May or may not be provided by the POS",
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "pos_updated_date_local": {
          "$ref": "#/$defs/NullableLocalDateTime",
          "description": "CRB local timestamp reported by the pos for the last update to this record. May or may not be provided by the POS",
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[2][0][0-9]{2}[-]([0][0-9]|[1][0-2])[-]([0-2][0-9]|[3][0-1]\\s([0-1][0-9]|[2][0-3])[:][0-5][0-9][:][0-5][0-9]([.][0-9]{1,3})?"
        },
        "gc_created_date": {
          "$ref": "#/$defs/NullableUtcDateTime",
          "description": "Timestamp for when this inventory record was processed by green check",
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "gc_created_date_local": {
          "$ref": "#/$defs/NullableLocalDateTime",
          "description": "CRB local timestamp for when this inventory record was processed by green check",
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[2][0][0-9]{2}[-]([0][0-9]|[1][0-2])[-]([0-2][0-9]|[3][0-1]\\s([0-1][0-9]|[2][0-3])[:][0-5][0-9][:][0-5][0-9]([.][0-9]{1,3})?"
        }
      },
      "required": [
        "id",
        "crb_id",
        "name",
        "pos_type",
        "pos_location_id",
        "pos_location_type",
        "pos_updated_date",
        "pos_updated_date_local",
        "gc_created_date",
        "gc_created_date_local"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "NullableLocalDateTime": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[2][0][0-9]{2}[-]([0][0-9]|[1][0-2])[-]([0-2][0-9]|[3][0-1])\\s([0-1][0-9]|[2][0-3])[:][0-5][0-9][:][0-5][0-9][.][0-9]{3}"
    },
    "NullableUtcDateTime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "PositiveInteger": {
      "type": "integer",
      "format": "int32",
      "minimum": 0
    },
    "UUID": {
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$"
    }
  }
}