{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "TCGPinas Retailer Inventory Feed",
  "description": "A read-only inventory contract. TCGPinas does not require orders, customers, or payment data.",
  "type": "object",
  "required": ["store", "generated_at", "currency", "listings"],
  "properties": {
    "store": { "type": "string", "minLength": 1 },
    "generated_at": { "type": "string", "format": "date-time" },
    "currency": { "const": "PHP" },
    "listings": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "card_name",
          "set_code",
          "collector_number",
          "finish",
          "condition",
          "language",
          "price",
          "quantity",
          "product_url"
        ],
        "properties": {
          "id": { "type": "string" },
          "scryfall_id": { "type": ["string", "null"], "format": "uuid" },
          "card_name": { "type": "string" },
          "set_name": { "type": "string" },
          "set_code": { "type": "string" },
          "collector_number": { "type": "string" },
          "finish": {
            "enum": ["nonfoil", "foil", "etched"]
          },
          "condition": {
            "enum": ["NM", "LP", "MP", "HP", "DMG", "sealed", "unknown"]
          },
          "language": { "type": "string", "default": "en" },
          "price": { "type": "number", "minimum": 0 },
          "quantity": { "type": "integer", "minimum": 0 },
          "product_url": { "type": "string", "format": "uri" },
          "image_url": {
            "type": ["string", "null"],
            "format": "uri"
          }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
