{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xp-tickets/json-schema/xp-tickets-listing-create-request-schema.json",
  "title": "ListingCreateRequest",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xp-tickets-openapi.yml#/components/schemas/ListingCreateRequest",
  "type": "object",
  "required": [
    "partner_ref",
    "event",
    "quantity",
    "section",
    "stock_type",
    "ask_per_ticket"
  ],
  "properties": {
    "partner_ref": {
      "type": "string",
      "maxLength": 64,
      "description": "Your ticket-group ID; unique per account."
    },
    "event": {
      "type": "object",
      "description": "At least one of `id` or `external_refs`; `details` required if neither is given, recommended always.",
      "properties": {
        "id": {
          "type": "string",
          "description": "XP event ID (prefixed `evt_`)."
        },
        "external_refs": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "$ref": "#/$defs/EventRef"
          }
        },
        "details": {
          "type": "object",
          "required": [
            "title",
            "venue_name",
            "start_datetime_local"
          ],
          "properties": {
            "title": {
              "type": "string",
              "maxLength": 512
            },
            "venue_name": {
              "type": "string",
              "maxLength": 256
            },
            "start_datetime_local": {
              "type": "string",
              "description": "Venue-local wall-clock time, no offset."
            },
            "city": {
              "type": "string",
              "maxLength": 128
            },
            "state_code": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2
            }
          }
        }
      }
    },
    "quantity": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "section": {
      "type": "string",
      "maxLength": 64
    },
    "row": {
      "type": "string",
      "maxLength": 32
    },
    "seats": {
      "type": "array",
      "description": "If present, must have exactly `quantity` entries.",
      "items": {
        "type": "string",
        "maxLength": 16
      }
    },
    "stock_type": {
      "type": "string",
      "enum": [
        "mobile",
        "axs",
        "eticket",
        "mobile_qr",
        "transferless",
        "physical"
      ]
    },
    "in_hand_at": {
      "type": "string",
      "format": "date-time",
      "description": "Omit if the tickets are in hand now."
    },
    "ask_per_ticket": {
      "type": "integer",
      "minimum": 100,
      "multipleOf": 100,
      "description": "List price per ticket in USD cents (whole dollars)."
    },
    "notes": {
      "type": "string",
      "maxLength": 512,
      "description": "Public listing notes (e.g. \"aisle\", \"obstructed view\")."
    },
    "metadata": {
      "type": "object",
      "description": "Opaque object echoed back on the listing (max 4 KB)."
    }
  },
  "$defs": {
    "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."
        }
      }
    }
  }
}