{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/counterpartycheck-com/json-schema/counterpartycheck-com-check-request-schema.json",
  "title": "CheckRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/counterpartycheck-com-openapi.yml#/components/schemas/CheckRequest",
  "type": "object",
  "required": [
    "counterparty"
  ],
  "properties": {
    "counterparty": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Legal or trading name of the payee",
          "maxLength": 200
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 code or country name",
          "maxLength": 60
        },
        "website": {
          "type": "string",
          "description": "Payee website domain or URL",
          "maxLength": 300
        },
        "email": {
          "type": "string",
          "description": "Email address the payee invoices or writes from",
          "maxLength": 254
        },
        "address": {
          "type": "string",
          "description": "Payee street address",
          "maxLength": 500
        }
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "ach",
            "wire",
            "card",
            "crypto",
            "check",
            "other"
          ]
        },
        "routing_number": {
          "type": "string",
          "description": "US ABA routing number"
        },
        "iban": {
          "type": "string"
        },
        "swift_bic": {
          "type": "string"
        },
        "crypto_address": {
          "type": "string",
          "description": "Receiving wallet address"
        },
        "crypto_network": {
          "type": "string",
          "description": "e.g. base, ethereum, solana, bitcoin, tron"
        },
        "amount": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "context": {
      "type": "object",
      "description": "What the paying agent knows about how this payment came about. Each field sharpens fraud detection.",
      "properties": {
        "first_payment_to_payee": {
          "type": "boolean"
        },
        "bank_details_changed": {
          "type": "boolean",
          "description": "The payee asked to change where money goes"
        },
        "change_requested_via": {
          "type": "string",
          "enum": [
            "email",
            "phone",
            "portal",
            "in_person",
            "chat",
            "other"
          ]
        },
        "requested_urgency": {
          "type": "boolean",
          "description": "The request pressed for fast payment"
        },
        "requester_email": {
          "type": "string",
          "description": "Who asked for this payment"
        },
        "known_good_domain": {
          "type": "string",
          "description": "The vendor's domain on file from past dealings"
        },
        "payer_domain": {
          "type": "string",
          "description": "Your own company's domain, to catch internal impersonation"
        },
        "previous_payment": {
          "type": "object",
          "description": "Details used for the last payment to this payee, to detect changes",
          "properties": {
            "routing_number": {
              "type": "string"
            },
            "iban": {
              "type": "string"
            },
            "crypto_address": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}