{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xp-tickets/json-schema/xp-tickets-listing-schema.json",
  "title": "Listing",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xp-tickets-openapi.yml#/components/schemas/Listing",
  "type": "object",
  "required": [
    "id",
    "partner_ref",
    "status",
    "status_reason",
    "event",
    "request_for_bids_id",
    "buyer",
    "event_submission",
    "quantity",
    "section",
    "row",
    "seats",
    "stock_type",
    "in_hand_at",
    "ask_per_ticket",
    "notes",
    "metadata",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Listing external ID (prefixed `lst_`)."
    },
    "partner_ref": {
      "type": "string",
      "description": "Your ticket-group ID, unique per account."
    },
    "status": {
      "$ref": "#/$defs/ListingStatus"
    },
    "status_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Machine-readable qualifier for the status (e.g. `unmatched` / `ambiguous_ref` under `pending_mapping`, `not_broadcast` under `dark`, `admin_removed` under `delisted` when XP closed the listing rather than you, `sale_rejected` under `delisted` when you rejected the sale)."
    },
    "event": {
      "nullable": true,
      "description": "The resolved XP event; null while `pending_mapping`.",
      "allOf": [
        {
          "$ref": "#/$defs/Event"
        }
      ]
    },
    "request_for_bids_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The lot buyers see and bid on (prefixed `rfb_`), as served by `GET /request-for-bids/{id}`; null until the listing is `live`."
    },
    "buyer": {
      "type": [
        "object",
        "null"
      ],
      "description": "Where to transfer the tickets, present while a sale is in flight (`sale_pending`, `sale_confirmed`, `sold`); null otherwise. Always XP's verification inbox, never the end buyer.",
      "required": [
        "name",
        "email"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      }
    },
    "event_submission": {
      "type": "object",
      "description": "Verbatim echo of the event identification you submitted.",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "external_refs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EventRef"
          }
        },
        "details": {
          "type": [
            "object",
            "null"
          ]
        }
      }
    },
    "quantity": {
      "type": "integer"
    },
    "section": {
      "type": "string"
    },
    "row": {
      "type": [
        "string",
        "null"
      ]
    },
    "seats": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "stock_type": {
      "type": "string",
      "enum": [
        "mobile",
        "axs",
        "eticket",
        "mobile_qr",
        "transferless",
        "physical"
      ],
      "description": "How the tickets will be delivered."
    },
    "in_hand_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the tickets are transferable; null = in hand now."
    },
    "ask_per_ticket": {
      "type": "integer",
      "description": "List price per ticket in USD cents (whole dollars)."
    },
    "notes": {
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "description": "Opaque object you supplied, echoed back."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Moves on every visible change; drives `updated_at_from`."
    }
  },
  "$defs": {
    "Event": {
      "type": "object",
      "required": [
        "id",
        "title",
        "start_datetime_local",
        "start_datetime",
        "timezone",
        "venue"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Event external ID (prefixed `evt_`)."
        },
        "title": {
          "type": "string"
        },
        "start_datetime_local": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
          "description": "Wall-clock time at the venue, no timezone offset.\nFormat: `YYYY-MM-DDTHH:MM:SS` (ISO 8601 without timezone).\n"
        },
        "start_datetime": {
          "type": "string",
          "format": "date-time",
          "description": "UTC time, ISO 8601 with `Z` suffix."
        },
        "timezone": {
          "type": "string",
          "description": "IANA timezone name of the venue."
        },
        "event_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "Event category. Common values: `concert`, `theater`,\n`sport`, `comedy`. Free-form — call `GET /events/facets`\nfor the live list.\n"
        },
        "venue": {
          "$ref": "#/$defs/VenueSummary"
        },
        "performers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PerformerSummary"
          }
        }
      }
    },
    "EventRef": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 64,
          "description": "An event identifier from your own catalog or upstream data source, matched verbatim (case-sensitive) against event identifiers XP holds internally."
        },
        "vendor": {
          "type": "string",
          "maxLength": 32,
          "description": "Optional label of your choosing, stored and echoed back for correlation. Not used for matching."
        }
      }
    },
    "ListingStatus": {
      "type": "string",
      "enum": [
        "pending_mapping",
        "dark",
        "live",
        "sale_pending",
        "sale_confirmed",
        "sold",
        "delisted",
        "lapsed"
      ],
      "description": "- `pending_mapping` — event not resolved yet\n- `dark` — event resolved, not broadcast\n- `live` — broadcast and biddable\n- `sale_pending` — a sale is in flight, inventory locked\n- `sale_confirmed` — you confirmed the inventory; transfer owed\n- `sold` — sale completed (terminal)\n- `delisted` — removed (terminal)\n- `lapsed` — sales cutoff passed with no sale (terminal)\n"
    },
    "PerformerSummary": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Performer external ID (prefixed `prf_`)."
        },
        "name": {
          "type": "string"
        },
        "league": {
          "type": [
            "string",
            "null"
          ],
          "description": "League, for sports performers. Common values: `NFL`, `MLB`,\n`NHL`, `NBA`, `NCAA Men's Basketball`, `NCAA Football`.\nFree-form — call `GET /performers/facets` for the live\nlist. `null` for non-sports performers.\n"
        },
        "role": {
          "type": [
            "string",
            "null"
          ],
          "description": "The performer's role in this event. Common values:\n`headliner`, `supporting act`, `special guest`,\n`opening act`, `tertiary`. May be `null`. Not filterable.\n"
        }
      }
    },
    "VenueSummary": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Venue external ID (prefixed `vnu_`)."
        },
        "name": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state_code": {
          "type": "string",
          "description": "Subdivision (state / province / region) where the venue is\nlocated. **Format is not strict** — parse as an opaque\nstring, not as a fixed-length ISO code. Typically an ISO\n3166-2 two-letter code for US states / Canadian provinces\n(e.g. `NY`, `ON`), but partners should expect free-form\nregional names for international venues (e.g. `Saxony`,\n`Lower Saxony`, `City of Bristol`). Legacy non-US rows may\nalso carry the literal country code here (e.g. `UK`).\n"
        }
      }
    }
  }
}