{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/domani-run/json-schema/domani-run-negotiation-schema.json",
  "title": "Negotiation",
  "description": "An anonymous, threaded price negotiation over a listed domain",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/domani-run-marketplace-api-openapi.yml#/components/schemas/Negotiation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "agreed",
        "completed",
        "declined",
        "expired",
        "cancelled"
      ]
    },
    "your_role": {
      "type": "string",
      "enum": [
        "buyer",
        "seller"
      ]
    },
    "your_turn": {
      "type": "boolean",
      "description": "True when it's your move to respond"
    },
    "current_offer": {
      "type": "number",
      "description": "Latest amount on the table (USD)"
    },
    "agreed_price": {
      "type": [
        "number",
        "null"
      ],
      "description": "Set once the price is agreed"
    },
    "list_price": {
      "type": "number",
      "description": "The listing's asking price (USD)"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "deal_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Set once finalized into a deal"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "offers": {
      "type": "array",
      "description": "The negotiation thread, oldest first",
      "items": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "enum": [
              "you",
              "counterparty"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "offer",
              "counter",
              "accept",
              "decline"
            ]
          },
          "amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}