-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
4111 lines (4044 loc) · 171 KB
/
openapi.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.0.0
info:
title: superfaktura.sk API
version: 1.0.0
description: |
Pomocou API môžete SuperFaktúru prepojiť napríklad s vašim e-shopom, CRM
systémom alebo vašou webovou stránkou s objednávkovým formulárom a
vystavovať faktúry zákazníkom automaticky.
externalDocs:
url: https://github.com/superfaktura/docs/
servers:
- url: https://moja.superfaktura.sk
description: Slovakia
- url: https://moje.superfaktura.cz
description: Czech Republic
- url: https://meine.superfaktura.at
description: Austria
- url: https://sandbox.superfaktura.sk
description: Sandbox (SK)
- url: https://sandbox.superfaktura.cz
description: Sandbox (CZ)
security:
- SFAPI: []
tags:
- name: Bank accounts
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/bank-account.md
- name: Cash register item
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/cash-register-item.md
- name: Cash register
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/cash-register.md
- name: Clients
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/clients.md
- name: Contact persons
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/contact-persons.md
- name: Expenses
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/expenses.md
- name: Invoice
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/invoice.md
- name: Other API commands
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/other.md
- name: Stock
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/stock.md
- name: Tags
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/tags.md
- name: Value lists
externalDocs:
url: https://github.com/superfaktura/docs/blob/master/value-lists.md
paths:
/bank_accounts/add:
post:
summary: Add new bank account
tags:
- Bank accounts
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/BankAccountReq"
responses:
200:
description: Successful creation
content:
application/json:
schema:
$ref: "#/components/schemas/BankAccountRes"
400:
description: Insufficient privileges
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
error: 1,
message: Ako používateľ typu Hosť nemáte oprávnenie na túto akciu.
error_message: Ako používateľ typu Hosť nemáte oprávnenie na túto akciu.
/bank_accounts/update/{id}:
post:
summary: Update bank account specified by ID
tags:
- Bank accounts
parameters:
- name: id
in: path
required: true
schema:
type: integer
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/BankAccountReq"
responses:
200:
description: Successful update
content:
application/json:
schema:
$ref: "#/components/schemas/BankAccountRes"
400:
description: Insufficient privileges or Wrong bank account
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/bank_accounts/delete/{id}:
post:
summary: Delete bank account specified by ID
tags:
- Bank accounts
parameters:
- name: id
in: path
required: true
schema:
type: integer
responses:
200:
description: Successful deletion
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
example:
error: "0"
message: Bankový účet bol vymazaný
400:
description: Insufficient privileges or Wrong bank account
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
401:
description: Wrong bank account
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/bank_accounts/index:
get:
summary: Get list of bank accounts
tags:
- Bank accounts
responses:
200:
description: Success
content:
application/json:
schema:
type: object
example:
error: 0
BankAccounts:
- BankAccount:
account: ""
bank_code: ""
bank_name: "FatraBanka"
country_id: "191"
created: "2050-01-01 23:59:59"
currency: null
default: true
iban: "SK012345678901234567890000"
id: "1"
modified: "2050-01-01 23:59:59"
show: true
swift: "SUZUKI"
user_id: "1"
user_profile_id: "1"
properties:
BankAccounts:
type: array
items:
type: object
properties:
BankAccount:
$ref: "#/components/schemas/BankAccountRes"
error:
type: integer
400:
description: No bank account found
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/cash_register_items/index/{id}:
get:
summary: Get detailed information about cash register and its items
tags:
- Cash register item
parameters:
- name: id
in: path
required: true
description: Cash register ID
schema:
type: integer
- name: date_from
in: query
description: Date from (YYYY-MM-DD)
schema:
type: string
format: date
- name: date_to
in: query
description: Date to (YYYY-MM-DD)
schema:
type: string
format: date
- name: datefilter
in: query
description: Time filter (today, yesterday, thismonth, thisyear, prevmonth, prevyear)
schema:
type: string
- name: sum_from
in: query
description: Sum from
schema:
type: number
format: float
- name: sum_to
in: query
description: Sum to
schema:
type: number
format: float
- name: term
in: query
schema:
type: string
description: Search term (filter items in output search term)
- name: type
in: query
description: Type filter ("in" for income and "out" for outgo)
schema:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/CashRegisterItemRes"
/cash_register_items/add:
post:
summary: Add Cash Register Item
tags:
- Cash register item
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
CashRegisterItem:
$ref: "#/components/schemas/CashRegisterItemReq"
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/CashRegisterItemRes"
/cash_register_items/delete/{id}:
get:
summary: Get Cash Register Items
tags:
- Cash register item
parameters:
- name: id
in: query
required: true
schema:
type: integer
example: 1
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/SummaryRes"
/cash_register_items/delete/:
post:
summary: Delete Cash Register Items
tags:
- Cash register item
requestBody:
required: true
content:
application/json:
schema:
type: object
example: { "ids": "2,3" }
description: IDs of items to delete (comma separated)
properties:
ids:
type: string
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
allOf:
- $ref: "#/components/schemas/SummaryRes"
- properties:
status:
type: number
400:
description: Wrong item
content:
application/json:
schema:
type: object
properties:
status:
type: number
Summary:
type: number
401:
description: Insufficient privileges
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/cash_registers/getDetails:
get:
summary: Get Cash Registers Details
description: |
Get detailed information about cash registers and its current
value status.
tags:
- Cash register
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: array
items:
type: object
properties:
CashRegister:
$ref: "#/components/schemas/CashRegister"
/cash_registers/view/{id}:
get:
summary: Get Cash Register by ID
description: |
Get detailed information about cash register by ID.
tags:
- Cash register
parameters:
- name: id
in: path
required: true
schema:
type: integer
example: 1
responses:
200:
description: Successful operation
content:
application/json:
schema:
type: object
properties:
CashRegister:
$ref: "#/components/schemas/CashRegister"
404:
description: Cash register not found
content:
application/json:
example: '{"error":1,"error_message":"CashRegister with id: 123 not found","message":"CashRegister with id: 123 not found"}'
400:
description: Invalid cash register ID
content:
application/json:
example: '{"error":1,"error_message":"Invalid CashRegister id","message":"Invalid CashRegister id"}'
/clients/create:
post:
summary: Create client
description: Create a new client.
tags:
- Clients
requestBody:
required: true
content:
application/json:
schema:
type: object
allOf:
- $ref: "#/components/schemas/Client"
- properties:
name:
type: string
description: Client name
responses:
200:
description: Successful update
content:
application/json:
schema:
properties:
data:
type: object
properties:
Client:
$ref: "#/components/schemas/Client"
error:
type: number
error_message:
type: string
description: The client has been saved
/clients/index.json/listinfo:1:
get:
summary: Get client information
description: Retrieve information about clients
tags:
- Clients
parameters:
- name: page
in: query
description: Page number
required: false
schema:
type: integer
- name: perPage
in: query
description: Items per page
required: false
schema:
type: integer
responses:
200:
description: Successful response
content:
application/json:
example:
itemCount: 3
items:
- Client:
id: 1
name: John Doe
address: Vymyslena 1
city: Bratislava
country: Slovensko
zip: 555 55
ClientStat:
order_count: 0
order_total: 0.00
# ... (other fields)
- Client:
id: 2
name: Santa Claus
address: North Pole 1
city: Santa’s Village
country: Finland
zip: 999 99
ClientStat:
order_count: 0
order_total: 0.00
# ... (other fields)
# ... (third client)
/clients/edit/{id}:
patch:
summary: Edit client information
description: Edit an existing client
tags:
- Clients
parameters:
- name: id
in: path
description: The ID of the client to be edited
required: true
schema:
type: integer
requestBody:
required: true
content:
application/json:
example:
data:
Client:
uuid: "598f4b4f-6fcb-4f25-9828-bf4237a715d0"
responses:
200:
description: Successful update
content:
application/json:
example:
error: 0
message: The client has been saved
400:
description: Bad data format
content:
application/json:
example:
error: 1
message: Bad data format
error_message: Bad data format
404:
description: Client not found
content:
application/json:
example:
error: 1
message: Client not found
error_message: Client not found
403:
description: Insufficient permissions
content:
application/json:
example:
error: 1
message: You can't edit this item
error_message: You can't edit this item
/clients/delete/{id}:
delete:
summary: Delete client
description: Delete an existing client
tags:
- Clients
parameters:
- name: id
in: path
description: The ID of the client to be deleted
required: true
schema:
type: integer
responses:
200:
description: Successful deletion
content:
application/json:
example:
redirect_url: /clients
error: 0
message: Contact deleted
404:
description: Client not found
content:
application/json:
example:
error: 1
message: Client not found
error_message: Client not found
403:
description: Insufficient permissions
content:
application/json:
example:
error: 1
message: You are not authorized to delete this client
error_message: You are not authorized to delete this client
/contact_people/add/api:1:
post:
summary: Add contact person to client
description: Add a new contact person to an existing client.
tags:
- Contact persons
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
contactperson:
type: object
properties:
client_id:
type: integer
name:
type: string
email:
type: string
phone:
type: string
responses:
200:
description: Successfully added person
content:
application/json:
example: '{"data": {"contactperson": {"client_id": 1, "created": "2050-01-01 23:59:59", "email": "[email protected]", "id": "2", "modified": "2050-01-01 23:59:59", "name": "John", "user_id": "1", "user_profile_id": "1"}}, "state": "SUCCESS"}'
404:
description: Wrong client
content:
application/json:
example: '{"error": 1, "error_message": "Client not found", "message": "Client not found"}'
403:
description: Insufficient privileges
content:
application/json:
example: '{"error": 1, "error_message": "Nemôžete pridať kontaktnú osobu", "message": "Nemôžete pridať kontaktnú osobu"}'
/contact_people/getcontactpeople/{id}:
get:
summary: Get contact persons for client
description: Get a list of contact persons for a client.
tags:
- Contact persons
parameters:
- name: id
in: path
description: The ID of the client to get contact persons for
required: true
schema:
type: integer
responses:
200:
description: Successful
content:
application/json:
example: '[{"contactperson": {"client_id": "3", "created": "2050-01-01 23:59:59", "email": "[email protected]", "id": "1", "modified": "2050-01-01 23:59:59", "name": "Janko Hrasko", "phone": null, "user_id": "1", "user_profile_id": "1"}}, {"contactperson": {"account": null, "address": "Pri Suchom mlyne 6", "country_id": 191, "created": "2050-01-01T23:59:59+01:00", "delivery_country_id": 191, "dic": "2023513470", "dont_travel": null, "iban": "", "ic_dph": "SK2023513470", "ico": "46655034", "id": 3, "modified": "2050-01-01T23:59:59+01:00", "name": "SuperFaktura, s.r.o.", "notices": true, "user_id": 1, "user_profile_id": 1, "zip": "811 04"}}]'
404:
description: Wrong client
content:
application/json:
example: '{"error": 1, "error_message": "Client not found", "message": "Client not found"}'
/contact_people/delete/{id}:
delete:
summary: Delete contact person
description: Delete a contact person from a client.
tags:
- Contact persons
parameters:
- name: id
in: path
description: The ID of the contact person to be deleted
required: true
schema:
type: integer
responses:
200:
description: Successful deletion
content:
application/json:
example: '{"error": 0}'
404:
description: Wrong contact person
content:
application/json:
example: '{"error": 1, "error_message": "Contact not found", "message": "Contact not found"}'
403:
description: Insufficient privileges
content:
application/json:
example: '{"error": 1, "error_message": "Nemôžete vymazať kontaktnú osobu", "message": "Nemôžete vymazať kontaktnú osobu"}'
/expenses/add:
post:
summary: Add new expense
tags:
- Expenses
requestBody:
required: true
content:
application/json:
example: '{"data": {"Expense": {"name": "Foo bar", "currency": "EUR", "amount": 12.14}}}'
responses:
200:
description: Successful creation
content:
application/json:
example: '{"data": {"Expense": {"id": "1", "name": "Foo bar", "currency": "EUR", "amount": 12.14}, "ExpenseItem": [{"id": "1", "description": null, "name": null, "tax": "0.00", "unit_price": "12.14"}], "error": 0, "error_message": "", "status": 1}}'
403:
description: Insufficient privileges
content:
application/json:
example: '{"error": 1, "error_message": "Ako používateľ typu Hosť nemáte oprávnenie na túto akciu."}'
400:
description: Missing data
content:
application/json:
example: '{"error": 1, "error_message": Chýbajúce údaje}'
/expenses/edit:
post:
summary: Edit expense
tags:
- Expenses
requestBody:
required: true
content:
application/json:
example: '{"data": {"Expense": {"id": "1", "name": "Foo bar", "currency": "EUR", "amount": 19.95, "due": "2148-01-01"}}}'
responses:
200:
description: Successfully edited
content:
application/json:
example: '{"data": {"Expense": {"id": "1", "name": "Foo bar", "currency": "EUR", "amount": 19.95, "due": "2148-01-01"}, "ExpenseItem": [{"id": "1", "description": null, "name": null, "tax": "0.00", "unit_price": "19.9500"}], "error": 0, "error_message": "", "status": 1}, "ExpenseBasicRate": [{"amount": "19.9500", "id": "1", "tax": "0.00", "total": "19.9500"}], "ExpenseExtra": [], "ExpensePayment": [], "Tag": [], "attachments": []}'
400:
description: Bad data format / missing expense ID
content:
application/json:
example: '{"error": 3, "error_message": "Bad data format."}'
404:
description: Wrong expense
content:
application/json:
example: '{"error": 1, "error_message": "Expense not found"}'
403:
description: Insufficient privileges
content:
application/json:
example: '{"error": 1, "error_message": "Ako používateľ typu Hosť nemáte oprávnenie na túto akciu."}'
500:
description: Unable to save
content:
application/json:
example: '{"error": 5, "error_message": "The expense could not be saved. Please, try again."}'
/expenses/view/{id}.json:
get:
summary: Expense detail
tags:
- Expenses
parameters:
- in: path
name: id
required: true
schema:
type: integer
responses:
200:
description: Successfully show details
content:
application/json:
example: '{"Client":[],"Document":[],"Expense":{"accounting_date":"2050-01-01 23:59:59","amount":12.14,"amount2":null,"amount3":null,"amount_country_home":"12.1400","amount_home":"12.1400","amount_paid":0,"amount_paid_vat":0,"client_data":null,"client_id":null,"comment":null,"constant":null,"country_exchange_rate":"1.00000000000000","created":"2050-01-01 23:59:59","currency":"EUR","delivery":"2050-01-01 23:59:59","demo":"0","discount":"0","discount_total":"0.0000","document_number":null,"due":"2050-01-01 23:59:59","exchange_rate":"1.00000000000000","expense_category_id":null,"expense_no":"1","flag":"issued","home_currency":"EUR","id":"1","missing_bank_account":true,"modified":"2050-01-01 23:59:59","my_data":"{\"id\":\"1\",\"user_id\":1,\"country_id\":\"191\",\"company_name\":\"SuperFaktura, s.r.o.\",\"name\":null,\"ico\":\"46655034\",\"dic\":\"2023513470\",\"ic_dph\":\"SK2023513470\",\"business_register\":\"Obchodn\\u00fd register Okresn\\u00e9ho s\\u00fadu Bratislava I, oddiel: Sro, vlo\\u017eka \\u010d. 81403\\/B\",\"address\":\"Pri Suchom mlyne 6\",\"city\":\"Bratislava - mestsk\\u00e1 \\u010das\\u0165 Star\\u00e9 Mesto\",\"zip\":\"811 04\",\"tax_payer\":\"1\",\"vat_interval\":null,\"company_type\":\"ltd\"}","name":"Foo bar","number":"2020001","paid":0,"paid_vat":0,"paydate":null,"qr":"","qr_type":"","qr_url":"","qr_url_max":"","rates":{"0.00":{"base":12.14,"vat":0}},"recurring":null,"sequence_id":"9","specific":null,"status":"1","tags":null,"tax":null,"tax_code":null,"taxable_supply":null,"taxdate":"2050-01-01","total":"12.1400","total_country_home":"12.1400","total_home":"12.1400","type":"invoice","user_id":"1","user_profile_id":"1","variable":null,"vat":0,"vat2":null,"vat3":null,"version":"basic"},"ExpenseBasicRate":[{"amount":"12.1400","id":"1","tax":"0.00","total":"12.1400"}],"ExpenseExtra":[],"ExpenseItem":[{"description":null,"discount":"0.00000","discount_description":null,"id":"1","name":null,"ordernum":"0","quantity":"1.00000","stock_item_id":null,"tax":"0.00","total":"12.1400","type":"rate","unit":null,"unit_price":"12.1400","unit_total":"12.1400"}],"ExpensePayment":[],"MyData":{"address":"Pri Suchom mlyne 6","business_register":"Obchodný register Okresného súdu Bratislava I, oddiel: Sro, vložka č. 81403/B","city":"Bratislava - mestská časť Staré Mesto","company_name":"SuperFaktura, s.r.o.","company_type":"ltd","country_id":"191","dic":"2023513470","ic_dph":"SK2023513470","ico":"46655034","id":"1","name":null,"tax_payer":"1","user_id":1,"vat_interval":null,"zip":"811 04"},"RelatedItem":[],"Tag":[],"VatSummary":[{"base":12.14,"vat":0}],"attachments":[]}}'
404:
description: Wrong expense
content:
application/json:
example: '{"error":1,"error_message":"Expense not found","message":"Expense not found"}'
# FIXME: non standard path, unable to define
/expenses/index.json[/{ATTRIBUTE}:{VALUE}]*/:
get:
summary: Get list of expenses
tags:
- Expenses
parameters:
- in: header
name: Authorization
required: true
schema:
type: string
- in: query
name: amount_from
schema:
type: number
- in: query
name: amount_to
schema:
type: number
- in: query
name: category
schema:
type: integer
- in: query
name: client_id
schema:
type: integer
- in: query
name: created
schema:
type: integer
- in: query
name: modified
schema:
type: integer
- in: query
name: created_since
schema:
type: string
- in: query
name: created_to
schema:
type: string
- in: query
name: modified_since
schema:
type: string
- in: query
name: modified_to
schema:
type: string
- in: query
name: delivery
schema:
type: integer
- in: query
name: delivery_since
schema:
type: string
- in: query
name: delivery_to
schema:
type: string
- in: query
name: direction
schema:
type: string
- in: query
name: due
schema:
type: string
- in: query
name: listinfo
schema:
type: integer
- in: query
name: page
schema:
type: integer
- in: query
name: payment_type
schema:
type: string
- in: query
name: per_page
schema:
type: integer
- in: query
name: search
schema:
type: string
- in: query
name: sort
schema:
type: string
- in: query
name: status
schema:
type: string
- in: query
name: type
schema:
type: string
responses:
200:
description: Successful response
content:
application/json:
example: '{"itemCount":3,"items":[{"Client":[],"Document":[],"Expense":{"accounting_date":"2050-01-01 23:59:59","amount":12.14,"amount2":null,"amount3":null,"amount_country_home":"12.1400","amount_home":"12.1400","amount_paid":0,"amount_paid_vat":0,"client_data":null,"client_id":null,"comment":null,"constant":null,"country_exchange_rate":"1.00000000000000","created":"2050-01-01","currency":"EUR","delivery":"2050-01-01","demo":"0","discount":"0","discount_total":"0.0000","document_number":null,"due":"2050-01-01","exchange_rate":"1.00000000000000","expense_category_id":null,"expense_no":"2","flag":"issued","home_currency":"EUR","id":"2","is_payable_by_tatrabanka":false,"missing_bank_account":true,"modified":"2050-01-01 23:59:59","my_data":"{\"id\":\"1\",\"user_id\":1,\"country_id\":\"191\",\"company_name\":\"SuperFaktura, s.r.o.\",\"name\":null,\"ico\":\"46655034\",\"dic\":\"2023513470\",\"ic_dph\":\"SK2023513470\",\"business_register\":\"Obchodn\\u00fd register Okresn\\u00e9ho s\\u00fadu Bratislava I, oddiel: Sro, vlo\\u017eka \\u010d. 81403\\/B\",\"address\":\"Pri Suchom mlyne 6\",\"city\":\"Bratislava - mestsk\\u00e1 \\u010das\\u0165 Star\\u00e9 Mesto\",\"zip\":\"811 04\",\"tax_payer\":\"1\",\"vat_interval":null,"company_type":"ltd"},"name":"Foo bar","number":"2020002","paid":0,"paid_vat":0,"paydate":null,"qr":"","qr_type":"","qr_url":"","qr_url_max":"","rates":[],"recurring":null,"sequence_id":"9","specific":null,"status":"1","tags":null,"tax":null,"tax_code":null,"taxable_supply":null,"taxdate":"2050-01-01","total":"12.1400","total_country_home":"12.1400","total_home":"12.1400","type":"invoice","user_id":"1","user_profile_id":"1","variable":null,"vat":0,"vat2":null,"vat3":null,"version":"basic"},"ExpenseBasicRate":[{"amount":"12.1400","id":"2","tax":"0.00","total":"12.1400"}],"ExpenseExtra":[],"ExpenseItem":[{"description":null,"discount":"0.00000","discount_description":null,"id":"2","name":null,"ordernum":"0","quantity":"1.00000","stock_item_id":null,"tax":"0.00","total":"12.1400","type":"rate","unit":null,"unit_price":"12.1400","unit_total":"12.1400"}],"ExpensePayment":[],"MyData":{"address":"Pri Suchom mlyne 6","business_register":"Obchodný register Okresného súdu Bratislava I, oddiel: Sro, vložka č. 81403/B","city":"Bratislava - mestská časť Staré Mesto","company_name":"SuperFaktura, s.r.o.","company_type":"ltd","country_id":"191","dic":"2023513470","ic_dph":"SK2023513470","ico":"46655034","id":"1","name":null,"tax_payer":"1","user_id":1,"vat_interval":null,"zip":"811 04"},"RelatedItem":[],"Tag":[],"VatSummary":[{"base":12.14,"vat":0}],"attachments":[]}],"page":2,"pageCount":3,"perPage":1}}'
/expenses/delete/{id}:
get:
summary: Delete expense
description: Delete an expense by ID.
tags:
- Expenses
parameters:
- in: path
name: id
required: true
schema:
type: integer
responses:
200:
description: Successful deletion
content:
application/json:
example: '{"message": "Expense deleted", "status": "success"}'
404:
description: Nonexistent ID
content:
application/json:
example: '{"error": 1, "error_message": "Expense not found", "message": "Expense not found"}'
403:
description: Insufficient privileges
content:
application/json:
example: '{"message": "Expense was not deleted", "status": "error"}'
500:
description: Unsuccessful deletion
content:
application/json:
example: '{"error": 2, "error_message": "Error deleting expense."}'
/expense_payments/add:
post:
summary: Add expense payment
description: Add a payment to an expense.
tags:
- Expenses
requestBody:
required: true
content:
application/json:
example: '{"ExpensePayment": {"expense_id": 1, "currency": "EUR", "amount": 12}}'
responses:
200:
description: Successfully added
content:
application/json:
example: '{"data": {"ExpensePayment": {"amount": 12, "currency": "EUR", "expense_id": 1, "id": "1"}}, "error": 0, "expense": { /* ...expense details... */ }, "message": "Úhrada bola uložená"}'
400:
description: Missing data
content:
application/json:
example: '{"error": 1, "error_message": Chýbajúce údaje, "message": Chýbajúce údaje}'
404:
description: Wrong expense
content:
application/json:
example: '{"error": 1, "message": "Expense not found"}'
/expense_payments/delete/{payment_id}:
get:
summary: Delete expense payment
description: Delete an expense payment by ID.
tags:
- Expenses
parameters:
- in: path
name: payment_id
required: true
schema:
type: integer
responses:
200:
description: Successful deletion
content:
application/json:
example: '{"error": 0, "message": "Úhrada nákladu bola zmazaná"}'
404:
description: Payment not found
content:
application/json:
example: '{"error": 1, "message": "Platba sa nenašla"}'
500:
description: Unsuccessful deletion
content:
application/json:
example: '{"error": 1, "message": "Expense payment was not deleted"}'
/expenses/addRelatedItem:
post:
summary: Add related item
description: Add a related item (document) to an expense.
tags:
- Expenses
requestBody:
required: true
content:
application/json:
example: '{"parent_id": 1, "parent_type": "expense", "child_id": 2, "child_type": "invoice"}'
responses:
200:
description: Successful linking of documents
content:
application/json:
example: '{"data": {"Expense": { /* ...expense details... */ }, "RelatedItem": {"id": "2"}}, "error": 0, "error_message": ""}'
400:
description: Invalid ID or data
content:
application/json:
example: '{"error": 1, "error_message": "Invalid id" }'
/expenses/deleteRelatedItem/{relation_id}:
get:
summary: Delete related item
description: Delete a relation between two documents.
tags:
- Expenses
parameters:
- in: path
name: relation_id
required: true