{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/threshold-rentals/json-schema/threshold-rentals-quote-schema.json",
  "title": "Quote",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/threshold-rentals-openapi.json#/components/schemas/Quote",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "property_id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "expired",
        "converted"
      ]
    },
    "check_in": {
      "type": "string",
      "format": "date"
    },
    "check_out": {
      "type": "string",
      "format": "date"
    },
    "check_in_time": {
      "type": "string"
    },
    "check_out_time": {
      "type": "string"
    },
    "nights": {
      "type": "integer"
    },
    "party": {
      "$ref": "#/$defs/Party"
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "amount": {
            "$ref": "#/$defs/Money"
          }
        }
      }
    },
    "total": {
      "$ref": "#/$defs/Money"
    },
    "due_now": {
      "$ref": "#/$defs/Money"
    },
    "compare_at": {
      "$ref": "#/$defs/CompareAt"
    },
    "security_hold": {
      "$ref": "#/$defs/Money"
    },
    "damage_deposit": {
      "type": "object",
      "additionalProperties": true,
      "description": "Present when the stay carries a damage deposit handled by Threshold. Nothing is held: the card the guest pays with is kept on file and charged, up to `amount`, only if the host reports damage within `claim_window_days` of check-out and the claim is upheld. Tell the guest this before they book (it is also the last item of house_rules)."
    },
    "booking_mode": {
      "type": "string",
      "enum": [
        "instant",
        "host_confirms"
      ]
    },
    "confirm_within_minutes": {
      "type": "integer",
      "description": "host_confirms only"
    },
    "payment": {
      "type": "object",
      "description": "Who collects payment and when the card is charged. Tell the guest note.",
      "properties": {
        "collected_by": {
          "type": "string",
          "enum": [
            "threshold",
            "host"
          ]
        },
        "merchant_of_record": {
          "type": "string",
          "enum": [
            "threshold",
            "host"
          ]
        },
        "methods": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "checkout": {
          "type": "string"
        },
        "plan": {
          "type": "string",
          "enum": [
            "full",
            "pay_later"
          ]
        },
        "authorized_at_request": {
          "$ref": "#/$defs/Money"
        },
        "charged_on": {
          "type": "string",
          "enum": [
            "booking",
            "host_acceptance"
          ]
        },
        "charge_date": {
          "type": "string",
          "format": "date-time"
        },
        "note": {
          "type": "string"
        }
      }
    },
    "cancellation": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "refund_schedule": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RefundTier"
          }
        }
      }
    },
    "house_rules": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Show these to the guest before requestBooking"
    },
    "guest_verification": {
      "type": "string"
    },
    "availability_checked_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "CompareAt": {
      "type": "object",
      "description": "Only when the host passes savings on: an estimate of the same stay on the host's main booking site. Present it as an estimate.",
      "properties": {
        "site": {
          "type": "string"
        },
        "estimated_total": {
          "$ref": "#/$defs/Money"
        },
        "savings": {
          "$ref": "#/$defs/Money"
        },
        "basis": {
          "type": "string"
        }
      }
    },
    "Money": {
      "type": "object",
      "required": [
        "amount",
        "currency"
      ],
      "properties": {
        "amount": {
          "type": "integer",
          "description": "In cents"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "Party": {
      "type": "object",
      "properties": {
        "adults": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "children": {
          "type": "integer",
          "minimum": 0
        },
        "infants": {
          "type": "integer",
          "minimum": 0
        },
        "pets": {
          "type": "integer",
          "minimum": 0
        },
        "service_animals": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "RefundTier": {
      "type": "object",
      "properties": {
        "until": {
          "type": "string",
          "format": "date-time",
          "description": "Cancel before this time…"
        },
        "refund": {
          "$ref": "#/$defs/Money",
          "description": "…to get this back"
        }
      }
    }
  }
}