{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/booklint-com/json-schema/booklint-com-offer-check-request-schema.json",
  "title": "OfferCheckRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/booklint-com-openapi.json#/components/schemas/OfferCheckRequest",
  "type": "object",
  "required": [
    "offer",
    "limits"
  ],
  "properties": {
    "offer": {
      "$ref": "#/$defs/Offer"
    },
    "limits": {
      "type": "object",
      "description": "The owner's limits: a rulebook {version, declared, rules}. Offer kinds: total_price_cap, fees_above_headline (free); refundable_required, free_cancellation_min_hours, no_auto_renew, renewal_price_cap, trial_end_min_days, page_text_consistency (Desk)."
    },
    "as_of": {
      "type": "string",
      "format": "date-time",
      "description": "The current UTC time. Time rules use it; the server clock is never used."
    },
    "page_text": {
      "type": "string",
      "maxLength": 65536,
      "description": "Optional plain text copied from the page; above 64 KB (UTF-8) the request is refused. booklint never fetches a URL."
    }
  },
  "$defs": {
    "Offer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "merchant": {
          "type": "string",
          "description": "An identifier or domain, no spaces."
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        },
        "headline_price": {
          "type": "number",
          "minimum": 0,
          "description": "The price shown first."
        },
        "line_items": {
          "type": "array",
          "maxItems": 200,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "amount"
            ],
            "properties": {
              "label": {
                "type": "string",
                "maxLength": 120
              },
              "amount": {
                "type": "number",
                "minimum": 0
              },
              "mandatory": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            }
          }
        },
        "refund": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "refundable": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "free_cancel_until": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        },
        "subscription": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "auto_renews": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "renewal_price": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0
            },
            "renewal_interval": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "day",
                "week",
                "month",
                "year",
                null
              ]
            },
            "trial_ends": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          }
        }
      }
    }
  }
}