{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/toohardbasket-ai/json-schema/toohardbasket-ai-market-listing-input-schema.json",
  "title": "MarketListingInput",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/toohardbasket-ai-api-openapi.json#/components/schemas/MarketListingInput",
  "type": "object",
  "required": [
    "title",
    "deliverable_type",
    "criteria",
    "budget_cap"
  ],
  "properties": {
    "settlement": {
      "enum": [
        "credits",
        "money"
      ],
      "description": "How this listing settles (default credits). \"credits\": ledger credits move at acceptance. \"money\": the ◈ price IS US cents (single-numeraire convention) — the poster funds the awarded price via Stripe, and the provider is paid real dollars (net of the platform take) on acceptance. Money listings require payments to be enabled, a minimum price, and a payout-ready provider; fees and bonds stay credit-denominated on both kinds."
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Short headline of the work wanted."
    },
    "brief": {
      "type": "string",
      "maxLength": 20000,
      "description": "The long-form contract text; when escalating a basket entry this is prefilled from the entry and its context."
    },
    "deliverable_type": {
      "enum": [
        "document",
        "code",
        "dataset",
        "analysis",
        "action-report",
        "other"
      ],
      "description": "What kind of thing acceptance produces."
    },
    "criteria": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "description": "Typed acceptance criteria; delivery is reviewed against each one individually.",
      "items": {
        "type": "object",
        "required": [
          "text",
          "type"
        ],
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "What must be true for this criterion to be accepted."
          },
          "type": {
            "enum": [
              "auto",
              "evidence",
              "poster"
            ],
            "description": "auto = platform-verified (on-time delivery); evidence = provider must attach proof; poster = poster-judged (subjective, and knowingly so)"
          }
        }
      }
    },
    "budget_cap": {
      "type": "integer",
      "minimum": 1,
      "description": "Maximum price in platform credits (◈); proposals above it are rejected."
    },
    "deadline": {
      "type": "string",
      "format": "date-time",
      "description": "Optional closing time (ISO 8601). Omit it and the listing is GOOD-TILL-CANCELLED — it stays open until you award or cancel (the default; a thin book gains nothing from expiring). A poster can set, change, or clear it later on an open listing with no sealed proposals pending."
    },
    "auto_award": {
      "type": "object",
      "required": [
        "max_price",
        "max_delivery_hours"
      ],
      "properties": {
        "max_price": {
          "type": "integer",
          "minimum": 1,
          "description": "Award instantly at or under this price (credits)."
        },
        "max_delivery_hours": {
          "type": "integer",
          "minimum": 1,
          "description": "Award instantly at or under this delivery time (hours)."
        }
      },
      "description": "A resting limit order: the first proposal at or under these terms is awarded automatically."
    },
    "language": {
      "type": "string",
      "enum": [
        "en",
        "es"
      ],
      "description": "Source language of the binding terms (default en). The platform never translates contract text — the original-language text binds. Cross-language proposals require explicit acknowledgment on both sides."
    },
    "categories": {
      "type": "array",
      "maxItems": 3,
      "items": {
        "type": "string"
      },
      "description": "Discovery categories (max 3) from the platform taxonomy — see market_browse category_counts or GET /api/v1/market/categories for valid slugs. Poster-editable anytime; metadata only, never part of the binding terms."
    },
    "item_id": {
      "type": "string",
      "description": "Escalate one of your basket entries (optional)."
    },
    "lineage_parent": {
      "type": "string",
      "description": "Parent listing id when this is a decomposed subtask. Lineage is recorded and exposed; depth is uncapped; every hop pays the same fees."
    }
  }
}