{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/freeport-gg/json-schema/freeport-gg-listing-schema.json",
  "title": "Listing",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/freeport-gg-api-openapi.json#/components/schemas/Listing",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "A prefixed ULID"
    },
    "external_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "active",
        "paused",
        "removed"
      ]
    },
    "taken_down": {
      "type": "boolean"
    },
    "game": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "A prefixed ULID"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "slug",
        "name"
      ],
      "additionalProperties": false
    },
    "category": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "A prefixed ULID"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "slug",
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "server": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "A prefixed ULID"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "region": {
          "type": [
            "string",
            "null"
          ]
        },
        "faction": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "slug",
        "name",
        "region",
        "faction"
      ],
      "additionalProperties": false
    },
    "package": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "A prefixed ULID"
        },
        "slug": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "slug",
        "label"
      ],
      "additionalProperties": false
    },
    "path": {
      "type": "string",
      "description": "The catalog page the listing appears on."
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "price": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "A decimal string in the row's currency. Never a float."
    },
    "tiers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tier"
      }
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "price_per_qty": {
      "type": "integer",
      "format": "int64",
      "description": "How many units the price buys: 1000 gold, a million, a billion. The batch carries the precision a price in whole cents cannot."
    },
    "unit_label": {
      "type": "string"
    },
    "min_qty": {
      "type": "integer",
      "format": "int64"
    },
    "max_qty": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "stock_qty": {
      "type": "integer",
      "format": "int64"
    },
    "low_stock_alert_qty": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "delivery_eta_minutes": {
      "type": "integer"
    },
    "attributes": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "external_id",
    "status",
    "taken_down",
    "game",
    "category",
    "server",
    "package",
    "path",
    "title",
    "description",
    "price",
    "tiers",
    "currency",
    "price_per_qty",
    "unit_label",
    "min_qty",
    "max_qty",
    "stock_qty",
    "low_stock_alert_qty",
    "delivery_eta_minutes",
    "attributes",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false,
  "$defs": {
    "Tier": {
      "type": "object",
      "properties": {
        "min_qty": {
          "type": "integer",
          "format": "int64",
          "description": "From this order quantity up, in units."
        },
        "price": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "A decimal string in the row's currency. Never a float."
        }
      },
      "required": [
        "min_qty",
        "price"
      ],
      "additionalProperties": false
    }
  }
}