{
  "swagger": "2.0",
  "info": {
    "version": "1.0.7",
    "title": "Simplicity Interface",
    "description": "An API to integrate with Simplicity from other Systems.",
    "contact": {
      "email": "integration@bitechsystems.co.za"
    },
    "license": {
      "name": "Simplicity SLA",
      "url": "http://live.bitechsystems.co.za/simplicity/SimplicityLicense.txt"
    }
  },
  "host": "dev.bitechsystems.co.za",
  "basePath": "/intface",
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json",
    "text/html"
  ],
  "externalDocs": {
    "description": "Simplicty Help",
    "url": "http://live.bitechsystems.co.za/simphelp/SimpHelp.html"
  },
  "schemes": [
    "https",
    "http"
  ],
  "tags": [
    {
      "name": "LeadImport",
      "description": "Lead Import"
    },
    {
      "name": "MasterData",
      "description": "Master Data"
    },
    {
      "name": "Creditors",
      "description": "Creditor Related Function"
    },
    {
      "name": "Developers",
      "description": "Operations available to developers"
    },
    {
      "name": "testing",
      "description": "Testing related features."
    },
    {
      "name": "Lists",
      "description": "Functions to access client and data lists. Only for certain providers."
    },
    {
      "name": "Client Info",
      "description": "Retrieve or Update certain client information"
    }
  ],
  "securityDefinitions": {
    "api_key": {
      "description": "A `x-api-key` must be provided in the header",
      "type": "apiKey",
      "in": "header",
      "name": "x-api-key"
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "parameters": {
    "provider": {
      "name": "provider",
      "in": "path",
      "description": "Name of the client system.",
      "required": true,
      "type": "string",
      "maxLength": 50
    },
    "client-uid": {
      "name": "client-uid",
      "in": "path",
      "description": "Unqiue UUID for Client / Lead",
      "required": true,
      "type": "string",
      "format": "uuid",
      "maxLength": 40
    },
    "obligation-uid": {
      "name": "obligation-uid",
      "in": "path",
      "description": "Unqiue UUID for Obligation. (This is not the creditor UID)",
      "required": true,
      "type": "string",
      "format": "uuid",
      "maxLength": 40
    },
    "document-uid": {
      "name": "document-uid",
      "in": "path",
      "description": "Unqiue UUID for a Document",
      "required": true,
      "type": "string",
      "format": "uuid",
      "maxLength": 40
    },
    "filter": {
      "name": "filter",
      "in": "path",
      "description": "Filter list by",
      "required": true,
      "type": "string",
      "enum": [
        "UnpaidByDate",
        "ChangedByDate",
        "AllByStatus"
      ]
    },
    "filtervalue": {
      "name": "filtervalue",
      "in": "query",
      "description": "Filter value, only applies if not using date",
      "required": false,
      "type": "string"
    },
    "startdate": {
      "name": "startdate",
      "in": "query",
      "required": false,
      "description": "Start Date",
      "type": "string",
      "format": "date"
    },
    "enddate": {
      "name": "enddate",
      "in": "query",
      "required": false,
      "description": "End Date",
      "type": "string",
      "format": "date"
    },
    "periodcount": {
      "name": "periodcount",
      "in": "path",
      "required": true,
      "description": "Number of periods to filter on Hyphen statement (0= All periods \"Default\", 1 = 1 Period etc)",
      "type": "integer"
    }
  },
  "paths": {
    "/ping": {
      "get": {
        "summary": "Server heartbeat operation",
        "description": "Ping the server to check if it's online.",
        "tags": [
          "Developers"
        ],
        "security": [],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/leads/{provider}": {
      "post": {
        "tags": [
          "LeadImport"
        ],
        "operationId": "leadPost",
        "description": "Adds a Lead to Simplicity",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "in": "body",
            "name": "Lead",
            "required": true,
            "description": "Lead record to add",
            "schema": {
              "$ref": "#/definitions/Lead"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "409": {
            "description": "Lead already exists"
          },
          "410": {
            "description": "Given Creditor does not exist"
          },
          "422": {
            "description": "Invalid input, object invalid"
          }
        }
      }
    },
    "/creditbureau/{provider}": {
      "post": {
        "tags": [
          "LeadImport"
        ],
        "operationId": "creditbureauPost",
        "description": "Adds a Credit Bureau File to Simplicity and Import Lead",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "in": "body",
            "name": "CreditBureau",
            "required": true,
            "description": "Credit Bureau Record to add",
            "schema": {
              "type": "object",
              "description": "Credit Bureau JSON",
              "required": [
                "creditbureau",
                "payload",
                "uid"
              ],
              "properties": {
                "creditbureau": {
                  "type": "string",
                  "example": "compuscan",
                  "enum": [
                    "compuscan",
                    "xds"
                  ],
                  "description": "Credit Bureau Type"
                },
                "payload": {
                  "type": "string",
                  "format": "base64",
                  "description": "Base 64 encoded file",
                  "example": "dGVzdA=="
                },
                "uid": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Uniquely identifies a client",
                  "example": "321434-2342-234-234",
                  "maxLength": 40
                },
                "clientid": {
                  "type": "string",
                  "maxLength": 15,
                  "description": "ID Number / Passport",
                  "example": 78041248752145
                }
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "409": {
            "description": "Record already exists"
          },
          "410": {
            "description": "Given Creditor does not exist"
          },
          "422": {
            "description": "Invalid input, object invalid"
          }
        }
      }
    },
    "/leads/{provider}/{client-uid}": {
      "patch": {
        "tags": [
          "LeadImport"
        ],
        "operationId": "leadsPatch",
        "description": "Updates a lead in Simplicity",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          },
          {
            "in": "body",
            "name": "Lead",
            "required": true,
            "description": "Lead record to add",
            "schema": {
              "$ref": "#/definitions/Lead"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "404": {
            "description": "Lead not found"
          },
          "409": {
            "description": "Lead already exists"
          },
          "410": {
            "description": "Given Creditor does not exist"
          },
          "422": {
            "description": "Invalid input, object invalid"
          }
        }
      }
    },
    "/clientstatus/{provider}/{client-uid}": {
      "get": {
        "tags": [
          "Client Info"
        ],
        "operationId": "clientstatus",
        "description": "Check if a client was imported and return the lead/client status.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ResultClientStatus"
              },
              "description": "."
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/documents/client/{provider}/{client-uid}": {
      "post": {
        "tags": [
          "LeadImport"
        ],
        "operationId": "postClientDocument",
        "description": "Insert a specified client/lead document",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          },
          {
            "in": "body",
            "name": "company",
            "required": true,
            "description": "Document record to insert",
            "schema": {
              "$ref": "#/definitions/Document"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Bad request"
          },
          "404": {
            "description": "Record not found. Can be lead or document record."
          },
          "422": {
            "description": "invalid input, object invalid"
          }
        }
      }
    },
    "/documents/obligation/{provider}/{obligation-uid}": {
      "post": {
        "tags": [
          "LeadImport"
        ],
        "operationId": "postObligationDocument",
        "description": "Insert a specified obligation document",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/obligation-uid"
          },
          {
            "in": "body",
            "name": "company",
            "required": true,
            "description": "Document record to insert",
            "schema": {
              "$ref": "#/definitions/Document"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/ResponseMessage"
            }
          },
          "400": {
            "description": "Bad request"
          },
          "404": {
            "description": "Record not found. Can be obligation or document record."
          },
          "422": {
            "description": "invalid input, object invalid"
          }
        }
      }
    },
    "/creditors/{provider}": {
      "get": {
        "tags": [
          "MasterData"
        ],
        "operationId": "getCreditors",
        "description": "Get a lsit of all the creditors.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LinkedCreditor"
              },
              "description": "Creditor only no obligations will be given."
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/clientcontactdetails/{provider}/{client-uid}": {
      "patch": {
        "tags": [
          "Client Info"
        ],
        "operationId": "updateClientinfo",
        "description": "Update contact information for given client.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          },
          {
            "in": "body",
            "name": "Lead",
            "required": true,
            "description": "Client contact detail to update",
            "schema": {
              "$ref": "#/definitions/clientcontactdetail"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ResponseMessage"
              },
              "description": "Update client info"
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/clientinfo/{provider}/{client-uid}": {
      "get": {
        "tags": [
          "Client Info"
        ],
        "operationId": "getClientinfo",
        "description": "Get information for given client.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ResultClientInfo"
              },
              "description": "Return client info"
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/clienttask/{provider}/{client-uid}": {
      "get": {
        "tags": [
          "Client Info"
        ],
        "operationId": "getClienttask",
        "description": "Get tasks for given client.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ResultClientTask"
              },
              "description": "Return client tasks"
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/clientobligation/{provider}/{client-uid}": {
      "get": {
        "tags": [
          "Client Info"
        ],
        "operationId": "getClientObligation",
        "description": "Get obligations for given client.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ResultClientObligation"
              },
              "description": "Return client obligations"
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/clientcrm/{provider}/{client-uid}": {
      "get": {
        "tags": [
          "Client Info"
        ],
        "operationId": "getClientCRMList",
        "description": "Get CRM's for given client.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          },
          {
            "$ref": "#/parameters/startdate"
          },
          {
            "$ref": "#/parameters/enddate"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CRM"
              },
              "description": "Return Client CRM's"
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/clientstatement/{provider}/{client-uid}/{periodcount}": {
      "get": {
        "tags": [
          "Client Info"
        ],
        "operationId": "getClientStatement",
        "description": "Get Consumer statement for given client.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/client-uid"
          },
          {
            "$ref": "#/parameters/periodcount"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ResultClientStatement"
              },
              "description": "Return client statement"
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/documents/download/{provider}/{document-uid}": {
      "get": {
        "tags": [
          "Client Info"
        ],
        "operationId": "getDocument",
        "description": "Returns the actual document as base64 in json.",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/document-uid"
          }
        ],
        "responses": {
          "200": {
            "description": "Document Results",
            "schema": {
              "$ref": "#/definitions/Document"
            }
          },
          "400": {
            "description": "Bad request"
          },
          "404": {
            "description": "Document record not found."
          },
          "422": {
            "description": "invalid input, object invalid"
          }
        }
      }
    },
    "/listclient/{provider}/{filter}": {
      "get": {
        "tags": [
          "Lists"
        ],
        "operationId": "listclient",
        "description": "List all the clients by filter condition.\n\n\n## Filter Conditions:\n  * AllByStatus    (e.g /listclient/x/AllByStatus?filtervalue=lead)\n    * lead (All Leads)\n    * active (Active Clients)\n    * terminated (Terminated Clients)\n    * client  (All clients)\n    \n  * ChangedByDate (e.g. /listclient/x/ChangedByDate?startdate=2017-01-01&enddate=2017-10-01)\n    * This will includ leads and clients. Filters all clients by audit events (changes) between the given dates.\n    \n  * UnpaidByDate (e.g. /listclient/x/UnpaidByDate?startdate=2017-01-01&enddate=2017-10-01)\n    * All clients with unpaid from Hyphen.\n  \n  * ForClientID (e.g. /listclient/x/ForClientID?filtervalue=89052350745654)\n    * Retrieve client by ID Number \n    \n  ___Formats___:\n  \n  * startdate/enddate (Format YYYY-MM-DD)\n  * [provider] = x\n",
        "summary": "Returns a list of clients based on the input filter and date ranges",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/provider"
          },
          {
            "$ref": "#/parameters/filter"
          },
          {
            "$ref": "#/parameters/startdate"
          },
          {
            "$ref": "#/parameters/enddate"
          },
          {
            "$ref": "#/parameters/filtervalue"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ClientList"
              },
              "description": "List of clients"
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    }
  },
  "definitions": {
    "Lead": {
      "type": "object",
      "required": [
        "id",
        "clientid"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Uniquely identifies a client",
          "example": "321434-2342-234-234",
          "maxLength": 40
        },
        "accepteddate": {
          "type": "string",
          "format": "date",
          "description": "Date when the lead was accepted on Debt Counselling",
          "example": "2016-12-01"
        },
        "actionday": {
          "type": "integer",
          "minimum": 1,
          "maximum": 31,
          "format": "int16",
          "description": "Action Day. Day of the month the client pays.",
          "example": 13
        },
        "addresses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          },
          "description": "List of addresses",
          "maximum": 4
        },
        "affordability": {
          "type": "number",
          "format": "double",
          "description": "Affordability. Amount of money the client can pay for Debt Counselling monthly.",
          "example": 200.2
        },
        "applicationdate": {
          "type": "string",
          "format": "date",
          "description": "Application Date. Date that the client/lead applied for Debt Counselling.",
          "example": "2016-11-20"
        },
        "bank_acc_nr": {
          "type": "string",
          "description": "Bank Account Number",
          "maxLength": 20
        },
        "bankacctype": {
          "type": "string",
          "enum": [
            "Current",
            "Savings",
            "Transmission",
            "Subshare"
          ],
          "description": "Bank Account Type",
          "example": "Savings",
          "maxLength": 20
        },
        "bankbranchnumber": {
          "type": "string",
          "description": "Bank Account No",
          "maxLength": 11
        },
        "birthdate": {
          "type": "string",
          "format": "date",
          "description": "Client's Birth Date",
          "example": "2016-05-02"
        },
        "branch": {
          "type": "string",
          "maxLength": 50,
          "description": "The branch name that the client falls under in Simplicity.",
          "example": "testing-branch"
        },
        "casenumber": {
          "type": "string",
          "description": "Court Case Number",
          "maxLength": 40
        },
        "cell": {
          "type": "string",
          "maxLength": 10,
          "description": "Client Cellphone number",
          "example": "08965412345"
        },
        "clientid": {
          "type": "string",
          "maxLength": 15,
          "description": "ID Number / Passport (Also set idtype field.)",
          "example": 78041248752145
        },
        "surname": {
          "type": "string",
          "maxLength": 40,
          "description": "Surname",
          "example": "Brown"
        },
        "collectiontype": {
          "type": "string",
          "enum": [
            "debit order",
            "eft",
            "stop order",
            "cash"
          ],
          "description": "Collection Type",
          "example": "debit order",
          "maxLength": 20
        },
        "costafter24": {
          "type": "number",
          "format": "double",
          "description": "After care fees after 24 months"
        },
        "court_order_date": {
          "type": "string",
          "format": "date",
          "description": "Court order date",
          "example": "2016-02-05"
        },
        "date_form16_received": {
          "type": "string",
          "format": "date",
          "description": "Date form 16 signed"
        },
        "dependant_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 128,
          "description": "Number of people reliant on the client",
          "example": 0
        },
        "district": {
          "type": "string",
          "maxLength": 40,
          "description": "Court district client falls under"
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 255,
          "description": "Client email",
          "example": "JohnDoe@example.com"
        },
        "employers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Employer"
          },
          "description": "Employer Information including spouse employer",
          "maximum": 2
        },
        "fax": {
          "type": "string",
          "maxLength": 10,
          "description": "Fax number"
        },
        "firstname": {
          "type": "string",
          "maxLength": 25,
          "description": "Client first name",
          "example": "John"
        },
        "gender": {
          "type": "string",
          "enum": [
            "Male",
            "Female"
          ],
          "description": "Client gender. Male/Female",
          "example": "Male"
        },
        "idtype": {
          "type": "string",
          "enum": [
            "ID",
            "Passport"
          ],
          "description": "Shows the type of ID",
          "maxLength": 20
        },
        "leadsource": {
          "type": "string",
          "maxLength": 40,
          "description": "Source of the lead",
          "example": "ABSA"
        },
        "martital_status": {
          "type": "string",
          "enum": [
            "Single",
            {
              "Married": "Community of Property"
            },
            {
              "Married": "Antenuptial Agreement"
            },
            {
              "Married": "Joined Application"
            },
            "Divorced",
            {
              "Divorced": "Joined Application"
            },
            "Co-Inhabited",
            {
              "Co-Inhabited": "Joined Application"
            },
            "Widow",
            "Widower",
            "Married by Tradition",
            {
              "Married by Tradition": "Joined Application"
            }
          ],
          "description": "Client Martital status",
          "example": "Married : Community of Property"
        },
        "spouse_birthdate": {
          "type": "string",
          "format": "date",
          "description": "Spouse Birth Date",
          "example": "2016-05-02"
        },
        "spouse_id": {
          "type": "string",
          "maxLength": 15,
          "description": "Spouse ID Number / Passport (Also set idtype field.)",
          "example": 77041248752145
        },
        "spouse_name": {
          "type": "string",
          "maxLength": 30,
          "description": "Name of the client's spouse"
        },
        "spouse_occupation": {
          "type": "string",
          "maxLength": 25,
          "description": "Client's spouse's occupation"
        },
        "spouse_addresses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          },
          "description": "Spouse address",
          "maximum": 2
        },
        "spouse_race": {
          "type": "string",
          "enum": [
            "asian",
            "black",
            "coloured",
            "white"
          ],
          "description": "Race of spouse"
        },
        "spouse_surname": {
          "type": "string",
          "maxLength": 25,
          "description": "Surname of spouse"
        },
        "spouse_telephone": {
          "type": "string",
          "maxLength": 10,
          "description": "Spouse telephone number"
        },
        "spouse_title": {
          "type": "string",
          "enum": [
            "MR",
            "MRS",
            "MSS",
            "ADV",
            "DR",
            "SIR",
            "HON",
            "REV"
          ],
          "description": "Title of the spouse. Mr/Mrs"
        },
        "spouse_work": {
          "type": "string",
          "maxLength": 20,
          "description": "Spouse Work Phone number"
        },
        "startdate": {
          "type": "string",
          "format": "date",
          "description": "Start date of the client. This is required for calculations."
        },
        "status": {
          "type": "string",
          "enum": [
            "under consideration",
            "accepted",
            "rejected",
            "terminated",
            "restructured",
            "all paid up"
          ],
          "description": "Client Status",
          "example": "Accepted"
        },
        "telephone": {
          "type": "string",
          "maxLength": 10,
          "description": "Client telephone number"
        },
        "title": {
          "type": "string",
          "enum": [
            "MR",
            "MRS",
            "MSS",
            "ADV",
            "DR",
            "SIR",
            "HON",
            "REV"
          ],
          "description": "Client title. Mr,Mrs"
        },
        "town": {
          "type": "string",
          "maxLength": 30,
          "description": "Current town client resides in"
        },
        "work": {
          "type": "string",
          "maxLength": 30,
          "description": "The client's work Telephone."
        },
        "creditors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Creditor"
          },
          "description": "Client Creditors and Obligations (accounts)",
          "minItems": 0,
          "maxItems": 100
        },
        "clientincome": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Income"
          },
          "description": "Show the income of the client",
          "minItems": 0,
          "maxItems": 100
        },
        "deductions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Deduction"
          },
          "description": "Indicates deductions",
          "minItems": 0,
          "maxItems": 100
        },
        "expenses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Expense"
          },
          "description": "Indicates the expense information",
          "minItems": 0,
          "maxItems": 100
        },
        "assests": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Asset"
          },
          "description": "Asset description",
          "minItems": 0,
          "maxItems": 100
        },
        "dependands": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Dependent"
          },
          "description": "Show the dependants",
          "minItems": 0,
          "maxItems": 100
        },
        "consultants": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Consultant"
          },
          "description": "Consultant description",
          "minItems": 0,
          "maxItems": 100
        },
        "notes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Notes"
          },
          "description": "Note Information",
          "minItems": 0,
          "maxItems": 1000
        }
      }
    },
    "Address": {
      "type": "object",
      "required": [
        "id",
        "address_type",
        "address1"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier",
          "example": "be0c4882-9839-4656-840e-7f4183c0be43"
        },
        "address_type": {
          "type": "string",
          "description": "Type of address. postal/street",
          "example": "postal",
          "enum": [
            "postal",
            "street"
          ]
        },
        "address1": {
          "type": "string",
          "description": "Street or Post address",
          "example": "187 Good Ave"
        },
        "address2": {
          "type": "string",
          "description": "Address Line 2",
          "example": "building 2"
        },
        "address3": {
          "type": "string",
          "description": "Suburb/Area Name",
          "example": "Ardenwold"
        },
        "city": {
          "type": "string",
          "maxLength": 30,
          "description": "City",
          "example": "Johanessburg"
        },
        "postal_code": {
          "type": "string",
          "maxLength": 10,
          "description": "Postal Code",
          "example": 1900
        }
      }
    },
    "Asset": {
      "type": "object",
      "required": [
        "id",
        "category",
        "description",
        "amount"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier",
          "example": "15324325-8423432432450"
        },
        "category": {
          "type": "string",
          "description": "Group in which the asset falls",
          "enum": [
            "Fixed Property",
            "Moveable Assets",
            "Cash Investment",
            "Share Investment",
            "Matured Insurance"
          ],
          "example": "Fixed Property"
        },
        "description": {
          "type": "string",
          "maxLength": 40,
          "description": "Description of asset",
          "example": "House on Elm St"
        },
        "amount": {
          "type": "number",
          "format": "double",
          "description": "Value of Asset",
          "example": 123456.89
        },
        "credit_provider": {
          "type": "string",
          "maxLength": 40,
          "description": "Creditor this asset belongs to."
        },
        "guid": {
          "type": "string",
          "format": "uuid",
          "description": "simplicity alternate unique reference",
          "example": "7abbf2d3-6fb6-4f1f-8bbc-845cc83b5031"
        }
      }
    },
    "Consultant": {
      "type": "object",
      "required": [
        "id",
        "consultant_type",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Universally Unique Identifier",
          "example": "b4724e8a-f691-4c86-b86c-ec1854860588"
        },
        "consultant_type": {
          "type": "string",
          "description": "Type of consultant",
          "example": "sales",
          "enum": [
            "sales",
            "admin"
          ]
        },
        "name": {
          "type": "string",
          "maxLength": 50,
          "description": "Name of the consultant",
          "example": "Bill the Salesguy"
        }
      }
    },
    "Deduction": {
      "type": "object",
      "required": [
        "id",
        "amount",
        "category",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier",
          "example": "f03da456-b0ac-45a7-9512-5c11a8cc17ba"
        },
        "category": {
          "type": "string",
          "maxLength": 30,
          "description": "Category of the deduction",
          "enum": [
            "Employer Deduction",
            "Statutory Deduction"
          ],
          "example": "Employer Deduction"
        },
        "description": {
          "type": "string",
          "description": "Name of the deduction",
          "maxLength": 40,
          "example": "UIF"
        },
        "amount": {
          "type": "number",
          "format": "double",
          "example": 80.01
        },
        "spouseamount": {
          "type": "number",
          "format": "double",
          "example": 80.01
        },
        "guid": {
          "type": "string",
          "format": "uuid",
          "description": "alternate unique reference",
          "example": "7abbf2d3-6fb6-4f1f-8bbc-845cc83b5031"
        }
      }
    },
    "Dependent": {
      "type": "object",
      "required": [
        "id",
        "age",
        "name",
        "relationship"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier",
          "example": "bd9f5777-3fd2-451b-97ba-212d54644b01"
        },
        "age": {
          "type": "integer",
          "example": 12
        },
        "name": {
          "type": "string",
          "example": "Jim Bob",
          "maxLength": 30
        },
        "relationship": {
          "type": "string",
          "example": "son",
          "maxLength": 20
        },
        "guid": {
          "type": "string",
          "format": "uuid",
          "description": "alternate unique reference",
          "example": "7abbf2d3-6fb6-4f1f-8bbc-845cc83b5031"
        }
      }
    },
    "Document": {
      "type": "object",
      "required": [
        "id",
        "documenttype",
        "documentname",
        "content",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier",
          "example": "bd9f5777-3fd2-451b-97ba-212d54644b01"
        },
        "documenttype": {
          "type": "string",
          "description": "Type of document",
          "maxLength": 30,
          "example": "ID Document"
        },
        "documentname": {
          "type": "string",
          "description": "Name of document, usually filename",
          "maxLength": 255,
          "example": "CopyofID.pdf"
        },
        "content": {
          "type": "string",
          "format": "byte",
          "description": "Base 64 string with gzip encoded document.",
          "example": "SGVsbG8sIHRoaXMgZGVjb2RlZCBjb3JyZWN0bHku"
        },
        "contentsize": {
          "type": "number",
          "description": "Byte size of the document"
        },
        "content_checksum": {
          "type": "string",
          "maxLength": 128,
          "description": "Md5 checksum of the original document file"
        },
        "description": {
          "type": "string",
          "maxLength": 50,
          "description": "Description of document, notes"
        }
      }
    },
    "Expense": {
      "type": "object",
      "required": [
        "id",
        "category",
        "description",
        "amount"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier",
          "example": "6ff8a258-1d42-4d75-a224-ed46cd5a418f"
        },
        "category": {
          "type": "string",
          "maxLength": 30,
          "description": "Category of the expense",
          "enum": [
            "Household Expense",
            "Financial Expense"
          ],
          "example": "Household Expense"
        },
        "description": {
          "type": "string",
          "description": "Name of the Expense",
          "maxLength": 40,
          "example": "Groceries"
        },
        "amount": {
          "type": "number",
          "format": "double",
          "example": 80.01
        },
        "note": {
          "type": "string",
          "maxLength": 255
        },
        "guid": {
          "type": "string",
          "format": "uuid",
          "description": "alternate unique reference",
          "example": "7abbf2d3-6fb6-4f1f-8bbc-845cc83b5031"
        }
      }
    },
    "Income": {
      "type": "object",
      "required": [
        "id",
        "amount",
        "category",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "simplicity unique reference",
          "example": "7abbf2d3-6fb6-4f1f-8bbc-845cc83b5031"
        },
        "category": {
          "type": "string",
          "maxLength": 30,
          "description": "Category of the income",
          "enum": [
            "Income",
            "Other Income"
          ],
          "example": "Income"
        },
        "description": {
          "type": "string",
          "description": "Name of the income",
          "maxLength": 40,
          "example": "Gross Pay"
        },
        "amount": {
          "type": "number",
          "format": "double",
          "example": 80.01,
          "description": "Income amount of the main applicant"
        },
        "spouse_amount": {
          "type": "number",
          "format": "double",
          "example": 80.01,
          "description": "Income amount of the applicant spouse if married"
        },
        "guid": {
          "type": "string",
          "format": "uuid",
          "description": "alternate unique reference",
          "example": "7abbf2d3-6fb6-4f1f-8bbc-845cc83b5031"
        }
      }
    },
    "Employer": {
      "type": "object",
      "required": [
        "id",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Universally Unique Identifier",
          "example": "b4724e8a-f691-4c86-b86c-ec1854860588"
        },
        "description": {
          "type": "string",
          "maxLength": 50,
          "description": "Name of employer",
          "example": "Pick n Pay"
        },
        "employer_type": {
          "type": "string",
          "maxLength": 30,
          "description": "Spouse or main applicant employer",
          "enum": [
            "main",
            "spouse"
          ],
          "example": "main"
        },
        "employeenumber": {
          "type": "string",
          "maxLength": 20,
          "description": "Employee Number"
        },
        "employment_date": {
          "type": "string",
          "format": "date",
          "description": "Date employed"
        }
      }
    },
    "Notes": {
      "type": "object",
      "description": "Client Notes. You can find this on the client form.",
      "required": [
        "id",
        "note_type",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "simplicity uuid reference",
          "example": "7abbf2d3-6fb6-4f1f-8bbc-845cc83b5031"
        },
        "note_type": {
          "type": "string",
          "maxLength": 30,
          "description": "Type of note",
          "enum": [
            "Client Note",
            "General Note",
            "Additional monies over and above declared income",
            "Additional information that can affect this application",
            "Motivation for Debt Counselling",
            "Case Notes"
          ],
          "example": "Client Note"
        },
        "description": {
          "type": "string",
          "description": "Note text",
          "example": "This is an example note."
        }
      }
    },
    "LinkedCreditor": {
      "type": "object",
      "required": [
        "id",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for Creditor",
          "example": "71f0659a-7f89-4a16-8725-11a34a71c7c1",
          "maxLength": 40
        },
        "description": {
          "type": "string",
          "description": "Creditor Name",
          "maxLength": 50,
          "example": "Nedbank Credit Cards"
        },
        "rid_trader": {
          "type": "integer",
          "format": "int16",
          "description": "Unique identifier for a Creditor (Used in Simplicity, Must be provided for auto linking)",
          "example": 20
        },
        "pdacode": {
          "type": "string",
          "description": "Hyphen Creditor Code",
          "maxLength": 50,
          "example": "CP0000000001"
        }
      }
    },
    "Creditor": {
      "type": "object",
      "required": [
        "id",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for Creditor",
          "example": "71f0659a-7f89-4a16-8725-11a34a71c7c1",
          "maxLength": 40
        },
        "description": {
          "type": "string",
          "description": "Creditor Name",
          "maxLength": 50,
          "example": "Nedbank Credit Cards"
        },
        "rid_trader": {
          "type": "integer",
          "format": "int16",
          "description": "Unique identifier for a Creditor (Used in Simplicity, Must be provided for auto linking)",
          "example": 20
        },
        "Obligations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Obligation"
          },
          "description": "Accounts under the creditor",
          "minItems": 0,
          "maxItems": 100
        }
      }
    },
    "Obligation": {
      "type": "object",
      "required": [
        "id",
        "reference",
        "accountcode"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for Obligation ( UUID)",
          "example": "71f0659a-7f89-4a16-8725-11a34a71c7c1",
          "maxLength": 40
        },
        "reference": {
          "type": "string",
          "description": "Account Reference",
          "example": "7006600100053256451",
          "maxLength": 20
        },
        "subreference": {
          "type": "string",
          "description": "Sub Account Reference",
          "example": "56451",
          "maxLength": 20
        },
        "accountcode": {
          "type": "string",
          "description": "Debt Restructure Account Type (DCRS) (Product Code / House)",
          "example": "UF",
          "enum": [
            "PBL",
            "SCV",
            "SM",
            "SPV",
            "UF",
            "UT"
          ]
        },
        "creditorcode": {
          "type": "string",
          "description": "NCR Account Type (Product Code / House)",
          "example": "O",
          "enum": [
            "BB",
            "BC",
            "BL",
            "BO",
            "BV",
            "L",
            "ML",
            "O",
            "PB",
            "RC",
            "RF",
            "RO",
            "OT"
          ]
        },
        "currentpaymentmethod": {
          "type": "string",
          "description": "Payment Method",
          "example": "UF",
          "enum": [
            "Cash Payment",
            "Garnish",
            "Debit Order",
            "Stop Order",
            "EFT"
          ]
        },
        "applyexcltoexpenses": {
          "type": "string",
          "description": "Apply Obligation to Expenses / Priority payment",
          "example": "None",
          "maxLength": 30,
          "enum": [
            "None",
            "Add to Expense",
            "Priority Payment"
          ]
        },
        "agreementtype": {
          "type": "string",
          "example": "Agreement Lawful",
          "maxLength": 20,
          "enum": [
            "Agreement Lawful",
            "Agreement Unlawful",
            "Agreement Reckless",
            "Agreement Provision Unlawful"
          ]
        },
        "creditortype": {
          "type": "string",
          "description": "Creditor Type",
          "example": "Obligation",
          "enum": [
            "Obligation",
            "Insurance",
            "Restructure Fees",
            "Legal Fees",
            "PDA Fees",
            "Aftercare Fees"
          ]
        },
        "currentbalance": {
          "type": "number",
          "format": "double",
          "description": "Account Current Balance",
          "example": 4114.78
        },
        "originalbalance": {
          "type": "number",
          "format": "double",
          "description": "Original Outstanding Balance",
          "example": 1000.78
        },
        "originalpayment": {
          "type": "number",
          "format": "double",
          "description": "Original Instalment",
          "example": 580
        },
        "originalinterest": {
          "type": "number",
          "format": "double",
          "description": "Original Interest Rate",
          "example": 22.5,
          "maximum": 1000
        },
        "originalterm": {
          "type": "number",
          "format": "int16",
          "description": "Original Payment Rerm",
          "example": 56,
          "maximum": 1024
        },
        "cobdate": {
          "type": "string",
          "format": "date",
          "description": "Certificate of Balance (COB) date",
          "example": "2016-11-20"
        },
        "cobreceivedfrom": {
          "type": "string",
          "description": "Certificate of Balance (COB) Source",
          "example": "Client",
          "maxLength": 40,
          "enum": [
            "Client",
            "Credit Provider",
            "Credit Bureau",
            "None"
          ]
        },
        "creditlimit": {
          "type": "number",
          "format": "double",
          "description": "Credit Limit",
          "example": 1000
        },
        "insurance_amount": {
          "type": "number",
          "format": "double",
          "description": "Linked Insurance Amount",
          "example": 80.1
        },
        "insurance_description": {
          "type": "string",
          "description": "Linked Insurance Description",
          "maxLength": 40
        },
        "cob_source": {
          "type": "string",
          "description": "Source of obligation info.",
          "enum": [
            "Client",
            "Credit Provider",
            "Credit Bureau",
            "None"
          ]
        },
        "date17_1": {
          "type": "string",
          "format": "date",
          "description": "17.1 Date",
          "example": "2016-11-20"
        },
        "defaultdate": {
          "type": "string",
          "format": "date",
          "description": "Date of Default",
          "example": "2016-11-20"
        },
        "description": {
          "type": "string",
          "description": "Name for the obligation",
          "example": "Nedbank Credit Cards",
          "maxLength": 40
        },
        "excludefrondebtreview": {
          "type": "boolean",
          "description": "Exclude From Debtreview",
          "example": false
        },
        "expiredate": {
          "type": "string",
          "format": "date",
          "description": "Expiry Date",
          "example": "2020-11-20"
        },
        "feevatamount": {
          "type": "number",
          "format": "double",
          "description": "Restructure / Legal Fees Vat Amount",
          "example": 120
        },
        "goodsdescription": {
          "type": "string",
          "description": "Goods Description",
          "maxLength": 40
        },
        "monthlycharges": {
          "type": "number",
          "format": "double",
          "description": "Monthly Fees / Charges",
          "example": 120
        },
        "openingdate": {
          "type": "string",
          "format": "date",
          "description": "Opening Date",
          "example": "2010-11-20"
        },
        "outstandingterm": {
          "type": "number",
          "format": "int16",
          "description": "Leftover term",
          "example": 30,
          "maximum": 1024
        },
        "payment": {
          "type": "number",
          "format": "double",
          "description": "Proposed Monthly Instalment (Calculated Field)",
          "example": 170.5
        },
        "startdate": {
          "type": "string",
          "format": "date",
          "example": "2010-02-03"
        }
      }
    },
    "ResultClientStatus": {
      "type": "object",
      "required": [
        "id",
        "clientid"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Uniquely identifies a client",
          "example": "321434-2342-234-234",
          "maxLength": 40
        },
        "clientid": {
          "type": "string",
          "maxLength": 15,
          "description": "ID Number / Passport (Also set idtype field.)",
          "example": 78041248752145
        },
        "clientstatus": {
          "type": "string",
          "description": "Client Status",
          "enum": [
            "Lead",
            "Client"
          ]
        }
      }
    },
    "ResultClientInfo": {
      "type": "object",
      "required": [
        "id",
        "clientid"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Uniquely identifies a client",
          "example": "321434-2342-234-234",
          "maxLength": 40
        },
        "clientid": {
          "type": "string",
          "maxLength": 15,
          "description": "ID Number / Passport (Also set idtype field.)",
          "example": 78041248752145
        },
        "client_title": {
          "type": "string",
          "description": "Client Title",
          "enum": [
            "MR",
            "MRS",
            "MSS",
            "ADV",
            "DR",
            "SIR",
            "HON",
            "REV"
          ]
        },
        "firstname": {
          "type": "string",
          "maxLength": 25,
          "description": "Client first name",
          "example": "John"
        },
        "surname": {
          "type": "string",
          "maxLength": 25,
          "description": "Client surname",
          "example": "Doe"
        },
        "birthdate": {
          "type": "string",
          "format": "date",
          "description": "Birthdate of client",
          "example": "2010-02-02"
        },
        "gender": {
          "type": "string",
          "enum": [
            "Male",
            "Female"
          ],
          "description": "Client gender. Male/Female",
          "example": "Male"
        },
        "number_of_dependants": {
          "type": "integer",
          "description": "Number of dependants",
          "example": "1"
        },
        "lead_status": {
          "type": "string",
          "maxLength": 50,
          "description": "Lead status",
          "example": "Already under debt review with another company"
        },
        "status": {
          "type": "string",
          "enum": [
            "lead",
            "client"
          ]
        },
        "client_status": {
          "type": "string",
          "enum": [
            "under consideration",
            "accepted",
            "rejected",
            "terminated",
            "restructured",
            "all paid up"
          ],
          "description": "Client Status",
          "example": "Accepted"
        },
        "martital_status": {
          "type": "string",
          "enum": [
            "Single",
            {
              "Married": "Community of Property"
            },
            {
              "Married": "Antenuptial Agreement"
            },
            {
              "Married": "Joined Application"
            },
            "Divorced",
            {
              "Divorced": "Joined Application"
            },
            "Co-Inhabited",
            {
              "Co-Inhabited": "Joined Application"
            },
            "Widow",
            "Widower",
            "Married by Tradition",
            {
              "Married by Tradition": "Joined Application"
            }
          ],
          "description": "Client Martital status",
          "example": "Married : Community of Property"
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 255,
          "description": "Client email",
          "example": "JohnDoe@example.com"
        },
        "cell": {
          "type": "string",
          "maxLength": 10,
          "description": "Client Cellphone number",
          "example": "08965412345"
        },
        "work": {
          "type": "string",
          "maxLength": 30,
          "description": "The client's work Telephone"
        },
        "telephone": {
          "type": "string",
          "maxLength": 10,
          "description": "Client telephone number"
        },
        "monthly_payment": {
          "type": "number",
          "format": "double",
          "description": "Client Monthly payment",
          "example": "1000.00"
        },
        "addresses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          },
          "description": "List of addresses",
          "maximum": 4
        },
        "clientincome": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Income"
          },
          "description": "Show the income of the client",
          "minItems": 0,
          "maxItems": 100
        },
        "deductions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Deduction"
          },
          "description": "Indicates deductions",
          "minItems": 0,
          "maxItems": 100
        },
        "expenses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Expense"
          },
          "description": "Indicates the expense information",
          "minItems": 0,
          "maxItems": 100
        },
        "assets": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Asset"
          },
          "description": "Asset description",
          "minItems": 0,
          "maxItems": 100
        },
        "dependents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Dependent"
          },
          "description": "Show the dependents",
          "minItems": 0,
          "maxItems": 100
        },
        "consultants": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Consultant"
          },
          "description": "Consultant description",
          "minItems": 0,
          "maxItems": 100
        },
        "notes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Notes"
          },
          "description": "Note Information",
          "minItems": 0,
          "maxItems": 1000
        }
      }
    },
    "clientcontactdetail": {
      "type": "object",
      "properties": {
        "addresses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          },
          "description": "List of addresses",
          "maximum": 4
        },
        "cell": {
          "type": "string",
          "maxLength": 10,
          "description": "Client Cellphone number",
          "example": "08965412345"
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 255,
          "description": "Client email",
          "example": "JohnDoe@example.com"
        },
        "fax": {
          "type": "string",
          "maxLength": 10,
          "description": "Fax number"
        },
        "telephone": {
          "type": "string",
          "maxLength": 10,
          "description": "Client telephone number"
        },
        "work": {
          "type": "string",
          "maxLength": 30,
          "description": "The client's work Telephone."
        }
      }
    },
    "ResultClientTask": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "number",
          "description": "Uniquely identifies a task",
          "example": 1
        },
        "sequence": {
          "type": "number",
          "format": "double",
          "description": "Sequence of task order",
          "example": 1
        },
        "description": {
          "type": "string",
          "description": "Description of task",
          "example": 1
        },
        "startdate": {
          "type": "string",
          "format": "date",
          "example": "2010-02-01"
        },
        "datedone": {
          "type": "string",
          "format": "date",
          "example": "2010-02-03"
        }
      }
    },
    "ResultClientStatement": {
      "type": "object",
      "properties": {
        "clientid": {
          "type": "string",
          "description": "Client ID number",
          "example": "8110125658086"
        },
        "statement": {
          "type": "string",
          "format": "byte",
          "description": "Base 64 string with gzip encoded document.",
          "example": "SGVsbG8sIHRoaXMgZGVjb2RlZCBjb3JyZWN0bHku"
        }
      }
    },
    "ResultClientObligation": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "UUID",
          "description": "Uniquely identifies an obligation",
          "example": "fcca7c62-ddcf-4e87-b88b-bf3b7d8c7ffe"
        },
        "creditor_type": {
          "type": "string",
          "description": "Obligation indicator, distinguishing creditor and fees",
          "example": "obligation",
          "enum": [
            "obligation",
            "aftercare fees",
            "pda fees",
            "legal fees",
            "restructure fees"
          ]
        },
        "creditor": {
          "type": "string",
          "description": "Credit Provider name",
          "example": "Absa"
        },
        "reference": {
          "type": "string",
          "description": "Client Reference at creditor",
          "example": "AB123"
        },
        "acount_type": {
          "type": "string",
          "description": "Account type",
          "enum": [
            "UF",
            "UT",
            "PBL",
            "SCV",
            "SPV",
            "SM"
          ],
          "example": "UF"
        },
        "original_balance": {
          "type": "number",
          "format": "double",
          "description": "Original outstanding balance",
          "example": 20000.11
        },
        "original_rate": {
          "type": "number",
          "format": "double",
          "description": "Contractual interest rate",
          "example": 20
        },
        "original_payment": {
          "type": "number",
          "format": "double",
          "description": "Contractual monthly instalment",
          "example": 100
        },
        "original_term": {
          "type": "number",
          "description": "Contractual repayment term",
          "example": 100
        },
        "inception_date": {
          "type": "string",
          "format": "date",
          "description": "Date of account original opening date",
          "example": "2010-02-01"
        },
        "expire_date": {
          "type": "string",
          "format": "date",
          "description": "Date of account original expire date",
          "example": "2012-02-01"
        },
        "cob_date": {
          "type": "string",
          "format": "date",
          "description": "Date when COB was received",
          "example": "2012-02-01"
        },
        "monthly_fees": {
          "type": "number",
          "format": "double",
          "description": "Contractual monthly fees",
          "example": 20
        },
        "credit_life": {
          "type": "number",
          "format": "double",
          "description": "Contractual credit life insurance",
          "example": 20
        },
        "current_balance": {
          "type": "number",
          "format": "double",
          "description": "Current account balance",
          "example": 19000.11
        },
        "remaining_term": {
          "type": "number",
          "example": 19
        },
        "final_payment_date": {
          "type": "string",
          "format": "date",
          "description": "2020-01-01"
        }
      }
    },
    "ResponseMessage": {
      "type": "object",
      "required": [
        "retval",
        "response_id"
      ],
      "properties": {
        "response_id": {
          "type": "string",
          "format": "uuid",
          "description": "Response ID",
          "example": 1
        },
        "retval": {
          "type": "number",
          "format": "byte",
          "description": "Response Status, 1=Error , 0=Success",
          "example": 0
        },
        "errmsg": {
          "type": "string",
          "description": "Detailed Error Message",
          "example": "Record could not be added."
        },
        "hint": {
          "type": "string",
          "description": "Hint on how to handle/resolve this error.",
          "example": "Check the required input fields."
        }
      }
    },
    "ClientList": {
      "type": "object",
      "required": [
        "uid",
        "clientid"
      ],
      "properties": {
        "uid": {
          "type": "string",
          "format": "uuid",
          "description": "Uniquely identifies a client",
          "example": "321434-2342-234-234",
          "maxLength": 40
        },
        "clientid": {
          "type": "string",
          "maxLength": 15,
          "description": "ID Number / Passport (Also set idtype field.)",
          "example": "78041248752145"
        },
        "clientfilenumber": {
          "type": "string",
          "description": "Client file number",
          "example": "00001"
        },
        "clientstatus": {
          "type": "string",
          "description": "Client status",
          "example": "Active"
        },
        "status": {
          "type": "string",
          "enum": [
            "lead",
            "client"
          ]
        }
      }
    },
    "CRM": {
      "type": "object",
      "required": [
        "uid"
      ],
      "properties": {
        "uid": {
          "type": "string",
          "format": "uuid",
          "description": "Uniquely identifies a CRM",
          "example": "321434-2342-234-234",
          "maxLength": 40
        },
        "description": {
          "type": "string",
          "description": "CRM Description",
          "example": "Form 17.1"
        },
        "type": {
          "type": "string",
          "description": "CRM Type",
          "example": "Call Outgoing"
        },
        "status": {
          "type": "string",
          "description": "CRM Status",
          "example": "Open"
        },
        "dateTime": {
          "type": "string",
          "format": "dateTime",
          "description": "CRM Date & Time",
          "example": "2017-01-01 16:00:00"
        },
        "dateTimeCompleted": {
          "type": "string",
          "format": "dateTime",
          "description": "CRM Date & Time completed",
          "example": "2017-01-01 16:00:00"
        },
        "assignedto": {
          "type": "string",
          "description": "CRM Assigned to user",
          "example": "user1"
        },
        "completedby": {
          "type": "string",
          "description": "CRM Completed by user",
          "example": "user1"
        },
        "documents": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "uid": {
                "type": "string",
                "format": "uuid",
                "description": "Uniquely identifies a Document",
                "example": "321434-2342-234-234",
                "maxLength": 40
              },
              "description": {
                "type": "string",
                "description": "Document Description",
                "example": "Form 17.1 - Nedbank"
              },
              "documenttype": {
                "type": "string",
                "description": "Document Type",
                "example": "Form 17.1"
              },
              "filename": {
                "type": "string",
                "description": "Document Filename",
                "example": "Form 17.1 - Nedbank.pdf"
              },
              "obligation-uid": {
                "type": "string",
                "format": "uuid",
                "description": "Uniquely identifies a document obligation",
                "example": "321434-2342-234-234",
                "maxLength": 40
              }
            }
          },
          "description": "Documents attached on the CRM",
          "minItems": 0,
          "maxItems": 100
        }
      }
    }
  }
}