{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/qorpiq-com/json-schema/qorpiq-com-charge-history-response-schema.json",
  "title": "ChargeHistoryResponse",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/qorpiq-com-openapi.yml#/components/schemas/ChargeHistoryResponse",
  "type": "object",
  "properties": {
    "transaction_id": {
      "type": "string"
    },
    "check": {
      "type": "string"
    },
    "cin": {
      "type": "string"
    },
    "company_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "ready"
      ]
    },
    "timestamp": {
      "type": "integer"
    },
    "currency": {
      "type": "string"
    },
    "unit": {
      "type": "string"
    },
    "has_open_charges": {
      "type": "boolean"
    },
    "open_charges_count": {
      "type": "integer"
    },
    "charges_count": {
      "type": "integer"
    },
    "register_charges_count": {
      "type": "integer",
      "description": "Charges on the MCA register. More than charges_count means newer CHG filings are being read (refreshing)."
    },
    "refreshing": {
      "type": "boolean",
      "description": "true when newer charge filings were found on the register and are being read now; call again later for them."
    },
    "charges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "charge_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "holder": {
            "type": "object",
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cin": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "satisfied",
              "unknown"
            ]
          },
          "creation_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "satisfaction_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "instrument_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "rate_of_interest": {
            "type": [
              "string",
              "null"
            ]
          },
          "terms_of_repayment": {
            "type": [
              "string",
              "null"
            ]
          },
          "extent_and_operation": {
            "type": [
              "string",
              "null"
            ]
          },
          "property_particulars": {
            "type": [
              "string",
              "null"
            ]
          },
          "property_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "consortium": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "joint_charge": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event": {
                  "type": "string",
                  "enum": [
                    "creation",
                    "modification",
                    "satisfaction"
                  ]
                },
                "form_id": {
                  "type": "string"
                },
                "srn": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "filing_date": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date"
                },
                "amount": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "modification_date": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date"
                },
                "modification_particulars": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "satisfaction_date": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date"
                }
              }
            }
          }
        }
      }
    },
    "source": {
      "$ref": "#/$defs/FiledFormsSource"
    }
  },
  "$defs": {
    "FiledFormsSource": {
      "type": "object",
      "description": "The filed forms an answer was read from, and when we last read them.",
      "required": [
        "provider",
        "kind",
        "fetched_at"
      ],
      "properties": {
        "provider": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "filed_forms"
          ]
        },
        "fetched_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}