@cloudcommerce/api 1.0.0-alpha.8 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1743 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Order object model
10
+ */
11
+ export interface Orders {
12
+ /**
13
+ * Order ID (ObjectID) [auto]
14
+ */
15
+ _id: string & { length: 24 };
16
+ /**
17
+ * When object was seted (POST/PUT), date and time in ISO 8601 standard representation [auto]
18
+ */
19
+ created_at: string;
20
+ /**
21
+ * When was it last changed, date and time in ISO 8601 standard representation [auto]
22
+ */
23
+ updated_at: string;
24
+ /**
25
+ * ID of store [auto]
26
+ */
27
+ store_id: number;
28
+ /**
29
+ * Whether order was created by staff and is trusted
30
+ */
31
+ staff_signature?: boolean;
32
+ /**
33
+ * URL to checkout page, if necessary, use `(_id)` where order unique ID must appear at URL
34
+ */
35
+ checkout_link?: string;
36
+ /**
37
+ * URL to order status page, if necessary, use `(_id)` where order unique ID must appear
38
+ */
39
+ status_link?: string;
40
+ /**
41
+ * UTM campaign HTTP parameters
42
+ */
43
+ utm?: {
44
+ /**
45
+ * Parameter 'utm_source', the referrer: (e.g. 'google', 'newsletter')
46
+ */
47
+ source?: string;
48
+ /**
49
+ * Parameter 'utm_medium', the marketing medium: (e.g. 'cpc', 'banner', 'email')
50
+ */
51
+ medium?: string;
52
+ /**
53
+ * Parameter 'utm_campaign', the product, promo code, or slogan (e.g. 'spring_sale')
54
+ */
55
+ campaign?: string;
56
+ /**
57
+ * Parameter 'utm_term', identifies the paid keywords
58
+ */
59
+ term?: string;
60
+ /**
61
+ * Parameter 'utm_content', used to differentiate ads
62
+ */
63
+ content?: string;
64
+ };
65
+ /**
66
+ * The website that the customer clicked on to come to the shop
67
+ */
68
+ referring_site?: string;
69
+ /**
70
+ * Code to identify the affiliate that referred the customer
71
+ */
72
+ affiliate_code?: string;
73
+ /**
74
+ * Initial URL of the session that originated the order
75
+ */
76
+ origin_url?: string;
77
+ /**
78
+ * IP address of the device used by the customer when placing the order
79
+ */
80
+ client_ip?: string;
81
+ /**
82
+ * User-Agent of the browser (if any) used by the customer
83
+ */
84
+ client_user_agent?: string;
85
+ /**
86
+ * Sales channel unique identifier or domain name
87
+ */
88
+ channel_id?: string;
89
+ /**
90
+ * Channel type or source
91
+ */
92
+ channel_type?: 'ecommerce' | 'mobile' | 'pos' | 'button' | 'social' | 'chatbot' | 'live';
93
+ /**
94
+ * Store domain name (numbers and lowercase letters, eg.: www.myshop.sample)
95
+ */
96
+ domain?: string;
97
+ /**
98
+ * Order number, if not specified will be filled auto incrementing
99
+ */
100
+ number?: number;
101
+ /**
102
+ * Order code used by seller and customer for identification, should be unique
103
+ */
104
+ code?: string;
105
+ /**
106
+ * Order main status
107
+ */
108
+ status?: 'open' | 'closed' | 'cancelled';
109
+ /**
110
+ * Date and time when order was opened, in ISO 8601 standard representation [auto]
111
+ */
112
+ opened_at?: string;
113
+ /**
114
+ * If the order is closed, specify the date and time it occurred
115
+ */
116
+ closed_at?: string;
117
+ /**
118
+ * If the order is cancelled, specify the date and time it occurred
119
+ */
120
+ cancelled_at?: string;
121
+ /**
122
+ * If the order is cancelled, specify the reason why it was cancelled
123
+ */
124
+ cancel_reason?: 'customer' | 'fraud' | 'inventory' | 'declined' | 'other';
125
+ /**
126
+ * Order status created by seller
127
+ */
128
+ seller_status?: string;
129
+ /**
130
+ * Financial status and date of change
131
+ */
132
+ financial_status?: {
133
+ /**
134
+ * Last status change, date and time in ISO 8601 standard representation [auto]
135
+ */
136
+ updated_at?: string;
137
+ /**
138
+ * Order financial status
139
+ */
140
+ current:
141
+ | 'pending'
142
+ | 'under_analysis'
143
+ | 'authorized'
144
+ | 'unauthorized'
145
+ | 'partially_paid'
146
+ | 'paid'
147
+ | 'in_dispute'
148
+ | 'partially_refunded'
149
+ | 'refunded'
150
+ | 'voided'
151
+ | 'unknown';
152
+ /**
153
+ * Flags to associate additional info
154
+ *
155
+ * @maxItems 10
156
+ */
157
+ flags?: string[];
158
+ };
159
+ /**
160
+ * Fulfillment status and date of change
161
+ */
162
+ fulfillment_status?: {
163
+ /**
164
+ * Last status change, date and time in ISO 8601 standard representation [auto]
165
+ */
166
+ updated_at?: string;
167
+ /**
168
+ * Order fulfillment (shipping) status
169
+ */
170
+ current:
171
+ | 'invoice_issued'
172
+ | 'in_production'
173
+ | 'in_separation'
174
+ | 'ready_for_shipping'
175
+ | 'partially_shipped'
176
+ | 'shipped'
177
+ | 'partially_delivered'
178
+ | 'delivered'
179
+ | 'returned_for_exchange'
180
+ | 'received_for_exchange'
181
+ | 'returned';
182
+ /**
183
+ * Flags to associate additional info
184
+ *
185
+ * @maxItems 10
186
+ */
187
+ flags?: string[];
188
+ };
189
+ /**
190
+ * Designator of currency according to ISO 4217 (3 uppercase letters)
191
+ */
192
+ currency_id?: string;
193
+ /**
194
+ * Graphic symbol used as a shorthand for currency's name
195
+ */
196
+ currency_symbol?: string;
197
+ /**
198
+ * Object with sums of values
199
+ */
200
+ amount: {
201
+ /**
202
+ * Order total amount
203
+ */
204
+ total: number;
205
+ /**
206
+ * The sum of all items prices
207
+ */
208
+ subtotal?: number;
209
+ /**
210
+ * Order freight cost
211
+ */
212
+ freight?: number;
213
+ /**
214
+ * Final discount value applied
215
+ */
216
+ discount?: number;
217
+ /**
218
+ * Value deducted via balance in wallet or loyalty points
219
+ */
220
+ balance?: number;
221
+ /**
222
+ * The sum of all the taxes applied to the order
223
+ */
224
+ tax?: number;
225
+ /**
226
+ * Sum of optional extra costs applied
227
+ */
228
+ extra?: number;
229
+ };
230
+ /**
231
+ * Name or summary of order payment method(s)
232
+ */
233
+ payment_method_label?: string;
234
+ /**
235
+ * Name of order shipping method(s)
236
+ */
237
+ shipping_method_label?: string;
238
+ /**
239
+ * List of order customers
240
+ *
241
+ * @maxItems 20
242
+ */
243
+ buyers?: {
244
+ /**
245
+ * Customer ID (ObjectID)
246
+ */
247
+ _id: string & { length: 24 };
248
+ /**
249
+ * Customer language two letter code, sometimes with region, e.g. 'pt_br', 'fr', 'en_us'
250
+ */
251
+ locale?: string;
252
+ /**
253
+ * Customer main email address
254
+ */
255
+ main_email?: string;
256
+ /**
257
+ * List of customer email addresses
258
+ *
259
+ * @maxItems 20
260
+ */
261
+ emails?: {
262
+ /**
263
+ * The actual email address
264
+ */
265
+ address: string;
266
+ /**
267
+ * The type of email
268
+ */
269
+ type?: 'work' | 'home' | 'other';
270
+ /**
271
+ * States whether or not the email address has been verified
272
+ */
273
+ verified?: boolean;
274
+ }[];
275
+ /**
276
+ * The name of this Customer, suitable for display
277
+ */
278
+ display_name?: string;
279
+ /**
280
+ * Customer name object
281
+ */
282
+ name?: {
283
+ /**
284
+ * The family name of this user, or "last name"
285
+ */
286
+ family_name?: string;
287
+ /**
288
+ * The "first name" of this user
289
+ */
290
+ given_name?: string;
291
+ /**
292
+ * The middle name(s) of this user
293
+ */
294
+ middle_name?: string;
295
+ };
296
+ /**
297
+ * Customer preferred pronoun
298
+ */
299
+ pronoun?: 'he' | 'she';
300
+ /**
301
+ * List of customer phone numbers
302
+ *
303
+ * @maxItems 20
304
+ */
305
+ phones?: {
306
+ /**
307
+ * Country calling code (without +), defined by standards E.123 and E.164
308
+ */
309
+ country_code?: number;
310
+ /**
311
+ * The actual phone number, digits only
312
+ */
313
+ number: string;
314
+ /**
315
+ * The type of phone
316
+ */
317
+ type?: 'home' | 'personal' | 'work' | 'other';
318
+ }[];
319
+ /**
320
+ * Physical or juridical (company) person
321
+ */
322
+ registry_type?: 'p' | 'j';
323
+ /**
324
+ * Country of document origin, an ISO 3166-2 code
325
+ */
326
+ doc_country?: string;
327
+ /**
328
+ * Responsible person or organization document number (only numbers)
329
+ */
330
+ doc_number?: string;
331
+ /**
332
+ * Municipal or state registration if exists
333
+ */
334
+ inscription_type?: 'State' | 'Municipal';
335
+ /**
336
+ * Municipal or state registration number (with characters) if exists
337
+ */
338
+ inscription_number?: string;
339
+ /**
340
+ * Registered company name or responsible fullname
341
+ */
342
+ corporate_name?: string;
343
+ }[];
344
+ /**
345
+ * Whether the order is only budget, without payment transactions
346
+ */
347
+ budget_only?: boolean;
348
+ /**
349
+ * List of shipping methods and address for this order
350
+ *
351
+ * @maxItems 100
352
+ */
353
+ shipping_lines?: {
354
+ /**
355
+ * Shipping line ID (ObjectID) [auto]
356
+ */
357
+ _id?: string & { length: 24 };
358
+ from: Address;
359
+ to: Address1;
360
+ /**
361
+ * Shipping object information
362
+ */
363
+ package?: {
364
+ /**
365
+ * Package dimensions
366
+ */
367
+ dimensions?: {
368
+ /**
369
+ * Package width, height and length
370
+ *
371
+ * This interface was referenced by `undefined`'s JSON-Schema definition
372
+ * via the `patternProperty` "^width|height|length$".
373
+ */
374
+ [k: string]: {
375
+ /**
376
+ * Size in specified unit
377
+ */
378
+ value: number;
379
+ /**
380
+ * Unit of measurement
381
+ */
382
+ unit?: 'mm' | 'cm' | 'm' | 'ft' | 'in' | 'yd' | 'mi';
383
+ };
384
+ };
385
+ /**
386
+ * Package weight for freight calculation
387
+ */
388
+ weight?: {
389
+ /**
390
+ * Size in specified unit
391
+ */
392
+ value: number;
393
+ /**
394
+ * Unit of measurement
395
+ */
396
+ unit?: 'mg' | 'g' | 'kg' | 'lb' | 'oz';
397
+ };
398
+ };
399
+ /**
400
+ * Shipping method (by application) chosen by customer
401
+ */
402
+ app?: {
403
+ /**
404
+ * Application ID (ObjectID)
405
+ */
406
+ _id?: string & { length: 24 };
407
+ /**
408
+ * Name of shipping method shown to customers
409
+ */
410
+ label?: string;
411
+ /**
412
+ * Carrier name
413
+ */
414
+ carrier?: string;
415
+ /**
416
+ * Carrier document number (only numbers)
417
+ */
418
+ carrier_doc_number?: string;
419
+ /**
420
+ * Name of service (shipping method) defined by carrier
421
+ */
422
+ service_name?: string;
423
+ /**
424
+ * Code of service defined by carrier
425
+ */
426
+ service_code?: string;
427
+ /**
428
+ * Contract number of the shop with carrier, if exists
429
+ */
430
+ contract?: string;
431
+ /**
432
+ * Shipping method icon image URI
433
+ */
434
+ icon?: string;
435
+ /**
436
+ * URI to carrier website to get package tracking status
437
+ */
438
+ tracking_url?: string;
439
+ };
440
+ /**
441
+ * Pick up option when no (or optional) freight
442
+ */
443
+ pick_up?: 'store' | 'locker' | 'point' | 'other';
444
+ /**
445
+ * Freight cost for this shipping line, without additionals
446
+ */
447
+ price?: number;
448
+ /**
449
+ * The package value declared to carrier, generally the sum of all items prices
450
+ */
451
+ declared_value?: number;
452
+ /**
453
+ * Cost for the "declared value" additional service
454
+ */
455
+ declared_value_price?: number;
456
+ /**
457
+ * Whether the package must be delivered with additional service "own hand"
458
+ */
459
+ own_hand?: boolean;
460
+ /**
461
+ * Cost for the "own hand" additional service
462
+ */
463
+ own_hand_price?: number;
464
+ /**
465
+ * If the package will be delivered with acknowledgment of receipt
466
+ */
467
+ receipt?: boolean;
468
+ /**
469
+ * Cost for the "acknowledgment of receipt" additional service
470
+ */
471
+ receipt_price?: number;
472
+ /**
473
+ * List of other additional services for this shipping line
474
+ *
475
+ * @maxItems 30
476
+ */
477
+ other_additionals?: {
478
+ /**
479
+ * Tag to identify object, use only lowercase letters, digits and underscore
480
+ */
481
+ tag?: string;
482
+ /**
483
+ * Name of the additional service
484
+ */
485
+ label: string;
486
+ /**
487
+ * Cost for this additional service
488
+ */
489
+ price?: number;
490
+ }[];
491
+ /**
492
+ * List of taxes or other additional services for this shipping line
493
+ *
494
+ * @maxItems 30
495
+ */
496
+ taxes?: {
497
+ /**
498
+ * Tag to identify object, use only lowercase letters, digits and underscore
499
+ */
500
+ tag?: string;
501
+ /**
502
+ * Tax title
503
+ */
504
+ label: string;
505
+ /**
506
+ * Tax value applied
507
+ */
508
+ price?: number;
509
+ /**
510
+ * Tax rate as a function of package value
511
+ */
512
+ rate?: number;
513
+ }[];
514
+ /**
515
+ * Discount on shipping price, negative if value was additionated (not discounted)
516
+ */
517
+ discount?: number;
518
+ /**
519
+ * Total cost for this shipping line, with additionals and taxes
520
+ */
521
+ total_price?: number;
522
+ /**
523
+ * Deadline for sending the package
524
+ */
525
+ posting_deadline?: {
526
+ /**
527
+ * Number of days to post the product after purchase
528
+ */
529
+ days: number;
530
+ /**
531
+ * If the deadline is calculated in working days
532
+ */
533
+ working_days?: boolean;
534
+ /**
535
+ * Whether days will be counted after payment approval
536
+ */
537
+ after_approval?: boolean;
538
+ };
539
+ /**
540
+ * Estimated delivery time
541
+ */
542
+ delivery_time?: {
543
+ /**
544
+ * Number of days for delivery after shipping
545
+ */
546
+ days: number;
547
+ /**
548
+ * If the deadline is calculated in working days
549
+ */
550
+ working_days?: boolean;
551
+ };
552
+ /**
553
+ * Date range when delivery will be made
554
+ */
555
+ scheduled_delivery?: {
556
+ /**
557
+ * Scheduled date and time on the ISO 8601 representation
558
+ *
559
+ * This interface was referenced by `undefined`'s JSON-Schema definition
560
+ * via the `patternProperty` "^start|end$".
561
+ */
562
+ [k: string]: string;
563
+ };
564
+ /**
565
+ * Additional text instructions for pick up or custom delivery process
566
+ */
567
+ delivery_instructions?: string;
568
+ /**
569
+ * List of codes for delivery status follow-up
570
+ *
571
+ * @maxItems 30
572
+ */
573
+ tracking_codes?: {
574
+ /**
575
+ * Tag to identify object, use only lowercase letters, digits and underscore
576
+ */
577
+ tag?: string;
578
+ /**
579
+ * Tracking code string
580
+ */
581
+ code: string;
582
+ /**
583
+ * URI for carrier website to get the tracking status with this code
584
+ */
585
+ link?: string;
586
+ }[];
587
+ /**
588
+ * List of invoices
589
+ *
590
+ * @maxItems 30
591
+ */
592
+ invoices?: {
593
+ /**
594
+ * Company that issued this invoice, usually the store company
595
+ */
596
+ issuer?: {
597
+ /**
598
+ * Organization document number (only numbers)
599
+ */
600
+ doc_number?: string;
601
+ /**
602
+ * Municipal or state registration if exists
603
+ */
604
+ inscription_type?: 'State' | 'Municipal';
605
+ /**
606
+ * Municipal or state registration number (with characters) if exists
607
+ */
608
+ inscription_number?: string;
609
+ /**
610
+ * Registered company name
611
+ */
612
+ corporate_name?: string;
613
+ };
614
+ /**
615
+ * Invoice number
616
+ */
617
+ number: string;
618
+ /**
619
+ * Invoice serial number
620
+ */
621
+ serial_number?: string;
622
+ /**
623
+ * Date and time of issue, in ISO 8601 standard representation [auto]
624
+ */
625
+ issued_at?: string;
626
+ /**
627
+ * URI to invoice file
628
+ */
629
+ link?: string;
630
+ /**
631
+ * Invoice access key (BR)
632
+ */
633
+ access_key?: string;
634
+ /**
635
+ * URI to DANFE (BR)
636
+ */
637
+ link_danfe?: string;
638
+ }[];
639
+ /**
640
+ * Fulfillment status and date of change
641
+ */
642
+ status?: {
643
+ /**
644
+ * Last status change, date and time in ISO 8601 standard representation [auto]
645
+ */
646
+ updated_at?: string;
647
+ /**
648
+ * Shipping status
649
+ */
650
+ current:
651
+ | 'invoice_issued'
652
+ | 'in_production'
653
+ | 'in_separation'
654
+ | 'ready_for_shipping'
655
+ | 'shipped'
656
+ | 'delivered'
657
+ | 'returned_for_exchange'
658
+ | 'received_for_exchange'
659
+ | 'returned';
660
+ };
661
+ /**
662
+ * For multi DC, set warehouse where the stock will be handled
663
+ */
664
+ warehouse_code?: string;
665
+ /**
666
+ * List of order items related with this shipping line, use only if items are divided
667
+ *
668
+ * @maxItems 3000
669
+ */
670
+ items?: string[];
671
+ /**
672
+ * Flags to associate additional info
673
+ *
674
+ * @maxItems 10
675
+ */
676
+ flags?: string[];
677
+ /**
678
+ * List of custom fields
679
+ *
680
+ * @maxItems 10
681
+ */
682
+ custom_fields?: {
683
+ /**
684
+ * Field name
685
+ */
686
+ field: string;
687
+ /**
688
+ * Field value
689
+ */
690
+ value: string;
691
+ }[];
692
+ /**
693
+ * Optional notes with additional info about this shipping line
694
+ */
695
+ notes?: string;
696
+ }[];
697
+ /**
698
+ * List of payment transactions for this order
699
+ *
700
+ * @maxItems 100
701
+ */
702
+ transactions?: {
703
+ /**
704
+ * Transaction ID (ObjectID) [auto]
705
+ */
706
+ _id?: string & { length: 24 };
707
+ /**
708
+ * Date and time of transaction creation, in ISO 8601 standard representation [auto]
709
+ */
710
+ created_at?: string;
711
+ /**
712
+ * Transaction type
713
+ */
714
+ type?: 'payment' | 'recurrence';
715
+ /**
716
+ * Payment method object
717
+ */
718
+ payment_method: {
719
+ /**
720
+ * Standardized payment method code
721
+ */
722
+ code:
723
+ | 'credit_card'
724
+ | 'banking_billet'
725
+ | 'online_debit'
726
+ | 'account_deposit'
727
+ | 'debit_card'
728
+ | 'balance_on_intermediary'
729
+ | 'loyalty_points'
730
+ | 'other';
731
+ /**
732
+ * Short description for payment method
733
+ */
734
+ name?: string;
735
+ };
736
+ /**
737
+ * Direct link to pay current transaction
738
+ */
739
+ payment_link?: string;
740
+ /**
741
+ * Additional text instructions for manual payments
742
+ */
743
+ payment_instructions?: string;
744
+ /**
745
+ * Transation payer info
746
+ */
747
+ payer?: {
748
+ /**
749
+ * Payer full name or company corporate name
750
+ */
751
+ fullname?: string;
752
+ /**
753
+ * Date of payer birth
754
+ */
755
+ birth_date?: {
756
+ /**
757
+ * Day of birth
758
+ */
759
+ day?: number;
760
+ /**
761
+ * Number of month of birth
762
+ */
763
+ month?: number;
764
+ /**
765
+ * Year of birth
766
+ */
767
+ year?: number;
768
+ };
769
+ /**
770
+ * Payer contact phone
771
+ */
772
+ phone?: {
773
+ /**
774
+ * Country calling code (without +), defined by standards E.123 and E.164
775
+ */
776
+ country_code?: number;
777
+ /**
778
+ * The actual phone number, digits only
779
+ */
780
+ number: string;
781
+ /**
782
+ * The type of phone
783
+ */
784
+ type?: 'home' | 'personal' | 'work' | 'other';
785
+ };
786
+ /**
787
+ * Physical or juridical (company) person
788
+ */
789
+ registry_type?: 'p' | 'j';
790
+ /**
791
+ * Country of document origin, an ISO 3166-2 code
792
+ */
793
+ doc_country?: string;
794
+ /**
795
+ * Responsible person or organization document number (only numbers)
796
+ */
797
+ doc_number?: string;
798
+ };
799
+ billing_address?: Address2;
800
+ /**
801
+ * Payment method (by application) chosen by customer
802
+ */
803
+ app?: {
804
+ /**
805
+ * Application ID (ObjectID)
806
+ */
807
+ _id?: string & { length: 24 };
808
+ /**
809
+ * Name of payment method shown to customers
810
+ */
811
+ label?: string;
812
+ /**
813
+ * Payment icon image URI
814
+ */
815
+ icon?: string;
816
+ /**
817
+ * Payment intermediator
818
+ */
819
+ intermediator?: {
820
+ /**
821
+ * Name of payment intermediator
822
+ */
823
+ name?: string;
824
+ /**
825
+ * URI to intermediator website
826
+ */
827
+ link?: string;
828
+ /**
829
+ * Gateway name standardized as identification code
830
+ */
831
+ code: string;
832
+ };
833
+ /**
834
+ * Base URI to payments
835
+ */
836
+ payment_url?: string;
837
+ };
838
+ /**
839
+ * Transaction properties in the intermediator
840
+ */
841
+ intermediator?: {
842
+ /**
843
+ * Transaction ID in the intermediator
844
+ */
845
+ transaction_id?: string;
846
+ /**
847
+ * Transaction code in the intermediator
848
+ */
849
+ transaction_code?: string;
850
+ /**
851
+ * Transaction reference code
852
+ */
853
+ transaction_reference?: string;
854
+ /**
855
+ * Payment method as defined by intermediator
856
+ */
857
+ payment_method?: {
858
+ /**
859
+ * Payment method code
860
+ */
861
+ code: string;
862
+ /**
863
+ * Short description for payment method
864
+ */
865
+ name?: string;
866
+ };
867
+ /**
868
+ * ID of customer account in the intermediator
869
+ */
870
+ buyer_id?: string;
871
+ };
872
+ /**
873
+ * Credit card data, if payment was done with credit card
874
+ */
875
+ credit_card?: {
876
+ /**
877
+ * Full name of the holder, as it is on the credit card
878
+ */
879
+ holder_name?: string;
880
+ /**
881
+ * Response code from AVS: http://www.emsecommerce.net/avs_cvv2_response_codes.htm
882
+ */
883
+ avs_result_code?: string | null;
884
+ /**
885
+ * Response code from credit card company, such as AVS result code
886
+ */
887
+ cvv_result_code?: string | null;
888
+ /**
889
+ * Issuer identification number (IIN), known as bank identification number (BIN)
890
+ */
891
+ bin?: number;
892
+ /**
893
+ * Credit card issuer name, eg.: Visa, American Express, MasterCard
894
+ */
895
+ company?: string;
896
+ /**
897
+ * Last digits (up to 4) of credit card number
898
+ */
899
+ last_digits?: string;
900
+ /**
901
+ * Unique credit card token
902
+ */
903
+ token?: string;
904
+ /**
905
+ * Credit card processing standardized error code
906
+ */
907
+ error_code?:
908
+ | 'incorrect_number'
909
+ | 'invalid_number'
910
+ | 'invalid_expiry_date'
911
+ | 'invalid_cvc'
912
+ | 'expired_card'
913
+ | 'incorrect_cvc'
914
+ | 'incorrect_zip'
915
+ | 'incorrect_address'
916
+ | 'card_declined'
917
+ | 'processing_error'
918
+ | 'call_issuer'
919
+ | 'pick_up_card';
920
+ };
921
+ /**
922
+ * Banking billet data, if payment was done with banking billet
923
+ */
924
+ banking_billet?: {
925
+ /**
926
+ * Ticket code, generally a barcode number
927
+ */
928
+ code?: string;
929
+ /**
930
+ * Date and time of expiration, in ISO 8601 standard representation
931
+ */
932
+ valid_thru?: string;
933
+ /**
934
+ * Text lines on ticket
935
+ *
936
+ * @maxItems 5
937
+ */
938
+ text_lines?: string[];
939
+ /**
940
+ * Direct link (URI) to banking billet
941
+ */
942
+ link?: string;
943
+ };
944
+ /**
945
+ * Account deposit data, if payment was done with account deposit
946
+ */
947
+ account_deposit?: {
948
+ /**
949
+ * Date and time of expiration, in ISO 8601 standard representation
950
+ */
951
+ valid_thru?: string;
952
+ /**
953
+ * Information notes to payment
954
+ *
955
+ * @maxItems 5
956
+ */
957
+ text_lines?: string[];
958
+ };
959
+ /**
960
+ * If paid with loyalty points, specify how many points and what program was consumed
961
+ */
962
+ loyalty_points?: {
963
+ /**
964
+ * The name of the loyalty points program
965
+ */
966
+ name?: string;
967
+ /**
968
+ * Unique identifier, program name using only lowercase, numbers and underscore
969
+ */
970
+ program_id: string;
971
+ /**
972
+ * Number of loyalty points applied from customer account
973
+ */
974
+ points_value: number;
975
+ /**
976
+ * The ratio of a point when converted to currency
977
+ */
978
+ ratio?: number;
979
+ };
980
+ /**
981
+ * Currency ID specific for this transaction, if different of order currency ID
982
+ */
983
+ currency_id?: string;
984
+ /**
985
+ * Currency symbol specific for this transaction
986
+ */
987
+ currency_symbol?: string;
988
+ /**
989
+ * Discount by payment method, negative if value was additionated (not discounted)
990
+ */
991
+ discount?: number;
992
+ /**
993
+ * Transaction amount, disregarding installment rates
994
+ */
995
+ amount: number;
996
+ /**
997
+ * Installments option
998
+ */
999
+ installments?: {
1000
+ /**
1001
+ * Number of installments
1002
+ */
1003
+ number: number;
1004
+ /**
1005
+ * Installment value
1006
+ */
1007
+ value?: number;
1008
+ /**
1009
+ * Tax applied
1010
+ */
1011
+ tax?: boolean;
1012
+ /**
1013
+ * Total value, sum of all plots
1014
+ */
1015
+ total?: number;
1016
+ };
1017
+ /**
1018
+ * Financial status and date of change
1019
+ */
1020
+ status?: {
1021
+ /**
1022
+ * Last status change, date and time in ISO 8601 standard representation [auto]
1023
+ */
1024
+ updated_at?: string;
1025
+ /**
1026
+ * Payment status
1027
+ */
1028
+ current:
1029
+ | 'pending'
1030
+ | 'under_analysis'
1031
+ | 'authorized'
1032
+ | 'unauthorized'
1033
+ | 'paid'
1034
+ | 'in_dispute'
1035
+ | 'refunded'
1036
+ | 'voided'
1037
+ | 'unknown';
1038
+ };
1039
+ /**
1040
+ * List of order items related with this transaction, use only if items are divided
1041
+ *
1042
+ * @maxItems 3000
1043
+ */
1044
+ items?: string[];
1045
+ /**
1046
+ * Flags to associate additional info
1047
+ *
1048
+ * @maxItems 10
1049
+ */
1050
+ flags?: string[];
1051
+ /**
1052
+ * List of custom fields
1053
+ *
1054
+ * @maxItems 10
1055
+ */
1056
+ custom_fields?: {
1057
+ /**
1058
+ * Field name
1059
+ */
1060
+ field: string;
1061
+ /**
1062
+ * Field value
1063
+ */
1064
+ value: string;
1065
+ }[];
1066
+ /**
1067
+ * Optional notes with additional info about this transaction
1068
+ */
1069
+ notes?: string;
1070
+ }[];
1071
+ /**
1072
+ * Historical of payments and financial status changes
1073
+ *
1074
+ * @maxItems 3000
1075
+ */
1076
+ payments_history?: {
1077
+ /**
1078
+ * Payment status ID (ObjectID) [auto]
1079
+ */
1080
+ _id?: string & { length: 24 };
1081
+ /**
1082
+ * ID of transaction related with this event
1083
+ */
1084
+ transaction_id?: string;
1085
+ /**
1086
+ * Date and time of the event, in ISO 8601 standard representation [auto]
1087
+ */
1088
+ date_time?: string;
1089
+ /**
1090
+ * Payment status
1091
+ */
1092
+ status:
1093
+ | 'pending'
1094
+ | 'under_analysis'
1095
+ | 'authorized'
1096
+ | 'unauthorized'
1097
+ | 'paid'
1098
+ | 'in_dispute'
1099
+ | 'refunded'
1100
+ | 'voided'
1101
+ | 'unknown';
1102
+ /**
1103
+ * Code of received notification with this status change
1104
+ */
1105
+ notification_code?: string;
1106
+ /**
1107
+ * If customer was already notified of this event
1108
+ */
1109
+ customer_notified?: boolean;
1110
+ /**
1111
+ * Flags to associate additional info
1112
+ *
1113
+ * @maxItems 10
1114
+ */
1115
+ flags?: string[];
1116
+ }[];
1117
+ /**
1118
+ * Fulfillment and tracking events
1119
+ *
1120
+ * @maxItems 3000
1121
+ */
1122
+ fulfillments?: {
1123
+ /**
1124
+ * Fulfillment status ID (ObjectID) [auto]
1125
+ */
1126
+ _id?: string & { length: 24 };
1127
+ /**
1128
+ * ID of shipping line related with this event
1129
+ */
1130
+ shipping_line_id?: string & { length: 24 };
1131
+ /**
1132
+ * Date and time of the event, in ISO 8601 standard representation [auto]
1133
+ */
1134
+ date_time?: string;
1135
+ /**
1136
+ * Fulfillment status
1137
+ */
1138
+ status:
1139
+ | 'invoice_issued'
1140
+ | 'in_production'
1141
+ | 'in_separation'
1142
+ | 'ready_for_shipping'
1143
+ | 'shipped'
1144
+ | 'delivered'
1145
+ | 'returned_for_exchange'
1146
+ | 'received_for_exchange'
1147
+ | 'returned';
1148
+ /**
1149
+ * Code of received notification with this status change
1150
+ */
1151
+ notification_code?: string;
1152
+ /**
1153
+ * If customer was already notified of this event
1154
+ */
1155
+ customer_notified?: boolean;
1156
+ /**
1157
+ * Flags to associate additional info
1158
+ *
1159
+ * @maxItems 10
1160
+ */
1161
+ flags?: string[];
1162
+ }[];
1163
+ /**
1164
+ * Products composing the order
1165
+ *
1166
+ * @maxItems 3000
1167
+ */
1168
+ items?: {
1169
+ /**
1170
+ * Order item ID (ObjectID) [auto]
1171
+ */
1172
+ _id?: string & { length: 24 };
1173
+ /**
1174
+ * Product ID
1175
+ */
1176
+ product_id: string & { length: 24 };
1177
+ /**
1178
+ * ID to specify the variation added to cart, if product has variations
1179
+ */
1180
+ variation_id?: string & { length: 24 };
1181
+ /**
1182
+ * Product or variation unique reference code
1183
+ */
1184
+ sku?: string;
1185
+ /**
1186
+ * Product or variation full name, or other label for this cart item
1187
+ */
1188
+ name?: string;
1189
+ /**
1190
+ * Product slug to complete page URL
1191
+ */
1192
+ slug?: string;
1193
+ /**
1194
+ * Product or variation picture for this cart item
1195
+ */
1196
+ picture?: {
1197
+ normal?: PictureSize;
1198
+ big?: PictureSize1;
1199
+ zoom?: PictureSize2;
1200
+ small?: PictureSize3;
1201
+ };
1202
+ /**
1203
+ * Item customization fields
1204
+ *
1205
+ * @maxItems 100
1206
+ */
1207
+ customizations?: {
1208
+ /**
1209
+ * Title for this customization field, can be the grid title
1210
+ */
1211
+ label?: string;
1212
+ /**
1213
+ * Option chosen or created by customer
1214
+ */
1215
+ option: {
1216
+ /**
1217
+ * Option ID (ObjectID) if it was predefined (not custom value created by customer)
1218
+ */
1219
+ _id?: string & { length: 24 };
1220
+ /**
1221
+ * Option text value displayed for the client
1222
+ */
1223
+ text: string;
1224
+ };
1225
+ /**
1226
+ * URL of file attached by customer to this field
1227
+ */
1228
+ attachment?: string;
1229
+ /**
1230
+ * Price alteration due to this customization
1231
+ */
1232
+ add_to_price?: {
1233
+ /**
1234
+ * Type of price addition
1235
+ */
1236
+ type?: 'percentage' | 'fixed';
1237
+ /**
1238
+ * Additional value, could be negative
1239
+ */
1240
+ addition: number;
1241
+ };
1242
+ }[];
1243
+ /**
1244
+ * Parent kit product for this item
1245
+ */
1246
+ kit_product?: {
1247
+ /**
1248
+ * Kit product ID (ObjectID)
1249
+ */
1250
+ _id: string & { length: 24 };
1251
+ /**
1252
+ * Kit product full name
1253
+ */
1254
+ name?: string;
1255
+ /**
1256
+ * Total quantity of items to close a kit unit
1257
+ */
1258
+ pack_quantity?: number;
1259
+ /**
1260
+ * Kit total pack price
1261
+ */
1262
+ price?: number;
1263
+ /**
1264
+ * Current kit composition
1265
+ *
1266
+ * @maxItems 100
1267
+ */
1268
+ composition?: {
1269
+ /**
1270
+ * Product ID (ObjectID)
1271
+ */
1272
+ _id: string & { length: 24 };
1273
+ /**
1274
+ * Selected variation ID (ObjectID) if any
1275
+ */
1276
+ variation_id?: string & { length: 24 };
1277
+ /**
1278
+ * Kit item quantity
1279
+ */
1280
+ quantity?: number;
1281
+ }[];
1282
+ };
1283
+ /**
1284
+ * Gift wrap chosen by customer
1285
+ */
1286
+ gift_wrap?: {
1287
+ /**
1288
+ * Tag to identify object, use only lowercase letters, digits and underscore
1289
+ */
1290
+ tag?: string;
1291
+ /**
1292
+ * Title describing this gift wrap
1293
+ */
1294
+ label: string;
1295
+ /**
1296
+ * Additional value due to this gift wrap
1297
+ */
1298
+ add_to_price?: number;
1299
+ };
1300
+ /**
1301
+ * Item quantity in cart
1302
+ */
1303
+ quantity: number;
1304
+ /**
1305
+ * Item stock management state respective to order status
1306
+ */
1307
+ stock_status?: 'pending' | 'released' | 'returned' | 'unmanaged' | 'out_of_stock' | '__releasing';
1308
+ /**
1309
+ * Product sale price specifically for this cart
1310
+ */
1311
+ price: number;
1312
+ /**
1313
+ * Final item price including additions due to customizations and gift wrap
1314
+ */
1315
+ final_price?: number;
1316
+ /**
1317
+ * Item's original price for comparison, without discounts
1318
+ */
1319
+ base_price?: number;
1320
+ /**
1321
+ * Flags to associate additional info
1322
+ *
1323
+ * @maxItems 10
1324
+ */
1325
+ flags?: string[];
1326
+ }[];
1327
+ /**
1328
+ * Extra discount applied by coupon or UTM campaign
1329
+ */
1330
+ extra_discount?: {
1331
+ /**
1332
+ * Text of discount coupon applied by customer
1333
+ */
1334
+ discount_coupon?: string;
1335
+ /**
1336
+ * Extra discount value
1337
+ */
1338
+ value: number;
1339
+ /**
1340
+ * Extra discount rule (by application)
1341
+ */
1342
+ app?: {
1343
+ /**
1344
+ * Application ID (ObjectID)
1345
+ */
1346
+ _id?: string & { length: 24 };
1347
+ /**
1348
+ * Name of the discount rule, can be the coupon or campaign name
1349
+ */
1350
+ label?: string;
1351
+ /**
1352
+ * Additional text description for the discount rule
1353
+ */
1354
+ description?: string;
1355
+ };
1356
+ /**
1357
+ * Flags to associate additional info
1358
+ *
1359
+ * @maxItems 10
1360
+ */
1361
+ flags?: string[];
1362
+ };
1363
+ /**
1364
+ * Original subscription (recurrence) order
1365
+ */
1366
+ subscription_order?: {
1367
+ /**
1368
+ * Subscription order ID (ObjectID)
1369
+ */
1370
+ _id: string & { length: 24 };
1371
+ /**
1372
+ * Subscription order number
1373
+ */
1374
+ number?: number;
1375
+ };
1376
+ /**
1377
+ * List of custom attributes
1378
+ *
1379
+ * @maxItems 100
1380
+ */
1381
+ metafields?: {
1382
+ /**
1383
+ * String to help distinguish who (or which app) created and can use the metafield
1384
+ */
1385
+ namespace?: string;
1386
+ /**
1387
+ * Field name
1388
+ */
1389
+ field?: string;
1390
+ /**
1391
+ * Custom property value
1392
+ */
1393
+ value: {
1394
+ [k: string]: unknown;
1395
+ };
1396
+ }[];
1397
+ /**
1398
+ * List of custom attributes
1399
+ *
1400
+ * @maxItems 100
1401
+ */
1402
+ hidden_metafields?: {
1403
+ /**
1404
+ * String to help distinguish who (or which app) created and can use the metafield
1405
+ */
1406
+ namespace?: string;
1407
+ /**
1408
+ * Field name
1409
+ */
1410
+ field?: string;
1411
+ /**
1412
+ * Custom property value
1413
+ */
1414
+ value: {
1415
+ [k: string]: unknown;
1416
+ };
1417
+ }[];
1418
+ /**
1419
+ * List of custom attributes, hidden by default, visible for the order buyers
1420
+ *
1421
+ * @maxItems 100
1422
+ */
1423
+ private_metafields?: {
1424
+ /**
1425
+ * String to help distinguish who (or which app) created and can use the metafield
1426
+ */
1427
+ namespace?: string;
1428
+ /**
1429
+ * Field name
1430
+ */
1431
+ field?: string;
1432
+ /**
1433
+ * Custom property value
1434
+ */
1435
+ value: {
1436
+ [k: string]: unknown;
1437
+ };
1438
+ }[];
1439
+ /**
1440
+ * Flags to associate additional info
1441
+ *
1442
+ * @maxItems 10
1443
+ */
1444
+ flags?: string[];
1445
+ /**
1446
+ * Optional notes with additional info about this order
1447
+ */
1448
+ notes?: string;
1449
+ /**
1450
+ * Description and notes about this order, available only for shop administrators
1451
+ */
1452
+ staff_notes?: string;
1453
+ }
1454
+ /**
1455
+ * Sender's address
1456
+ */
1457
+ export interface Address {
1458
+ /**
1459
+ * ZIP (CEP, postal...) code
1460
+ */
1461
+ zip: string;
1462
+ /**
1463
+ * Street or public place name
1464
+ */
1465
+ street?: string;
1466
+ /**
1467
+ * House or building street number
1468
+ */
1469
+ number?: number;
1470
+ /**
1471
+ * Address complement or second line, such as apartment number
1472
+ */
1473
+ complement?: string;
1474
+ /**
1475
+ * Borough name
1476
+ */
1477
+ borough?: string;
1478
+ /**
1479
+ * Some optional other reference for this address
1480
+ */
1481
+ near_to?: string;
1482
+ /**
1483
+ * Full in line mailing address, should include street, number and borough
1484
+ */
1485
+ line_address?: string;
1486
+ /**
1487
+ * City name
1488
+ */
1489
+ city?: string;
1490
+ /**
1491
+ * Country name
1492
+ */
1493
+ country?: string;
1494
+ /**
1495
+ * An ISO 3166-2 country code
1496
+ */
1497
+ country_code?: string;
1498
+ /**
1499
+ * Province or state name
1500
+ */
1501
+ province?: string;
1502
+ /**
1503
+ * The two-letter code for the province or state
1504
+ */
1505
+ province_code?: string;
1506
+ /**
1507
+ * The name of recipient, generally is the customer's name
1508
+ */
1509
+ name?: string;
1510
+ /**
1511
+ * The recipient's last name
1512
+ */
1513
+ last_name?: string;
1514
+ /**
1515
+ * Customer phone number for this mailing address
1516
+ */
1517
+ phone?: {
1518
+ /**
1519
+ * Country calling code (without +), defined by standards E.123 and E.164
1520
+ */
1521
+ country_code?: number;
1522
+ /**
1523
+ * The actual phone number, digits only
1524
+ */
1525
+ number: string;
1526
+ };
1527
+ }
1528
+ /**
1529
+ * Shipping address (recipient)
1530
+ */
1531
+ export interface Address1 {
1532
+ /**
1533
+ * ZIP (CEP, postal...) code
1534
+ */
1535
+ zip: string;
1536
+ /**
1537
+ * Street or public place name
1538
+ */
1539
+ street?: string;
1540
+ /**
1541
+ * House or building street number
1542
+ */
1543
+ number?: number;
1544
+ /**
1545
+ * Address complement or second line, such as apartment number
1546
+ */
1547
+ complement?: string;
1548
+ /**
1549
+ * Borough name
1550
+ */
1551
+ borough?: string;
1552
+ /**
1553
+ * Some optional other reference for this address
1554
+ */
1555
+ near_to?: string;
1556
+ /**
1557
+ * Full in line mailing address, should include street, number and borough
1558
+ */
1559
+ line_address?: string;
1560
+ /**
1561
+ * City name
1562
+ */
1563
+ city?: string;
1564
+ /**
1565
+ * Country name
1566
+ */
1567
+ country?: string;
1568
+ /**
1569
+ * An ISO 3166-2 country code
1570
+ */
1571
+ country_code?: string;
1572
+ /**
1573
+ * Province or state name
1574
+ */
1575
+ province?: string;
1576
+ /**
1577
+ * The two-letter code for the province or state
1578
+ */
1579
+ province_code?: string;
1580
+ /**
1581
+ * The name of recipient, generally is the customer's name
1582
+ */
1583
+ name?: string;
1584
+ /**
1585
+ * The recipient's last name
1586
+ */
1587
+ last_name?: string;
1588
+ /**
1589
+ * Customer phone number for this mailing address
1590
+ */
1591
+ phone?: {
1592
+ /**
1593
+ * Country calling code (without +), defined by standards E.123 and E.164
1594
+ */
1595
+ country_code?: number;
1596
+ /**
1597
+ * The actual phone number, digits only
1598
+ */
1599
+ number: string;
1600
+ };
1601
+ }
1602
+ /**
1603
+ * The mailing address associated with the payment method
1604
+ */
1605
+ export interface Address2 {
1606
+ /**
1607
+ * ZIP (CEP, postal...) code
1608
+ */
1609
+ zip: string;
1610
+ /**
1611
+ * Street or public place name
1612
+ */
1613
+ street?: string;
1614
+ /**
1615
+ * House or building street number
1616
+ */
1617
+ number?: number;
1618
+ /**
1619
+ * Address complement or second line, such as apartment number
1620
+ */
1621
+ complement?: string;
1622
+ /**
1623
+ * Borough name
1624
+ */
1625
+ borough?: string;
1626
+ /**
1627
+ * Some optional other reference for this address
1628
+ */
1629
+ near_to?: string;
1630
+ /**
1631
+ * Full in line mailing address, should include street, number and borough
1632
+ */
1633
+ line_address?: string;
1634
+ /**
1635
+ * City name
1636
+ */
1637
+ city?: string;
1638
+ /**
1639
+ * Country name
1640
+ */
1641
+ country?: string;
1642
+ /**
1643
+ * An ISO 3166-2 country code
1644
+ */
1645
+ country_code?: string;
1646
+ /**
1647
+ * Province or state name
1648
+ */
1649
+ province?: string;
1650
+ /**
1651
+ * The two-letter code for the province or state
1652
+ */
1653
+ province_code?: string;
1654
+ /**
1655
+ * The name of recipient, generally is the customer's name
1656
+ */
1657
+ name?: string;
1658
+ /**
1659
+ * The recipient's last name
1660
+ */
1661
+ last_name?: string;
1662
+ /**
1663
+ * Customer phone number for this mailing address
1664
+ */
1665
+ phone?: {
1666
+ /**
1667
+ * Country calling code (without +), defined by standards E.123 and E.164
1668
+ */
1669
+ country_code?: number;
1670
+ /**
1671
+ * The actual phone number, digits only
1672
+ */
1673
+ number: string;
1674
+ };
1675
+ }
1676
+ /**
1677
+ * Default image size variant
1678
+ */
1679
+ export interface PictureSize {
1680
+ /**
1681
+ * Image link
1682
+ */
1683
+ url: string;
1684
+ /**
1685
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
1686
+ */
1687
+ size?: string;
1688
+ /**
1689
+ * Alternative text, HTML alt tag (important for SEO)
1690
+ */
1691
+ alt?: string;
1692
+ }
1693
+ /**
1694
+ * Image big size variant
1695
+ */
1696
+ export interface PictureSize1 {
1697
+ /**
1698
+ * Image link
1699
+ */
1700
+ url: string;
1701
+ /**
1702
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
1703
+ */
1704
+ size?: string;
1705
+ /**
1706
+ * Alternative text, HTML alt tag (important for SEO)
1707
+ */
1708
+ alt?: string;
1709
+ }
1710
+ /**
1711
+ * Image zoom size variant
1712
+ */
1713
+ export interface PictureSize2 {
1714
+ /**
1715
+ * Image link
1716
+ */
1717
+ url: string;
1718
+ /**
1719
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
1720
+ */
1721
+ size?: string;
1722
+ /**
1723
+ * Alternative text, HTML alt tag (important for SEO)
1724
+ */
1725
+ alt?: string;
1726
+ }
1727
+ /**
1728
+ * Image small size variant
1729
+ */
1730
+ export interface PictureSize3 {
1731
+ /**
1732
+ * Image link
1733
+ */
1734
+ url: string;
1735
+ /**
1736
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
1737
+ */
1738
+ size?: string;
1739
+ /**
1740
+ * Alternative text, HTML alt tag (important for SEO)
1741
+ */
1742
+ alt?: string;
1743
+ }