{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/precleared-dev/json-schema/precleared-dev-check-response-schema.json",
  "title": "CheckResponse",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/precleared-dev-openapi.json#/components/schemas/CheckResponse",
  "type": "object",
  "required": [
    "charged"
  ],
  "properties": {
    "charged": {
      "type": "boolean",
      "description": "False for unknown xx_unknown_country answers and one qualifying re-check within 24 hours. Combined cap: 50 per UK day per key, or keyless IP, then charged as normal. Apify partner billing unchanged."
    },
    "free_recheck_of": {
      "type": "string",
      "description": "Earlier receipt id. Same address and key, or keyless channel, within 24 hours of a charged unknown or consent_needed answer with recipient_country, company_name or company_number added or changed. Once per address in 24 hours."
    },
    "held_because": {
      "type": "object",
      "required": [
        "case",
        "evidence"
      ],
      "properties": {
        "case": {
          "type": "string",
          "enum": [
            "likely_sole_trader",
            "sole_trader_stated",
            "company_not_linked",
            "no_company_found"
          ]
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "possible_company": {
      "type": "object",
      "required": [
        "name",
        "number"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "number": {
          "type": "string"
        }
      },
      "description": "Unconfirmed company suggestion. Never establishes recipient country."
    },
    "verdict": {
      "type": "string",
      "enum": [
        "ok_to_email",
        "consent_needed",
        "blocked",
        "unknown"
      ]
    },
    "confidence": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low"
      ]
    },
    "reasons": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "rules_applied": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "footer_text": {
      "type": [
        "string",
        "null"
      ]
    },
    "next_step": {
      "type": [
        "string",
        "null"
      ]
    },
    "facts": {
      "type": "object",
      "description": "legal_form_source companies_house_name_domain means an active company matching the supplied or website-derived name is confirmed by a distinctive recipient domain stem match, with medium confidence. Exact matches must be unique; fuzzy names require at least 0.6 token overlap and the same domain guard. Generic words alone and fewer than five matched letters do not confirm a company. legal_form_source companies_house_stem_area means no name was given or printed, but the only active company whose name is the domain stem (at least 8 letters, with a distinctive word) has its registered office in the same postcode area as an address printed on the website, with medium confidence. Dormant companies, common-word names and sites that print a company number never use it. A name-plus-domain match whose name has only one distinctive word also needs the registered office in a postcode area printed on the website. Scottish partnerships are corporate subscribers under PECR. When the recipient's address or registered office is in Scotland, held reasons say sole trader, not sole trader or partnership. legal_form_source public_sector_domain means the recipient's domain is a UK public-sector one (.gov.uk, .ac.uk, .sch.uk, .police.uk and similar). legal_form_source is unavailable when Companies House could not be searched by name, or unconfirmed when one exact active company matches the domain but the website could not be read to confirm it runs the site. Both UK verdicts are unknown. For unconfirmed, pass company_number only if the website or your lead data confirms the company named in the notes; otherwise check again later."
    },
    "receipt": {
      "$ref": "#/$defs/Receipt"
    },
    "rules_version": {
      "type": "string"
    },
    "usage": {
      "type": "object",
      "properties": {
        "trial_ends_at": {
          "type": "string",
          "format": "date-time",
          "description": "Present while the key trial is running."
        },
        "plan_url": {
          "type": "string",
          "format": "uri",
          "description": "Tracked p=monthly checkout, added to keyed low/heads-up notices unless a plan is active. In the last three trial days, notice includes the trial end date and monthly option."
        },
        "free_remaining_today": {
          "type": "integer"
        },
        "credits_remaining": {
          "type": "integer"
        },
        "auto_topup": {
          "type": "boolean",
          "description": "Present for keyed calls. Whether auto top-up is enabled."
        },
        "manage_url": {
          "type": "string",
          "description": "Key settings page. Present in auto top-up low-balance notices."
        },
        "low_balance": {
          "type": "boolean",
          "description": "Present when the key has 1 to 200 pack checks left."
        },
        "top_up_url": {
          "type": "string",
          "description": "Checkout link for another 2,000 checks at low pack balance. Omitted while an automatic top-up is on its way; included if it failed. At low free allowance with zero credits, links to /buy?ref=low instead, without creating checkout."
        },
        "get_key_url": {
          "type": "string",
          "description": "Free-key page with ?ref=low, present near the keyless daily limit."
        },
        "notice": {
          "type": "string",
          "description": "Free-allowance heads-up at max(2, 20% of the keyless allowance) or max(3, 20% of the key allowance) remaining, when credits are zero. Also used for the unchanged low pack balance or auto top-up failure notice."
        }
      }
    },
    "disclaimer": {
      "type": "string"
    }
  },
  "$defs": {
    "Receipt": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "request_hash": {
          "type": "string"
        },
        "response_hash": {
          "type": "string"
        },
        "signature": {
          "type": "string"
        },
        "algorithm": {
          "type": "string"
        },
        "key_version": {
          "type": "string"
        },
        "verify_url": {
          "type": "string"
        }
      }
    }
  }
}