This repository was archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvic.api.v0.yaml
5664 lines (5660 loc) · 183 KB
/
vic.api.v0.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
openapi: 3.1.0
info:
version: 0.20.0
contact: {}
title: Vic.ai API
description:
$ref: 'docs/main.md'
security:
- BearerAuth: []
servers:
- url: https://api.us.stage.vic.ai/v0
description: staging server, US
- url: https://api.no.stage.vic.ai/v0
description: staging server, NO
- url: https://api.us.vic.ai/v0
description: production server, US
- url: https://api.no.vic.ai/v0
description: production server, NO
tags:
- name: Authentication
description:
$ref: 'docs/authentication.md'
- name: Pagination
description:
$ref: 'docs/pagination.md'
- name: Accounts
description: |
GL (General Ledger) accounts are part of your *ERP* **Masterdata**. In
order to be associated with an invoice line item, key data about the
account must be stored in Vic.ai. These operations allow querying and
manipulation of these GL account data.
- name: Attachments
description:
$ref: 'docs/attachments.md'
- name: Dimensions
description: |
Dimensions are part of your *ERP* **Masterdata**, and represent business
categories that are associated with invoice line items, that Vic.ai can
automatically assign to invoice line items. These operations allow
querying and manipulation of the dimension data.
- name: Invoices
description: |
These routes give you read-only access to two types of invoices:
- Invoices which have not yet been posted to the ERP system (restricted access).
- Invoices which have been posted to the ERP system.
- name: Invoices for training
description: |
Invoices used for training AI models.
- name: Payment batches
description: |
Payment batches are a collection of payments that are made to vendors.
- name: Payment terms
description: |
Payment terms are part of your *ERP* **Masterdata**, and represent
payment terms that Vic.ai can automatically assign to invoices. Some
vendors may have a default payment term, and some invoices may have a
specific payment term. In either case, Vic.ai can automatically assign
payment terms to invoices.
- name: Purchase orders
description: The purchase orders.
- name: Status
description: |
Status requests on the state of the Vic.ai system.
- name: Tags
description: |
Tags are part of your *ERP* **Masterdata**, and represent business
categories that are associated with certain entities, like Vendor.
- name: Tax codes
description: The tax codes.
- name: VAT codes
description: |
In some regions, VAT codes are part of your *ERP* **Masterdata**, that
represent timeboxed VAT codes and VAT values that Vic.ai can automatically
assign to invoice line items.
- name: Vendors
description: |
Vendors are part of your *ERP* **Masterdata**, and represent companies
that produce invoices. In order to be associated with an invoice, key
data about the vendor must be stored in Vic.ai. These operations allow
querying and manipulation of the vendor data.
- name: Vendor groups
description: |
Vendors can be grouped together in Vic.ai. This is especially useful
for purchase order matching where you want to match a purchase order
to a group of vendors.
- name: Vendor tags
description: |
Vendor tags are used to categorize vendors using tags.
- name: Synchronizing
description:
$ref: 'docs/synchronizing.md'
- name: Webhooks
description:
$ref: 'docs/webhooks.md'
paths:
/token:
post:
description: |
Use this endpoint to obtain an access token that can be used to authenticate subsequent requests to the API.
summary: Obtain an access token
operationId: obtainToken
tags: [Authentication]
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GetTokenInput'
responses:
'200':
$ref: '#/components/responses/TokenCreatedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/healthCheck:
get:
description: |
Use this request to obtain a health check statement.
summary: Health check
operationId: healthCheck
tags: [Status]
responses:
'200':
$ref: '#/components/responses/HealthyResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/accounts:
get:
description: |
Use this request to query the GL account data that are stored in Vic.ai.
summary: List all accounts
operationId: listAccounts
tags: [Accounts]
parameters:
- $ref: '#/components/parameters/PagingLimit'
- $ref: '#/components/parameters/PagingCursor'
- $ref: '#/components/parameters/SinceFilter'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/SortOrder'
responses:
'200':
$ref: '#/components/responses/AccountsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/accounts/synchronize:
post:
description: |
Tells the ERP to synchronize the Account resource. If the ERP is
using the API, the call will be sent via the normal webhook methods. If
the ERP is not using this API then this will call the native
integration's synchronize functionality.
summary: Synchronize Accounts
operationId: synchronizeAccounts
tags: [Accounts, Synchronizing]
responses:
'204':
$ref: '#/components/responses/SynchronizeAccountsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/accounts/{id}:
get:
description: |
Use this request to get data for a single GL account that is stored in
Vic.ai.
summary: Info for a specific account
operationId: getAccount
tags: [Accounts]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
responses:
'200':
$ref: '#/components/responses/AccountResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
put:
description: |
Use this request to *upsert* GL account data for one GL account into
Vic.ai.
If the account is known by Vic.ai, the externalId supplied will be used
to resolve the account and perform an update of the data, otherwise, a
new account will be inserted.
If the upsert action is part of a syncRequest, you should include the
syncRequest ID in the `X-Request-Id` header.
summary: Upserts an account
operationId: upsertAccount
tags: [Accounts]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/RequestId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AccountUpsert'
responses:
'201':
$ref: '#/components/responses/AccountUpsertedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
delete:
description: |
Use this request to delete data for a single account that is stored in
Vic.ai
summary: Deletes an account
operationId: deleteAccount
tags: [Accounts]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
responses:
'201':
$ref: '#/components/responses/AccountDeletedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/dimensions:
get:
description: |
Use this request to query the dimensions data that are stored in Vic.ai.
summary: List all dimensions
operationId: listDimensions
tags: [Dimensions]
parameters:
- $ref: '#/components/parameters/PagingLimit'
- $ref: '#/components/parameters/PagingCursor'
- $ref: '#/components/parameters/SinceFilter'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/SortOrder'
responses:
'200':
$ref: '#/components/responses/DimensionsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
post:
description: Create a new dimension in Vic.ai.
summary: Create a dimension
operationId: createDimension
tags: [Dimensions]
requestBody:
$ref: '#/components/requestBodies/CreateDimensionRequest'
responses:
'201':
$ref: '#/components/responses/DimensionCreatedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/dimensions/synchronize:
post:
description: |
Tells the ERP to synchronize the Dimension resource. If the ERP is
using the API, the call will be sent via the normal webhook methods. If
the ERP is not using this API then this will call the native
integration's synchronize functionality.
summary: Synchronize Dimensions
operationId: synchronizeDimensions
tags: [Dimensions, Synchronizing]
responses:
'204':
$ref: '#/components/responses/SynchronizeDimensionsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/dimensions/{id}:
get:
description: |
Use this request to get data for a single dimension that is stored in
Vic.ai.
summary: Info for a specific dimension
operationId: getDimension
tags: [Dimensions]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
responses:
'200':
$ref: '#/components/responses/DimensionResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
put:
description: |
Use this request to update or insert dimensions data for one dimension
into Vic.ai.
**Note:** The insert portion of this will be changed to no longer
function and the `createDimension` operation should be used instead.
If the dimension is known by Vic.ai, the `externalId` supplied will be
used to resolve the dimension and perform an update of the data,
otherwise, a new dimension will be inserted.
If the upsert action is part of a `syncRequest`, you should include the
`syncRequest` ID in the `X-Request-Id` header.
summary: Upserts a dimension
operationId: upsertDimension
tags: [Dimensions]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/RequestId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DimensionUpsert'
responses:
'200':
$ref: '#/components/responses/DimensionUpdatedResponse'
'201':
$ref: '#/components/responses/DimensionCreatedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
delete:
description: Use this request to delete data for a single dimension that is
stored in Vic.ai
summary: Deletes a dimension
operationId: deleteDimension
tags: [Dimensions]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
responses:
'201':
$ref: '#/components/responses/DimensionDeletedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vendors:
get:
description: Use this request to query the vendor data that are stored in Vic.ai.
summary: List all vendors
operationId: listVendors
tags: [Vendor groups]
parameters:
- $ref: '#/components/parameters/PagingLimit'
- $ref: '#/components/parameters/PagingCursor'
- $ref: '#/components/parameters/SinceFilter'
- $ref: '#/components/parameters/VendorConfirmedFilter'
- $ref: '#/components/parameters/VendorUnconfirmedFilter'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/SortOrder'
- name: state
in: query
description: |
Filter vendors by state.
- `PENDING` - The vendor is not confirmed, has no errors, and was
not predicted. It is pending to be confirmed.
- `ACTIVE` - The vendor is confirmed and has no errors.
- `PREDICTED` - The vendor was predicted by Vic.
- `ERRORED` - The vendor has errors set.
required: false
schema:
$ref: '#/components/schemas/VendorStateFilter'
responses:
'200':
$ref: '#/components/responses/VendorsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vendors/synchronize:
post:
description: |
Tells the ERP to synchronize the Vendor resource. If the ERP is using
the API, the call will be sent via the normal webhook methods. If the
ERP is not using this API then this will call the native integration's
synchronize functionality.
summary: Synchronize Vendors
operationId: synchronizeVendors
tags: [Vendors, Synchronizing]
responses:
'204':
$ref: '#/components/responses/SynchronizeVendorsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vendors/{id}:
get:
description: |
Use this request to get data for a single vendor that is stored in Vic.ai.
summary: Info for a specific vendor
operationId: getVendor
tags: [Vendors]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
responses:
'200':
$ref: '#/components/responses/VendorResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
put:
description: |
Updates or inserts a vendor into the Vic.ai system.
All fields passed are set on the vendor. All fields that are omitted
from the request body are considered to be null and will be set to null.
If the vendor is known by Vic.ai, the `externalId` supplied will be used
to resolve the vendor and perform an update of the data, otherwise, a
new vendor will be inserted.
If the upsert action is part of a `syncRequest`, you should include the
`syncRequest` ID in the `X-Request-Id` header.
summary: Upserts a vendor
operationId: upsertVendor
tags: [Vendors]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/RequestId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/VendorUpsert'
responses:
'200':
$ref: '#/components/responses/VendorUpdatedResponse'
'201':
$ref: '#/components/responses/VendorCreatedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
delete:
description: |
Use this request to delete data for a single vendor that is stored in
Vic.ai
summary: Deletes a vendor
operationId: deleteVendor
tags: [Vendors]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
responses:
'201':
$ref: '#/components/responses/VendorDeletedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vendors/{id}/errors:
post:
description: |
Use this post to report vendor update failure errors back to Vic.ai.
Strictly a response to the callbacks.
* The `X-Request-Id` header is required.
* The `id` MUST be a Vendor `internalId`.
summary: Completes the response callback cycle resulting from a 202
operationId: setVendorRemoteErrors
tags: [Vendors]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/RequestId'
- $ref: '#/components/parameters/UseSystem'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SetVendorRemoteErrors'
responses:
'200':
$ref: '#/components/responses/VendorRemoteErrorsUpdatedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
delete:
summary: Clears errors on the Vendor.
description: Used to clear errors that have been fixed in the ERP system.
operationId: clearVendorRemoteErrors
tags: [Vendors]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/RequestId'
- $ref: '#/components/parameters/UseSystem'
responses:
'200':
$ref: '#/components/responses/VendorRemoteErrorsClearedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vendorGroups:
get:
description: List all vendor groups.
summary: List all vendor groups
operationId: listVendorGroups
tags: [Vendor groups]
parameters:
- $ref: '#/components/parameters/PagingLimit'
- $ref: '#/components/parameters/PagingCursor'
responses:
'200':
$ref: '#/components/responses/VendorGroupsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
post:
description: Create a vendor group.
summary: Create a vendor group
operationId: createVendorGroup
tags: [Vendor groups]
requestBody:
$ref: '#/components/requestBodies/CreateVendorGroupRequest'
responses:
'201':
$ref: '#/components/responses/VendorGroupResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vendorGroups/{id}:
put:
description: Update the vendor group.
summary: Update the vendor group
operationId: updateVendorGroup
tags: [Vendor groups]
parameters:
- name: id
in: path
required: true
description: The id of the vendor group
schema:
type: string
format: uuid
requestBody:
$ref: '#/components/requestBodies/UpdateVendorGroupRequest'
responses:
'200':
$ref: '#/components/responses/VendorGroupResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
delete:
description: Delete vendor group.
summary: Delete vendor group
operationId: deleteVendorGroup
tags: [Vendors]
parameters:
- name: id
in: path
required: true
description: The id of the vendor group
schema:
type: string
format: uuid
responses:
'204':
$ref: '#/components/responses/VendorGroupDeletedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/attachments:
post:
description: |
Use this to upload an attachment to Vic.ai. The attachment will be
created and processing enqueued automatically.
The response is a 201 with the attachment ID.
summary: Upload an attachment
operationId: uploadAttachment
tags: [Attachments]
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [file]
properties:
file:
type: string
format: binary
responses:
'201':
$ref: '#/components/responses/AttachmentCreatedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/invoices:
get:
description: |
Use this request to query the invoice data that are stored in Vic.ai.
summary: List all invoices
operationId: listInvoices
tags: [Invoices]
parameters:
- $ref: '#/components/parameters/PagingLimit'
- $ref: '#/components/parameters/PagingCursor'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/SinceFilter'
- $ref: '#/components/parameters/SortOrder'
- $ref: '#/components/parameters/InvoiceStateFilter'
- $ref: '#/components/parameters/InvoiceMarkedAsFilter'
- $ref: '#/components/parameters/InvoiceBillStatusFilter'
responses:
'200':
$ref: '#/components/responses/InvoicesResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
post:
summary: Create an invoice.
description:
$ref: 'docs/create_invoice.md'
operationId: createInvoice
tags: [Invoices]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateInvoice'
responses:
'201':
$ref: '#/components/responses/InvoiceCreatedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/ResourceNotFoundResponse'
'422':
$ref: '#/components/responses/UnprocessableEntityResponse'
/invoices/{id}:
get:
description: |
Use this request to get data for a single invoice that is stored in
Vic.ai
summary: Info for a specific invoice
operationId: getInvoice
tags: [Invoices]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
responses:
'200':
$ref: '#/components/responses/InvoiceResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
patch:
description: |
Use this request to indicate that an invoice has been posted or
transferred to the ERP system, in the case where you have not activated
a subscription, or you have responded to the subscription with a
202-asynchronous response.
Note that this operation can either be a confirmation, or a rejection,
depending on the shape of the payload.
Possible payloads:
- InvoiceConfirm: used to confirm that the invoice data have been
successfully posted to the ERP, possibly including a postingError.
- Use of this postingError means that the invoice data are posted, but
some secondary content needs amendation in the ERP that cannot be
performed from the vic user interface (for example: a problem
uploading the posted document).
- InvoiceReject: used to communicate that the invoice data have NOT been
successfully posted to the ERP, due to invalid data. This should NOT
be used to communicate an error in posting due to a general failure
such as a network issue or an availability issue with the ERP, in
those or similar cases, a retry should be performed without notifying the vic system.
Currently unsupported:
- InvoiceClearError: the error set in an `InvoiceConfirm` operation
should be cleared because the postingError has been resolved in the
ERP. This cannot be used to clear an error due to `InvoiceReject`.
Note that `:id` *must* be internalId for this route.
summary: Asynchronous reply to invoice post or invoice transfer
operationId: ackInvoice
tags: [Invoices]
parameters:
- name: id
in: path
required: true
description: |
The `internalId` of the invoice which should be confirmed.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/InvoiceConfirm'
- $ref: '#/components/schemas/InvoiceReject'
responses:
'201':
$ref: '#/components/responses/InvoiceResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
delete:
description: |
Use this request to delete data for a single invoice that is stored in
Vic.ai
summary: Deletes an invoice
operationId: deleteInvoice
tags: [Invoices]
parameters:
- $ref: '#/components/parameters/PathId'
- $ref: '#/components/parameters/UseSystem'
- $ref: '#/components/parameters/Comment'
responses:
'204':
$ref: '#/components/responses/InvoiceDeletedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/invoices/{id}/process:
post:
summary: Start the invoice processing.
description: |
Tells Vic that the invoice is ready to start being processed. Once this
is called, it may not be called again.
operationId: startProcessingInvoice
tags: [Invoices]
parameters:
- $ref: '#/components/parameters/UseSystem'
- name: id
in: path
required: true
description: The Invoice internal id or external id.
schema:
type: string
responses:
'202':
$ref: '#/components/responses/InvoiceResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/ResourceNotFoundResponse'
'422':
$ref: '#/components/responses/UnprocessableEntityResponse'
/invoices/{id}/document:
get:
description: |
Use this request to get the document associated with a single invoice
that is stored in Vic.ai
summary: Document for a specific invoice
operationId: getInvoiceDocument
tags: [Invoices]
parameters:
- $ref: '#/components/parameters/UseSystem'
- name: id
in: path
required: true
description: The Invoice internal id or external id.
schema:
type: string
responses:
'200':
$ref: '#/components/responses/InvoiceDocumentResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
post:
summary: Upload document invoice
description: |
This attaches a document to the invoice for processing. An external id
must be specified for an invoice prior to calling this.
* Once an invoice has been processed, you may not attach a new document.
* Once a document has been attached to an invoice, it may not be
changed.
**NOTE:** The maximum file size allowed is 64MB.
operationId: uploadDocumentInvoice
tags: [Invoices]
parameters:
- $ref: '#/components/parameters/UseSystem'
- name: id
in: path
required: true
description: The Invoice internal id or external id.
schema:
type: string
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [document]
properties:
document:
type: string
format: binary
responses:
'200':
$ref: '#/components/responses/InvoiceResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/ResourceNotFoundResponse'
'422':
$ref: '#/components/responses/UnprocessableEntityResponse'
/invoices/{id}/confirm:
post:
description: |
Used to confirm that the invoice data have been successfully posted to
the ERP, possibly including a `postingError`.
Use of this `postingError` means that the invoice data are posted, but
some secondary content needs amendation in the ERP that cannot be
performed from the vic user interface (for example: a problem
uploading the posted document).
Note: `id` *must* be the `internalId` of the invoice.
summary: Asynchronous reply to invoice post or invoice transfer
operationId: confirmInvoice
tags: [Invoices]
parameters:
- name: id
in: path
required: true
description: |
The `internalId` of the invoice which should be confirmed.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/InvoiceConfirm'
responses:
'200':
$ref: '#/components/responses/InvoiceConfirmedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/ResourceNotFoundResponse'
'422':
$ref: '#/components/responses/UnprocessableEntityResponse'
/invoices/{id}/reject:
post:
description: |
Used to communicate that the invoice data have **NOT** been
successfully posted to the ERP, due to invalid data. This should **NOT**
be used to communicate an error in posting due to a general failure
such as a network issue or an availability issue with the ERP, in
those or similar cases, a retry should be performed without notifying the vic system.
Note: `id` *must* be the `internalId` of the invoice.
summary: Asynchronous reply to invoice post
operationId: rejectInvoice
tags: [Invoices]
parameters:
- name: id
in: path
required: true
description: |
The `internalId` of the invoice which should be confirmed.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/InvoiceReject'
responses:
'200':
$ref: '#/components/responses/InvoiceRejectedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/ResourceNotFoundResponse'
'422':
$ref: '#/components/responses/UnprocessableEntityResponse'
/invoices/{id}/lineItems:
get:
description: |
List all of the line items for the invoice.
NOTE: They are ungrouped so that you may inspect and modify them as
necessary.
summary: line items for a specific invoice
operationId: getInvoicelineItems
tags: [Invoices]
parameters:
- $ref: '#/components/parameters/UseSystem'
- name: id
in: path
required: true
description: The Invoice internal id or external id.
schema:
type: string
responses:
'200':
$ref: '#/components/responses/InvoiceLineItemsResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/trainingInvoices:
get:
description: |
Use this request to query the training invoice data that are stored in Vic.ai.
summary: List all training invoices
operationId: listTrainingInvoices
tags: [Invoices for training]
parameters:
- $ref: '#/components/parameters/PagingLimit'
- $ref: '#/components/parameters/PagingCursor'
- $ref: '#/components/parameters/SinceFilter'
- $ref: '#/components/parameters/SortOrder'
responses:
'200':
$ref: '#/components/responses/TrainingInvoicesResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/trainingInvoices/{id}:
get:
description: |
Use this request to get data for a single training invoice that is
stored in Vic.ai
summary: Info for a specific training invoice
operationId: getTrainingInvoice
tags: [Invoices for training]
parameters:
- $ref: '#/components/parameters/PathId'
responses:
'200':
$ref: '#/components/responses/TrainingInvoiceResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
put:
description:
$ref: 'docs/upsert_training_invoice.md'
summary: Upserts a training invoice
operationId: upsertTrainingInvoice
tags: [Invoices for training]
parameters:
- $ref: '#/components/parameters/PathId'
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [invoiceData]
properties:
invoiceData:
$ref: '#/components/schemas/TrainingInvoiceUpsert'
invoiceDocument:
type: string
format: binary
encoding:
invoiceData:
contentType: application/json
headers:
Content-Type:
required: true
schema:
type: string
invoiceDocument:
contentType: application/pdf, image/png, image/tiff, application/vnd.openxmlformats-officedocument.wordprocessingml.document
headers:
Content-Type:
required: true
schema:
type: string
responses:
'201':
$ref: '#/components/responses/TrainingInvoiceUpsertedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
delete:
description: |
Use this request to delete data for a single training invoice that is
stored in Vic.ai
summary: Deletes a training invoice
operationId: deleteTrainingInvoice
tags: [Invoices for training]
parameters:
- $ref: '#/components/parameters/PathId'
responses:
'201':
$ref: '#/components/responses/TrainingInvoiceDeletedResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/trainingInvoices/{id}/document:
get:
description: |
Use this request to get the document associated with a training invoice
that is stored in Vic.ai
summary: Document for a specific training invoice
operationId: getTrainingInvoiceDocument
tags: [Invoices for training]
parameters:
- $ref: '#/components/parameters/PathId'
responses:
'200':
$ref: '#/components/responses/TrainingInvoiceDocumentResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vatCodes:
get:
description: |
Use this request to query all the VAT code data that are stored in
Vic.ai.
summary: List all VAT codes
operationId: listVatCodes
tags: [VAT codes]
parameters:
- $ref: '#/components/parameters/PagingLimit'
- $ref: '#/components/parameters/PagingCursor'
- $ref: '#/components/parameters/SinceFilter'
- $ref: '#/components/parameters/SortOrder'
- $ref: '#/components/parameters/VatCodeFilter'
responses:
'200':
$ref: '#/components/responses/VatCodesResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vatCodes/synchronize:
post:
description: |
Tells the ERP to synchronize the Vat Code resource. If the ERP is using
the API, the call will be sent via the normal webhook methods. If the
ERP is not using this API then this will call the native integration's
synchronize functionality.
summary: Synchronize Vat Codes
operationId: synchronizeVatCodes
tags: [VAT codes, Synchronizing]
responses:
'204':
$ref: '#/components/responses/SynchronizeVatCodesResponse'
'4XX':
$ref: '#/components/responses/ErrorResponse'
/vatCodes/{id}:
get:
description: |