{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/marketsdk/json-schema/marketsdk-listing-object-schema.json",
  "title": "ListingObject",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/marketsdk-listings-api-openapi.yml#/components/schemas/ListingObject",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "listing"
      ]
    },
    "id": {
      "type": "string"
    },
    "seller": {
      "type": "string"
    },
    "category": {
      "type": [
        "string",
        "null"
      ]
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "price": {
      "$ref": "#/$defs/MoneyObject"
    },
    "quantity": {
      "type": "number"
    },
    "quantity_available": {
      "type": "number",
      "description": "Not reserved by an open order."
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "published",
        "sold",
        "expired",
        "removed"
      ]
    },
    "attributes": {
      "type": "object",
      "additionalProperties": true
    },
    "media": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MediaObject"
      }
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "published_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "removed_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "object",
    "id",
    "seller",
    "category",
    "title",
    "description",
    "price",
    "quantity",
    "quantity_available",
    "status",
    "attributes",
    "media",
    "metadata",
    "published_at",
    "expires_at",
    "removed_reason",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "MediaObject": {
      "type": "object",
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "media"
          ]
        },
        "id": {
          "type": "string"
        },
        "listing": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "ready"
          ]
        },
        "content_type": {
          "type": "string"
        },
        "size_bytes": {
          "type": "number"
        },
        "position": {
          "type": "number"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "A signed link to the file, valid for an hour. Null until the upload completes."
        },
        "url_expires_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "object",
        "id",
        "listing",
        "status",
        "content_type",
        "size_bytes",
        "position",
        "url",
        "url_expires_at",
        "created_at"
      ]
    },
    "MoneyObject": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number",
          "description": "Integer minor units."
        },
        "currency": {
          "type": "string"
        }
      },
      "required": [
        "amount",
        "currency"
      ]
    }
  }
}