# carf.correct

Build a UK CARF XML v1.5 correction from prior accepted XML and replacement or deletion records. Up to 10,000 users.

- REST: `POST https://api.kanagu.dev/v1/carf/correct`
- MCP tool: `carf.correct` at https://api.kanagu.dev/mcp
- Price: $0.10 USD per user, on successful calls only. Trial: 10 calls per IP per UTC day without a key, shared by REST and MCP.
- Auth: `Authorization: Bearer <key>` for billed calls. Retries: reuse `Idempotency-Key`.

## Request body

- `history` (array of string): Complete prior accepted CARF XML, oldest first. For correct, supply the files before previousXml.
- `messageSuffix` (string (max 75 chars), required)
- `timestamp` (string, required)
- `previousXml` (string, required)
- `provider` (object)
- `users` (array of object, required)

## Response

- `valid` (boolean, required)
- `reportableUsers` (integer (0 to 10000), required)
- `errors` (array of object, required)
- `errors[].rule` (string, required)
- `errors[].path` (string, required)
- `errors[].line` (integer (≤ 9007199254740991))
- `errors[].expected` (string, required)
- `errors[].actual` (string, required)
- `errors[].source` (string, required)
- `needsReview` (array of object, required)
- `needsReview[].rule` (string, required)
- `needsReview[].path` (string, required)
- `needsReview[].line` (integer (≤ 9007199254740991))
- `needsReview[].expected` (string, required)
- `needsReview[].actual` (string, required)
- `needsReview[].source` (string, required)
- `schemaVersion` ("1.5", required)
- `xml` (string | null, required)
- `filename` (string | null, required)
- `messageRefId` (string | null, required)

## Example

```sh
curl https://api.kanagu.dev/v1/carf/correct \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"previousXml":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<CARF_OECD xmlns=\"urn:oecd:ties:carf:v1\" xmlns:stf=\"urn:oecd:ties:carfstf:v5\" version=\"1.5\">\n<MessageSpec><SendingEntityIN>XRCASP000001234</SendingEntityIN><TransmittingCountry>GB</TransmittingCountry><ReceivingCountry>GB</ReceivingCountry><MessageType>CARF</MessageType><MessageRefId>GB2026GB-XRCASP000001234-original</MessageRefId><MessageTypeIndic>CARF701</MessageTypeIndic><ReportingPeriod>2026-12-31</ReportingPeriod><Timestamp>2027-05-01T09:00:00</Timestamp></MessageSpec>\n<CARFBody>\n<RCASP><RCASP_ID><Entity><ResCountryCode>GB</ResCountryCode><TIN issuedBy=\"GB\">08801357</TIN><Name>Bramble Digital Markets Ltd</Name><Address><CountryCode>GB</CountryCode><AddressFix><Street>10 Exchange Road</Street><PostCode>EC2A 1AA</PostCode><City>London</City></AddressFix></Address></Entity></RCASP_ID><Nexus>CARF901</Nexus><OtherNexus Nexus=\"CARF902\" ResCountryCode=\"FR\"></OtherNexus><DocSpec><stf:DocTypeIndic>OECD1</stf:DocTypeIndic><stf:DocRefId>GB2026GB-XRCASP000001234-original-provider</stf:DocRefId></DocSpec></RCASP>\n</CARFBody>\n</CARF_OECD>","messageSuffix":"correction-1","timestamp":"2027-05-02T09:00:00","provider":{"action":"replace","previousDocRefId":"GB2026GB-XRCASP000001234-original-provider","docSuffix":"provider","record":{"party":{"kind":"entity","name":"Bramble Digital Markets Ltd","residenceCountries":["GB"],"tins":[{"value":"08801357","issuedBy":"GB"}],"addresses":[{"country":"GB","city":"London","street":"10 Exchange Road","postCode":"EC2A 1AA"}]},"nexus":"CARF901"}},"users":[]}'
```

```ts
const res = await fetch("https://api.kanagu.dev/v1/carf/correct", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "previousXml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<CARF_OECD xmlns=\"urn:oecd:ties:carf:v1\" xmlns:stf=\"urn:oecd:ties:carfstf:v5\" version=\"1.5\">\n<MessageSpec><SendingEntityIN>XRCASP000001234</SendingEntityIN><TransmittingCountry>GB</TransmittingCountry><ReceivingCountry>GB</ReceivingCountry><MessageType>CARF</MessageType><MessageRefId>GB2026GB-XRCASP000001234-original</MessageRefId><MessageTypeIndic>CARF701</MessageTypeIndic><ReportingPeriod>2026-12-31</ReportingPeriod><Timestamp>2027-05-01T09:00:00</Timestamp></MessageSpec>\n<CARFBody>\n<RCASP><RCASP_ID><Entity><ResCountryCode>GB</ResCountryCode><TIN issuedBy=\"GB\">08801357</TIN><Name>Bramble Digital Markets Ltd</Name><Address><CountryCode>GB</CountryCode><AddressFix><Street>10 Exchange Road</Street><PostCode>EC2A 1AA</PostCode><City>London</City></AddressFix></Address></Entity></RCASP_ID><Nexus>CARF901</Nexus><OtherNexus Nexus=\"CARF902\" ResCountryCode=\"FR\"></OtherNexus><DocSpec><stf:DocTypeIndic>OECD1</stf:DocTypeIndic><stf:DocRefId>GB2026GB-XRCASP000001234-original-provider</stf:DocRefId></DocSpec></RCASP>\n</CARFBody>\n</CARF_OECD>",
    "messageSuffix": "correction-1",
    "timestamp": "2027-05-02T09:00:00",
    "provider": {
      "action": "replace",
      "previousDocRefId": "GB2026GB-XRCASP000001234-original-provider",
      "docSuffix": "provider",
      "record": {
        "party": {
          "kind": "entity",
          "name": "Bramble Digital Markets Ltd",
          "residenceCountries": [
            "GB"
          ],
          "tins": [
            {
              "value": "08801357",
              "issuedBy": "GB"
            }
          ],
          "addresses": [
            {
              "country": "GB",
              "city": "London",
              "street": "10 Exchange Road",
              "postCode": "EC2A 1AA"
            }
          ]
        },
        "nexus": "CARF901"
      }
    },
    "users": []
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
```

## Errors

JSON `{"error":{"code","message"}}`.

- 400 `invalid_input`: The body does not match the request schema. The message names each field.
- 400 `invalid_json`: The body is missing or is not valid JSON.
- 400 `invalid_idempotency_key`: Idempotency-Key must be 1–128 visible ASCII characters.
- 401 `invalid_api_key`: The Bearer key is missing, malformed, invalid or inactive.
- 402 `free_allowance_exhausted`: This month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left.
- 404 `not_found`: No operation at this path.
- 409 `idempotency_conflict`: The Idempotency-Key was already used with a different body.
- 413 `payload_too_large`: JSON bodies may be at most 64 KiB.
- 429 `trial_limit`: The anonymous trial allows 10 calls per IP per UTC day, shared by REST and MCP. Retry-After gives the seconds left.
- 500 `internal_error`: The call failed on our side. It is not billed; retry with the same Idempotency-Key.

## JSON Schema

Request:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "history": {
      "description": "Complete prior accepted CARF XML, oldest first. For correct, supply the files before previousXml.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "messageSuffix": {
      "type": "string",
      "minLength": 1,
      "maxLength": 75,
      "pattern": "^[A-Za-z0-9_.-]+$"
    },
    "timestamp": {
      "type": "string",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d))|(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?)$"
    },
    "previousXml": {
      "type": "string",
      "minLength": 1
    },
    "provider": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "const": "replace"
            },
            "previousDocRefId": {
              "type": "string",
              "pattern": "^[\\s\\S]{28,164}$"
            },
            "docSuffix": {
              "type": "string",
              "pattern": "^[\\s\\S]{1,63}$"
            },
            "record": {
              "type": "object",
              "properties": {
                "party": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "individual"
                        },
                        "residenceCountries": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          }
                        },
                        "tins": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "issuedBy": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{2}$"
                                  }
                                },
                                "required": [
                                  "value",
                                  "issuedBy"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "const": "NOTIN"
                                  }
                                },
                                "required": [
                                  "value"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "addresses": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "country": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              },
                              "street": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "buildingIdentifier": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "suiteIdentifier": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "floorIdentifier": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "districtName": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "poBox": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "postCode": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "city": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "countrySubentity": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "additionalInfo": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 4000
                              }
                            },
                            "required": [
                              "country",
                              "city"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "individualIds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "issuedBy": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              }
                            },
                            "required": [
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "firstName": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "middleNames": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          }
                        },
                        "lastName": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "birthDate": {
                          "type": "string",
                          "format": "date",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                        },
                        "birthPlace": {
                          "type": "object",
                          "properties": {
                            "city": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "citySubentity": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "country": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "countryCode": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "required": [
                                    "countryCode"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "formerCountryName": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    }
                                  },
                                  "required": [
                                    "formerCountryName"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "city",
                            "country"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "kind",
                        "residenceCountries",
                        "tins",
                        "addresses",
                        "firstName",
                        "lastName",
                        "birthDate"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "entity"
                        },
                        "residenceCountries": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          }
                        },
                        "tins": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "issuedBy": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{2}$"
                                  }
                                },
                                "required": [
                                  "value",
                                  "issuedBy"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "string",
                                    "const": "NOTIN"
                                  }
                                },
                                "required": [
                                  "value"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "addresses": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "country": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              },
                              "street": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "buildingIdentifier": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "suiteIdentifier": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "floorIdentifier": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "districtName": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "poBox": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "postCode": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "city": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "countrySubentity": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "additionalInfo": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 4000
                              }
                            },
                            "required": [
                              "country",
                              "city"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "individualIds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "issuedBy": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              }
                            },
                            "required": [
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "organisationIds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "value": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "issuedBy": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              },
                              "type": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              }
                            },
                            "required": [
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "kind",
                        "residenceCountries",
                        "tins",
                        "addresses",
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  ]
                },
                "nexus": {
                  "type": "string",
                  "enum": [
                    "CARF901",
                    "CARF902",
                    "CARF903",
                    "CARF904",
                    "CARF905"
                  ]
                },
                "otherNexus": {
                  "type": "object",
                  "properties": {
                    "nexus": {
                      "type": "string",
                      "enum": [
                        "CARF901",
                        "CARF902",
                        "CARF903",
                        "CARF904",
                        "CARF905"
                      ]
                    },
                    "country": {
                      "type": "string",
                      "pattern": "^[A-Z]{2}$"
                    }
                  },
                  "required": [
                    "nexus",
                    "country"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "party",
                "nexus"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "action",
            "previousDocRefId",
            "docSuffix",
            "record"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "const": "delete"
            },
            "previousDocRefId": {
              "type": "string",
              "pattern": "^[\\s\\S]{28,164}$"
            },
            "docSuffix": {
              "type": "string",
              "pattern": "^[\\s\\S]{1,63}$"
            },
            "previousXmlContainsAllActiveUsers": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "action",
            "previousDocRefId",
            "docSuffix",
            "previousXmlContainsAllActiveUsers"
          ],
          "additionalProperties": false
        }
      ]
    },
    "users": {
      "maxItems": 10000,
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "replace"
              },
              "previousDocRefId": {
                "type": "string",
                "pattern": "^[\\s\\S]{28,164}$"
              },
              "docSuffix": {
                "type": "string",
                "pattern": "^[\\s\\S]{1,63}$"
              },
              "record": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "individual"
                      },
                      "residenceCountries": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        }
                      },
                      "tins": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "issuedBy": {
                                  "type": "string",
                                  "pattern": "^[A-Z]{2}$"
                                }
                              },
                              "required": [
                                "value",
                                "issuedBy"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "const": "NOTIN"
                                }
                              },
                              "required": [
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "addresses": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "country": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$"
                            },
                            "street": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "buildingIdentifier": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "suiteIdentifier": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "floorIdentifier": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "districtName": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "poBox": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "postCode": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "city": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "countrySubentity": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "additionalInfo": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4000
                            }
                          },
                          "required": [
                            "country",
                            "city"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "individualIds": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "issuedBy": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$"
                            }
                          },
                          "required": [
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "firstName": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "middleNames": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        }
                      },
                      "lastName": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "birthDate": {
                        "type": "string",
                        "format": "date",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                      },
                      "birthPlace": {
                        "type": "object",
                        "properties": {
                          "city": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "citySubentity": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "country": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "countryCode": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{2}$"
                                  }
                                },
                                "required": [
                                  "countryCode"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "formerCountryName": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  }
                                },
                                "required": [
                                  "formerCountryName"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "required": [
                          "city",
                          "country"
                        ],
                        "additionalProperties": false
                      },
                      "transactions": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "asset": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "cryptoToCryptoIn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoToCryptoOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoFiatIn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoFiatOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoTransferIn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "transferType": {
                                    "type": "string",
                                    "pattern": "^CARF50[1-9]$"
                                  },
                                  "alternativeValuation": {
                                    "type": "string",
                                    "pattern": "^CARF100[1-4]$"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count",
                                  "transferType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoTransferOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "transferType": {
                                    "type": "string",
                                    "pattern": "^CARF60[1-6]$"
                                  },
                                  "alternativeValuation": {
                                    "type": "string",
                                    "pattern": "^CARF100[1-4]$"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count",
                                  "transferType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "walletTransfersOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "alternativeValuation": {
                                    "type": "string",
                                    "pattern": "^CARF100[1-4]$"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "retailPayments": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "asset"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "residenceCountries",
                      "tins",
                      "addresses",
                      "firstName",
                      "lastName",
                      "birthDate",
                      "transactions"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "entity"
                      },
                      "residenceCountries": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        }
                      },
                      "tins": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "issuedBy": {
                                  "type": "string",
                                  "pattern": "^[A-Z]{2}$"
                                }
                              },
                              "required": [
                                "value",
                                "issuedBy"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "string",
                                  "const": "NOTIN"
                                }
                              },
                              "required": [
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "addresses": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "country": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$"
                            },
                            "street": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "buildingIdentifier": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "suiteIdentifier": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "floorIdentifier": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "districtName": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "poBox": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "postCode": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "city": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "countrySubentity": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "additionalInfo": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4000
                            }
                          },
                          "required": [
                            "country",
                            "city"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "individualIds": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "issuedBy": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$"
                            }
                          },
                          "required": [
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "organisationIds": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "issuedBy": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$"
                            },
                            "type": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            }
                          },
                          "required": [
                            "value"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "transactions": {
                        "minItems": 1,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "asset": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "cryptoToCryptoIn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoToCryptoOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoFiatIn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoFiatOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "exchangeType": {
                                    "type": "string",
                                    "enum": [
                                      "CARF401",
                                      "CARF402",
                                      "CARF403",
                                      "CARF404"
                                    ]
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoTransferIn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "transferType": {
                                    "type": "string",
                                    "pattern": "^CARF50[1-9]$"
                                  },
                                  "alternativeValuation": {
                                    "type": "string",
                                    "pattern": "^CARF100[1-4]$"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count",
                                  "transferType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cryptoTransferOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "transferType": {
                                    "type": "string",
                                    "pattern": "^CARF60[1-6]$"
                                  },
                                  "alternativeValuation": {
                                    "type": "string",
                                    "pattern": "^CARF100[1-4]$"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count",
                                  "transferType"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "walletTransfersOut": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "alternativeValuation": {
                                    "type": "string",
                                    "pattern": "^CARF100[1-4]$"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "retailPayments": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d{1,2})?$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "units": {
                                    "type": "string",
                                    "maxLength": 100,
                                    "pattern": "^\\d+(?:\\.\\d+)?$"
                                  },
                                  "count": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency",
                                  "units",
                                  "count"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "asset"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "controllingPersons": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "person": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "individual"
                                },
                                "residenceCountries": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{2}$"
                                  }
                                },
                                "tins": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "value": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 200
                                          },
                                          "issuedBy": {
                                            "type": "string",
                                            "pattern": "^[A-Z]{2}$"
                                          }
                                        },
                                        "required": [
                                          "value",
                                          "issuedBy"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "value": {
                                            "type": "string",
                                            "const": "NOTIN"
                                          }
                                        },
                                        "required": [
                                          "value"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  }
                                },
                                "addresses": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "country": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{2}$"
                                      },
                                      "street": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "buildingIdentifier": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "suiteIdentifier": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "floorIdentifier": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "districtName": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "poBox": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "postCode": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "city": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "countrySubentity": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "additionalInfo": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 4000
                                      }
                                    },
                                    "required": [
                                      "country",
                                      "city"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "individualIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "value": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 200
                                      },
                                      "issuedBy": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{2}$"
                                      }
                                    },
                                    "required": [
                                      "value"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "firstName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "middleNames": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  }
                                },
                                "lastName": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "birthDate": {
                                  "type": "string",
                                  "format": "date",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                },
                                "birthPlace": {
                                  "type": "object",
                                  "properties": {
                                    "city": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    },
                                    "citySubentity": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    },
                                    "country": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "countryCode": {
                                              "type": "string",
                                              "pattern": "^[A-Z]{2}$"
                                            }
                                          },
                                          "required": [
                                            "countryCode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "formerCountryName": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 200
                                            }
                                          },
                                          "required": [
                                            "formerCountryName"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "city",
                                    "country"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "kind",
                                "residenceCountries",
                                "tins",
                                "addresses",
                                "firstName",
                                "lastName",
                                "birthDate"
                              ],
                              "additionalProperties": false
                            },
                            "roles": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^CARF8(?:0[1-9]|1[0-3])$"
                              }
                            }
                          },
                          "required": [
                            "person",
                            "roles"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "residenceCountries",
                      "tins",
                      "addresses",
                      "name",
                      "transactions"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "action",
              "previousDocRefId",
              "docSuffix",
              "record"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "delete"
              },
              "previousDocRefId": {
                "type": "string",
                "pattern": "^[\\s\\S]{28,164}$"
              },
              "docSuffix": {
                "type": "string",
                "pattern": "^[\\s\\S]{1,63}$"
              }
            },
            "required": [
              "action",
              "previousDocRefId",
              "docSuffix"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "required": [
    "messageSuffix",
    "timestamp",
    "previousXml",
    "users"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "previousXml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<CARF_OECD xmlns=\"urn:oecd:ties:carf:v1\" xmlns:stf=\"urn:oecd:ties:carfstf:v5\" version=\"1.5\">\n<MessageSpec><SendingEntityIN>XRCASP000001234</SendingEntityIN><TransmittingCountry>GB</TransmittingCountry><ReceivingCountry>GB</ReceivingCountry><MessageType>CARF</MessageType><MessageRefId>GB2026GB-XRCASP000001234-original</MessageRefId><MessageTypeIndic>CARF701</MessageTypeIndic><ReportingPeriod>2026-12-31</ReportingPeriod><Timestamp>2027-05-01T09:00:00</Timestamp></MessageSpec>\n<CARFBody>\n<RCASP><RCASP_ID><Entity><ResCountryCode>GB</ResCountryCode><TIN issuedBy=\"GB\">08801357</TIN><Name>Bramble Digital Markets Ltd</Name><Address><CountryCode>GB</CountryCode><AddressFix><Street>10 Exchange Road</Street><PostCode>EC2A 1AA</PostCode><City>London</City></AddressFix></Address></Entity></RCASP_ID><Nexus>CARF901</Nexus><OtherNexus Nexus=\"CARF902\" ResCountryCode=\"FR\"></OtherNexus><DocSpec><stf:DocTypeIndic>OECD1</stf:DocTypeIndic><stf:DocRefId>GB2026GB-XRCASP000001234-original-provider</stf:DocRefId></DocSpec></RCASP>\n</CARFBody>\n</CARF_OECD>",
      "messageSuffix": "correction-1",
      "timestamp": "2027-05-02T09:00:00",
      "provider": {
        "action": "replace",
        "previousDocRefId": "GB2026GB-XRCASP000001234-original-provider",
        "docSuffix": "provider",
        "record": {
          "party": {
            "kind": "entity",
            "name": "Bramble Digital Markets Ltd",
            "residenceCountries": [
              "GB"
            ],
            "tins": [
              {
                "value": "08801357",
                "issuedBy": "GB"
              }
            ],
            "addresses": [
              {
                "country": "GB",
                "city": "London",
                "street": "10 Exchange Road",
                "postCode": "EC2A 1AA"
              }
            ]
          },
          "nexus": "CARF901"
        }
      },
      "users": []
    }
  ]
}
```

Response:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "valid": {
      "type": "boolean"
    },
    "reportableUsers": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "rule": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "expected": {
            "type": "string"
          },
          "actual": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "rule",
          "path",
          "expected",
          "actual",
          "source"
        ],
        "additionalProperties": false
      }
    },
    "needsReview": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "rule": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "expected": {
            "type": "string"
          },
          "actual": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "rule",
          "path",
          "expected",
          "actual",
          "source"
        ],
        "additionalProperties": false
      }
    },
    "schemaVersion": {
      "type": "string",
      "const": "1.5"
    },
    "xml": {
      "type": [
        "string",
        "null"
      ]
    },
    "filename": {
      "type": [
        "string",
        "null"
      ]
    },
    "messageRefId": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "valid",
    "reportableUsers",
    "errors",
    "needsReview",
    "schemaVersion",
    "xml",
    "filename",
    "messageRefId"
  ],
  "additionalProperties": false
}
```
