{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/resollo-com/json-schema/resollo-com-draft-listing-schema.json",
  "title": "DraftListing",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/resollo-com-openapi.yml#/components/schemas/DraftListing",
  "type": "object",
  "required": [
    "product_id",
    "state",
    "suggested",
    "activation_url",
    "quota_remaining"
  ],
  "properties": {
    "product_id": {
      "type": "string",
      "format": "uuid"
    },
    "state": {
      "type": "string",
      "enum": [
        "inactive"
      ]
    },
    "suggested": {
      "type": "object",
      "required": [
        "name",
        "description",
        "category",
        "condition",
        "attributes",
        "semantic_profile",
        "shipment_prices",
        "price"
      ],
      "description": "The final field values used for the listing, all generated by Resollo's AI. The price amount is the midpoint of the AI's suggested range (min/max).",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "category": {
          "$ref": "#/$defs/Category"
        },
        "condition": {
          "$ref": "#/$defs/Condition"
        },
        "attributes": {
          "type": "object"
        },
        "semantic_profile": {
          "type": [
            "object",
            "null"
          ]
        },
        "shipment_prices": {
          "type": "object"
        },
        "price": {
          "type": "object",
          "required": [
            "amount",
            "currency",
            "min",
            "max",
            "reasoning"
          ],
          "properties": {
            "amount": {
              "type": "number"
            },
            "currency": {
              "type": "string"
            },
            "min": {
              "type": "number",
              "description": "AI-suggested price range lower bound."
            },
            "max": {
              "type": "number",
              "description": "AI-suggested price range upper bound."
            },
            "reasoning": {
              "type": "string"
            }
          }
        }
      }
    },
    "activation_url": {
      "type": "string",
      "format": "uri",
      "description": "The seller's existing product-management page. The listing stays `inactive` (not publicly visible, not in the moderation queue) until the seller opens this URL and activates it themselves."
    },
    "quota_remaining": {
      "type": "object",
      "required": [
        "autofill",
        "price_suggestion"
      ],
      "description": "Remaining AI credits after this call, which consumed 2 (one per pipeline).",
      "properties": {
        "autofill": {
          "type": "integer"
        },
        "price_suggestion": {
          "type": "integer"
        }
      }
    }
  },
  "$defs": {
    "Category": {
      "type": "object",
      "required": [
        "id",
        "key",
        "name_en"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Raw `category_id` from the listing (may be a subcategory id)."
        },
        "key": {
          "type": "string",
          "description": "Stable top-level category key (e.g. `ELECTRONICS`). `UNKNOWN` if unrecognized."
        },
        "name_en": {
          "type": "string"
        }
      }
    },
    "Condition": {
      "type": "object",
      "required": [
        "value",
        "key",
        "name_en"
      ],
      "properties": {
        "value": {
          "type": "integer"
        },
        "key": {
          "type": "string"
        },
        "name_en": {
          "type": "string"
        }
      }
    }
  }
}