{
    "type": "object",
    "properties": {
        "ContactID": {
            "type": "string"
        },
        "ContactStatus": {
            "type": "string"
        },
        "Name": {
            "type": "string"
        },
        "EmailAddress": {
            "type": "string"
        },
        "Addresses": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "AddressType": {
                        "type": "string"
                    },
                    "City": {
                        "type": "string"
                    },
                    "Region": {
                        "type": "string"
                    },
                    "PostalCode": {
                        "type": "string"
                    },
                    "Country": {
                        "type": "string"
                    },
                    "AddressLine1": {
                        "type": "string"
                    }
                },
                "required": [
                    "AddressType"
                ]
            }
        },
        "Phones": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "PhoneType": {
                        "type": "string"
                    },
                    "PhoneNumber": {
                        "type": "string"
                    },
                    "PhoneAreaCode": {
                        "type": "string"
                    },
                    "PhoneCountryCode": {
                        "type": "string"
                    }
                },
                "required": [
                    "PhoneType"
                ]
            }
        },
        "UpdatedDateUTC": {
            "type": "string"
        },
        "ContactGroups": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "ContactGroupID": {
                        "type": "string"
                    },
                    "Name": {
                        "type": "string"
                    },
                    "Status": {
                        "type": "string"
                    },
                    "HasValidationErrors": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "ContactGroupID",
                    "Name",
                    "Status",
                    "Contacts",
                    "HasValidationErrors"
                ]
            }
        },
        "IsSupplier": {
            "type": "boolean"
        },
        "IsCustomer": {
            "type": "boolean"
        },
        "Balances": {
            "type": "object",
            "properties": {
                "AccountsReceivable": {
                    "type": "object",
                    "properties": {
                        "Outstanding": {
                            "type": "integer"
                        },
                        "Overdue": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "Outstanding",
                        "Overdue"
                    ]
                }
            },
            "required": [
                "AccountsReceivable",
                "AccountsPayable"
            ]
        },
        "ContactPersons": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "FirstName": {
                        "type": "string"
                    },
                    "LastName": {
                        "type": "string"
                    },
                    "EmailAddress": {
                        "type": "string"
                    },
                    "IncludeInEmails": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "FirstName",
                    "EmailAddress",
                    "IncludeInEmails"
                ]
            }
        },
        "HasAttachments": {
            "type": "boolean"
        },
        "HasValidationErrors": {
            "type": "boolean"
        },
        "BankAccountDetails": {
            "type": "string"
        }
    },
    "required": [
        "ContactID",
        "ContactStatus",
        "Name",
        "Addresses",
        "Phones",
        "UpdatedDateUTC",
        "ContactGroups",
        "IsSupplier",
        "IsCustomer",
        "ContactPersons",
        "HasAttachments",
        "HasValidationErrors"
    ],
    "version": 1
}
