{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paidnice-com/json-schema/paidnice-com-contact-policy-check-schema.json",
  "title": "ContactPolicyCheck",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paidnice-com-openapi.json#/components/schemas/ContactPolicyCheck",
  "type": "object",
  "properties": {
    "policies": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "policyId": {
            "type": "integer",
            "description": "Paidnice policy id"
          },
          "title": {
            "type": "string",
            "description": "Policy name"
          },
          "type": {
            "type": "string",
            "enum": [
              "reminder",
              "fee",
              "discount",
              "sms",
              "statement_late_fee",
              "statement",
              "escalation",
              "contact_escalation",
              "quote_email",
              "payment_plan_reminder",
              "on_demand_placeholder"
            ],
            "description": "The kind of policy, for example reminder, fee, discount or sms"
          },
          "scope": {
            "type": "string",
            "enum": [
              "invoice",
              "contact"
            ],
            "description": "contact: the policy acts on the contact as a whole (statements, contact escalations). invoice: it acts on each invoice"
          },
          "message": {
            "type": "string",
            "description": "A short summary of how the policy applies to the contact and its invoices"
          },
          "applicableInvoiceCount": {
            "type": "integer",
            "description": "Number of the contact's invoices the policy applies to"
          },
          "nonApplicableInvoiceCount": {
            "type": "integer",
            "description": "Number of the contact's invoices the policy does not apply to"
          },
          "appliesToContact": {
            "type": "boolean",
            "description": "True when the policy applies to the contact"
          }
        },
        "required": [
          "policyId",
          "title",
          "type",
          "scope",
          "message",
          "applicableInvoiceCount",
          "nonApplicableInvoiceCount",
          "appliesToContact"
        ]
      },
      "description": "One per policy in the contact's group"
    }
  },
  "required": [
    "policies"
  ]
}