-
Notifications
You must be signed in to change notification settings - Fork 4
/
Parasut.cs
1618 lines (1617 loc) · 86.5 KB
/
Parasut.cs
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
using System.Net.Http.Headers;
using System.Net.Mime;
using System.Reflection;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Parasut {
public interface IParasut {
void SetCompanyId(string companyid);
void SetClientId(string clientid);
void SetClientSecret(string clientsecret);
void SetUsername(string username);
void SetPassword(string password);
bool Authorize();
Parasut.Response.Contacts SearchContact(Parasut.Request.Contact.ContactData.ContactAttributes search);
Parasut.Response.Contact CreateContact(Parasut.Request.Contact contact);
Parasut.Response.Contact UpdateContact(string id, Parasut.Request.Contact contact);
Parasut.Response.Contact ShowContact(string id);
void DeleteContact(string id);
Parasut.Response.Employees SearchEmployee(Parasut.Request.Employee.EmployeeData.EmployeeAttributes search);
Parasut.Response.Employee CreateEmployee(Parasut.Request.Employee employee);
Parasut.Response.Employee UpdateEmployee(string id, Parasut.Request.Employee employee);
Parasut.Response.Employee ShowEmployee(string id);
void DeleteEmployee(string id);
Parasut.Response.SalesInvoice CreateSalesInvoice(Parasut.Request.SalesInvoice invoice);
Parasut.Response.SalesInvoice UpdateSalesInvoice(string id, Parasut.Request.SalesInvoice invoice);
Parasut.Response.SalesInvoice ShowSalesInvoice(string id);
Parasut.Response.SalesInvoice RecoverSalesInvoice(string id);
Parasut.Response.SalesInvoice ArchiveSalesInvoice(string id);
Parasut.Response.SalesInvoice UnarchiveSalesInvoice(string id);
Parasut.Response.SalesInvoice CancelSalesInvoice(string id);
Parasut.Response.SalesInvoice ConvertSalesInvoice(string id);
void DeleteSalesInvoice(string id);
Parasut.Response.EArchive CreateEArchive(Parasut.Request.EArchive earchive);
Parasut.Response.EInvoice CreateEInvoice(Parasut.Request.EInvoice einvoice);
Parasut.Response.EArchive ShowEArchive(string id);
Parasut.Response.EInvoice ShowEInvoice(string id);
Parasut.Response.EArchivePDF ShowEArchivePDF(string id);
Parasut.Response.EInvoicePDF ShowEInvoicePDF(string id);
Parasut.Response.EInvoiceInboxes ListEInvoiceInboxes(string vkn);
Parasut.Response.Transaction ShowTransaction(string id);
Parasut.Response.TrackableJob TrackJob(string id);
void DeleteTransaction(string id);
}
public class Parasut : IParasut {
private string Endpoint { get; set; }
private string CompanyId { get; set; }
private string ClientId { get; set; }
private string ClientSecret { get; set; }
private string Username { get; set; }
private string Password { get; set; }
private string Token { get; set; }
public Parasut() {
Endpoint = "https://api.parasut.com/v4/";
}
public class Request {
public class Authorize : Request {
[JsonPropertyName("client_id")]
public string ClientId { init; get; }
[JsonPropertyName("client_secret")]
public string ClientSecret { init; get; }
[JsonPropertyName("username")]
public string Username { init; get; }
[JsonPropertyName("password")]
public string Password { init; get; }
[JsonPropertyName("grant_type")]
public string GrantType { init; get; }
[JsonPropertyName("redirect_uri")]
public string RedirectURI { init; get; }
}
public class Contact : Request {
[JsonPropertyName("data")]
public ContactData Data { init; get; }
}
public class Employee : Request {
[JsonPropertyName("data")]
public EmployeeData Data { init; get; }
}
public class SalesInvoice : Request {
[JsonPropertyName("data")]
public SalesInvoiceData Data { init; get; }
}
public class EArchive : Request {
[JsonPropertyName("data")]
public EArchiveData Data { init; get; }
}
public class EInvoice : Request {
[JsonPropertyName("data")]
public EInvoiceData Data { init; get; }
}
public class ContactData : Contact {
public ContactData() {
Type = "contacts";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public ContactAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public ContactRelationships Relationships { init; get; }
public class ContactAttributes {
[JsonPropertyName("email")]
public string Email { init; get; }
[JsonPropertyName("name")]
public string Name { init; get; }
[JsonPropertyName("short_name")]
public string ShortName { init; get; }
[JsonPropertyName("contact_type")]
public string ContactType { init; get; }
[JsonPropertyName("account_type")]
public string AccountType { init; get; }
[JsonPropertyName("tax_office")]
public string TaxOffice { init; get; }
[JsonPropertyName("tax_number")]
public string TaxNumber { init; get; }
[JsonPropertyName("country")]
public string Country { init; get; }
[JsonPropertyName("city")]
public string City { init; get; }
[JsonPropertyName("district")]
public string District { init; get; }
[JsonPropertyName("address")]
public string Address { init; get; }
[JsonPropertyName("phone")]
public string Phone { init; get; }
[JsonPropertyName("fax")]
public string Fax { init; get; }
[JsonPropertyName("iban")]
public string IBAN { init; get; }
[JsonPropertyName("is_abroad")]
public bool? IsAbroad { init; get; }
[JsonPropertyName("archived")]
public bool? Archived { init; get; }
[JsonPropertyName("untrackable")]
public bool? Untrackable { init; get; }
}
public class ContactRelationships {
[JsonPropertyName("category")]
public ContactCategory ContactCategory { get; set; }
[JsonPropertyName("contact_people")]
public ContactPeople ContactPeople { get; set; }
}
public class ContactCategory {
[JsonPropertyName("data")]
public ContactCategoryData Data { init; get; }
}
public class ContactPeople {
[JsonPropertyName("data")]
public ContactPeopleData[] Data { init; get; }
}
public class ContactCategoryData {
public ContactCategoryData() {
Type = "item_categories";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class ContactPeopleData {
public ContactPeopleData() {
Type = "contact_people";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public ContactPeopleAttributes Attributes { init; get; }
}
public class ContactPeopleAttributes {
[JsonPropertyName("name")]
public string Name { init; get; }
[JsonPropertyName("email")]
public string Email { init; get; }
[JsonPropertyName("phone")]
public string Phone { init; get; }
[JsonPropertyName("notes")]
public string Notes { init; get; }
}
}
public class EmployeeData : Employee {
public EmployeeData() {
Type = "employees";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public EmployeeAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public EmployeeRelationships Relationships { init; get; }
public class EmployeeAttributes {
[JsonPropertyName("email")]
public string Email { init; get; }
[JsonPropertyName("name")]
public string Name { init; get; }
[JsonPropertyName("iban")]
public string IBAN { init; get; }
[JsonPropertyName("archived")]
public bool? Archived { init; get; }
}
public class EmployeeRelationships {
[JsonPropertyName("category")]
public EmployeeCategory EmployeeCategory { get; set; }
}
public class EmployeeCategory {
[JsonPropertyName("data")]
public EmployeeCategoryData Data { init; get; }
}
public class EmployeeCategoryData {
public EmployeeCategoryData() {
Type = "item_categories";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
}
public class SalesInvoiceData : SalesInvoice {
public SalesInvoiceData() {
Type = "sales_invoices";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public SalesInvoiceAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public SalesInvoiceRelationships Relationships { init; get; }
public class SalesInvoiceAttributes {
[JsonPropertyName("invoice_id")]
public int? InvoiceId { init; get; }
[JsonPropertyName("invoice_series")]
public string InvoiceSeries { init; get; }
[JsonPropertyName("item_type")]
public string ItemType { init; get; }
[JsonPropertyName("description")]
public string Description { init; get; }
[JsonPropertyName("issue_date")]
public string IssueDate { init; get; }
[JsonPropertyName("due_date")]
public string DueDate { init; get; }
[JsonPropertyName("order_date")]
public string OrderDate { init; get; }
[JsonPropertyName("order_no")]
public string OrderNo { init; get; }
[JsonPropertyName("currency")]
public string Currency { init; get; }
[JsonPropertyName("exchange_rate")]
public string ExchangeRate { init; get; }
[JsonPropertyName("withholding_rate")]
public string WithholdingRate { init; get; }
[JsonPropertyName("vat_withholding_rate")]
public string VatWithholdingRate { init; get; }
[JsonPropertyName("invoice_discount_type")]
public string InvoiceDiscountType { init; get; }
[JsonPropertyName("invoice_discount")]
public string InvoiceDiscount { init; get; }
[JsonPropertyName("billing_address")]
public string BillingAddress { init; get; }
[JsonPropertyName("billing_phone")]
public string BillingPhone { init; get; }
[JsonPropertyName("billing_fax")]
public string BillingFax { init; get; }
[JsonPropertyName("tax_office")]
public string TaxOffice { init; get; }
[JsonPropertyName("tax_number")]
public string TaxNumber { init; get; }
[JsonPropertyName("payer_tax_numbers")]
public List<string> PayerTaxNumbers { init; get; }
[JsonPropertyName("country")]
public string Country { init; get; }
[JsonPropertyName("city")]
public string City { init; get; }
[JsonPropertyName("district")]
public string District { init; get; }
[JsonPropertyName("payment_account_id")]
public string PaymentAccountID { init; get; }
[JsonPropertyName("payment_date")]
public string PaymentDate { init; get; }
[JsonPropertyName("payment_description")]
public string PaymentDescription { init; get; }
[JsonPropertyName("shipment_addres")]
public string ShipmentAddres { init; get; }
[JsonPropertyName("shipment_included")]
public bool? ShipmentIncluded { init; get; }
[JsonPropertyName("cash_sale")]
public bool? CashSale { init; get; }
[JsonPropertyName("is_abroad")]
public bool? IsAbroad { init; get; }
}
public class SalesInvoiceRelationships {
[JsonPropertyName("category")]
public SalesInvoiceCategory Category { get; set; }
[JsonPropertyName("contact")]
public SalesInvoiceContact Contact { get; set; }
[JsonPropertyName("details")]
public SalesInvoiceDetails Details { get; set; }
[JsonPropertyName("tags")]
public SalesInvoiceTags Tags { get; set; }
[JsonPropertyName("sales_offer")]
public SalesInvoiceSalesOffer SalesOffer { get; set; }
}
public class SalesInvoiceCategory {
[JsonPropertyName("data")]
public SalesInvoiceCategoryData Data { init; get; }
}
public class SalesInvoiceContact {
[JsonPropertyName("data")]
public SalesInvoiceContactData Data { init; get; }
}
public class SalesInvoiceDetails {
[JsonPropertyName("data")]
public SalesInvoiceDetailsData[] Data { init; get; }
}
public class SalesInvoiceTags {
[JsonPropertyName("data")]
public SalesInvoiceTagsData[] Data { init; get; }
}
public class SalesInvoiceSalesOffer {
[JsonPropertyName("data")]
public SalesInvoiceSalesOfferData Data { init; get; }
}
public class SalesInvoiceCategoryData {
public SalesInvoiceCategoryData() {
Type = "item_categories";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class SalesInvoiceContactData {
public SalesInvoiceContactData() {
Type = "contacts";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class SalesInvoiceDetailsData {
public SalesInvoiceDetailsData() {
Type = "sales_invoice_details";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public SalesInvoiceDetailsAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public SalesInvoiceDetailsRelationships Relationships { init; get; }
public class SalesInvoiceDetailsAttributes {
[JsonPropertyName("quantity")]
public string Quantity { init; get; }
[JsonPropertyName("unit_price")]
public string UnitPrice { init; get; }
[JsonPropertyName("vat_rate")]
public string VatRate { init; get; }
[JsonPropertyName("discount_type")]
public string DiscountType { init; get; }
[JsonPropertyName("discount_value")]
public string DiscountValue { init; get; }
[JsonPropertyName("excise_duty_type")]
public string ExciseDutyType { init; get; }
[JsonPropertyName("excise_duty_value")]
public string ExciseDutyValue { init; get; }
[JsonPropertyName("communications_tax_rate")]
public string CommunicationsTaxRate { init; get; }
[JsonPropertyName("description")]
public string Description { init; get; }
[JsonPropertyName("delivery_method")]
public string DeliveryMethod { init; get; }
[JsonPropertyName("shipping_method")]
public string ShippingMethod { init; get; }
}
public class SalesInvoiceDetailsRelationships {
[JsonPropertyName("product")]
public SalesInvoiceDetailsProduct Product { get; set; }
[JsonPropertyName("warehouse")]
public SalesInvoiceDetailsWarehouse Warehouse { get; set; }
}
public class SalesInvoiceDetailsProduct {
[JsonPropertyName("data")]
public SalesInvoiceDetailsProductData Data { init; get; }
}
public class SalesInvoiceDetailsProductData {
public SalesInvoiceDetailsProductData() {
Type = "products";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class SalesInvoiceDetailsWarehouse {
[JsonPropertyName("data")]
public SalesInvoiceDetailsWarehouseData Data { init; get; }
}
public class SalesInvoiceDetailsWarehouseData {
public SalesInvoiceDetailsWarehouseData() {
Type = "warehouses";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
}
public class SalesInvoiceTagsData {
public SalesInvoiceTagsData() {
Type = "tags";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class SalesInvoiceSalesOfferData {
public SalesInvoiceSalesOfferData() {
Type = "sales_offers";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
}
public class EArchiveData : EArchive {
public EArchiveData() {
Type = "e_archives";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public EArchiveAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public EArchiveRelationships Relationships { init; get; }
public class EArchiveAttributes {
[JsonPropertyName("note")]
public string Note { init; get; }
[JsonPropertyName("internet_sale")]
public InternetSaleData InternetSale { init; get; }
[JsonPropertyName("shipment")]
public ShipmentData Shipment { init; get; }
[JsonPropertyName("excise_duty_codes")]
public EArchiveExciseDutyCode[] ExciseDutyCodes { init; get; }
[JsonPropertyName("vat_withholding_code")]
public string VatWithholdingCode { init; get; }
[JsonPropertyName("vat_exemption_reason_code")]
public string VatExemptionReasonCode { init; get; }
[JsonPropertyName("vat_exemption_reason")]
public string VatExemptionReason { init; get; }
}
public class EArchiveRelationships {
[JsonPropertyName("sales_invoice")]
public EArchiveSalesInvoice SalesInvoice { get; set; }
}
public class EArchiveExciseDutyCode {
[JsonPropertyName("product")]
public int? Product { init; get; }
[JsonPropertyName("sales_excise_duty_code")]
public string SalesExciseDutyCode { init; get; }
}
public class InternetSaleData {
[JsonPropertyName("url")]
public string Url { init; get; }
[JsonPropertyName("payment_type")]
public string PaymentType { init; get; }
[JsonPropertyName("payment_platform")]
public string PaymentPlatform { init; get; }
[JsonPropertyName("payment_date")]
public string PaymentDate { init; get; }
}
public class ShipmentData {
[JsonPropertyName("title")]
public string Title { init; get; }
[JsonPropertyName("name")]
public string Name { init; get; }
[JsonPropertyName("vkn")]
public string VKN { init; get; }
[JsonPropertyName("tckn")]
public string TCKN { init; get; }
[JsonPropertyName("date")]
public string Date { init; get; }
}
public class EArchiveSalesInvoice {
[JsonPropertyName("data")]
public EArchiveSalesInvoiceData Data { init; get; }
}
public class EArchiveSalesInvoiceData {
public EArchiveSalesInvoiceData() {
Type = "sales_invoices";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
}
public class EInvoiceData : EInvoice {
public EInvoiceData() {
Type = "e_invoices";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public EInvoiceAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public EInvoiceRelationships Relationships { init; get; }
public class EInvoiceAttributes {
[JsonPropertyName("to")]
public string To { init; get; }
[JsonPropertyName("scenario")]
public string Scenario { init; get; }
[JsonPropertyName("note")]
public string Note { init; get; }
[JsonPropertyName("excise_duty_codes")]
public EInvoiceExciseDutyCode[] ExciseDutyCodes { init; get; }
[JsonPropertyName("vat_withholding_code")]
public string VatWithholdingCode { init; get; }
[JsonPropertyName("vat_exemption_reason_code")]
public string VatExemptionReasonCode { init; get; }
[JsonPropertyName("vat_exemption_reason")]
public string VatExemptionReason { init; get; }
[JsonPropertyName("custom_requirement_params")]
public CustomRequirementParam CustomRequirementParams { init; get; }
}
public class EInvoiceExciseDutyCode {
[JsonPropertyName("product")]
public int? Product { init; get; }
[JsonPropertyName("sales_excise_duty_code")]
public string SalesExciseDutyCode { init; get; }
}
public class CustomRequirementParam {
[JsonPropertyName("integration")]
public CustomIntegration Integration { init; get; }
[JsonPropertyName("products")]
public List<CustomProduct> Products { init; get; }
}
public class CustomIntegration {
[JsonPropertyName("data")]
public IntegrationData Data { init; get; }
}
public class CustomProduct {
[JsonPropertyName("product_id")]
public string Id { init; get; }
[JsonPropertyName("data")]
public ProductData Data { init; get; }
}
public class ProductData {
[JsonPropertyName("buyer_code")]
public string BuyerCode { init; get; }
}
public class IntegrationData {
[JsonPropertyName("additional_invoice_type")]
public string AdditionalInvoiceType { init; get; }
[JsonPropertyName("supplier_code")]
public string SupplierCode { init; get; }
[JsonPropertyName("tax_payer_code")]
public string TaxPayerCode { init; get; }
[JsonPropertyName("tax_payer_name")]
public string TaxPayerName { init; get; }
[JsonPropertyName("file_number")]
public string FileNumber { init; get; }
[JsonPropertyName("term_start_date")]
public string TermStartDate { init; get; }
[JsonPropertyName("term_end_date")]
public string TermEndDate { init; get; }
}
public class EInvoiceRelationships {
[JsonPropertyName("invoice")]
public EInvoiceInvoice Invoice { get; set; }
}
public class EInvoiceInvoice {
[JsonPropertyName("data")]
public EInvoiceInvoiceData Data { init; get; }
}
public class EInvoiceInvoiceData {
public EInvoiceInvoiceData() {
Type = "sales_invoices";
}
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
}
}
public class Response {
public class Authorize : Response {
[JsonPropertyName("token_type")]
public string TokenType { init; get; }
[JsonPropertyName("access_token")]
public string AccessToken { init; get; }
[JsonPropertyName("refresh_token")]
public string RefreshToken { init; get; }
[JsonPropertyName("expires_in")]
public int? ExpiresIn { init; get; }
[JsonPropertyName("created_at")]
public long? CreatedAt { init; get; }
[JsonPropertyName("scope")]
public string Scope { init; get; }
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
}
public class Contact : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public ContactData Data { init; get; }
[JsonPropertyName("included")]
public IncludedData[] Included { init; get; }
}
public class Contacts : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public ContactData[] Data { init; get; }
}
public class Employee : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public EmployeeData Data { init; get; }
[JsonPropertyName("included")]
public IncludedData[] Included { init; get; }
}
public class Employees : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public EmployeeData[] Data { init; get; }
}
public class SalesInvoice : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public SalesInvoiceData Data { init; get; }
[JsonPropertyName("included")]
public IncludedData[] Included { init; get; }
}
public class SalesInvoices : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public SalesInvoiceData[] Data { init; get; }
}
public class EArchive : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public EArchiveData Data { init; get; }
[JsonPropertyName("included")]
public IncludedData[] Included { init; get; }
}
public class EInvoice : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public EInvoiceData Data { init; get; }
[JsonPropertyName("included")]
public IncludedData[] Included { init; get; }
}
public class EArchivePDF : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public EArchivePDFData Data { init; get; }
}
public class EInvoicePDF : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public EInvoicePDFData Data { init; get; }
}
public class EInvoiceInboxes : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public List<EInvoiceInboxesData> Data { init; get; }
}
public class Transaction : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public TransactionData Data { init; get; }
[JsonPropertyName("included")]
public IncludedData[] Included { init; get; }
}
public class TrackableJob : Response {
[JsonPropertyName("errors")]
public List<ResponseError> Errors { init; get; }
[JsonPropertyName("data")]
public TrackableJobData Data { init; get; }
}
public class IncludedData : Response {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public object Attributes { init; get; }
[JsonPropertyName("relationships")]
public object Relationships { init; get; }
}
public class ContactData : Contact {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public ContactAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public ContactRelationships Relationships { init; get; }
public class ContactAttributes {
[JsonPropertyName("balance")]
public string Balance { init; get; }
[JsonPropertyName("trl_balance")]
public string TRLBalance { init; get; }
[JsonPropertyName("usd_balance")]
public string USDBalance { init; get; }
[JsonPropertyName("eur_balance")]
public string EURBalance { init; get; }
[JsonPropertyName("gbp_balance")]
public string GBPBalance { init; get; }
[JsonPropertyName("email")]
public string Email { init; get; }
[JsonPropertyName("name")]
public string Name { init; get; }
[JsonPropertyName("short_name")]
public string ShortName { init; get; }
[JsonPropertyName("contact_type")]
public string ContactType { init; get; }
[JsonPropertyName("account_type")]
public string AccountType { init; get; }
[JsonPropertyName("tax_office")]
public string TaxOffice { init; get; }
[JsonPropertyName("tax_number")]
public string TaxNumber { init; get; }
[JsonPropertyName("country")]
public string Country { init; get; }
[JsonPropertyName("city")]
public string City { init; get; }
[JsonPropertyName("district")]
public string District { init; get; }
[JsonPropertyName("address")]
public string Address { init; get; }
[JsonPropertyName("phone")]
public string Phone { init; get; }
[JsonPropertyName("fax")]
public string Fax { init; get; }
[JsonPropertyName("iban")]
public string IBAN { init; get; }
[JsonPropertyName("is_abroad")]
public bool? IsAbroad { init; get; }
[JsonPropertyName("archived")]
public bool? Archived { init; get; }
[JsonPropertyName("untrackable")]
public bool? Untrackable { init; get; }
[JsonPropertyName("created_at")]
public string CreatedAt { init; get; }
[JsonPropertyName("updated_at")]
public string UpdatedAt { init; get; }
}
public class ContactRelationships {
[JsonPropertyName("category")]
public ContactCategory ContactCategory { get; set; }
[JsonPropertyName("contact_portal")]
public ContactPortal ContactPortal { get; set; }
[JsonPropertyName("contact_people")]
public ContactPeople ContactPeople { get; set; }
}
public class ContactCategory {
[JsonPropertyName("data")]
public ContactCategoryData Data { init; get; }
}
public class ContactPortal {
[JsonPropertyName("data")]
public ContactPortalData Data { init; get; }
}
public class ContactPeople {
[JsonPropertyName("data")]
public ContactPeopleData[] Data { init; get; }
}
public class ContactCategoryData {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class ContactPortalData {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class ContactPeopleData {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
}
public class EmployeeData : Employee {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public EmployeeAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public EmployeeRelationships Relationships { init; get; }
public class EmployeeAttributes {
[JsonPropertyName("balance")]
public string Balance { init; get; }
[JsonPropertyName("trl_balance")]
public string TRLBalance { init; get; }
[JsonPropertyName("usd_balance")]
public string USDBalance { init; get; }
[JsonPropertyName("eur_balance")]
public string EURBalance { init; get; }
[JsonPropertyName("gbp_balance")]
public string GBPBalance { init; get; }
[JsonPropertyName("email")]
public string Email { init; get; }
[JsonPropertyName("name")]
public string Name { init; get; }
[JsonPropertyName("iban")]
public string IBAN { init; get; }
[JsonPropertyName("archived")]
public bool? Archived { init; get; }
[JsonPropertyName("created_at")]
public string CreatedAt { init; get; }
[JsonPropertyName("updated_at")]
public string UpdatedAt { init; get; }
}
public class EmployeeRelationships {
[JsonPropertyName("category")]
public EmployeeCategory EmployeeCategory { get; set; }
[JsonPropertyName("managed_by_user")]
public ManagedByUser ManagedByUser { get; set; }
[JsonPropertyName("managed_by_user_role")]
public ManagedByUserRole ManagedByUserRole { get; set; }
}
public class EmployeeCategory {
[JsonPropertyName("data")]
public EmployeeCategoryData Data { init; get; }
}
public class ManagedByUser {
[JsonPropertyName("data")]
public ManagedByUserData Data { init; get; }
}
public class ManagedByUserRole {
[JsonPropertyName("data")]
public ManagedByUserRoleData Data { init; get; }
}
public class EmployeeCategoryData {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class ManagedByUserData {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
public class ManagedByUserRoleData {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
}
}
public class SalesInvoiceData : SalesInvoice {
[JsonPropertyName("id")]
public string Id { init; get; }
[JsonPropertyName("type")]
public string Type { init; get; }
[JsonPropertyName("attributes")]
public SalesInvoiceAttributes Attributes { init; get; }
[JsonPropertyName("relationships")]
public SalesInvoiceRelationships Relationships { init; get; }
public class SalesInvoiceAttributes {
[JsonPropertyName("invoice_id")]
public int? InvoiceId { init; get; }
[JsonPropertyName("invoice_no")]
public string InvoiceNo { init; get; }
[JsonPropertyName("invoice_series")]
public string InvoiceSeries { init; get; }
[JsonPropertyName("net_total")]
public string NetTotal { init; get; }
[JsonPropertyName("gross_total")]
public string GrossTotal { init; get; }
[JsonPropertyName("total_excise_duty")]
public string TotalExciseDuty { init; get; }
[JsonPropertyName("total_communications_tax")]
public string TotalCommunicationsTax { init; get; }
[JsonPropertyName("total_vat")]
public string TotalVat { init; get; }
[JsonPropertyName("withholding")]
public string Withholding { init; get; }
[JsonPropertyName("vat_withholding")]
public string VatWithholding { init; get; }
[JsonPropertyName("withholding_rate")]
public string WithholdingRate { init; get; }
[JsonPropertyName("vat_withholding_rate")]
public string VatWithholdingRate { init; get; }
[JsonPropertyName("total_discount")]
public string TotalDiscount { init; get; }
[JsonPropertyName("total_invoice_discount")]
public string TotalInvoiceDiscount { init; get; }
[JsonPropertyName("before_taxes_total")]
public string BeforeTaxesTotal { init; get; }
[JsonPropertyName("remaining")]
public string Remaining { init; get; }
[JsonPropertyName("remaining_in_trl")]
public string RemainingInTrl { init; get; }
[JsonPropertyName("created_at")]
public string CreatedAt { init; get; }
[JsonPropertyName("updated_at")]
public string UpdatedAt { init; get; }
[JsonPropertyName("item_type")]
public string ItemType { init; get; }
[JsonPropertyName("description")]
public string Description { init; get; }
[JsonPropertyName("issue_date")]
public string IssueDate { init; get; }
[JsonPropertyName("due_date")]
public string DueDate { init; get; }
[JsonPropertyName("order_date")]
public string OrderDate { init; get; }
[JsonPropertyName("order_no")]
public string OrderNo { init; get; }
[JsonPropertyName("currency")]
public string Currency { init; get; }
[JsonPropertyName("exchange_rate")]
public string ExchangeRate { init; get; }
[JsonPropertyName("invoice_discount_type")]
public string InvoiceDiscountType { init; get; }
[JsonPropertyName("invoice_discount")]
public string InvoiceDiscount { init; get; }
[JsonPropertyName("billing_address")]
public string BillingAddress { init; get; }
[JsonPropertyName("billing_phone")]
public string BillingPhone { init; get; }
[JsonPropertyName("billing_fax")]
public string BillingFax { init; get; }
[JsonPropertyName("tax_office")]
public string TaxOffice { init; get; }
[JsonPropertyName("tax_number")]
public string TaxNumber { init; get; }
[JsonPropertyName("payer_tax_numbers")]
public List<string> PayerTaxNumbers { init; get; }
[JsonPropertyName("country")]
public string Country { init; get; }
[JsonPropertyName("city")]
public string City { init; get; }
[JsonPropertyName("district")]
public string District { init; get; }
[JsonPropertyName("payment_status")]
public string PaymentStatus { init; get; }
[JsonPropertyName("shipment_addres")]
public string ShipmentAddres { init; get; }
[JsonPropertyName("shipment_included")]
public bool? ShipmentIncluded { init; get; }
[JsonPropertyName("cash_sale")]
public bool? CashSale { init; get; }
[JsonPropertyName("is_abroad")]
public bool? IsAbroad { init; get; }
[JsonPropertyName("archived")]
public bool? Archived { init; get; }
}
public class SalesInvoiceRelationships {
[JsonPropertyName("category")]
public SalesInvoiceCategory Category { get; set; }
[JsonPropertyName("contact")]
public SalesInvoiceContact Contact { get; set; }
[JsonPropertyName("details")]
public SalesInvoiceDetails Details { get; set; }
[JsonPropertyName("payments")]
public SalesInvoicePayments Payments { get; set; }
[JsonPropertyName("tags")]
public SalesInvoiceTags Tags { get; set; }
[JsonPropertyName("sales_offer")]
public SalesInvoiceSalesOffer SalesOffer { get; set; }