@accounter/green-invoice-graphql 0.8.2-alpha-20251102162844-adaba3b25910083f6ebd80bd580629e1c0871260 → 0.8.2-alpha-20251102200443-d7162b8ce1dfc629b8b454df17dcec9ed005a052

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,130 @@
1
1
  {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "definitions": {
4
- "addExpenseRequest": {
5
- "$ref": "#/definitions/Expense"
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://api.greeninvoice.co.il/schema/v1",
4
+ "$defs": {
5
+ "getDocumentResponse": {
6
+ "$ref": "#/$defs/Document"
6
7
  },
7
- "addExpenseResponse": {
8
+ "searchDocumentsRequest": {
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "properties": {
12
+ "page": {
13
+ "type": "number",
14
+ "description": "Page requested"
15
+ },
16
+ "pageSize": {
17
+ "type": "number",
18
+ "description": "Results per page"
19
+ },
20
+ "number": {
21
+ "$ref": "#/$defs/DocumentTaxNumber"
22
+ },
23
+ "type": {
24
+ "type": "array",
25
+ "description": "Document type",
26
+ "items": {
27
+ "$ref": "#/$defs/DocumentType"
28
+ }
29
+ },
30
+ "status": {
31
+ "type": "array",
32
+ "description": "Document status",
33
+ "items": {
34
+ "type": "number",
35
+ "enum": [0, 1, 2, 3, 4]
36
+ }
37
+ },
38
+ "paymentTypes": {
39
+ "type": "array",
40
+ "description": "Payment types used in this document",
41
+ "items": {
42
+ "type": "number",
43
+ "enum": [-1, 0, 1, 2, 3, 4, 5, 10, 11]
44
+ }
45
+ },
46
+ "fromDate": {
47
+ "type": "string",
48
+ "description": "Documents that were created after the specified date in the format YYYY-MM-DD",
49
+ "format": "date"
50
+ },
51
+ "toDate": {
52
+ "type": "string",
53
+ "description": "Documents that were created until the specified date in the format YYYY-MM-DD",
54
+ "format": "date"
55
+ },
56
+ "clientId": {
57
+ "type": "string",
58
+ "description": "Client ID"
59
+ },
60
+ "clientName": {
61
+ "type": "string",
62
+ "description": "Client name"
63
+ },
64
+ "description": {
65
+ "type": "string",
66
+ "description": "Document description"
67
+ },
68
+ "download": {
69
+ "type": "boolean",
70
+ "description": "Whether document was downloaded by client"
71
+ },
72
+ "sort": {
73
+ "enum": ["documentDate", "creationDate"]
74
+ }
75
+ },
76
+ "required": []
77
+ },
78
+ "searchDocumentsResponse": {
79
+ "allOf": [
80
+ { "$ref": "#/$defs/PaginationMeta" },
81
+ {
82
+ "type": "object",
83
+ "properties": {
84
+ "items": {
85
+ "type": "array",
86
+ "items": {
87
+ "$ref": "#/$defs/Document"
88
+ }
89
+ }
90
+ },
91
+ "required": ["items"]
92
+ }
93
+ ],
94
+ "unevaluatedProperties": false
95
+ },
96
+ "previewDocumentRequest": {
97
+ "description": "Previews a document before the actual generation",
98
+ "additionalProperties": false,
99
+ "$ref": "#/$defs/DocumentInputNew"
100
+ },
101
+ "previewDocumentResponse": {
8
102
  "oneOf": [
9
103
  {
10
- "$ref": "#/definitions/Expense"
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "properties": {
107
+ "file": {
108
+ "description": "Preview document file in Base64",
109
+ "type": "string"
110
+ }
111
+ },
112
+ "required": ["file"]
11
113
  },
12
114
  {
13
- "$ref": "#/definitions/ErrorResponse"
115
+ "$ref": "#/$defs/ErrorResponse"
14
116
  }
15
117
  ]
16
118
  },
119
+ "getLinkedDocumentsResponse": {
120
+ "$ref": "#/$defs/GetLinkedDocuments"
121
+ },
17
122
  "addDocumentRequest": {
18
123
  "description": "Add a document to the current business",
19
- "additionalProperties": false,
20
124
  "allOf": [
21
- { "$ref": "#/definitions/DocumentInputNew" },
125
+ { "$ref": "#/$defs/DocumentInputNew" },
22
126
  {
127
+ "type": "object",
23
128
  "properties": {
24
129
  "emailContent": {
25
130
  "type": "string",
@@ -31,15 +136,16 @@
31
136
  }
32
137
  }
33
138
  }
34
- ]
139
+ ],
140
+ "unevaluatedProperties": false
35
141
  },
36
142
  "addDocumentResponse": {
37
143
  "oneOf": [
38
144
  {
39
- "$ref": "#/definitions/AddedDocument"
145
+ "$ref": "#/$defs/AddedDocument"
40
146
  },
41
147
  {
42
- "$ref": "#/definitions/ErrorResponse"
148
+ "$ref": "#/$defs/ErrorResponse"
43
149
  }
44
150
  ]
45
151
  },
@@ -48,196 +154,109 @@
48
154
  "additionalProperties": false,
49
155
  "properties": {}
50
156
  },
51
- "previewDocumentRequest": {
52
- "description": "Previews a document before the actual generation",
53
- "additionalProperties": false,
54
- "$ref": "#/definitions/DocumentInputNew"
55
- },
56
- "previewDocumentResponse": {
57
- "oneOf": [
58
- {
59
- "type": "object",
60
- "additionalProperties": false,
61
- "properties": {
62
- "file": {
63
- "description": "Preview document file in Base64",
64
- "type": "string"
65
- }
66
- },
67
- "required": ["file"]
68
- },
69
- {
70
- "$ref": "#/definitions/ErrorResponse"
71
- }
72
- ]
73
- },
74
- "addExpenseDraftByFileRequest": {
157
+ "getExpenseRequest": {
75
158
  "type": "object",
76
159
  "additionalProperties": false,
77
- "required": [],
160
+ "required": ["id"],
78
161
  "properties": {
79
- "file": {
162
+ "id": {
80
163
  "type": "string",
81
- "description": "The file, in Base64, allowed types: GIF, PNG, JPG, SVG, PDF"
164
+ "description": "The expense ID"
82
165
  }
83
166
  }
84
167
  },
85
- "addExpenseDraftByFileResponse": {
86
- "$ref": "#/definitions/GetExpenseDraft"
87
- },
88
- "generalErrorResponse": {
89
- "type": "object",
90
- "additionalProperties": false,
91
- "properties": {
92
- "errorCode:": {
93
- "type": "integer"
94
- },
95
- "errorMessage": {
96
- "type": ["string", "null"]
97
- }
98
- }
168
+ "getExpenseResponse": {
169
+ "$ref": "#/$defs/GetExpense"
99
170
  },
100
- "getClientResponse": {
171
+ "searchExpensesRequest": {
101
172
  "type": "object",
102
173
  "additionalProperties": false,
103
174
  "properties": {
104
- "id": {
105
- "$ref": "#/definitions/ClientId"
106
- },
107
- "name": {
108
- "$ref": "#/definitions/ClientName"
109
- },
110
- "active": {
111
- "type": "boolean",
112
- "description": "Is the client currently active or not"
113
- },
114
- "taxId": {
115
- "type": "string",
116
- "description": "The client tax ID",
117
- "examples": ["0123456789"]
118
- },
119
- "paymentTerms": {
120
- "type": "integer",
121
- "description": "The client payment term, default is 0",
122
- "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
123
- },
124
- "bankName": {
125
- "type": "string",
126
- "description": "The client bank name"
127
- },
128
- "bankBranch": {
129
- "type": "string",
130
- "description": "The client bank branch"
131
- },
132
- "bankAccount": {
133
- "type": "string",
134
- "description": "The supplier bank account number"
135
- },
136
- "country": {
137
- "$ref": "#/definitions/Country"
138
- },
139
- "phone": {
140
- "$ref": "#/definitions/ClientPhone"
141
- },
142
-
143
- "mobile": {
175
+ "fromDate": {
144
176
  "type": "string",
145
- "description": "The supplier mobile number"
177
+ "description": "Expense that were created after the specified date in the format YYYY-MM-DD"
146
178
  },
147
- "contactPerson": {
179
+ "toDate": {
148
180
  "type": "string",
149
- "description": "The supplier contact person name"
150
- },
151
- "emails": {
152
- "$ref": "#/definitions/ClientEmails"
153
- },
154
- "labels": {
155
- "type": "array",
156
- "additionalItems": false,
157
- "items": {
158
- "type": "string"
159
- }
160
- },
161
- "creationDate": {
162
- "$ref": "#/definitions/CreationDate"
163
- },
164
- "lastUpdateDate": {
165
- "type": "integer",
166
- "description": "The last update date of the supplier, in UNIX timestamp format"
167
- },
168
- "send": {
169
- "type": "boolean",
170
- "description": "Whether to send emails to the user automatically when assigning him to an invoice or not"
181
+ "description": "Expense that were created until the specified date in the format YYYY-MM-DD"
171
182
  },
172
- "department": {
183
+ "dueDate": {
173
184
  "type": "string",
174
- "description": "The supplier department"
185
+ "description": "Due date of the expense, in the format YYYY-MM-DD"
175
186
  },
176
- "accountingKey": {
187
+ "description": {
177
188
  "type": "string",
178
- "description": "The supplier accounting key"
189
+ "description": "Expense description"
179
190
  },
180
- "address": {
191
+ "supplierId": {
181
192
  "type": "string",
182
- "description": "The supplier address"
193
+ "description": "Supplier's ID"
183
194
  },
184
- "city": {
195
+ "supplierName": {
185
196
  "type": "string",
186
- "description": "The supplier city"
197
+ "description": "Supplier's name"
187
198
  },
188
- "zip": {
199
+ "number": {
189
200
  "type": "string",
190
- "description": "The supplier zip code"
201
+ "description": "Expense serial number"
191
202
  },
192
- "category": {
193
- "type": "integer",
194
- "description": "The category this client is related to"
203
+ "paid": {
204
+ "type": "boolean",
205
+ "description": "Filter expenses that are only paid or unpaid, if not added to the request, will return both"
195
206
  },
196
- "subCategory": {
197
- "type": "integer",
198
- "description": "The sub category this client is related to"
207
+ "reported": {
208
+ "type": "boolean",
209
+ "description": "Filter expenses that are only reported or unreported, if not added to the request, will return both"
199
210
  },
200
- "fax": {
211
+ "sort": {
201
212
  "type": "string",
202
- "description": "Client fax"
213
+ "description": "The field to sort the results by"
203
214
  },
204
- "remarks": {
205
- "type": "string",
206
- "description": "Client remarks for self use",
207
- "example": "Customer approved 2016 sales"
215
+ "minAmount": {
216
+ "type": "number",
217
+ "description": "Min amount of the expense"
208
218
  },
209
- "incomeAmount": {
219
+ "maxAmount": {
210
220
  "type": "number",
211
- "description": "The amount of incomes from the customer"
221
+ "description": "Max amount of the expense"
212
222
  },
213
- "paymentAmount": {
214
- "type": "number"
223
+ "page": {
224
+ "type": "number",
225
+ "description": "Page requested"
215
226
  },
216
- "balanceAmount": {
227
+ "pageSize": {
217
228
  "type": "number",
218
- "description": "The balance amount of the client"
229
+ "description": "Results per page"
219
230
  }
220
- }
231
+ },
232
+ "required": ["minAmount", "maxAmount", "page", "pageSize"]
221
233
  },
222
- "getExpenseRequest": {
223
- "type": "object",
224
- "additionalProperties": false,
225
- "required": ["id"],
226
- "properties": {
227
- "id": {
228
- "type": "string",
229
- "description": "The expense ID"
234
+ "searchExpensesResponse": {
235
+ "allOf": [
236
+ { "$ref": "#/$defs/PaginationMeta" },
237
+ {
238
+ "type": "object",
239
+ "properties": {
240
+ "items": {
241
+ "$ref": "#/$defs/GetExpense"
242
+ }
243
+ }
230
244
  }
231
- }
245
+ ],
246
+ "unevaluatedProperties": false
232
247
  },
233
- "getExpenseResponse": {
234
- "$ref": "#/definitions/GetExpense"
235
- },
236
- "getDocumentResponse": {
237
- "$ref": "#/definitions/Document"
248
+ "addExpenseRequest": {
249
+ "$ref": "#/$defs/Expense"
238
250
  },
239
- "getLinkedDocumentsResponse": {
240
- "$ref": "#/definitions/GetLinkedDocuments"
251
+ "addExpenseResponse": {
252
+ "oneOf": [
253
+ {
254
+ "$ref": "#/$defs/Expense"
255
+ },
256
+ {
257
+ "$ref": "#/$defs/ErrorResponse"
258
+ }
259
+ ]
241
260
  },
242
261
  "updateExpenseRequest": {
243
262
  "type": "object",
@@ -261,13 +280,13 @@
261
280
  ]
262
281
  },
263
282
  "currency": {
264
- "$ref": "#/definitions/Currency"
283
+ "$ref": "#/$defs/Currency"
265
284
  },
266
285
  "currencyRate": {
267
- "$ref": "#/definitions/CurrencyRate"
286
+ "$ref": "#/$defs/CurrencyRate"
268
287
  },
269
288
  "vat": {
270
- "$ref": "#/definitions/Vat"
289
+ "$ref": "#/$defs/Vat"
271
290
  },
272
291
  "amount": {
273
292
  "type": "number",
@@ -286,7 +305,7 @@
286
305
  "description": "Reporting date of the expense"
287
306
  },
288
307
  "documentType": {
289
- "$ref": "#/definitions/ExpenseDocumentType"
308
+ "$ref": "#/$defs/ExpenseDocumentType"
290
309
  },
291
310
  "number": {
292
311
  "type": "string",
@@ -298,13 +317,13 @@
298
317
  },
299
318
  "remarks": {
300
319
  "type": "string",
301
- "string": "Remarks for the expense"
320
+ "description": "Remarks for the expense"
302
321
  },
303
322
  "supplier": {
304
- "$ref": "#/definitions/Supplier"
323
+ "$ref": "#/$defs/Supplier"
305
324
  },
306
325
  "accountingClassification": {
307
- "$ref": "#/definitions/AccountingClassification"
326
+ "$ref": "#/$defs/AccountingClassification"
308
327
  },
309
328
  "active": {
310
329
  "type": "boolean",
@@ -315,10 +334,10 @@
315
334
  "updateExpenseResponse": {
316
335
  "oneOf": [
317
336
  {
318
- "$ref": "#/definitions/GetExpense"
337
+ "$ref": "#/$defs/GetExpense"
319
338
  },
320
339
  {
321
- "$ref": "#/definitions/ErrorResponse"
340
+ "$ref": "#/$defs/ErrorResponse"
322
341
  }
323
342
  ]
324
343
  },
@@ -330,12 +349,12 @@
330
349
  "fromDate": {
331
350
  "type": "string",
332
351
  "description": "Expense drafts that were created after the specified date in the format YYYY-MM-DD",
333
- "format": "YYYY-MM-DD"
352
+ "format": "date"
334
353
  },
335
354
  "toDate": {
336
355
  "type": "string",
337
356
  "description": "Expense drafts that were created until the specified date in the format YYYY-MM-DD",
338
- "format": "YYYY-MM-DD"
357
+ "format": "date"
339
358
  },
340
359
  "description": {
341
360
  "type": "string",
@@ -360,397 +379,488 @@
360
379
  }
361
380
  },
362
381
  "searchExpenseDraftsResponse": {
363
- "type": "object",
364
- "additionalProperties": false,
365
- "required": ["page", "pageSize", "total", "pages", "items", "aggregations"],
366
- "properties": {
367
- "total": {
368
- "type": "number",
369
- "description": "The total length of the items that were retrieved"
370
- },
371
- "from": {
372
- "type": "number"
373
- },
374
- "to": {
375
- "type": "number"
376
- },
377
- "page": {
378
- "type": "number",
379
- "description": "The page that was requested to retrieve"
380
- },
381
- "pageSize": {
382
- "type": "number",
383
- "description": "The page size that was requested"
384
- },
385
- "pages": {
386
- "type": "number",
387
- "description": "The amount of pages that exist"
388
- },
389
- "aggregations": {
382
+ "allOf": [
383
+ { "$ref": "#/$defs/PaginationMeta" },
384
+ {
390
385
  "type": "object",
391
- "additionalProperties": false,
392
- "required": ["totalAmount"],
393
386
  "properties": {
394
- "totalAmount": {
387
+ "aggregations": {
395
388
  "type": "object",
396
389
  "additionalProperties": false,
397
- "required": ["value"],
390
+ "required": ["totalAmount"],
398
391
  "properties": {
399
- "value": {
400
- "type": "number"
392
+ "totalAmount": {
393
+ "type": "object",
394
+ "additionalProperties": false,
395
+ "required": ["value"],
396
+ "properties": {
397
+ "value": {
398
+ "type": "number"
399
+ }
400
+ }
401
401
  }
402
402
  }
403
- }
404
- }
405
- },
406
- "items": {
407
- "type": "array",
408
- "additionalItems": false,
409
- "description": "The expense drafts that were found",
410
- "items": {
411
- "type": "object",
412
- "additionalProperties": false,
413
- "description": "Partial Expense",
414
- "required": [
415
- "id",
416
- "status",
417
- "creationDate",
418
- "lastUpdateDate",
419
- "reportingPeriod",
420
- "hasDefaultValues",
421
- "url",
422
- "thumbnail",
423
- "expense"
424
- ],
425
- "properties": {
426
- "id": {
427
- "type": "string"
428
- },
429
- "status": {
430
- "type": "number"
431
- },
432
- "creationDate": {
433
- "$ref": "#/definitions/CreationDate"
434
- },
435
- "lastUpdateDate": {
436
- "type": "number"
437
- },
438
- "reportingPeriod": {
439
- "type": "string"
440
- },
441
- "hasDefaultValues": {
442
- "type": "boolean"
443
- },
444
- "url": {
445
- "type": "string"
446
- },
447
- "thumbnail": {
448
- "type": "string"
449
- },
450
- "expense": {
403
+ },
404
+ "items": {
405
+ "type": "array",
406
+ "description": "The expense drafts that were found",
407
+ "items": {
451
408
  "type": "object",
452
409
  "additionalProperties": false,
410
+ "description": "Partial Expense",
453
411
  "required": [
454
- "accountingClassification",
455
- "active",
456
- "addRecipient",
457
- "confirmFromEdit",
458
- "currency",
459
- "currencyRate",
460
- "description",
461
- "documentType",
462
- "fileHash",
463
- "fileKey",
464
- "labels",
465
- "reportingDate",
466
- "supplier",
467
- "tags",
468
- "texts",
469
- "vat"
412
+ "id",
413
+ "status",
414
+ "creationDate",
415
+ "lastUpdateDate",
416
+ "reportingPeriod",
417
+ "hasDefaultValues",
418
+ "url",
419
+ "thumbnail",
420
+ "expense"
470
421
  ],
471
422
  "properties": {
472
- "accountingClassification": {
473
- "$ref": "#/definitions/AccountingClassification"
474
- },
475
- "active": {
476
- "type": "boolean",
477
- "description": "Is the expense active or not"
478
- },
479
- "addRecipient": {
480
- "type": "boolean",
481
- "description": "Should we save the supplier or not (by setting this to true you are required to add a supplier)"
423
+ "id": {
424
+ "type": "string"
482
425
  },
483
- "amount": {
484
- "type": "number",
485
- "description": "The total amount of the expense"
426
+ "status": {
427
+ "type": "number"
486
428
  },
487
- "confirmFromEdit": {
488
- "type": "boolean"
489
- },
490
- "currency": {
491
- "$ref": "#/definitions/Currency"
492
- },
493
- "currencyRate": {
494
- "$ref": "#/definitions/CurrencyRate"
429
+ "creationDate": {
430
+ "$ref": "#/$defs/CreationDate"
495
431
  },
496
- "date": {
497
- "type": "string",
498
- "description": "Date of the expense"
432
+ "lastUpdateDate": {
433
+ "type": "number"
499
434
  },
500
- "description": {
501
- "type": "string",
502
- "description": "Description for the expense"
435
+ "reportingPeriod": {
436
+ "type": "string"
503
437
  },
504
- "documentType": {
505
- "$ref": "#/definitions/ExpenseDocumentType"
506
- },
507
- "fileHash": {
508
- "type": "string",
509
- "description": "File hash"
510
- },
511
- "fileKey": {
512
- "type": "string",
513
- "description": "Key of the file location"
438
+ "hasDefaultValues": {
439
+ "type": "boolean"
514
440
  },
515
- "labels": {
516
- "type": "array",
517
- "additionalItems": false,
518
- "items": {
519
- "type": "string"
520
- }
441
+ "url": {
442
+ "type": "string"
521
443
  },
522
- "number": {
523
- "type": ["string", "null"],
524
- "description": "Number of the expense"
444
+ "thumbnail": {
445
+ "type": "string"
525
446
  },
526
- "paymentType": {
527
- "description": "Payment method",
528
- "oneOf": [
529
- {
447
+ "expense": {
448
+ "type": "object",
449
+ "additionalProperties": false,
450
+ "required": [
451
+ "accountingClassification",
452
+ "active",
453
+ "addRecipient",
454
+ "confirmFromEdit",
455
+ "currency",
456
+ "currencyRate",
457
+ "description",
458
+ "documentType",
459
+ "fileHash",
460
+ "fileKey",
461
+ "labels",
462
+ "reportingDate",
463
+ "supplier",
464
+ "tags",
465
+ "texts",
466
+ "vat"
467
+ ],
468
+ "properties": {
469
+ "accountingClassification": {
470
+ "$ref": "#/$defs/AccountingClassification"
471
+ },
472
+ "active": {
473
+ "type": "boolean",
474
+ "description": "Is the expense active or not"
475
+ },
476
+ "addRecipient": {
477
+ "type": "boolean",
478
+ "description": "Should we save the supplier or not (by setting this to true you are required to add a supplier)"
479
+ },
480
+ "amount": {
481
+ "type": "number",
482
+ "description": "The total amount of the expense"
483
+ },
484
+ "confirmFromEdit": {
530
485
  "type": "boolean"
531
486
  },
532
- {
533
- "type": ["string", "number"],
534
- "enum": ["1", "2", "3", "4", "5", "10", "11", 1, 2, 3, 4, 5, 10, 11]
487
+ "currency": {
488
+ "$ref": "#/$defs/Currency"
489
+ },
490
+ "currencyRate": {
491
+ "$ref": "#/$defs/CurrencyRate"
492
+ },
493
+ "date": {
494
+ "type": "string",
495
+ "description": "Date of the expense"
496
+ },
497
+ "description": {
498
+ "type": "string",
499
+ "description": "Description for the expense"
500
+ },
501
+ "documentType": {
502
+ "$ref": "#/$defs/ExpenseDocumentType"
503
+ },
504
+ "fileHash": {
505
+ "type": "string",
506
+ "description": "File hash"
507
+ },
508
+ "fileKey": {
509
+ "type": "string",
510
+ "description": "Key of the file location"
511
+ },
512
+ "labels": {
513
+ "type": "array",
514
+ "items": {
515
+ "type": "string"
516
+ }
517
+ },
518
+ "number": {
519
+ "type": ["string", "null"],
520
+ "description": "Number of the expense"
521
+ },
522
+ "paymentType": {
523
+ "description": "Payment method",
524
+ "oneOf": [
525
+ {
526
+ "type": "boolean"
527
+ },
528
+ {
529
+ "type": ["string", "number"],
530
+ "enum": ["1", "2", "3", "4", "5", "10", "11", 1, 2, 3, 4, 5, 10, 11]
531
+ }
532
+ ]
533
+ },
534
+ "reportingDate": {
535
+ "type": "string",
536
+ "description": "Reporting date of the expense"
537
+ },
538
+ "supplier": {
539
+ "$ref": "#/$defs/Supplier"
540
+ },
541
+ "tags": {
542
+ "type": "array",
543
+ "items": {
544
+ "type": "string"
545
+ }
546
+ },
547
+ "texts": {
548
+ "type": "array",
549
+ "items": {
550
+ "type": "string"
551
+ }
552
+ },
553
+ "vat": {
554
+ "$ref": "#/$defs/Vat"
535
555
  }
536
- ]
537
- },
538
- "reportingDate": {
539
- "type": "string",
540
- "description": "Reporting date of the expense"
541
- },
542
- "supplier": {
543
- "$ref": "#/definitions/Supplier"
544
- },
545
- "tags": {
546
- "type": "array",
547
- "additionalItems": false,
548
- "items": {
549
- "type": "string"
550
- }
551
- },
552
- "texts": {
553
- "type": "array",
554
- "additionalItems": false,
555
- "items": {
556
- "type": "string"
557
556
  }
558
- },
559
- "vat": {
560
- "$ref": "#/definitions/Vat"
561
557
  }
562
558
  }
563
559
  }
564
560
  }
565
- }
561
+ },
562
+ "required": ["aggregations", "items"]
563
+ }
564
+ ],
565
+ "unevaluatedProperties": false
566
+ },
567
+ "addExpenseDraftByFileRequest": {
568
+ "type": "object",
569
+ "additionalProperties": false,
570
+ "required": [],
571
+ "properties": {
572
+ "file": {
573
+ "type": "string",
574
+ "description": "The file, in Base64, allowed types: GIF, PNG, JPG, SVG, PDF"
575
+ }
576
+ }
577
+ },
578
+ "addExpenseDraftByFileResponse": {
579
+ "$ref": "#/$defs/GetExpenseDraft"
580
+ },
581
+ "addClientRequest": {
582
+ "description": "Add a new client to the current business",
583
+ "allOf": [
584
+ { "$ref": "#/$defs/ContactInfo" },
585
+ { "$ref": "#/$defs/Address" },
586
+ { "$ref": "#/$defs/BankingInfo" },
587
+ {
588
+ "type": "object",
589
+ "properties": {
590
+ "name": {
591
+ "$ref": "#/$defs/ClientName"
592
+ },
593
+ "active": {
594
+ "type": "boolean",
595
+ "description": "Is the client currently active or not"
596
+ },
597
+ "taxId": {
598
+ "type": "string",
599
+ "description": "The client tax ID",
600
+ "examples": ["0123456789"]
601
+ },
602
+ "paymentTerms": {
603
+ "type": "integer",
604
+ "description": "The client payment term, default is 0",
605
+ "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
606
+ },
607
+ "labels": {
608
+ "type": "array",
609
+ "items": {
610
+ "type": "string"
611
+ }
612
+ },
613
+ "send": {
614
+ "type": "boolean",
615
+ "description": "Whether to send emails to the user automatically when assigning him to an invoice or not"
616
+ },
617
+ "department": {
618
+ "type": "string",
619
+ "description": "The client department"
620
+ },
621
+ "accountingKey": {
622
+ "type": "string",
623
+ "description": "The client accounting key"
624
+ },
625
+ "category": {
626
+ "type": "integer",
627
+ "description": "The category this client is related to"
628
+ },
629
+ "subCategory": {
630
+ "type": "integer",
631
+ "description": "The sub category this client is related to"
632
+ },
633
+ "remarks": {
634
+ "type": "string",
635
+ "description": "Client remarks for self use",
636
+ "example": "Customer approved 2016 sales"
637
+ }
638
+ },
639
+ "required": ["name"]
566
640
  }
567
- }
641
+ ],
642
+ "unevaluatedProperties": false
568
643
  },
569
- "searchExpensesRequest": {
644
+ "addClientResponse": {
645
+ "oneOf": [
646
+ {
647
+ "$ref": "#/$defs/getClientResponse"
648
+ },
649
+ {
650
+ "$ref": "#/$defs/ErrorResponse"
651
+ }
652
+ ]
653
+ },
654
+ "updateClientRequest": {
655
+ "description": "Update an existing client",
570
656
  "type": "object",
571
657
  "additionalProperties": false,
658
+ "required": ["name"],
572
659
  "properties": {
573
- "fromDate": {
574
- "type": "string",
575
- "description": "Expense that were created after the specified date in the format YYYY-MM-DD"
576
- },
577
- "toDate": {
578
- "type": "string",
579
- "description": "Expense that were created until the specified date in the format YYYY-MM-DD"
580
- },
581
- "dueDate": {
582
- "type": "string",
583
- "description": "Due date of the expense, in the format YYYY-MM-DD"
584
- },
585
- "description": {
586
- "type": "string",
587
- "description": "Expense description"
660
+ "name": {
661
+ "$ref": "#/$defs/ClientName"
588
662
  },
589
- "supplierId": {
590
- "type": "string",
591
- "description": "Supplier's ID"
663
+ "active": {
664
+ "type": "boolean",
665
+ "description": "Is the client currently active or not"
592
666
  },
593
- "supplierName": {
667
+ "taxId": {
594
668
  "type": "string",
595
- "description": "Supplier's name"
669
+ "description": "The client tax ID",
670
+ "examples": ["0123456789"]
596
671
  },
597
- "number": {
598
- "type": "string",
599
- "description": "Expense serial number"
672
+ "paymentTerms": {
673
+ "type": "integer",
674
+ "description": "The client payment term, default is 0",
675
+ "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
600
676
  },
601
- "paid": {
602
- "type": "boolean",
603
- "description": "Filter expenses that are only paid or unpaid, if not added to the request, will return both"
677
+ "labels": {
678
+ "type": "array",
679
+ "items": {
680
+ "type": "string"
681
+ }
604
682
  },
605
- "reported": {
683
+ "send": {
606
684
  "type": "boolean",
607
- "description": "Filter expenses that are only reported or unreported, if not added to the request, will return both"
685
+ "description": "Whether to send emails to the user automatically when assigning him to an invoice or not"
608
686
  },
609
- "sort": {
687
+ "department": {
610
688
  "type": "string",
611
- "description": "The field to sort the results by"
612
- },
613
- "minAmount": {
614
- "type": "number",
615
- "description": "Min amount of the expense"
616
- },
617
- "maxAmount": {
618
- "type": "number",
619
- "description": "Max amount of the expense"
620
- },
621
- "page": {
622
- "type": "number",
623
- "description": "Page requested"
624
- },
625
- "pageSize": {
626
- "type": "number",
627
- "description": "Results per page"
628
- }
629
- },
630
- "required": ["minAmount", "maxAmount", "page", "pageSize"]
631
- },
632
- "searchExpensesResponse": {
633
- "type": "object",
634
- "properties": {
635
- "total": {
636
- "type": "number",
637
- "description": "The total length of the items that were retrieved"
689
+ "description": "The client department"
638
690
  },
639
- "page": {
640
- "type": "number",
641
- "description": "The page that was requested to retrieve"
642
- },
643
- "pageSize": {
644
- "type": "number",
645
- "description": "The page size that was requested"
691
+ "accountingKey": {
692
+ "type": "string",
693
+ "description": "The client accounting key"
646
694
  },
647
- "pages": {
648
- "type": "number",
649
- "description": "The amount of pages that exist"
695
+ "category": {
696
+ "type": "integer",
697
+ "description": "The category this client is related to"
650
698
  },
651
- "items": {
652
- "$ref": "#/definitions/GetExpense"
653
- }
654
- }
655
- },
656
- "searchDocumentsRequest": {
657
- "type": "object",
658
- "additionalProperties": false,
659
- "properties": {
660
- "page": {
661
- "type": "number",
662
- "description": "Page requested"
699
+ "subCategory": {
700
+ "type": "integer",
701
+ "description": "The sub category this client is related to"
663
702
  },
664
- "pageSize": {
665
- "type": "number",
666
- "description": "Results per page"
703
+ "remarks": {
704
+ "type": "string",
705
+ "description": "Client remarks for self use",
706
+ "example": "Customer approved 2016 sales"
667
707
  },
668
- "number": {
669
- "$ref": "#/definitions/DocumentTaxNumber"
708
+ "phone": {
709
+ "type": "string",
710
+ "description": "Phone number"
670
711
  },
671
- "type": {
672
- "type": "array",
673
- "description": "Document type",
674
- "items": {
675
- "$ref": "#/definitions/DocumentType"
676
- }
712
+ "mobile": {
713
+ "type": "string",
714
+ "description": "Mobile number"
677
715
  },
678
- "status": {
716
+ "emails": {
679
717
  "type": "array",
680
- "description": "Document status",
681
718
  "items": {
682
- "type": "number",
683
- "enum": [0, 1, 2, 3, 4]
684
- }
719
+ "type": "string",
720
+ "format": "email"
721
+ },
722
+ "description": "Email addresses"
685
723
  },
686
- "paymentTypes": {
687
- "type": "array",
688
- "description": "Payment types used in this document",
689
- "items": {
690
- "type": "number",
691
- "enum": [-1, 0, 1, 2, 3, 4, 5, 10, 11]
692
- }
724
+ "fax": {
725
+ "type": "string",
726
+ "description": "Fax number"
693
727
  },
694
- "fromDate": {
728
+ "contactPerson": {
695
729
  "type": "string",
696
- "description": "Documents that were created after the specified date in the format YYYY-MM-DD",
697
- "format": "YYYY-MM-DD"
730
+ "description": "Contact person name"
698
731
  },
699
- "toDate": {
732
+ "address": {
700
733
  "type": "string",
701
- "description": "Documents that were created until the specified date in the format YYYY-MM-DD",
702
- "format": "YYYY-MM-DD"
734
+ "description": "Street address"
703
735
  },
704
- "clientId": {
736
+ "city": {
705
737
  "type": "string",
706
- "description": "Client ID"
738
+ "description": "City name"
707
739
  },
708
- "clientName": {
740
+ "zip": {
709
741
  "type": "string",
710
- "description": "Client name"
742
+ "description": "Zip/postal code"
711
743
  },
712
- "description": {
744
+ "country": {
745
+ "$ref": "#/$defs/Country"
746
+ },
747
+ "bankName": {
713
748
  "type": "string",
714
- "description": "Document description"
749
+ "description": "Bank name"
715
750
  },
716
- "download": {
717
- "type": "boolean",
718
- "description": "Whether document was downloaded by client"
751
+ "bankBranch": {
752
+ "type": "string",
753
+ "description": "Bank branch number"
719
754
  },
720
- "sort": {
721
- "enum": ["documentDate", "creationDate"]
755
+ "bankAccount": {
756
+ "type": "string",
757
+ "description": "Bank account number"
722
758
  }
723
- },
724
- "required": []
759
+ }
725
760
  },
726
- "searchDocumentsResponse": {
727
- "type": "object",
728
- "properties": {
729
- "total": {
730
- "type": "number",
731
- "description": "The total length of the items that were retrieved"
732
- },
733
- "page": {
734
- "type": "number",
735
- "description": "The page that was requested to retrieve"
736
- },
737
- "pageSize": {
738
- "type": "number",
739
- "description": "The page size that was requested"
761
+ "updateClientResponse": {
762
+ "oneOf": [
763
+ {
764
+ "$ref": "#/$defs/getClientResponse"
740
765
  },
741
- "pages": {
742
- "type": "number",
743
- "description": "The amount of pages that exist"
766
+ {
767
+ "$ref": "#/$defs/ErrorResponse"
768
+ }
769
+ ]
770
+ },
771
+ "deleteClientResponse": {
772
+ "oneOf": [
773
+ {
774
+ "$ref": "#/$defs/getClientResponse"
744
775
  },
745
- "items": {
746
- "type": "array",
747
- "items": {
748
- "$ref": "#/definitions/Document"
776
+ {
777
+ "$ref": "#/$defs/ErrorResponse"
778
+ }
779
+ ]
780
+ },
781
+ "getClientResponse": {
782
+ "allOf": [
783
+ { "$ref": "#/$defs/ContactInfo" },
784
+ { "$ref": "#/$defs/Address" },
785
+ { "$ref": "#/$defs/BankingInfo" },
786
+ {
787
+ "type": "object",
788
+ "properties": {
789
+ "id": {
790
+ "$ref": "#/$defs/ClientId"
791
+ },
792
+ "name": {
793
+ "$ref": "#/$defs/ClientName"
794
+ },
795
+ "active": {
796
+ "type": "boolean",
797
+ "description": "Is the client currently active or not"
798
+ },
799
+ "taxId": {
800
+ "type": "string",
801
+ "description": "The client tax ID",
802
+ "examples": ["0123456789"]
803
+ },
804
+ "paymentTerms": {
805
+ "type": "integer",
806
+ "description": "The client payment term, default is 0",
807
+ "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
808
+ },
809
+ "labels": {
810
+ "type": "array",
811
+ "items": {
812
+ "type": "string"
813
+ }
814
+ },
815
+ "creationDate": {
816
+ "$ref": "#/$defs/CreationDate"
817
+ },
818
+ "lastUpdateDate": {
819
+ "type": "integer",
820
+ "description": "The last update date of the supplier, in UNIX timestamp format"
821
+ },
822
+ "send": {
823
+ "type": "boolean",
824
+ "description": "Whether to send emails to the user automatically when assigning him to an invoice or not"
825
+ },
826
+ "department": {
827
+ "type": "string",
828
+ "description": "The supplier department"
829
+ },
830
+ "accountingKey": {
831
+ "type": "string",
832
+ "description": "The supplier accounting key"
833
+ },
834
+ "category": {
835
+ "type": "integer",
836
+ "description": "The category this client is related to"
837
+ },
838
+ "subCategory": {
839
+ "type": "integer",
840
+ "description": "The sub category this client is related to"
841
+ },
842
+ "remarks": {
843
+ "type": "string",
844
+ "description": "Client remarks for self use",
845
+ "example": "Customer approved 2016 sales"
846
+ },
847
+ "incomeAmount": {
848
+ "type": "number",
849
+ "description": "The amount of incomes from the customer"
850
+ },
851
+ "paymentAmount": {
852
+ "type": "number"
853
+ },
854
+ "balanceAmount": {
855
+ "type": "number",
856
+ "description": "The balance amount of the client"
857
+ }
749
858
  }
750
859
  }
751
- },
752
- "required": ["total", "page", "pageSize", "pages", "items"]
860
+ ],
861
+ "unevaluatedProperties": false
753
862
  },
863
+
754
864
  "getFileUploadUrlResponse": {
755
865
  "type": "object",
756
866
  "properties": {
@@ -837,11 +947,23 @@
837
947
  "results": {
838
948
  "type": "array",
839
949
  "items": {
840
- "$ref": "#/definitions/BankTransaction"
950
+ "$ref": "#/$defs/BankTransaction"
841
951
  }
842
952
  }
843
- },
844
- "required": []
953
+ },
954
+ "required": []
955
+ },
956
+ "generalErrorResponse": {
957
+ "type": "object",
958
+ "additionalProperties": false,
959
+ "properties": {
960
+ "errorCode": {
961
+ "type": "integer"
962
+ },
963
+ "errorMessage": {
964
+ "type": ["string", "null"]
965
+ }
966
+ }
845
967
  },
846
968
  "AccountingClassification": {
847
969
  "type": "object",
@@ -888,6 +1010,47 @@
888
1010
  }
889
1011
  }
890
1012
  },
1013
+ "Address": {
1014
+ "type": "object",
1015
+ "description": "Physical address information",
1016
+ "additionalProperties": false,
1017
+ "properties": {
1018
+ "address": {
1019
+ "type": "string",
1020
+ "description": "Street address"
1021
+ },
1022
+ "city": {
1023
+ "type": "string",
1024
+ "description": "City name"
1025
+ },
1026
+ "zip": {
1027
+ "type": "string",
1028
+ "description": "Zip/postal code"
1029
+ },
1030
+ "country": {
1031
+ "$ref": "#/$defs/Country"
1032
+ }
1033
+ }
1034
+ },
1035
+ "BankingInfo": {
1036
+ "type": "object",
1037
+ "description": "Banking information",
1038
+ "additionalProperties": false,
1039
+ "properties": {
1040
+ "bankName": {
1041
+ "type": "string",
1042
+ "description": "Bank name"
1043
+ },
1044
+ "bankBranch": {
1045
+ "type": "string",
1046
+ "description": "Bank branch number"
1047
+ },
1048
+ "bankAccount": {
1049
+ "type": "string",
1050
+ "description": "Bank account number"
1051
+ }
1052
+ }
1053
+ },
891
1054
  "BankTransaction": {
892
1055
  "type": "object",
893
1056
  "additionalProperties": false,
@@ -945,7 +1108,7 @@
945
1108
  "type": ["string", "null"],
946
1109
  "description": "The creditor account"
947
1110
  },
948
- "currency": { "$ref": "#/definitions/Currency" },
1111
+ "currency": { "$ref": "#/$defs/Currency" },
949
1112
  "valueDate": {
950
1113
  "type": "string",
951
1114
  "description": "Value date of the transaction"
@@ -1069,51 +1232,23 @@
1069
1232
  ]
1070
1233
  },
1071
1234
  "Client": {
1072
- "allOf": [
1073
- { "$ref": "#/definitions/ClientCore" },
1074
- {
1075
- "additionalProperties": false,
1076
- "properties": {
1077
- "country": {
1078
- "$ref": "#/definitions/Country"
1079
- },
1080
- "emails": {
1081
- "$ref": "#/definitions/ClientEmails"
1082
- },
1083
- "id": {
1084
- "$ref": "#/definitions/ClientId"
1085
- },
1086
- "name": {
1087
- "$ref": "#/definitions/ClientName"
1088
- },
1089
- "phone": {
1090
- "$ref": "#/definitions/ClientPhone"
1091
- },
1092
- "self": {
1093
- "$ref": "#/definitions/ClientSelf"
1094
- }
1095
- },
1096
- "required": ["country", "emails", "id", "name", "phone", "self"]
1097
- }
1098
- ]
1099
- },
1100
- "ClientCore": {
1101
1235
  "type": "object",
1236
+ "additionalProperties": false,
1102
1237
  "properties": {
1103
1238
  "country": {
1104
- "$ref": "#/definitions/Country"
1239
+ "$ref": "#/$defs/Country"
1105
1240
  },
1106
1241
  "emails": {
1107
- "$ref": "#/definitions/ClientEmails"
1242
+ "$ref": "#/$defs/ClientEmails"
1108
1243
  },
1109
1244
  "id": {
1110
- "$ref": "#/definitions/ClientId"
1245
+ "$ref": "#/$defs/ClientId"
1111
1246
  },
1112
1247
  "name": {
1113
- "$ref": "#/definitions/ClientName"
1248
+ "$ref": "#/$defs/ClientName"
1114
1249
  },
1115
1250
  "phone": {
1116
- "$ref": "#/definitions/ClientPhone"
1251
+ "$ref": "#/$defs/ClientPhone"
1117
1252
  },
1118
1253
  "taxId": {
1119
1254
  "type": "string",
@@ -1121,25 +1256,53 @@
1121
1256
  "examples": ["0123456789"]
1122
1257
  },
1123
1258
  "self": {
1124
- "$ref": "#/definitions/ClientSelf"
1259
+ "$ref": "#/$defs/ClientSelf"
1260
+ },
1261
+ "address": {
1262
+ "type": "string",
1263
+ "description": "Client address"
1264
+ },
1265
+ "city": {
1266
+ "type": "string",
1267
+ "description": "Client city"
1268
+ },
1269
+ "zip": {
1270
+ "type": "string",
1271
+ "description": "Client zip code"
1272
+ },
1273
+ "fax": {
1274
+ "type": "string",
1275
+ "description": "Client fax"
1276
+ },
1277
+ "mobile": {
1278
+ "type": "string",
1279
+ "description": "The client mobile number"
1280
+ },
1281
+ "add": {
1282
+ "type": "boolean",
1283
+ "description": "Add a temporary client to the clients' list"
1125
1284
  }
1126
1285
  }
1127
1286
  },
1128
1287
  "ClientEmails": {
1129
1288
  "type": "array",
1289
+ "description": "List of email addresses",
1130
1290
  "items": {
1131
- "type": "string"
1291
+ "type": "string",
1292
+ "format": "email"
1132
1293
  }
1133
1294
  },
1134
1295
  "ClientId": {
1135
1296
  "type": "string",
1136
1297
  "description": "The client ID",
1137
- "examples": ["8b338c95-095e-46d4-b2c6-331747508759"]
1298
+ "examples": ["8b338c95-095e-46d4-b2c6-331747508759"],
1299
+ "format": "uuid"
1138
1300
  },
1139
1301
  "ClientName": {
1140
1302
  "type": "string",
1141
1303
  "description": "The client name",
1142
- "examples": ["לקוח אפ3"]
1304
+ "examples": ["לקוח אפ3"],
1305
+ "minLength": 1
1143
1306
  },
1144
1307
  "ClientPhone": {
1145
1308
  "type": "string"
@@ -1149,6 +1312,37 @@
1149
1312
  "description": "Whether the client is self",
1150
1313
  "examples": [false]
1151
1314
  },
1315
+ "ContactInfo": {
1316
+ "type": "object",
1317
+ "description": "Contact information for clients and suppliers",
1318
+ "additionalProperties": false,
1319
+ "properties": {
1320
+ "phone": {
1321
+ "type": "string",
1322
+ "description": "Phone number"
1323
+ },
1324
+ "mobile": {
1325
+ "type": "string",
1326
+ "description": "Mobile number"
1327
+ },
1328
+ "emails": {
1329
+ "type": "array",
1330
+ "items": {
1331
+ "type": "string",
1332
+ "format": "email"
1333
+ },
1334
+ "description": "Email addresses"
1335
+ },
1336
+ "fax": {
1337
+ "type": "string",
1338
+ "description": "Fax number"
1339
+ },
1340
+ "contactPerson": {
1341
+ "type": "string",
1342
+ "description": "Contact person name"
1343
+ }
1344
+ }
1345
+ },
1152
1346
  "Country": {
1153
1347
  "type": "string",
1154
1348
  "description": "2-letter ISO supplier country code, default is IL",
@@ -1443,50 +1637,51 @@
1443
1637
  "additionalProperties": false,
1444
1638
  "properties": {
1445
1639
  "id": {
1446
- "$ref": "#/definitions/DocumentId"
1640
+ "$ref": "#/$defs/DocumentId"
1447
1641
  },
1448
1642
  "lang": {
1449
- "$ref": "#/definitions/DocumentLang"
1643
+ "$ref": "#/$defs/DocumentLang"
1450
1644
  },
1451
1645
  "number": {
1452
- "$ref": "#/definitions/DocumentSerialNumber"
1646
+ "$ref": "#/$defs/DocumentSerialNumber"
1453
1647
  },
1454
1648
  "signed": {
1455
- "$ref": "#/definitions/DocumentSigned"
1649
+ "$ref": "#/$defs/DocumentSigned"
1456
1650
  },
1457
1651
  "url": {
1458
- "$ref": "#/definitions/Url"
1652
+ "$ref": "#/$defs/Url"
1459
1653
  }
1460
1654
  },
1461
1655
  "required": ["id", "lang", "number", "signed", "url"]
1462
1656
  },
1463
1657
  "Document": {
1658
+ "type": "object",
1464
1659
  "description": "A Single Document",
1465
1660
  "additionalProperties": false,
1466
1661
  "properties": {
1467
1662
  "amount": {
1468
- "$ref": "#/definitions/DocumentAmount"
1663
+ "$ref": "#/$defs/DocumentAmount"
1469
1664
  },
1470
1665
  "amountDueVat": {
1471
- "$ref": "#/definitions/DocumentAmountDueVat"
1666
+ "$ref": "#/$defs/DocumentAmountDueVat"
1472
1667
  },
1473
1668
  "amountDueVatLocal": {
1474
- "$ref": "#/definitions/DocumentAmountDueVatLocal"
1669
+ "$ref": "#/$defs/DocumentAmountDueVatLocal"
1475
1670
  },
1476
1671
  "amountExcludeVat": {
1477
- "$ref": "#/definitions/DocumentAmountExcludeVat"
1672
+ "$ref": "#/$defs/DocumentAmountExcludeVat"
1478
1673
  },
1479
1674
  "amountExemptVat": {
1480
- "$ref": "#/definitions/DocumentAmountExemptVat"
1675
+ "$ref": "#/$defs/DocumentAmountExemptVat"
1481
1676
  },
1482
1677
  "amountLocal": {
1483
- "$ref": "#/definitions/DocumentAmountLocal"
1678
+ "$ref": "#/$defs/DocumentAmountLocal"
1484
1679
  },
1485
1680
  "amountOpened": {
1486
- "$ref": "#/definitions/DocumentAmountOpened"
1681
+ "$ref": "#/$defs/DocumentAmountOpened"
1487
1682
  },
1488
1683
  "business": {
1489
- "$ref": "#/definitions/Business"
1684
+ "$ref": "#/$defs/Business"
1490
1685
  },
1491
1686
  "calculatedAmountLocal": {
1492
1687
  "type": "number"
@@ -1510,68 +1705,75 @@
1510
1705
  "type": "number"
1511
1706
  },
1512
1707
  "client": {
1513
- "$ref": "#/definitions/Client"
1708
+ "allOf": [
1709
+ { "$ref": "#/$defs/Client" },
1710
+ {
1711
+ "type": "object",
1712
+ "required": ["country", "emails", "id", "name", "phone", "self"]
1713
+ }
1714
+ ],
1715
+ "unevaluatedProperties": false
1514
1716
  },
1515
1717
  "creationDate": {
1516
- "$ref": "#/definitions/CreationDate"
1718
+ "$ref": "#/$defs/CreationDate"
1517
1719
  },
1518
- "currency": { "$ref": "#/definitions/Currency" },
1720
+ "currency": { "$ref": "#/$defs/Currency" },
1519
1721
  "currencyRate": {
1520
- "$ref": "#/definitions/CurrencyRate"
1722
+ "$ref": "#/$defs/CurrencyRate"
1521
1723
  },
1522
1724
  "data": {
1523
- "$ref": "#/definitions/DocumentData"
1725
+ "$ref": "#/$defs/DocumentData"
1524
1726
  },
1525
1727
  "description": {
1526
- "$ref": "#/definitions/DocumentDescription"
1728
+ "$ref": "#/$defs/DocumentDescription"
1527
1729
  },
1528
1730
  "documentDate": {
1529
- "$ref": "#/definitions/DocumentDate"
1731
+ "$ref": "#/$defs/DocumentDate"
1530
1732
  },
1531
1733
  "downloaded": {
1532
1734
  "type": "boolean"
1533
1735
  },
1534
1736
  "footer": {
1535
- "$ref": "#/definitions/DocumentFooter"
1737
+ "$ref": "#/$defs/DocumentFooter"
1536
1738
  },
1537
1739
  "id": {
1538
- "$ref": "#/definitions/DocumentId"
1740
+ "$ref": "#/$defs/DocumentId"
1539
1741
  },
1540
1742
  "income": {
1541
- "$ref": "#/definitions/DocumentIncome"
1743
+ "$ref": "#/$defs/DocumentIncome"
1542
1744
  },
1543
1745
  "lang": {
1544
- "$ref": "#/definitions/DocumentLang"
1746
+ "$ref": "#/$defs/DocumentLang"
1545
1747
  },
1546
1748
  "linkedDocuments": {
1547
- "$ref": "#/definitions/DocumentLinkedDocuments"
1749
+ "$ref": "#/$defs/DocumentLinkedDocuments"
1548
1750
  },
1549
1751
  "number": {
1550
- "$ref": "#/definitions/DocumentTaxNumber"
1752
+ "$ref": "#/$defs/DocumentTaxNumber"
1551
1753
  },
1552
1754
  "payment": {
1553
- "$ref": "#/definitions/DocumentPayment"
1755
+ "$ref": "#/$defs/DocumentPayment"
1554
1756
  },
1555
1757
  "ref": {
1556
- "$ref": "#/definitions/DocumentRef"
1758
+ "$ref": "#/$defs/DocumentRef"
1557
1759
  },
1558
1760
  "remarks": {
1559
- "$ref": "#/definitions/DocumentRemarks"
1761
+ "$ref": "#/$defs/DocumentRemarks"
1560
1762
  },
1561
1763
  "reverseCharge": {
1562
1764
  "type": "boolean"
1563
1765
  },
1564
1766
  "rounding": {
1565
- "$ref": "#/definitions/DocumentRounding"
1767
+ "$ref": "#/$defs/DocumentRounding"
1566
1768
  },
1567
1769
  "signed": {
1568
- "$ref": "#/definitions/DocumentSigned"
1770
+ "$ref": "#/$defs/DocumentSigned"
1569
1771
  },
1570
1772
  "skinId": {
1571
1773
  "type": "number"
1572
1774
  },
1573
1775
  "status": {
1574
- "$ref": "#/definitions/DocumentStatus"
1776
+ "$ref": "#/$defs/DocumentStatus"
1575
1777
  },
1576
1778
  "taxConfirmationEligible": {
1577
1779
  "type": "boolean"
@@ -1580,25 +1782,25 @@
1580
1782
  "type": "number"
1581
1783
  },
1582
1784
  "type": {
1583
- "$ref": "#/definitions/DocumentType"
1785
+ "$ref": "#/$defs/DocumentType"
1584
1786
  },
1585
1787
  "url": {
1586
- "$ref": "#/definitions/Url"
1788
+ "$ref": "#/$defs/Url"
1587
1789
  },
1588
1790
  "userName": {
1589
1791
  "type": "string"
1590
1792
  },
1591
1793
  "vat": {
1592
- "$ref": "#/definitions/Vat"
1794
+ "$ref": "#/$defs/Vat"
1593
1795
  },
1594
1796
  "vatLocal": {
1595
1797
  "type": "number"
1596
1798
  },
1597
1799
  "vatRate": {
1598
- "$ref": "#/definitions/VatRate"
1800
+ "$ref": "#/$defs/VatRate"
1599
1801
  },
1600
1802
  "vatType": {
1601
- "$ref": "#/definitions/VatType"
1803
+ "$ref": "#/$defs/VatType"
1602
1804
  }
1603
1805
  },
1604
1806
  "required": [
@@ -1645,18 +1847,20 @@
1645
1847
  ]
1646
1848
  },
1647
1849
  "DocumentInputNew": {
1850
+ "type": "object",
1851
+ "additionalProperties": false,
1648
1852
  "properties": {
1649
1853
  "description": {
1650
- "$ref": "#/definitions/DocumentDescription"
1854
+ "$ref": "#/$defs/DocumentDescription"
1651
1855
  },
1652
1856
  "remarks": {
1653
- "$ref": "#/definitions/DocumentRemarks"
1857
+ "$ref": "#/$defs/DocumentRemarks"
1654
1858
  },
1655
1859
  "footer": {
1656
- "$ref": "#/definitions/DocumentFooter"
1860
+ "$ref": "#/$defs/DocumentFooter"
1657
1861
  },
1658
1862
  "type": {
1659
- "$ref": "#/definitions/DocumentType"
1863
+ "$ref": "#/$defs/DocumentType"
1660
1864
  },
1661
1865
  "date": {
1662
1866
  "description": "Document date in the format YYYY-MM-DD",
@@ -1667,20 +1871,20 @@
1667
1871
  "type": "string"
1668
1872
  },
1669
1873
  "lang": {
1670
- "$ref": "#/definitions/DocumentLang"
1874
+ "$ref": "#/$defs/DocumentLang"
1671
1875
  },
1672
- "currency": { "$ref": "#/definitions/Currency" },
1876
+ "currency": { "$ref": "#/$defs/Currency" },
1673
1877
  "vatType": {
1674
- "$ref": "#/definitions/VatType"
1878
+ "$ref": "#/$defs/VatType"
1675
1879
  },
1676
1880
  "discount": {
1677
- "$ref": "#/definitions/DocumentDiscount"
1881
+ "$ref": "#/$defs/DocumentDiscount"
1678
1882
  },
1679
1883
  "rounding": {
1680
- "$ref": "#/definitions/DocumentRounding"
1884
+ "$ref": "#/$defs/DocumentRounding"
1681
1885
  },
1682
1886
  "signed": {
1683
- "$ref": "#/definitions/DocumentSigned"
1887
+ "$ref": "#/$defs/DocumentSigned"
1684
1888
  },
1685
1889
  "maxPayments": {
1686
1890
  "description": "Max payments allowed (valid only on supported accounts)",
@@ -1688,44 +1892,19 @@
1688
1892
  },
1689
1893
  "client": {
1690
1894
  "allOf": [
1691
- { "$ref": "#/definitions/ClientCore" },
1895
+ { "$ref": "#/$defs/Client" },
1692
1896
  {
1693
1897
  "type": "object",
1694
- "properties": {
1695
- "address": {
1696
- "type": "string",
1697
- "description": "Client address"
1698
- },
1699
- "city": {
1700
- "type": "string",
1701
- "description": "Client city"
1702
- },
1703
- "zip": {
1704
- "type": "string",
1705
- "description": "Client zip code"
1706
- },
1707
- "fax": {
1708
- "type": "string",
1709
- "description": "Client fax"
1710
- },
1711
- "mobile": {
1712
- "type": "string",
1713
- "description": "The client mobile number"
1714
- },
1715
- "add": {
1716
- "type": "boolean",
1717
- "description": "Add a temporary client to the clients' list"
1718
- }
1719
- }
1720
- },
1721
- { "required": ["id"] }
1722
- ]
1898
+ "required": ["id"]
1899
+ }
1900
+ ],
1901
+ "unevaluatedProperties": false
1723
1902
  },
1724
1903
  "income": {
1725
- "$ref": "#/definitions/DocumentIncome"
1904
+ "$ref": "#/$defs/DocumentIncome"
1726
1905
  },
1727
1906
  "payment": {
1728
- "$ref": "#/definitions/DocumentPayment"
1907
+ "$ref": "#/$defs/DocumentPayment"
1729
1908
  },
1730
1909
  "linkedDocumentIds": {
1731
1910
  "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.",
@@ -1748,27 +1927,28 @@
1748
1927
  },
1749
1928
  "DocumentCore": {
1750
1929
  "type": "object",
1930
+ "additionalProperties": false,
1751
1931
  "properties": {
1752
1932
  "amount": {
1753
- "$ref": "#/definitions/DocumentAmount"
1933
+ "$ref": "#/$defs/DocumentAmount"
1754
1934
  },
1755
1935
  "amountDueVat": {
1756
- "$ref": "#/definitions/DocumentAmountDueVat"
1936
+ "$ref": "#/$defs/DocumentAmountDueVat"
1757
1937
  },
1758
1938
  "amountExcludeVat": {
1759
- "$ref": "#/definitions/DocumentAmountExcludeVat"
1939
+ "$ref": "#/$defs/DocumentAmountExcludeVat"
1760
1940
  },
1761
1941
  "amountExemptVat": {
1762
- "$ref": "#/definitions/DocumentAmountExemptVat"
1942
+ "$ref": "#/$defs/DocumentAmountExemptVat"
1763
1943
  },
1764
1944
  "amountLocal": {
1765
- "$ref": "#/definitions/DocumentAmountLocal"
1945
+ "$ref": "#/$defs/DocumentAmountLocal"
1766
1946
  },
1767
1947
  "amountOpened": {
1768
- "$ref": "#/definitions/DocumentAmountOpened"
1948
+ "$ref": "#/$defs/DocumentAmountOpened"
1769
1949
  },
1770
1950
  "business": {
1771
- "$ref": "#/definitions/Business"
1951
+ "$ref": "#/$defs/Business"
1772
1952
  },
1773
1953
  "calculatedAmountLocal": {
1774
1954
  "type": "number"
@@ -1792,87 +1972,88 @@
1792
1972
  "type": "number"
1793
1973
  },
1794
1974
  "client": {
1795
- "$ref": "#/definitions/ClientCore"
1975
+ "$ref": "#/$defs/Client"
1796
1976
  },
1797
1977
  "creationDate": {
1798
- "$ref": "#/definitions/CreationDate"
1978
+ "$ref": "#/$defs/CreationDate"
1799
1979
  },
1800
- "currency": { "$ref": "#/definitions/Currency" },
1980
+ "currency": { "$ref": "#/$defs/Currency" },
1801
1981
  "currencyRate": {
1802
- "$ref": "#/definitions/CurrencyRate"
1982
+ "$ref": "#/$defs/CurrencyRate"
1803
1983
  },
1804
1984
  "data": {
1805
- "$ref": "#/definitions/DocumentData"
1985
+ "$ref": "#/$defs/DocumentData"
1806
1986
  },
1807
1987
  "description": {
1808
- "$ref": "#/definitions/DocumentDescription"
1988
+ "$ref": "#/$defs/DocumentDescription"
1809
1989
  },
1810
1990
  "documentDate": {
1811
- "$ref": "#/definitions/DocumentDate"
1991
+ "$ref": "#/$defs/DocumentDate"
1812
1992
  },
1813
1993
  "downloaded": {
1814
1994
  "type": "boolean"
1815
1995
  },
1816
1996
  "id": {
1817
- "$ref": "#/definitions/DocumentId"
1997
+ "$ref": "#/$defs/DocumentId"
1818
1998
  },
1819
1999
  "income": {
1820
- "$ref": "#/definitions/DocumentIncome"
2000
+ "$ref": "#/$defs/DocumentIncome"
1821
2001
  },
1822
2002
  "lang": {
1823
- "$ref": "#/definitions/DocumentLang"
2003
+ "$ref": "#/$defs/DocumentLang"
1824
2004
  },
1825
2005
  "number": {
1826
- "$ref": "#/definitions/DocumentTaxNumber"
2006
+ "$ref": "#/$defs/DocumentTaxNumber"
1827
2007
  },
1828
2008
  "payment": {
1829
- "$ref": "#/definitions/DocumentPayment"
2009
+ "$ref": "#/$defs/DocumentPayment"
1830
2010
  },
1831
2011
  "ref": {
1832
- "$ref": "#/definitions/DocumentRef"
2012
+ "$ref": "#/$defs/DocumentRef"
1833
2013
  },
1834
2014
  "remarks": {
1835
- "$ref": "#/definitions/DocumentRemarks"
2015
+ "$ref": "#/$defs/DocumentRemarks"
1836
2016
  },
1837
2017
  "reverseCharge": {
1838
2018
  "type": "boolean"
1839
2019
  },
1840
2020
  "rounding": {
1841
- "$ref": "#/definitions/DocumentRounding"
2021
+ "$ref": "#/$defs/DocumentRounding"
1842
2022
  },
1843
2023
  "signed": {
1844
- "$ref": "#/definitions/DocumentSigned"
2024
+ "$ref": "#/$defs/DocumentSigned"
1845
2025
  },
1846
2026
  "skinId": {
1847
2027
  "type": "number"
1848
2028
  },
1849
2029
  "status": {
1850
- "$ref": "#/definitions/DocumentStatus"
2030
+ "$ref": "#/$defs/DocumentStatus"
1851
2031
  },
1852
2032
  "templateId": {
1853
2033
  "type": "number"
1854
2034
  },
1855
2035
  "type": {
1856
- "$ref": "#/definitions/DocumentType"
2036
+ "$ref": "#/$defs/DocumentType"
1857
2037
  },
1858
2038
  "url": {
1859
- "$ref": "#/definitions/Url"
2039
+ "$ref": "#/$defs/Url"
1860
2040
  },
1861
2041
  "vat": {
1862
- "$ref": "#/definitions/Vat"
2042
+ "$ref": "#/$defs/Vat"
1863
2043
  },
1864
2044
  "vatRate": {
1865
- "$ref": "#/definitions/VatRate"
2045
+ "$ref": "#/$defs/VatRate"
1866
2046
  },
1867
2047
  "vatType": {
1868
- "$ref": "#/definitions/VatType"
2048
+ "$ref": "#/$defs/VatType"
1869
2049
  }
1870
2050
  }
1871
2051
  },
1872
2052
  "Expense": {
1873
2053
  "allOf": [
1874
- { "$ref": "#/definitions/ExpensePartial" },
2054
+ { "$ref": "#/$defs/ExpensePartial" },
1875
2055
  {
2056
+ "type": "object",
1876
2057
  "required": [
1877
2058
  "currency",
1878
2059
  "vat",
@@ -1885,7 +2066,8 @@
1885
2066
  "accountingClassification"
1886
2067
  ]
1887
2068
  }
1888
- ]
2069
+ ],
2070
+ "unevaluatedProperties": false
1889
2071
  },
1890
2072
  "ExpensePartial": {
1891
2073
  "type": "object",
@@ -1905,13 +2087,13 @@
1905
2087
  ]
1906
2088
  },
1907
2089
  "currency": {
1908
- "$ref": "#/definitions/Currency"
2090
+ "$ref": "#/$defs/Currency"
1909
2091
  },
1910
2092
  "currencyRate": {
1911
- "$ref": "#/definitions/CurrencyRate"
2093
+ "$ref": "#/$defs/CurrencyRate"
1912
2094
  },
1913
2095
  "vat": {
1914
- "$ref": "#/definitions/Vat"
2096
+ "$ref": "#/$defs/Vat"
1915
2097
  },
1916
2098
  "amount": {
1917
2099
  "type": "number",
@@ -1930,7 +2112,7 @@
1930
2112
  "description": "Reporting date of the expense"
1931
2113
  },
1932
2114
  "documentType": {
1933
- "$ref": "#/definitions/ExpenseDocumentType"
2115
+ "$ref": "#/$defs/ExpenseDocumentType"
1934
2116
  },
1935
2117
  "number": {
1936
2118
  "type": ["string", "null"],
@@ -1942,13 +2124,13 @@
1942
2124
  },
1943
2125
  "remarks": {
1944
2126
  "type": "string",
1945
- "string": "Remarks for the expense"
2127
+ "description": "Remarks for the expense"
1946
2128
  },
1947
2129
  "supplier": {
1948
- "$ref": "#/definitions/Supplier"
2130
+ "$ref": "#/$defs/Supplier"
1949
2131
  },
1950
2132
  "accountingClassification": {
1951
- "$ref": "#/definitions/AccountingClassification"
2133
+ "$ref": "#/$defs/AccountingClassification"
1952
2134
  },
1953
2135
  "active": {
1954
2136
  "type": "boolean",
@@ -1983,7 +2165,7 @@
1983
2165
  "enum": [1, 2, 3, 4, 5, 6]
1984
2166
  },
1985
2167
  "documentType": {
1986
- "$ref": "#/definitions/ExpenseDocumentType"
2168
+ "$ref": "#/$defs/ExpenseDocumentType"
1987
2169
  },
1988
2170
  "status": {
1989
2171
  "type": "number",
@@ -1996,13 +2178,13 @@
1996
2178
  "enum": [-1, 0, 1, 2, 3, 4, 5, 10, 11]
1997
2179
  },
1998
2180
  "currency": {
1999
- "$ref": "#/definitions/Currency"
2181
+ "$ref": "#/$defs/Currency"
2000
2182
  },
2001
2183
  "currencyRate": {
2002
- "$ref": "#/definitions/CurrencyRate"
2184
+ "$ref": "#/$defs/CurrencyRate"
2003
2185
  },
2004
2186
  "vat": {
2005
- "$ref": "#/definitions/Vat"
2187
+ "$ref": "#/$defs/Vat"
2006
2188
  },
2007
2189
  "amount": {
2008
2190
  "type": "number",
@@ -2033,7 +2215,7 @@
2033
2215
  "description": "Remarks for the expense"
2034
2216
  },
2035
2217
  "supplier": {
2036
- "$ref": "#/definitions/Supplier"
2218
+ "$ref": "#/$defs/Supplier"
2037
2219
  },
2038
2220
  "thumbnail": {
2039
2221
  "type": "string",
@@ -2052,7 +2234,7 @@
2052
2234
  "description": "Reporting date of the expense"
2053
2235
  },
2054
2236
  "accountingClassification": {
2055
- "$ref": "#/definitions/AccountingClassification"
2237
+ "$ref": "#/$defs/AccountingClassification"
2056
2238
  },
2057
2239
  "amountLocal": {
2058
2240
  "type": "number",
@@ -2067,7 +2249,7 @@
2067
2249
  "description": "The vat amount of accounting"
2068
2250
  },
2069
2251
  "creationDate": {
2070
- "$ref": "#/definitions/CreationDate"
2252
+ "$ref": "#/$defs/CreationDate"
2071
2253
  },
2072
2254
  "lastUpdateDate": {
2073
2255
  "type": "integer",
@@ -2089,14 +2271,14 @@
2089
2271
  "enum": [10, 50]
2090
2272
  },
2091
2273
  "creationDate": {
2092
- "$ref": "#/definitions/CreationDate"
2274
+ "$ref": "#/$defs/CreationDate"
2093
2275
  },
2094
2276
  "lastUpdateDate": {
2095
2277
  "type": "integer",
2096
2278
  "description": "The last update date of the expense draft, in UNIX timestamp format"
2097
2279
  },
2098
2280
  "expense": {
2099
- "$ref": "#/definitions/ExpensePartial"
2281
+ "$ref": "#/$defs/ExpensePartial"
2100
2282
  },
2101
2283
  "thumbnail": {
2102
2284
  "type": "string",
@@ -2113,26 +2295,26 @@
2113
2295
  "additionalProperties": false,
2114
2296
  "properties": {
2115
2297
  "amount": {
2116
- "$ref": "#/definitions/DocumentAmount"
2298
+ "$ref": "#/$defs/DocumentAmount"
2117
2299
  },
2118
- "currency": { "$ref": "#/definitions/Currency" },
2300
+ "currency": { "$ref": "#/$defs/Currency" },
2119
2301
  "currencyRate": {
2120
- "$ref": "#/definitions/CurrencyRate"
2302
+ "$ref": "#/$defs/CurrencyRate"
2121
2303
  },
2122
2304
  "documentDate": {
2123
- "$ref": "#/definitions/DocumentDate"
2305
+ "$ref": "#/$defs/DocumentDate"
2124
2306
  },
2125
2307
  "id": {
2126
- "$ref": "#/definitions/DocumentId"
2308
+ "$ref": "#/$defs/DocumentId"
2127
2309
  },
2128
2310
  "number": {
2129
- "$ref": "#/definitions/DocumentTaxNumber"
2311
+ "$ref": "#/$defs/DocumentTaxNumber"
2130
2312
  },
2131
2313
  "status": {
2132
- "$ref": "#/definitions/DocumentStatus"
2314
+ "$ref": "#/$defs/DocumentStatus"
2133
2315
  },
2134
2316
  "type": {
2135
- "$ref": "#/definitions/DocumentType"
2317
+ "$ref": "#/$defs/DocumentType"
2136
2318
  }
2137
2319
  }
2138
2320
  },
@@ -2143,12 +2325,14 @@
2143
2325
  "amount": {
2144
2326
  "type": "number",
2145
2327
  "description": "Amount",
2146
- "examples": [354]
2328
+ "examples": [354],
2329
+ "minimum": 0
2147
2330
  },
2148
2331
  "amountTotal": {
2149
2332
  "type": "number",
2150
2333
  "description": "Total amount",
2151
- "examples": [354]
2334
+ "examples": [354],
2335
+ "minimum": 0
2152
2336
  },
2153
2337
  "catalogNum": {
2154
2338
  "type": "string",
@@ -2156,15 +2340,16 @@
2156
2340
  "examples": ["MXDFSDD"]
2157
2341
  },
2158
2342
  "currency": {
2159
- "$ref": "#/definitions/Currency"
2343
+ "$ref": "#/$defs/Currency"
2160
2344
  },
2161
2345
  "currencyRate": {
2162
- "$ref": "#/definitions/CurrencyRate"
2346
+ "$ref": "#/$defs/CurrencyRate"
2163
2347
  },
2164
2348
  "description": {
2165
2349
  "type": "string",
2166
2350
  "description": "Item description",
2167
- "examples": ["Item description"]
2351
+ "examples": ["Item description"],
2352
+ "minLength": 1
2168
2353
  },
2169
2354
  "itemId": {
2170
2355
  "type": "string",
@@ -2174,33 +2359,74 @@
2174
2359
  "price": {
2175
2360
  "type": "number",
2176
2361
  "description": "Item price",
2177
- "examples": [300]
2362
+ "examples": [300],
2363
+ "minimum": 0
2178
2364
  },
2179
2365
  "quantity": {
2180
2366
  "type": "number",
2181
2367
  "description": "Quantity",
2182
- "examples": [1]
2368
+ "examples": [1],
2369
+ "minimum": 0
2183
2370
  },
2184
2371
  "vat": {
2185
- "$ref": "#/definitions/Vat"
2372
+ "$ref": "#/$defs/Vat"
2186
2373
  },
2187
2374
  "vatRate": {
2188
- "$ref": "#/definitions/VatRate"
2375
+ "$ref": "#/$defs/VatRate"
2189
2376
  },
2190
2377
  "vatType": {
2191
- "$ref": "#/definitions/VatType"
2378
+ "$ref": "#/$defs/VatType"
2192
2379
  }
2193
2380
  },
2194
2381
  "required": ["description", "quantity", "price", "currency", "vatType"]
2195
2382
  },
2383
+ "PaginationMeta": {
2384
+ "type": "object",
2385
+ "description": "Pagination metadata for list responses",
2386
+ "additionalProperties": false,
2387
+ "required": ["total", "page", "pageSize", "pages"],
2388
+ "properties": {
2389
+ "total": {
2390
+ "type": "number",
2391
+ "description": "Total number of items",
2392
+ "minimum": 0
2393
+ },
2394
+ "page": {
2395
+ "type": "number",
2396
+ "description": "Current page number",
2397
+ "minimum": 1
2398
+ },
2399
+ "pageSize": {
2400
+ "type": "number",
2401
+ "description": "Number of items per page",
2402
+ "minimum": 1
2403
+ },
2404
+ "pages": {
2405
+ "type": "number",
2406
+ "description": "Total number of pages",
2407
+ "minimum": 0
2408
+ },
2409
+ "from": {
2410
+ "type": "number",
2411
+ "description": "Starting index",
2412
+ "minimum": 0
2413
+ },
2414
+ "to": {
2415
+ "type": "number",
2416
+ "description": "Ending index",
2417
+ "minimum": 0
2418
+ }
2419
+ }
2420
+ },
2196
2421
  "Payment": {
2197
2422
  "allOf": [
2198
- { "$ref": "#/definitions/PaymentCore" },
2423
+ { "$ref": "#/$defs/PaymentCore" },
2199
2424
  {
2200
- "additionalProperties": false,
2425
+ "type": "object",
2201
2426
  "properties": {
2202
2427
  "amount": {
2203
- "type": "number"
2428
+ "type": "number",
2429
+ "description": "Payment amount"
2204
2430
  },
2205
2431
  "cancellable": {
2206
2432
  "type": "boolean",
@@ -2208,33 +2434,36 @@
2208
2434
  "examples": [false]
2209
2435
  },
2210
2436
  "description": {
2211
- "type": "string"
2437
+ "type": "string",
2438
+ "description": "Payment description"
2212
2439
  },
2213
2440
  "name": {
2214
2441
  "type": "string",
2442
+ "description": "Payment name",
2215
2443
  "examples": ["העברה בנקאית"]
2216
2444
  },
2217
2445
  "ref": {
2218
2446
  "type": "array",
2219
2447
  "description": "The referred documents types",
2220
2448
  "items": {
2221
- "$ref": "#/definitions/DocumentType"
2449
+ "$ref": "#/$defs/DocumentType"
2222
2450
  }
2223
2451
  }
2224
2452
  },
2225
2453
  "required": ["type", "price"]
2226
2454
  }
2227
- ]
2455
+ ],
2456
+ "unevaluatedProperties": false
2228
2457
  },
2229
2458
  "PaymentDocument": {
2230
2459
  "type": "object",
2231
2460
  "additionalProperties": false,
2232
2461
  "properties": {
2233
2462
  "currency": {
2234
- "$ref": "#/definitions/Currency"
2463
+ "$ref": "#/$defs/Currency"
2235
2464
  },
2236
2465
  "currencyRate": {
2237
- "$ref": "#/definitions/CurrencyRate"
2466
+ "$ref": "#/$defs/CurrencyRate"
2238
2467
  },
2239
2468
  "date": {
2240
2469
  "type": "string"
@@ -2319,20 +2548,23 @@
2319
2548
  },
2320
2549
  "PaymentCore": {
2321
2550
  "type": "object",
2551
+ "additionalProperties": false,
2322
2552
  "properties": {
2323
2553
  "currency": {
2324
- "$ref": "#/definitions/Currency"
2554
+ "$ref": "#/$defs/Currency"
2325
2555
  },
2326
2556
  "currencyRate": {
2327
- "$ref": "#/definitions/CurrencyRate"
2557
+ "$ref": "#/$defs/CurrencyRate"
2328
2558
  },
2329
2559
  "date": {
2330
- "type": "string"
2560
+ "type": "string",
2561
+ "description": "Payment date"
2331
2562
  },
2332
2563
  "price": {
2333
2564
  "type": "number",
2334
2565
  "description": "Sum paid",
2335
- "examples": [300]
2566
+ "examples": [300],
2567
+ "minimum": 0
2336
2568
  },
2337
2569
  "type": {
2338
2570
  "type": "number",
@@ -2347,115 +2579,75 @@
2347
2579
  }
2348
2580
  },
2349
2581
  "Supplier": {
2350
- "type": "object",
2351
- "additionalProperties": false,
2352
- "description": "Supplier of the expense",
2353
- "properties": {
2354
- "id": {
2355
- "type": "string",
2356
- "description": "The supplier ID"
2357
- },
2358
- "name": {
2359
- "type": "string",
2360
- "description": "The supplier name"
2361
- },
2362
- "active": {
2363
- "type": "boolean",
2364
- "description": "Is the supplier active or not"
2365
- },
2366
- "taxId": {
2367
- "type": "string",
2368
- "description": "The supplier tax ID"
2369
- },
2370
- "paymentTerms": {
2371
- "type": "number",
2372
- "description": "The supplier payment term, default is 0",
2373
- "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
2374
- },
2375
- "bankName": {
2376
- "type": "string",
2377
- "description": "The supplier bank name"
2378
- },
2379
- "bankBranch": {
2380
- "type": "string",
2381
- "description": "The supplier bank branch number"
2382
- },
2383
- "bankAccount": {
2384
- "type": "string",
2385
- "description": "The supplier bank account number"
2386
- },
2387
- "country": {
2388
- "$ref": "#/definitions/Country"
2389
- },
2390
- "phone": {
2391
- "type": "string",
2392
- "description": "The supplier phone number"
2393
- },
2394
- "mobile": {
2395
- "type": "string",
2396
- "description": "The supplier mobile number"
2397
- },
2398
- "contactPerson": {
2399
- "type": "string",
2400
- "description": "The supplier contact person name"
2401
- },
2402
- "emails": {
2403
- "$ref": "#/definitions/ClientEmails"
2404
- },
2405
- "labels": {
2406
- "type": "array",
2407
- "additionalItems": false,
2408
- "items": {
2409
- "type": "string"
2582
+ "allOf": [
2583
+ { "$ref": "#/$defs/ContactInfo" },
2584
+ { "$ref": "#/$defs/Address" },
2585
+ { "$ref": "#/$defs/BankingInfo" },
2586
+ {
2587
+ "type": "object",
2588
+ "description": "Supplier of the expense",
2589
+ "properties": {
2590
+ "id": {
2591
+ "type": "string",
2592
+ "description": "The supplier ID"
2593
+ },
2594
+ "name": {
2595
+ "type": "string",
2596
+ "description": "The supplier name"
2597
+ },
2598
+ "active": {
2599
+ "type": "boolean",
2600
+ "description": "Is the supplier active or not"
2601
+ },
2602
+ "taxId": {
2603
+ "type": "string",
2604
+ "description": "The supplier tax ID"
2605
+ },
2606
+ "paymentTerms": {
2607
+ "type": "number",
2608
+ "description": "The supplier payment term, default is 0",
2609
+ "enum": [-1, 0, 10, 15, 30, 45, 60, 75, 90, 120]
2610
+ },
2611
+ "labels": {
2612
+ "type": "array",
2613
+ "items": {
2614
+ "type": "string"
2615
+ }
2616
+ },
2617
+ "creationDate": {
2618
+ "$ref": "#/$defs/CreationDate"
2619
+ },
2620
+ "lastUpdateDate": {
2621
+ "type": "integer",
2622
+ "description": "The last update date of the supplier, in UNIX timestamp format"
2623
+ },
2624
+ "department": {
2625
+ "type": "string",
2626
+ "description": "The supplier department"
2627
+ },
2628
+ "accountingKey": {
2629
+ "type": "string",
2630
+ "description": "The supplier accounting key"
2631
+ },
2632
+ "remarks": {
2633
+ "type": "string",
2634
+ "description": "The Supplier remarks for self use"
2635
+ },
2636
+ "incomeAmount": {
2637
+ "type": "number",
2638
+ "description": "The amount of incomes from the customer"
2639
+ },
2640
+ "paymentAmount": {
2641
+ "type": "number"
2642
+ },
2643
+ "balanceAmount": {
2644
+ "type": "number",
2645
+ "description": "The balance amount of the supplier"
2646
+ }
2410
2647
  }
2411
- },
2412
- "creationDate": {
2413
- "$ref": "#/definitions/CreationDate"
2414
- },
2415
- "lastUpdateDate": {
2416
- "type": "integer",
2417
- "description": "The last update date of the supplier, in UNIX timestamp format"
2418
- },
2419
- "department": {
2420
- "type": "string",
2421
- "description": "The supplier department"
2422
- },
2423
- "accountingKey": {
2424
- "type": "string",
2425
- "description": "The supplier accounting key"
2426
- },
2427
- "address": {
2428
- "type": "string",
2429
- "description": "The supplier address"
2430
- },
2431
- "city": {
2432
- "type": "string",
2433
- "description": "The supplier city"
2434
- },
2435
- "zip": {
2436
- "type": "string",
2437
- "description": "The supplier zip code"
2438
- },
2439
- "fax": {
2440
- "type": "string",
2441
- "description": "The supplier fax number"
2442
- },
2443
- "remarks": {
2444
- "type": "string",
2445
- "description": "The Supplier remarks for self use"
2446
- },
2447
- "incomeAmount": {
2448
- "type": "number",
2449
- "description": "The amount of incomes from the customer"
2450
- },
2451
- "paymentAmount": {
2452
- "type": "number"
2453
- },
2454
- "balanceAmount": {
2455
- "type": "number",
2456
- "description": "The balance amount of the supplier"
2457
2648
  }
2458
- }
2649
+ ],
2650
+ "unevaluatedProperties": false
2459
2651
  },
2460
2652
  "ErrorResponse": {
2461
2653
  "type": "object",
@@ -2491,12 +2683,15 @@
2491
2683
  },
2492
2684
  "CreationDate": {
2493
2685
  "type": "integer",
2494
- "description": "The creation date, in UNIX timestamp format"
2686
+ "description": "The creation date, in UNIX timestamp format",
2687
+ "minimum": 0
2495
2688
  },
2496
2689
  "CurrencyRate": {
2497
2690
  "type": "number",
2498
2691
  "description": "Currency rate relative to ILS",
2499
- "examples": [1]
2692
+ "examples": [1],
2693
+ "minimum": 0,
2694
+ "exclusiveMinimum": 0
2500
2695
  },
2501
2696
  "DocumentLang": {
2502
2697
  "description": "Document language",
@@ -2505,12 +2700,13 @@
2505
2700
  },
2506
2701
  "DocumentDescription": {
2507
2702
  "description": "Document's description",
2508
- "type": "string"
2703
+ "type": "string",
2704
+ "minLength": 1
2509
2705
  },
2510
2706
  "DocumentIncome": {
2511
2707
  "type": "array",
2512
2708
  "items": {
2513
- "$ref": "#/definitions/Income"
2709
+ "$ref": "#/$defs/Income"
2514
2710
  }
2515
2711
  },
2516
2712
  "DocumentId": {
@@ -2520,7 +2716,7 @@
2520
2716
  "DocumentLinkedDocuments": {
2521
2717
  "type": "array",
2522
2718
  "items": {
2523
- "$ref": "#/definitions/DocumentLinkedDocument"
2719
+ "$ref": "#/$defs/DocumentLinkedDocument"
2524
2720
  }
2525
2721
  },
2526
2722
  "DocumentLinkedDocument": {
@@ -2528,26 +2724,26 @@
2528
2724
  "additionalProperties": false,
2529
2725
  "properties": {
2530
2726
  "amount": {
2531
- "$ref": "#/definitions/DocumentAmount"
2727
+ "$ref": "#/$defs/DocumentAmount"
2532
2728
  },
2533
- "currency": { "$ref": "#/definitions/Currency" },
2729
+ "currency": { "$ref": "#/$defs/Currency" },
2534
2730
  "currencyRate": {
2535
- "$ref": "#/definitions/CurrencyRate"
2731
+ "$ref": "#/$defs/CurrencyRate"
2536
2732
  },
2537
2733
  "documentDate": {
2538
- "$ref": "#/definitions/DocumentDate"
2734
+ "$ref": "#/$defs/DocumentDate"
2539
2735
  },
2540
2736
  "id": {
2541
- "$ref": "#/definitions/DocumentId"
2737
+ "$ref": "#/$defs/DocumentId"
2542
2738
  },
2543
2739
  "number": {
2544
- "$ref": "#/definitions/DocumentTaxNumber"
2740
+ "$ref": "#/$defs/DocumentTaxNumber"
2545
2741
  },
2546
2742
  "reverseCharge": {
2547
2743
  "type": "boolean"
2548
2744
  },
2549
2745
  "type": {
2550
- "$ref": "#/definitions/DocumentType"
2746
+ "$ref": "#/$defs/DocumentType"
2551
2747
  }
2552
2748
  },
2553
2749
  "required": [
@@ -2564,7 +2760,7 @@
2564
2760
  "DocumentPayment": {
2565
2761
  "type": "array",
2566
2762
  "items": {
2567
- "$ref": "#/definitions/PaymentDocument"
2763
+ "$ref": "#/$defs/PaymentDocument"
2568
2764
  }
2569
2765
  },
2570
2766
  "DocumentRef": {
@@ -2583,7 +2779,8 @@
2583
2779
  },
2584
2780
  "DocumentDate": {
2585
2781
  "description": "Document reference date",
2586
- "type": "string"
2782
+ "type": "string",
2783
+ "format": "date"
2587
2784
  },
2588
2785
  "DocumentDiscount": {
2589
2786
  "description": "Discount information",
@@ -2635,42 +2832,50 @@
2635
2832
  "DocumentSerialNumber": {
2636
2833
  "description": "Document serial number",
2637
2834
  "type": "integer",
2638
- "examples": [10002]
2835
+ "examples": [10002],
2836
+ "minimum": 1
2639
2837
  },
2640
2838
  "DocumentAmount": {
2641
2839
  "description": "Total amount, in requested currency (including the VAT, Discount & Rounding)",
2642
2840
  "type": "number",
2643
- "examples": [354]
2841
+ "examples": [354],
2842
+ "minimum": 0
2644
2843
  },
2645
2844
  "DocumentAmountDueVat": {
2646
2845
  "description": "Amount due VAT - Amount before VAT, and before rounding & discount (if requested)",
2647
2846
  "type": "number",
2648
- "examples": [100]
2847
+ "examples": [100],
2848
+ "minimum": 0
2649
2849
  },
2650
2850
  "DocumentAmountExcludeVat": {
2651
2851
  "description": "Amount excluded VAT - Amount that is excluded of VAT",
2652
2852
  "type": "number",
2653
- "examples": [18]
2853
+ "examples": [18],
2854
+ "minimum": 0
2654
2855
  },
2655
2856
  "DocumentAmountDueVatLocal": {
2656
2857
  "description": "Amount due VAT - local currency",
2657
2858
  "type": "number",
2658
- "examples": [100]
2859
+ "examples": [100],
2860
+ "minimum": 0
2659
2861
  },
2660
2862
  "DocumentAmountExemptVat": {
2661
2863
  "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)",
2662
2864
  "type": "number",
2663
- "examples": [18]
2865
+ "examples": [18],
2866
+ "minimum": 0
2664
2867
  },
2665
2868
  "DocumentAmountLocal": {
2666
2869
  "description": "Amount in local currency",
2667
2870
  "type": "number",
2668
- "examples": [300]
2871
+ "examples": [300],
2872
+ "minimum": 0
2669
2873
  },
2670
2874
  "DocumentAmountOpened": {
2671
2875
  "description": "Amount that is still left to be paid, exists only in payment request documents",
2672
2876
  "type": "number",
2673
- "examples": [300]
2877
+ "examples": [300],
2878
+ "minimum": 0
2674
2879
  },
2675
2880
  "ExpenseDocumentType": {
2676
2881
  "type": "number",
@@ -2680,7 +2885,8 @@
2680
2885
  "Vat": {
2681
2886
  "description": "VAT amount",
2682
2887
  "type": "number",
2683
- "examples": [54]
2888
+ "examples": [54],
2889
+ "minimum": 0
2684
2890
  },
2685
2891
  "VatType": {
2686
2892
  "description": "VAT type",
@@ -2690,7 +2896,9 @@
2690
2896
  },
2691
2897
  "VatRate": {
2692
2898
  "type": "number",
2693
- "description": "VAT rate"
2899
+ "description": "VAT rate",
2900
+ "minimum": 0,
2901
+ "maximum": 100
2694
2902
  }
2695
2903
  }
2696
2904
  }