UNPKG

@accounter/green-invoice-graphql

Version:
2,697 lines 71.3 kB
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "addExpenseRequest": {
      "$ref": "#/definitions/Expense"
    },
    "addExpenseResponse": {
      "oneOf": [
        {
          "$ref": "#/definitions/Expense"
        },
        {
          "$ref": "#/definitions/ErrorResponse"
        }
      ]
    },
    "addDocumentRequest": {
      "description": "Add a document to the current business",
      "additionalProperties": false,
      "allOf": [
        { "$ref": "#/definitions/DocumentInputNew" },
        {
          "properties": {
            "emailContent": {
              "type": "string",
              "description": "Email content to send with the document"
            },
            "attachment": {
              "type": "boolean",
              "description": "Whether to attach the document to the email"
            }
          }
        }
      ]
    },
    "addDocumentResponse": {
      "oneOf": [
        {
          "$ref": "#/definitions/AddedDocument"
        },
        {
          "$ref": "#/definitions/ErrorResponse"
        }
      ]
    },
    "closeDocumentResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {}
    },
    "previewDocumentRequest": {
      "description": "Previews a document before the actual generation",
      "additionalProperties": false,
      "$ref": "#/definitions/DocumentInputNew"
    },
    "previewDocumentResponse": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "file": {
              "description": "Preview document file in Base64",
              "type": "string"
            }
          },
          "required": ["file"]
        },
        {
          "$ref": "#/definitions/ErrorResponse"
        }
      ]
    },
    "addExpenseDraftByFileRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [],
      "properties": {
        "file": {
          "type": "string",
          "description": "The file, in Base64, allowed types: GIF, PNG, JPG, SVG, PDF"
        }
      }
    },
    "addExpenseDraftByFileResponse": {
      "$ref": "#/definitions/GetExpenseDraft"
    },
    "generalErrorResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "errorCode:": {
          "type": "integer"
        },
        "errorMessage": {
          "type": ["string", "null"]
        }
      }
    },
    "getClientResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/definitions/ClientId"
        },
        "name": {
          "$ref": "#/definitions/ClientName"
        },
        "active": {
          "type": "boolean",
          "description": "Is the client currently active or not"
        },
        "taxId": {
          "type": "string",
          "description": "The client tax ID",
          "examples": ["0123456789"]
        },
        "paymentTerms": {
          "type": "integer",
          "description": "The client payment term, default is 0",
          "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
        },
        "bankName": {
          "type": "string",
          "description": "The client bank name"
        },
        "bankBranch": {
          "type": "string",
          "description": "The client bank branch"
        },
        "bankAccount": {
          "type": "string",
          "description": "The supplier bank account number"
        },
        "country": {
          "$ref": "#/definitions/Country"
        },
        "phone": {
          "$ref": "#/definitions/ClientPhone"
        },

        "mobile": {
          "type": "string",
          "description": "The supplier mobile number"
        },
        "contactPerson": {
          "type": "string",
          "description": "The supplier contact person name"
        },
        "emails": {
          "$ref": "#/definitions/ClientEmails"
        },
        "labels": {
          "type": "array",
          "additionalItems": false,
          "items": {
            "type": "string"
          }
        },
        "creationDate": {
          "$ref": "#/definitions/CreationDate"
        },
        "lastUpdateDate": {
          "type": "integer",
          "description": "The last update date of the supplier, in UNIX timestamp format"
        },
        "send": {
          "type": "boolean",
          "description": "Whether to send emails to the user automatically when assigning him to an invoice or not"
        },
        "department": {
          "type": "string",
          "description": "The supplier department"
        },
        "accountingKey": {
          "type": "string",
          "description": "The supplier accounting key"
        },
        "address": {
          "type": "string",
          "description": "The supplier address"
        },
        "city": {
          "type": "string",
          "description": "The supplier city"
        },
        "zip": {
          "type": "string",
          "description": "The supplier zip code"
        },
        "category": {
          "type": "integer",
          "description": "The category this client is related to"
        },
        "subCategory": {
          "type": "integer",
          "description": "The sub category this client is related to"
        },
        "fax": {
          "type": "string",
          "description": "Client fax"
        },
        "remarks": {
          "type": "string",
          "description": "Client remarks for self use",
          "example": "Customer approved 2016 sales"
        },
        "incomeAmount": {
          "type": "number",
          "description": "The amount of incomes from the customer"
        },
        "paymentAmount": {
          "type": "number"
        },
        "balanceAmount": {
          "type": "number",
          "description": "The balance amount of the client"
        }
      }
    },
    "getExpenseRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id"],
      "properties": {
        "id": {
          "type": "string",
          "description": "The expense ID"
        }
      }
    },
    "getExpenseResponse": {
      "$ref": "#/definitions/GetExpense"
    },
    "getDocumentResponse": {
      "$ref": "#/definitions/Document"
    },
    "getLinkedDocumentsResponse": {
      "$ref": "#/definitions/GetLinkedDocuments"
    },
    "updateExpenseRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id"],
      "properties": {
        "id": {
          "type": "string",
          "description": "The expense ID"
        },
        "paymentType": {
          "description": "Payment method",
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": ["string", "number"],
              "enum": ["1", "2", "3", "4", "5", "10", "11", 1, 2, 3, 4, 5, 10, 11]
            }
          ]
        },
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "vat": {
          "$ref": "#/definitions/Vat"
        },
        "amount": {
          "type": "number",
          "description": "The total amount of the expense"
        },
        "date": {
          "type": "string",
          "description": "Date of the expense"
        },
        "dueDate": {
          "type": "string",
          "description": "Due date of the expense"
        },
        "reportingDate": {
          "type": "string",
          "description": "Reporting date of the expense"
        },
        "documentType": {
          "$ref": "#/definitions/ExpenseDocumentType"
        },
        "number": {
          "type": "string",
          "description": "Number of the expense"
        },
        "description": {
          "type": "string",
          "description": "Description for the expense"
        },
        "remarks": {
          "type": "string",
          "string": "Remarks for the expense"
        },
        "supplier": {
          "$ref": "#/definitions/Supplier"
        },
        "accountingClassification": {
          "$ref": "#/definitions/AccountingClassification"
        },
        "active": {
          "type": "boolean",
          "description": "Is the expense active or not"
        }
      }
    },
    "updateExpenseResponse": {
      "oneOf": [
        {
          "$ref": "#/definitions/GetExpense"
        },
        {
          "$ref": "#/definitions/ErrorResponse"
        }
      ]
    },
    "searchExpenseDraftsRequest": {
      "type": "object",
      "additionalProperties": false,
      "required": [],
      "properties": {
        "fromDate": {
          "type": "string",
          "description": "Expense drafts that were created after the specified date in the format YYYY-MM-DD",
          "format": "YYYY-MM-DD"
        },
        "toDate": {
          "type": "string",
          "description": "Expense drafts that were created until the specified date in the format YYYY-MM-DD",
          "format": "YYYY-MM-DD"
        },
        "description": {
          "type": "string",
          "description": "Expense draft description"
        },
        "supplierId": {
          "type": "string",
          "description": "Supplier's ID"
        },
        "supplierName": {
          "type": "string",
          "description": "Supplier's name"
        },
        "page": {
          "type": "number",
          "description": "Page requested"
        },
        "pageSize": {
          "type": "number",
          "description": "Results per page"
        }
      }
    },
    "searchExpenseDraftsResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": ["page", "pageSize", "total", "pages", "items", "aggregations"],
      "properties": {
        "total": {
          "type": "number",
          "description": "The total length of the items that were retrieved"
        },
        "from": {
          "type": "number"
        },
        "to": {
          "type": "number"
        },
        "page": {
          "type": "number",
          "description": "The page that was requested to retrieve"
        },
        "pageSize": {
          "type": "number",
          "description": "The page size that was requested"
        },
        "pages": {
          "type": "number",
          "description": "The amount of pages that exist"
        },
        "aggregations": {
          "type": "object",
          "additionalProperties": false,
          "required": ["totalAmount"],
          "properties": {
            "totalAmount": {
              "type": "object",
              "additionalProperties": false,
              "required": ["value"],
              "properties": {
                "value": {
                  "type": "number"
                }
              }
            }
          }
        },
        "items": {
          "type": "array",
          "additionalItems": false,
          "description": "The expense drafts that were found",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "description": "Partial Expense",
            "required": [
              "id",
              "status",
              "creationDate",
              "lastUpdateDate",
              "reportingPeriod",
              "hasDefaultValues",
              "url",
              "thumbnail",
              "expense"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "creationDate": {
                "$ref": "#/definitions/CreationDate"
              },
              "lastUpdateDate": {
                "type": "number"
              },
              "reportingPeriod": {
                "type": "string"
              },
              "hasDefaultValues": {
                "type": "boolean"
              },
              "url": {
                "type": "string"
              },
              "thumbnail": {
                "type": "string"
              },
              "expense": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "accountingClassification",
                  "active",
                  "addRecipient",
                  "confirmFromEdit",
                  "currency",
                  "currencyRate",
                  "description",
                  "documentType",
                  "fileHash",
                  "fileKey",
                  "labels",
                  "reportingDate",
                  "supplier",
                  "tags",
                  "texts",
                  "vat"
                ],
                "properties": {
                  "accountingClassification": {
                    "$ref": "#/definitions/AccountingClassification"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Is the expense active or not"
                  },
                  "addRecipient": {
                    "type": "boolean",
                    "description": "Should we save the supplier or not (by setting this to true you are required to add a supplier)"
                  },
                  "amount": {
                    "type": "number",
                    "description": "The total amount of the expense"
                  },
                  "confirmFromEdit": {
                    "type": "boolean"
                  },
                  "currency": {
                    "$ref": "#/definitions/Currency"
                  },
                  "currencyRate": {
                    "$ref": "#/definitions/CurrencyRate"
                  },
                  "date": {
                    "type": "string",
                    "description": "Date of the expense"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description for the expense"
                  },
                  "documentType": {
                    "$ref": "#/definitions/ExpenseDocumentType"
                  },
                  "fileHash": {
                    "type": "string",
                    "description": "File hash"
                  },
                  "fileKey": {
                    "type": "string",
                    "description": "Key of the file location"
                  },
                  "labels": {
                    "type": "array",
                    "additionalItems": false,
                    "items": {
                      "type": "string"
                    }
                  },
                  "number": {
                    "type": ["string", "null"],
                    "description": "Number of the expense"
                  },
                  "paymentType": {
                    "description": "Payment method",
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": ["string", "number"],
                        "enum": ["1", "2", "3", "4", "5", "10", "11", 1, 2, 3, 4, 5, 10, 11]
                      }
                    ]
                  },
                  "reportingDate": {
                    "type": "string",
                    "description": "Reporting date of the expense"
                  },
                  "supplier": {
                    "$ref": "#/definitions/Supplier"
                  },
                  "tags": {
                    "type": "array",
                    "additionalItems": false,
                    "items": {
                      "type": "string"
                    }
                  },
                  "texts": {
                    "type": "array",
                    "additionalItems": false,
                    "items": {
                      "type": "string"
                    }
                  },
                  "vat": {
                    "$ref": "#/definitions/Vat"
                  }
                }
              }
            }
          }
        }
      }
    },
    "searchExpensesRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "fromDate": {
          "type": "string",
          "description": "Expense that were created after the specified date in the format YYYY-MM-DD"
        },
        "toDate": {
          "type": "string",
          "description": "Expense that were created until the specified date in the format YYYY-MM-DD"
        },
        "dueDate": {
          "type": "string",
          "description": "Due date of the expense, in the format YYYY-MM-DD"
        },
        "description": {
          "type": "string",
          "description": "Expense description"
        },
        "supplierId": {
          "type": "string",
          "description": "Supplier's ID"
        },
        "supplierName": {
          "type": "string",
          "description": "Supplier's name"
        },
        "number": {
          "type": "string",
          "description": "Expense serial number"
        },
        "paid": {
          "type": "boolean",
          "description": "Filter expenses that are only paid or unpaid, if not added to the request, will return both"
        },
        "reported": {
          "type": "boolean",
          "description": "Filter expenses that are only reported or unreported, if not added to the request, will return both"
        },
        "sort": {
          "type": "string",
          "description": "The field to sort the results by"
        },
        "minAmount": {
          "type": "number",
          "description": "Min amount of the expense"
        },
        "maxAmount": {
          "type": "number",
          "description": "Max amount of the expense"
        },
        "page": {
          "type": "number",
          "description": "Page requested"
        },
        "pageSize": {
          "type": "number",
          "description": "Results per page"
        }
      },
      "required": ["minAmount", "maxAmount", "page", "pageSize"]
    },
    "searchExpensesResponse": {
      "type": "object",
      "properties": {
        "total": {
          "type": "number",
          "description": "The total length of the items that were retrieved"
        },
        "page": {
          "type": "number",
          "description": "The page that was requested to retrieve"
        },
        "pageSize": {
          "type": "number",
          "description": "The page size that was requested"
        },
        "pages": {
          "type": "number",
          "description": "The amount of pages that exist"
        },
        "items": {
          "$ref": "#/definitions/GetExpense"
        }
      }
    },
    "searchDocumentsRequest": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "page": {
          "type": "number",
          "description": "Page requested"
        },
        "pageSize": {
          "type": "number",
          "description": "Results per page"
        },
        "number": {
          "$ref": "#/definitions/DocumentTaxNumber"
        },
        "type": {
          "type": "array",
          "description": "Document type",
          "items": {
            "$ref": "#/definitions/DocumentType"
          }
        },
        "status": {
          "type": "array",
          "description": "Document status",
          "items": {
            "type": "number",
            "enum": [0, 1, 2, 3, 4]
          }
        },
        "paymentTypes": {
          "type": "array",
          "description": "Payment types used in this document",
          "items": {
            "type": "number",
            "enum": [-1, 0, 1, 2, 3, 4, 5, 10, 11]
          }
        },
        "fromDate": {
          "type": "string",
          "description": "Documents that were created after the specified date in the format YYYY-MM-DD",
          "format": "YYYY-MM-DD"
        },
        "toDate": {
          "type": "string",
          "description": "Documents that were created until the specified date in the format YYYY-MM-DD",
          "format": "YYYY-MM-DD"
        },
        "clientId": {
          "type": "string",
          "description": "Client ID"
        },
        "clientName": {
          "type": "string",
          "description": "Client name"
        },
        "description": {
          "type": "string",
          "description": "Document description"
        },
        "download": {
          "type": "boolean",
          "description": "Whether document was downloaded by client"
        },
        "sort": {
          "enum": ["documentDate", "creationDate"]
        }
      },
      "required": []
    },
    "searchDocumentsResponse": {
      "type": "object",
      "properties": {
        "total": {
          "type": "number",
          "description": "The total length of the items that were retrieved"
        },
        "page": {
          "type": "number",
          "description": "The page that was requested to retrieve"
        },
        "pageSize": {
          "type": "number",
          "description": "The page size that was requested"
        },
        "pages": {
          "type": "number",
          "description": "The amount of pages that exist"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Document"
          }
        }
      },
      "required": ["total", "page", "pageSize", "pages", "items"]
    },
    "getFileUploadUrlResponse": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "File Upload URL"
        },
        "fields": {
          "type": "object",
          "properties": {
            "otherField": {
              "type": "string"
            },
            "bucket": {
              "type": "string"
            },
            "key": {
              "type": "string"
            },
            "Policy": {
              "type": "string"
            },
            "x-amz-meta-account-id": {
              "type": "string"
            },
            "x-amz-meta-user-id": {
              "type": "string"
            },
            "x-amz-meta-business-id": {
              "type": "string"
            },
            "x-amz-meta-file-context": {
              "type": "string"
            },
            "x-amz-meta-file-data": {
              "type": "string"
            },
            "X-Amz-Algorithm": {
              "type": "string"
            },
            "X-Amz-Credential": {
              "type": "string"
            },
            "X-Amz-Date": {
              "type": "string"
            },
            "X-Amz-Security-Token": {
              "type": "string"
            },
            "X-Amz-Signature": {
              "type": "string"
            }
          }
        }
      },
      "required": ["url", "fields"]
    },
    "getBankTransactionsResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "size": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        },
        "pages": {
          "type": "integer"
        },
        "page": {
          "type": "integer"
        },
        "from": {
          "type": "integer"
        },
        "to": {
          "type": "integer"
        },
        "aggregations": {
          "type": "object",
          "additionalProperties": false
        },
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BankTransaction"
          }
        }
      },
      "required": []
    },
    "AccountingClassification": {
      "type": "object",
      "additionalProperties": false,
      "description": "Account classification of the expense",
      "properties": {
        "id": {
          "type": "string",
          "description": "The classification ID, see 'Get Accounting Classifications' endpoint"
        },
        "key": {
          "type": "string",
          "description": "The classification key"
        },
        "code": {
          "type": "string",
          "description": "The classification code"
        },
        "title": {
          "type": "string",
          "description": "The classification title"
        },
        "irsCode": {
          "type": "number",
          "description": "The classification IRS code",
          "enum": [
            1306, 1307, 1310, 1320, 1330, 1340, 1390, 3011, 3012, 3015, 3055, 3060, 3066, 3067,
            3068, 3070, 3075, 3080, 3085, 3090, 3100, 3120, 3511, 3512, 3515, 3520, 3535, 3540,
            3545, 3550, 3555, 3560, 3566, 3567, 3568, 3570, 3575, 3580, 3590, 3595, 3600, 3620,
            3625, 3640, 3650, 3660, 3665, 3680, 5010, 5090, 8040, 8050, 8060, 8080, 8090
          ]
        },
        "income": {
          "type": "number",
          "description": "The classification income"
        },
        "type": {
          "type": "number",
          "description": "The classification type"
        },
        "vat": {
          "type": "number",
          "description": "The classification VAT"
        }
      }
    },
    "BankTransaction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "The transaction ID"
        },
        "aspspCode": {
          "type": "string",
          "description": "The bank code",
          "enum": ["12"]
        },
        "businessId": {
          "type": "string",
          "description": "The business ID"
        },
        "createdAt": {
          "type": "number",
          "description": "The creation date timestamp"
        },
        "updatedAt": {
          "type": "number",
          "description": "The update date timestamp"
        },
        "status": {
          "type": "integer"
        },
        "classification": {
          "type": "integer"
        },
        "bookingStatus": {
          "type": "string",
          "description": "The booking status",
          "enum": ["booked"]
        },
        "source": {
          "type": "string",
          "description": "The source of the transaction",
          "enum": ["bank"]
        },
        "amount": {
          "type": "number",
          "description": "The amount of the transaction"
        },
        "resourceId": {
          "type": "string",
          "description": "The resource ID"
        },
        "creditorName": {
          "type": ["string", "null"],
          "description": "The creditor name"
        },
        "creditorAccount": {
          "type": ["string", "null"],
          "description": "The creditor account"
        },
        "currency": { "$ref": "#/definitions/Currency" },
        "valueDate": {
          "type": "string",
          "description": "Value date of the transaction"
        },
        "bookingDate": {
          "type": "string",
          "description": "Booking date of the transaction"
        },
        "checkId": {
          "type": ["string", "null"],
          "description": "The check ID"
        },
        "description": {
          "type": "string"
        },
        "debtorName": {
          "type": ["string", "null"],
          "description": "The debtor name"
        },
        "debtorAccount": {
          "type": ["string", "null"],
          "description": "The debtor account"
        },
        "type": {
          "type": "string",
          "description": "The type of the transaction",
          "enum": ["credit", "debt"]
        },
        "name": { "type": "string" },
        "date": {
          "type": "string"
        },
        "iban": {
          "type": "string",
          "description": "The IBAN of the transaction"
        }
      }
    },
    "Business": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "accountantDocsEmailSettings": {
          "type": "number"
        },
        "accountantEmails": {
          "type": "array"
        },
        "accountantReportEmailSettings": {
          "type": "number"
        },
        "accountingType": {
          "type": "number"
        },
        "active": {
          "type": "boolean"
        },
        "advanceNationalInsuranceRate": {
          "type": "number"
        },
        "advanceTaxRate": {
          "type": "number"
        },
        "bankDisplay": {
          "type": "boolean"
        },
        "bankDisplayEn": {
          "type": "boolean"
        },
        "deductionRate": {
          "type": "number"
        },
        "documentsEmailSettings": {
          "type": "number"
        },
        "emailSubjectType": {
          "type": "number"
        },
        "exemption": {
          "type": "boolean",
          "description": "Is the business exemption free or not",
          "examples": [false]
        },
        "incomeReportEmailSettings": {
          "type": "number"
        },
        "incomeReportFormatType": {
          "type": "number"
        },
        "reportSendingDay": {
          "type": "number"
        },
        "senderEmailSettings": {
          "type": "number"
        },
        "type": {
          "type": "number",
          "description": "The business type ID",
          "enum": [1, 2, 3, 4, 5, 6]
        }
      },
      "required": [
        "accountantDocsEmailSettings",
        "accountantEmails",
        "accountantReportEmailSettings",
        "accountingType",
        "active",
        "advanceNationalInsuranceRate",
        "advanceTaxRate",
        "bankDisplay",
        "bankDisplayEn",
        "deductionRate",
        "documentsEmailSettings",
        "emailSubjectType",
        "exemption",
        "incomeReportEmailSettings",
        "incomeReportFormatType",
        "reportSendingDay",
        "senderEmailSettings",
        "type"
      ]
    },
    "Client": {
      "allOf": [
        { "$ref": "#/definitions/ClientCore" },
        {
          "additionalProperties": false,
          "properties": {
            "country": {
              "$ref": "#/definitions/Country"
            },
            "emails": {
              "$ref": "#/definitions/ClientEmails"
            },
            "id": {
              "$ref": "#/definitions/ClientId"
            },
            "name": {
              "$ref": "#/definitions/ClientName"
            },
            "phone": {
              "$ref": "#/definitions/ClientPhone"
            },
            "self": {
              "$ref": "#/definitions/ClientSelf"
            }
          },
          "required": ["country", "emails", "id", "name", "phone", "self"]
        }
      ]
    },
    "ClientCore": {
      "type": "object",
      "properties": {
        "country": {
          "$ref": "#/definitions/Country"
        },
        "emails": {
          "$ref": "#/definitions/ClientEmails"
        },
        "id": {
          "$ref": "#/definitions/ClientId"
        },
        "name": {
          "$ref": "#/definitions/ClientName"
        },
        "phone": {
          "$ref": "#/definitions/ClientPhone"
        },
        "taxId": {
          "type": "string",
          "description": "The client tax ID",
          "examples": ["0123456789"]
        },
        "self": {
          "$ref": "#/definitions/ClientSelf"
        }
      }
    },
    "ClientEmails": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "ClientId": {
      "type": "string",
      "description": "The client ID",
      "examples": ["8b338c95-095e-46d4-b2c6-331747508759"]
    },
    "ClientName": {
      "type": "string",
      "description": "The client name",
      "examples": ["לקוח אפ3"]
    },
    "ClientPhone": {
      "type": "string"
    },
    "ClientSelf": {
      "type": "boolean",
      "description": "Whether the client is self",
      "examples": [false]
    },
    "Country": {
      "type": "string",
      "description": "2-letter ISO supplier country code, default is IL",
      "enum": [
        "UG",
        "UZ",
        "AT",
        "AU",
        "UA",
        "UY",
        "AZ",
        "CX",
        "AE",
        "IT",
        "BS",
        "GS",
        "UM",
        "VI",
        "VG",
        "HM",
        "TC",
        "MP",
        "MH",
        "SB",
        "FO",
        "FK",
        "FJ",
        "KM",
        "CK",
        "CC",
        "KY",
        "ID",
        "IS",
        "IE",
        "IR",
        "SV",
        "AL",
        "DZ",
        "AX",
        "AO",
        "AI",
        "AD",
        "AQ",
        "AG",
        "EE",
        "AF",
        "EC",
        "AR",
        "US",
        "AW",
        "ER",
        "AM",
        "ET",
        "BT",
        "BV",
        "BW",
        "BG",
        "BO",
        "BA",
        "BI",
        "BF",
        "BH",
        "BY",
        "BE",
        "BZ",
        "BD",
        "BJ",
        "BB",
        "BN",
        "BR",
        "GB",
        "BM",
        "DJ",
        "JM",
        "JE",
        "GA",
        "GE",
        "GH",
        "GT",
        "GU",
        "GP",
        "GY",
        "GI",
        "GN",
        "GW",
        "GQ",
        "GF",
        "GM",
        "GL",
        "DE",
        "GD",
        "GG",
        "DM",
        "DK",
        "ZA",
        "SS",
        "KR",
        "IM",
        "NF",
        "HT",
        "MV",
        "BQ",
        "IN",
        "NL",
        "HK",
        "HU",
        "HN",
        "IO",
        "TF",
        "PH",
        "DO",
        "CD",
        "CF",
        "PS",
        "WF",
        "VN",
        "VU",
        "VE",
        "VA",
        "ZW",
        "ZM",
        "CI",
        "TJ",
        "TV",
        "TG",
        "TO",
        "TN",
        "TK",
        "TR",
        "TM",
        "TW",
        "TZ",
        "TT",
        "GR",
        "JP",
        "JO",
        "IL",
        "KW",
        "CV",
        "LA",
        "LB",
        "LY",
        "LU",
        "LV",
        "LR",
        "LT",
        "LI",
        "LS",
        "MR",
        "MU",
        "ML",
        "MG",
        "MZ",
        "MD",
        "MN",
        "ME",
        "MS",
        "MC",
        "TL",
        "MM",
        "YT",
        "FM",
        "MW",
        "MY",
        "MT",
        "EG",
        "MO",
        "MK",
        "MX",
        "MA",
        "MQ",
        "NR",
        "NO",
        "NG",
        "NZ",
        "NU",
        "NE",
        "NI",
        "NA",
        "NP",
        "ST",
        "SJ",
        "EH",
        "SD",
        "SZ",
        "SO",
        "SY",
        "SR",
        "SL",
        "SC",
        "CN",
        "SG",
        "SI",
        "SK",
        "WS",
        "AS",
        "BL",
        "MF",
        "SM",
        "PM",
        "SN",
        "SH",
        "VC",
        "LC",
        "SX",
        "KN",
        "SA",
        "ES",
        "RS",
        "LK",
        "OM",
        "IQ",
        "PW",
        "PL",
        "PF",
        "PR",
        "PT",
        "PN",
        "FI",
        "PA",
        "PG",
        "PK",
        "PY",
        "PE",
        "TD",
        "CL",
        "CZ",
        "KP",
        "FR",
        "CU",
        "CO",
        "CG",
        "XK",
        "CR",
        "CW",
        "KZ",
        "QA",
        "KG",
        "KI",
        "NC",
        "KH",
        "CM",
        "CA",
        "KE",
        "CY",
        "HR",
        "RE",
        "RW",
        "RO",
        "RU",
        "SE",
        "CH",
        "TH",
        "YE"
      ]
    },
    "Currency": {
      "type": "string",
      "description": "3-letter ISO item currency code",
      "enum": [
        "ILS",
        "USD",
        "EUR",
        "GBP",
        "JPY",
        "CHF",
        "CNY",
        "AUD",
        "CAD",
        "RUB",
        "BRL",
        "HKD",
        "SGD",
        "THB",
        "MXN",
        "TRY",
        "NZD",
        "SEK",
        "NOK",
        "DKK",
        "KRW",
        "INR",
        "IDR",
        "PLN",
        "RON",
        "ZAR",
        "HRK"
      ]
    },
    "AddedDocument": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/definitions/DocumentId"
        },
        "lang": {
          "$ref": "#/definitions/DocumentLang"
        },
        "number": {
          "$ref": "#/definitions/DocumentSerialNumber"
        },
        "signed": {
          "$ref": "#/definitions/DocumentSigned"
        },
        "url": {
          "$ref": "#/definitions/Url"
        }
      },
      "required": ["id", "lang", "number", "signed", "url"]
    },
    "Document": {
      "description": "A Single Document",
      "additionalProperties": false,
      "properties": {
        "amount": {
          "$ref": "#/definitions/DocumentAmount"
        },
        "amountDueVat": {
          "$ref": "#/definitions/DocumentAmountDueVat"
        },
        "amountDueVatLocal": {
          "$ref": "#/definitions/DocumentAmountDueVatLocal"
        },
        "amountExcludeVat": {
          "$ref": "#/definitions/DocumentAmountExcludeVat"
        },
        "amountExemptVat": {
          "$ref": "#/definitions/DocumentAmountExemptVat"
        },
        "amountLocal": {
          "$ref": "#/definitions/DocumentAmountLocal"
        },
        "amountOpened": {
          "$ref": "#/definitions/DocumentAmountOpened"
        },
        "business": {
          "$ref": "#/definitions/Business"
        },
        "calculatedAmountLocal": {
          "type": "number"
        },
        "calculatedAmountOpenedLocal": {
          "type": "number"
        },
        "calculatedIncomeAmountExcludeLocal": {
          "type": "number"
        },
        "calculatedIncomeAmountLocal": {
          "type": "number"
        },
        "calculatedPaymentAmountLocal": {
          "type": "number"
        },
        "cancellable": {
          "type": "boolean"
        },
        "cancelType": {
          "type": "number"
        },
        "client": {
          "$ref": "#/definitions/Client"
        },
        "creationDate": {
          "$ref": "#/definitions/CreationDate"
        },
        "currency": { "$ref": "#/definitions/Currency" },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "data": {
          "$ref": "#/definitions/DocumentData"
        },
        "description": {
          "$ref": "#/definitions/DocumentDescription"
        },
        "documentDate": {
          "$ref": "#/definitions/DocumentDate"
        },
        "downloaded": {
          "type": "boolean"
        },
        "footer": {
          "$ref": "#/definitions/DocumentFooter"
        },
        "id": {
          "$ref": "#/definitions/DocumentId"
        },
        "income": {
          "$ref": "#/definitions/DocumentIncome"
        },
        "lang": {
          "$ref": "#/definitions/DocumentLang"
        },
        "linkedDocuments": {
          "$ref": "#/definitions/DocumentLinkedDocuments"
        },
        "number": {
          "$ref": "#/definitions/DocumentTaxNumber"
        },
        "payment": {
          "$ref": "#/definitions/DocumentPayment"
        },
        "ref": {
          "$ref": "#/definitions/DocumentRef"
        },
        "remarks": {
          "$ref": "#/definitions/DocumentRemarks"
        },
        "reverseCharge": {
          "type": "boolean"
        },
        "rounding": {
          "$ref": "#/definitions/DocumentRounding"
        },
        "signed": {
          "$ref": "#/definitions/DocumentSigned"
        },
        "skinId": {
          "type": "number"
        },
        "status": {
          "$ref": "#/definitions/DocumentStatus"
        },
        "taxConfirmationEligible": {
          "type": "boolean"
        },
        "templateId": {
          "type": "number"
        },
        "type": {
          "$ref": "#/definitions/DocumentType"
        },
        "url": {
          "$ref": "#/definitions/Url"
        },
        "userName": {
          "type": "string"
        },
        "vat": {
          "$ref": "#/definitions/Vat"
        },
        "vatLocal": {
          "type": "number"
        },
        "vatRate": {
          "$ref": "#/definitions/VatRate"
        },
        "vatType": {
          "$ref": "#/definitions/VatType"
        }
      },
      "required": [
        "amount",
        "amountDueVat",
        "amountDueVatLocal",
        "amountExcludeVat",
        "amountExemptVat",
        "amountLocal",
        "amountOpened",
        "business",
        "calculatedAmountLocal",
        "calculatedAmountOpenedLocal",
        "calculatedIncomeAmountExcludeLocal",
        "calculatedIncomeAmountLocal",
        "calculatedPaymentAmountLocal",
        "cancellable",
        "client",
        "creationDate",
        "currency",
        "currencyRate",
        "data",
        "description",
        "documentDate",
        "downloaded",
        "id",
        "income",
        "lang",
        "number",
        "payment",
        "ref",
        "reverseCharge",
        "rounding",
        "signed",
        "skinId",
        "status",
        "taxConfirmationEligible",
        "templateId",
        "type",
        "url",
        "vat",
        "vatRate",
        "vatType"
      ]
    },
    "DocumentInputNew": {
      "properties": {
        "description": {
          "$ref": "#/definitions/DocumentDescription"
        },
        "remarks": {
          "$ref": "#/definitions/DocumentRemarks"
        },
        "footer": {
          "$ref": "#/definitions/DocumentFooter"
        },
        "type": {
          "$ref": "#/definitions/DocumentType"
        },
        "date": {
          "description": "Document date in the format YYYY-MM-DD",
          "type": "string"
        },
        "dueDate": {
          "description": "Document payment due date in the format YYYY-MM-DD",
          "type": "string"
        },
        "lang": {
          "$ref": "#/definitions/DocumentLang"
        },
        "currency": { "$ref": "#/definitions/Currency" },
        "vatType": {
          "$ref": "#/definitions/VatType"
        },
        "discount": {
          "$ref": "#/definitions/DocumentDiscount"
        },
        "rounding": {
          "$ref": "#/definitions/DocumentRounding"
        },
        "signed": {
          "$ref": "#/definitions/DocumentSigned"
        },
        "maxPayments": {
          "description": "Max payments allowed (valid only on supported accounts)",
          "type": "integer"
        },
        "client": {
          "allOf": [
            { "$ref": "#/definitions/ClientCore" },
            {
              "type": "object",
              "properties": {
                "address": {
                  "type": "string",
                  "description": "Client address"
                },
                "city": {
                  "type": "string",
                  "description": "Client city"
                },
                "zip": {
                  "type": "string",
                  "description": "Client zip code"
                },
                "fax": {
                  "type": "string",
                  "description": "Client fax"
                },
                "mobile": {
                  "type": "string",
                  "description": "The client mobile number"
                },
                "add": {
                  "type": "boolean",
                  "description": "Add a temporary client to the clients' list"
                }
              }
            },
            { "required": ["id"] }
          ]
        },
        "income": {
          "$ref": "#/definitions/DocumentIncome"
        },
        "payment": {
          "$ref": "#/definitions/DocumentPayment"
        },
        "linkedDocumentIds": {
          "description": "Linked document IDs. allows you to state the related / relevant documents, e.g.: when creating a receipt, attach your original invoice document ID as one of the ids in the linkedDocumentIds - this in turn will automatically close the original invoice if needed.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "linkedPaymentId": {
          "description": "Linked payment ID (valid for document type 305 only). allows you to define the paymentId that the document is going to be relevant to, this can be attached only to invoice documents (type 305).",
          "type": "string"
        },
        "linkType": {
          "description": "Reference type (applicable only when using linkedDocumentIds)",
          "type": "string",
          "enum": ["LINK", "CANCEL"]
        }
      },
      "required": ["type", "lang", "currency", "vatType"]
    },
    "DocumentCore": {
      "type": "object",
      "properties": {
        "amount": {
          "$ref": "#/definitions/DocumentAmount"
        },
        "amountDueVat": {
          "$ref": "#/definitions/DocumentAmountDueVat"
        },
        "amountExcludeVat": {
          "$ref": "#/definitions/DocumentAmountExcludeVat"
        },
        "amountExemptVat": {
          "$ref": "#/definitions/DocumentAmountExemptVat"
        },
        "amountLocal": {
          "$ref": "#/definitions/DocumentAmountLocal"
        },
        "amountOpened": {
          "$ref": "#/definitions/DocumentAmountOpened"
        },
        "business": {
          "$ref": "#/definitions/Business"
        },
        "calculatedAmountLocal": {
          "type": "number"
        },
        "calculatedAmountOpenedLocal": {
          "type": "number"
        },
        "calculatedIncomeAmountExcludeLocal": {
          "type": "number"
        },
        "calculatedIncomeAmountLocal": {
          "type": "number"
        },
        "calculatedPaymentAmountLocal": {
          "type": "number"
        },
        "cancellable": {
          "type": "boolean"
        },
        "cancelType": {
          "type": "number"
        },
        "client": {
          "$ref": "#/definitions/ClientCore"
        },
        "creationDate": {
          "$ref": "#/definitions/CreationDate"
        },
        "currency": { "$ref": "#/definitions/Currency" },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "data": {
          "$ref": "#/definitions/DocumentData"
        },
        "description": {
          "$ref": "#/definitions/DocumentDescription"
        },
        "documentDate": {
          "$ref": "#/definitions/DocumentDate"
        },
        "downloaded": {
          "type": "boolean"
        },
        "id": {
          "$ref": "#/definitions/DocumentId"
        },
        "income": {
          "$ref": "#/definitions/DocumentIncome"
        },
        "lang": {
          "$ref": "#/definitions/DocumentLang"
        },
        "number": {
          "$ref": "#/definitions/DocumentTaxNumber"
        },
        "payment": {
          "$ref": "#/definitions/DocumentPayment"
        },
        "ref": {
          "$ref": "#/definitions/DocumentRef"
        },
        "remarks": {
          "$ref": "#/definitions/DocumentRemarks"
        },
        "reverseCharge": {
          "type": "boolean"
        },
        "rounding": {
          "$ref": "#/definitions/DocumentRounding"
        },
        "signed": {
          "$ref": "#/definitions/DocumentSigned"
        },
        "skinId": {
          "type": "number"
        },
        "status": {
          "$ref": "#/definitions/DocumentStatus"
        },
        "templateId": {
          "type": "number"
        },
        "type": {
          "$ref": "#/definitions/DocumentType"
        },
        "url": {
          "$ref": "#/definitions/Url"
        },
        "vat": {
          "$ref": "#/definitions/Vat"
        },
        "vatRate": {
          "$ref": "#/definitions/VatRate"
        },
        "vatType": {
          "$ref": "#/definitions/VatType"
        }
      }
    },
    "Expense": {
      "allOf": [
        { "$ref": "#/definitions/ExpensePartial" },
        {
          "required": [
            "currency",
            "vat",
            "amount",
            "date",
            "reportingDate",
            "documentType",
            "number",
            "supplier",
            "accountingClassification"
          ]
        }
      ]
    },
    "ExpensePartial": {
      "type": "object",
      "additionalProperties": false,
      "description": "A Single Expense",
      "properties": {
        "paymentType": {
          "description": "Payment method",
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": ["string", "number"],
              "enum": ["1", "2", "3", "4", "5", "10", "11", 1, 2, 3, 4, 5, 10, 11]
            }
          ]
        },
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "vat": {
          "$ref": "#/definitions/Vat"
        },
        "amount": {
          "type": "number",
          "description": "The total amount of the expense"
        },
        "date": {
          "type": "string",
          "description": "Date of the expense"
        },
        "dueDate": {
          "type": "string",
          "description": "Due date of the expense"
        },
        "reportingDate": {
          "type": "string",
          "description": "Reporting date of the expense"
        },
        "documentType": {
          "$ref": "#/definitions/ExpenseDocumentType"
        },
        "number": {
          "type": ["string", "null"],
          "description": "Number of the expense"
        },
        "description": {
          "type": "string",
          "description": "Description for the expense"
        },
        "remarks": {
          "type": "string",
          "string": "Remarks for the expense"
        },
        "supplier": {
          "$ref": "#/definitions/Supplier"
        },
        "accountingClassification": {
          "$ref": "#/definitions/AccountingClassification"
        },
        "active": {
          "type": "boolean",
          "description": "Is the expense active or not"
        },
        "addRecipient": {
          "type": "boolean",
          "description": "Should we save the supplier or not (by setting this to true you are required to add a supplier)"
        },
        "addAccountingClassification": {
          "type": "boolean",
          "description": "Should we save the accounting classification (by setting this to true you are required to add an accounting classification that contains title & irsCode)"
        }
      }
    },
    "GetExpense": {
      "type": "object",
      "additionalProperties": false,
      "description": "A Single Expense",
      "properties": {
        "amountExcludeVat": {
          "type": "number",
          "description": "The amount excluding the vat"
        },
        "id": {
          "type": "string",
          "description": "The expense ID"
        },
        "businessType": {
          "type": "number",
          "description": "The business type ID",
          "enum": [1, 2, 3, 4, 5, 6]
        },
        "documentType": {
          "$ref": "#/definitions/ExpenseDocumentType"
        },
        "status": {
          "type": "number",
          "description": "The status of the expense",
          "enum": [10, 20, 30, 100]
        },
        "paymentType": {
          "type": "number",
          "description": "Payment method",
          "enum": [-1, 0, 1, 2, 3, 4, 5, 10, 11]
        },
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "vat": {
          "$ref": "#/definitions/Vat"
        },
        "amount": {
          "type": "number",
          "description": "The total amount of the expense"
        },
        "date": {
          "type": "string",
          "description": "Date of the expense"
        },
        "dueDate": {
          "type": "string",
          "description": "Due date of the expense"
        },
        "number": {
          "type": "string",
          "description": "Number of the expense"
        },
        "active": {
          "type": "boolean",
          "description": "Is the expense currently active or not"
        },
        "description": {
          "type": "string",
          "description": "Description for the expense"
        },
        "remarks": {
          "type": "string",
          "description": "Remarks for the expense"
        },
        "supplier": {
          "$ref": "#/definitions/Supplier"
        },
        "thumbnail": {
          "type": "string",
          "description": "URL of expense thumbnail"
        },
        "url": {
          "type": "string",
          "description": "URL to download the expense thumbnail"
        },
        "cancellable": {
          "type": "boolean",
          "description": "Is the supplier currently active or not"
        },
        "reportingDate": {
          "type": "string",
          "description": "Reporting date of the expense"
        },
        "accountingClassification": {
          "$ref": "#/definitions/AccountingClassification"
        },
        "amountLocal": {
          "type": "number",
          "description": "The local amount of the expense"
        },
        "amountAccounting": {
          "type": "number",
          "description": "The amount of accounting"
        },
        "vatAccounting": {
          "type": "number",
          "description": "The vat amount of accounting"
        },
        "creationDate": {
          "$ref": "#/definitions/CreationDate"
        },
        "lastUpdateDate": {
          "type": "integer",
          "description": "The last update date of the expense, in UNIX timestamp format"
        }
      }
    },
    "GetExpenseDraft": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "The expense draft ID"
        },
        "status": {
          "type": "number",
          "description": "The status of the expense draft",
          "enum": [10, 50]
        },
        "creationDate": {
          "$ref": "#/definitions/CreationDate"
        },
        "lastUpdateDate": {
          "type": "integer",
          "description": "The last update date of the expense draft, in UNIX timestamp format"
        },
        "expense": {
          "$ref": "#/definitions/ExpensePartial"
        },
        "thumbnail": {
          "type": "string",
          "description": "URL of expense thumbnail"
        },
        "url": {
          "type": "string",
          "description": "URL to download the expense thumbnail"
        }
      }
    },
    "GetLinkedDocuments": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "amount": {
          "$ref": "#/definitions/DocumentAmount"
        },
        "currency": { "$ref": "#/definitions/Currency" },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "documentDate": {
          "$ref": "#/definitions/DocumentDate"
        },
        "id": {
          "$ref": "#/definitions/DocumentId"
        },
        "number": {
          "$ref": "#/definitions/DocumentTaxNumber"
        },
        "status": {
          "$ref": "#/definitions/DocumentStatus"
        },
        "type": {
          "$ref": "#/definitions/DocumentType"
        }
      }
    },
    "Income": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "amount": {
          "type": "number",
          "description": "Amount",
          "examples": [354]
        },
        "amountTotal": {
          "type": "number",
          "description": "Total amount",
          "examples": [354]
        },
        "catalogNum": {
          "type": "string",
          "description": "Catalog number",
          "examples": ["MXDFSDD"]
        },
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "description": {
          "type": "string",
          "description": "Item description",
          "examples": ["Item description"]
        },
        "itemId": {
          "type": "string",
          "description": "The ID of the item to attach as income",
          "examples": ["8b338c95-095e-46d4-b2c6-331747508759"]
        },
        "price": {
          "type": "number",
          "description": "Item price",
          "examples": [300]
        },
        "quantity": {
          "type": "number",
          "description": "Quantity",
          "examples": [1]
        },
        "vat": {
          "$ref": "#/definitions/Vat"
        },
        "vatRate": {
          "$ref": "#/definitions/VatRate"
        },
        "vatType": {
          "$ref": "#/definitions/VatType"
        }
      },
      "required": ["description", "quantity", "price", "currency", "vatType"]
    },
    "Payment": {
      "allOf": [
        { "$ref": "#/definitions/PaymentCore" },
        {
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number"
            },
            "cancellable": {
              "type": "boolean",
              "description": "Is this document a cancellable document",
              "examples": [false]
            },
            "description": {
              "type": "string"
            },
            "name": {
              "type": "string",
              "examples": ["העברה בנקאית"]
            },
            "ref": {
              "type": "array",
              "description": "The referred documents types",
              "items": {
                "$ref": "#/definitions/DocumentType"
              }
            }
          },
          "required": ["type", "price"]
        }
      ]
    },
    "PaymentDocument": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "date": {
          "type": "string"
        },
        "price": {
          "type": "number",
          "description": "Sum paid",
          "examples": [300]
        },
        "type": {
          "type": "number",
          "description": "Payment method",
          "enum": [-1, 0, 1, 2, 3, 4, 5, 9, 10, 11]
        },
        "subType": {
          "type": "number",
          "description": "Other payment sub type (required when using 'other' as a Payment type)",
          "enum": [1, 2, 3, 4, 5, 6, 7, 8]
        },
        "bankName": {
          "type": "string",
          "description": "Bank name (required when using Cheques)",
          "examples": ["My Bank"]
        },
        "bankBranch": {
          "type": "string",
          "description": "Bank branch number (required when using Cheques)",
          "examples": ["212345"]
        },
        "bankAccount": {
          "type": "string",
          "description": "Bank account number (required when using Cheques)",
          "examples": ["212345"]
        },
        "chequeNum": {
          "type": "string",
          "description": "Cheque number (required when using Cheques)",
          "examples": ["10002"]
        },
        "accountId": {
          "type": "string",
          "description": "Payer account (PayPal / Payment App / Other)",
          "examples": ["TFGFFGSYYE"]
        },
        "transactionId": {
          "type": "string",
          "description": "Transaction ID (PayPal / Payment App / Other)",
          "examples": ["TGBBBXNLKS75SKJS"]
        },
        "appType": {
          "type": "integer",
          "description": "Payment app type (required when using 'payment app' as a Payment type)",
          "enum": [1, 2, 3, 4, 5, 6]
        },
        "cardType": {
          "type": "integer",
          "description": "Credit card type",
          "enum": [1, 2, 3, 4, 5]
        },
        "cardNum": {
          "type": "string",
          "description": "Credit card's last 4 digits",
          "examples": ["8765"]
        },
        "dealType": {
          "type": "integer",
          "description": "Credit card deal type",
          "enum": [1, 2, 3, 4, 5, 6]
        },
        "numPayments": {
          "type": "integer",
          "description": "Credit card's payments count (1-36)",
          "examples": [1]
        },
        "firstPayment": {
          "type": "number",
          "description": "Credit card's first payment",
          "examples": [10]
        }
      },
      "required": ["type", "price", "currency"]
    },
    "PaymentCore": {
      "type": "object",
      "properties": {
        "currency": {
          "$ref": "#/definitions/Currency"
        },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "date": {
          "type": "string"
        },
        "price": {
          "type": "number",
          "description": "Sum paid",
          "examples": [300]
        },
        "type": {
          "type": "number",
          "description": "Payment method",
          "enum": [-1, 0, 1, 2, 3, 4, 5, 9, 10, 11]
        },
        "subType": {
          "type": "number",
          "description": "Other payment sub type (required when using 'other' as a Payment type)",
          "enum": [1, 2, 3, 4, 5, 6, 7, 8]
        }
      }
    },
    "Supplier": {
      "type": "object",
      "additionalProperties": false,
      "description": "Supplier of the expense",
      "properties": {
        "id": {
          "type": "string",
          "description": "The supplier ID"
        },
        "name": {
          "type": "string",
          "description": "The supplier name"
        },
        "active": {
          "type": "boolean",
          "description": "Is the supplier active or not"
        },
        "taxId": {
          "type": "string",
          "description": "The supplier tax ID"
        },
        "paymentTerms": {
          "type": "number",
          "description": "The supplier payment term, default is 0",
          "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
        },
        "bankName": {
          "type": "string",
          "description": "The supplier bank name"
        },
        "bankBranch": {
          "type": "string",
          "description": "The supplier bank branch number"
        },
        "bankAccount": {
          "type": "string",
          "description": "The supplier bank account number"
        },
        "country": {
          "$ref": "#/definitions/Country"
        },
        "phone": {
          "type": "string",
          "description": "The supplier phone number"
        },
        "mobile": {
          "type": "string",
          "description": "The supplier mobile number"
        },
        "contactPerson": {
          "type": "string",
          "description": "The supplier contact person name"
        },
        "emails": {
          "$ref": "#/definitions/ClientEmails"
        },
        "labels": {
          "type": "array",
          "additionalItems": false,
          "items": {
            "type": "string"
          }
        },
        "creationDate": {
          "$ref": "#/definitions/CreationDate"
        },
        "lastUpdateDate": {
          "type": "integer",
          "description": "The last update date of the supplier, in UNIX timestamp format"
        },
        "department": {
          "type": "string",
          "description": "The supplier department"
        },
        "accountingKey": {
          "type": "string",
          "description": "The supplier accounting key"
        },
        "address": {
          "type": "string",
          "description": "The supplier address"
        },
        "city": {
          "type": "string",
          "description": "The supplier city"
        },
        "zip": {
          "type": "string",
          "description": "The supplier zip code"
        },
        "fax": {
          "type": "string",
          "description": "The supplier fax number"
        },
        "remarks": {
          "type": "string",
          "description": "The Supplier remarks for self use"
        },
        "incomeAmount": {
          "type": "number",
          "description": "The amount of incomes from the customer"
        },
        "paymentAmount": {
          "type": "number"
        },
        "balanceAmount": {
          "type": "number",
          "description": "The balance amount of the supplier"
        }
      }
    },
    "ErrorResponse": {
      "type": "object",
      "additionalProperties": false,
      "description": "Error",
      "properties": {
        "errorCode": {
          "type": "number"
        },
        "errorMessage": {
          "type": "string"
        }
      }
    },
    "Url": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "he": {
          "type": "string",
          "description": "Copy in Hebrew"
        },
        "en": {
          "type": "string",
          "description": "Copy in English"
        },
        "origin": {
          "type": "string",
          "description": "Origin"
        }
      },
      "required": ["he", "origin"]
    },
    "CreationDate": {
      "type": "integer",
      "description": "The creation date, in UNIX timestamp format"
    },
    "CurrencyRate": {
      "type": "number",
      "description": "Currency rate relative to ILS",
      "examples": [1]
    },
    "DocumentLang": {
      "description": "Document language",
      "type": "string",
      "enum": ["en", "he"]
    },
    "DocumentDescription": {
      "description": "Document's description",
      "type": "string"
    },
    "DocumentIncome": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Income"
      }
    },
    "DocumentId": {
      "description": "Document ID",
      "type": "string"
    },
    "DocumentLinkedDocuments": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/DocumentLinkedDocument"
      }
    },
    "DocumentLinkedDocument": {
      "description": "A Linked Document",
      "additionalProperties": false,
      "properties": {
        "amount": {
          "$ref": "#/definitions/DocumentAmount"
        },
        "currency": { "$ref": "#/definitions/Currency" },
        "currencyRate": {
          "$ref": "#/definitions/CurrencyRate"
        },
        "documentDate": {
          "$ref": "#/definitions/DocumentDate"
        },
        "id": {
          "$ref": "#/definitions/DocumentId"
        },
        "number": {
          "$ref": "#/definitions/DocumentTaxNumber"
        },
        "reverseCharge": {
          "type": "boolean"
        },
        "type": {
          "$ref": "#/definitions/DocumentType"
        }
      },
      "required": [
        "amount",
        "currency",
        "currencyRate",
        "documentDate",
        "id",
        "number",
        "reverseCharge",
        "type"
      ]
    },
    "DocumentPayment": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/PaymentDocument"
      }
    },
    "DocumentRef": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "DocumentSigned": {
      "description": "Digital sign the document",
      "type": "boolean"
    },
    "DocumentTaxNumber": {
      "description": "Document tax number",
      "type": "string"
    },
    "DocumentDate": {
      "description": "Document reference date",
      "type": "string"
    },
    "DocumentDiscount": {
      "description": "Discount information",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "amount": {
          "type": "number",
          "examples": [10]
        },
        "type": {
          "type": "string",
          "description": "Discount amount type",
          "enum": ["sum", "percentage"]
        }
      },
      "required": ["type", "amount"]
    },
    "DocumentRounding": {
      "description": "Round the amounts",
      "type": "boolean"
    },
    "DocumentType": {
      "description": "Document type",
      "type": "number",
      "enum": [10, 100, 200, 210, 300, 305, 320, 330, 400, 405, 500, 600, 610]
    },
    "DocumentRemarks": {
      "type": ["string"]
    },
    "DocumentFooter": {
      "description": "Texts appearing in footer",
      "type": "string"
    },
    "DocumentData": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tags": {
          "description": "TODO: implement",
          "type": "array"
        }
      }
    },
    "DocumentStatus": {
      "description": "Document status",
      "type": "number"
    },
    "DocumentSerialNumber": {
      "description": "Document serial number",
      "type": "integer",
      "examples": [10002]
    },
    "DocumentAmount": {
      "description": "Total amount, in requested currency (including the VAT, Discount & Rounding)",
      "type": "number",
      "examples": [354]
    },
    "DocumentAmountDueVat": {
      "description": "Amount due VAT - Amount before VAT, and before rounding & discount (if requested)",
      "type": "number",
      "examples": [100]
    },
    "DocumentAmountExcludeVat": {
      "description": "Amount excluded VAT - Amount that is excluded of VAT",
      "type": "number",
      "examples": [18]
    },
    "DocumentAmountDueVatLocal": {
      "description": "Amount due VAT - local currency",
      "type": "number",
      "examples": [100]
    },
    "DocumentAmountExemptVat": {
      "description": "Amount exempt VAT - 0 unless there's one or more items that are excluded of VAT such as mixed documents (that have both VAT excluded & included items)",
      "type": "number",
      "examples": [18]
    },
    "DocumentAmountLocal": {
      "description": "Amount in local currency",
      "type": "number",
      "examples": [300]
    },
    "DocumentAmountOpened": {
      "description": "Amount that is still left to be paid, exists only in payment request documents",
      "type": "number",
      "examples": [300]
    },
    "ExpenseDocumentType": {
      "type": "number",
      "description": "Document type",
      "enum": [20, 305, 320, 330, 400, 405]
    },
    "Vat": {
      "description": "VAT amount",
      "type": "number",
      "examples": [54]
    },
    "VatType": {
      "description": "VAT type",
      "type": "number",
      "enum": [0, 1, 2],
      "examples": [0]
    },
    "VatRate": {
      "type": "number",
      "description": "VAT rate"
    }
  }
}