@cloudcommerce/types 0.0.35

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,515 @@
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
+ * Triggered when order is being closed, must create payment transaction and return info
10
+ */
11
+ export interface CreateTransactionParams {
12
+ /**
13
+ * Products composing the cart
14
+ *
15
+ * @maxItems 3000
16
+ */
17
+ items: {
18
+ /**
19
+ * Product ID
20
+ */
21
+ product_id: string;
22
+ /**
23
+ * ID to specify the variation added to cart, if product has variations
24
+ */
25
+ variation_id?: string;
26
+ /**
27
+ * Product or variation unique reference code
28
+ */
29
+ sku?: string;
30
+ /**
31
+ * Product or variation full name, or other label for this cart item
32
+ */
33
+ name?: string;
34
+ /**
35
+ * Item quantity in cart
36
+ */
37
+ quantity: number;
38
+ /**
39
+ * Designator of currency according to ISO 4217 (3 uppercase letters)
40
+ */
41
+ currency_id?: string;
42
+ /**
43
+ * Graphic symbol used as a shorthand for currency's name
44
+ */
45
+ currency_symbol?: string;
46
+ /**
47
+ * Product sale price specifically for this cart
48
+ */
49
+ price: number;
50
+ /**
51
+ * Final item price including additions due to customizations and gift wrap
52
+ */
53
+ final_price?: number;
54
+ }[];
55
+ /**
56
+ * Designator of currency according to ISO 4217 (3 uppercase letters)
57
+ */
58
+ currency_id?: string;
59
+ /**
60
+ * Graphic symbol used as a shorthand for currency's name
61
+ */
62
+ currency_symbol?: string;
63
+ /**
64
+ * Object with sums of values
65
+ */
66
+ amount: {
67
+ /**
68
+ * Order total amount
69
+ */
70
+ total: number;
71
+ /**
72
+ * The sum of all items prices
73
+ */
74
+ subtotal?: number;
75
+ /**
76
+ * Order freight cost
77
+ */
78
+ freight?: number;
79
+ /**
80
+ * Applied discount value
81
+ */
82
+ discount?: number;
83
+ /**
84
+ * The sum of all the taxes applied to the order
85
+ */
86
+ tax?: number;
87
+ /**
88
+ * Sum of optional extra costs applied
89
+ */
90
+ extra?: number;
91
+ };
92
+ /**
93
+ * Transaction type
94
+ */
95
+ type?: 'payment' | 'recurrence';
96
+ /**
97
+ * Chosen payment method object
98
+ */
99
+ payment_method: {
100
+ /**
101
+ * Standardized payment method code
102
+ */
103
+ code:
104
+ | 'credit_card'
105
+ | 'banking_billet'
106
+ | 'online_debit'
107
+ | 'account_deposit'
108
+ | 'debit_card'
109
+ | 'balance_on_intermediary'
110
+ | 'loyalty_points'
111
+ | 'other';
112
+ /**
113
+ * Short description for payment method
114
+ */
115
+ name?: string;
116
+ };
117
+ /**
118
+ * Order buyer info
119
+ */
120
+ buyer: {
121
+ /**
122
+ * Customer ID in the store
123
+ */
124
+ customer_id: string;
125
+ /**
126
+ * Buyer email address
127
+ */
128
+ email: string;
129
+ /**
130
+ * Customer full name or company corporate name
131
+ */
132
+ fullname: string;
133
+ /**
134
+ * Customer gender, female, male or third gender (X)
135
+ */
136
+ gender?: 'f' | 'm' | 'x';
137
+ /**
138
+ * Date of customer birth
139
+ */
140
+ birth_date: {
141
+ /**
142
+ * Day of birth
143
+ */
144
+ day?: number;
145
+ /**
146
+ * Number of month of birth
147
+ */
148
+ month?: number;
149
+ /**
150
+ * Year of birth
151
+ */
152
+ year?: number;
153
+ };
154
+ /**
155
+ * Buyer contact phone
156
+ */
157
+ phone: {
158
+ /**
159
+ * Country calling code (without +), defined by standards E.123 and E.164
160
+ */
161
+ country_code?: number;
162
+ /**
163
+ * The actual phone number, digits only
164
+ */
165
+ number: string;
166
+ /**
167
+ * The type of phone
168
+ */
169
+ type?: 'home' | 'personal' | 'work' | 'other';
170
+ };
171
+ /**
172
+ * Physical or juridical (company) person
173
+ */
174
+ registry_type: 'p' | 'j';
175
+ /**
176
+ * Country of document origin, an ISO 3166-2 code
177
+ */
178
+ doc_country?: string;
179
+ /**
180
+ * Responsible person or organization document number (only numbers)
181
+ */
182
+ doc_number: string;
183
+ /**
184
+ * Municipal or state registration if exists
185
+ */
186
+ inscription_type?: 'State' | 'Municipal';
187
+ /**
188
+ * Municipal or state registration number (with characters) if exists
189
+ */
190
+ inscription_number?: string;
191
+ };
192
+ /**
193
+ * Transation payer info
194
+ */
195
+ payer?: {
196
+ /**
197
+ * Payer full name or company corporate name
198
+ */
199
+ fullname?: string;
200
+ /**
201
+ * Date of payer birth
202
+ */
203
+ birth_date?: {
204
+ /**
205
+ * Day of birth
206
+ */
207
+ day?: number;
208
+ /**
209
+ * Number of month of birth
210
+ */
211
+ month?: number;
212
+ /**
213
+ * Year of birth
214
+ */
215
+ year?: number;
216
+ };
217
+ /**
218
+ * Payer contact phone
219
+ */
220
+ phone?: {
221
+ /**
222
+ * Country calling code (without +), defined by standards E.123 and E.164
223
+ */
224
+ country_code?: number;
225
+ /**
226
+ * The actual phone number, digits only
227
+ */
228
+ number: string;
229
+ /**
230
+ * The type of phone
231
+ */
232
+ type?: 'home' | 'personal' | 'work' | 'other';
233
+ };
234
+ /**
235
+ * Physical or juridical (company) person
236
+ */
237
+ registry_type?: 'p' | 'j';
238
+ /**
239
+ * Country of document origin, an ISO 3166-2 code
240
+ */
241
+ doc_country?: string;
242
+ /**
243
+ * Responsible person or organization document number (only numbers)
244
+ */
245
+ doc_number?: string;
246
+ };
247
+ /**
248
+ * ID of customer account in the intermediator
249
+ */
250
+ intermediator_buyer_id?: string;
251
+ billing_address?: Address;
252
+ to?: Address1;
253
+ /**
254
+ * Credit card data, if payment will be done with credit card
255
+ */
256
+ credit_card?: {
257
+ /**
258
+ * Full name of the holder, as it is on the credit card
259
+ */
260
+ holder_name?: string;
261
+ /**
262
+ * Issuer identification number (IIN), known as bank identification number (BIN)
263
+ */
264
+ bin?: number;
265
+ /**
266
+ * Credit card issuer name, eg.: Visa, American Express, MasterCard
267
+ */
268
+ company?: string;
269
+ /**
270
+ * Last digits (up to 4) of credit card number
271
+ */
272
+ last_digits?: string;
273
+ /**
274
+ * Unique credit card token
275
+ */
276
+ token?: string;
277
+ /**
278
+ * Credit card CVV number (Card Verification Value)
279
+ */
280
+ cvv?: number;
281
+ /**
282
+ * Credit card encrypted hash
283
+ */
284
+ hash?: string;
285
+ /**
286
+ * Whether the hashed credit card should be saved for further use
287
+ */
288
+ save?: boolean;
289
+ };
290
+ /**
291
+ * Number of installments chosen
292
+ */
293
+ installments_number?: number;
294
+ /**
295
+ * Customer's loyalty points applied, program ID as property
296
+ */
297
+ loyalty_points_applied?: {
298
+ /**
299
+ * Number of loyalty points used
300
+ *
301
+ * This interface was referenced by `undefined`'s JSON-Schema definition
302
+ * via the `patternProperty` "^[a-z0-9_]{2,30}$".
303
+ */
304
+ [k: string]: number;
305
+ };
306
+ /**
307
+ * ID of created order
308
+ */
309
+ order_id?: string;
310
+ /**
311
+ * Number of created order
312
+ */
313
+ order_number: number;
314
+ /**
315
+ * Payment or order ID if pre committed on gateway (authorization/capture)
316
+ */
317
+ open_payment_id?: string;
318
+ /**
319
+ * UTM campaign HTTP parameters
320
+ */
321
+ utm?: {
322
+ /**
323
+ * Parameter "utm_source", the referrer: (e.g. google, newsletter)
324
+ */
325
+ source?: string;
326
+ /**
327
+ * Parameter "utm_medium", the marketing medium: (e.g. cpc, banner, email)
328
+ */
329
+ medium?: string;
330
+ /**
331
+ * Parameter "utm_campaign", the product, promo code, or slogan (e.g. spring_sale)
332
+ */
333
+ campaign?: string;
334
+ /**
335
+ * Parameter "utm_term", identifies the paid keywords
336
+ */
337
+ term?: string;
338
+ /**
339
+ * Parameter "utm_content", used to differentiate ads
340
+ */
341
+ content?: string;
342
+ };
343
+ /**
344
+ * Code to identify the affiliate that referred the customer
345
+ */
346
+ affiliate_code?: string;
347
+ /**
348
+ * IP address of the browser used by the customer when placing the order
349
+ */
350
+ browser_ip?: string;
351
+ /**
352
+ * Channel unique identificator
353
+ */
354
+ channel_id?: number;
355
+ /**
356
+ * Channel type or source
357
+ */
358
+ channel_type?: 'ecommerce' | 'mobile' | 'pdv' | 'button' | 'facebook' | 'chatbot';
359
+ /**
360
+ * Store domain name (numbers and lowercase letters, eg.: www.myshop.sample)
361
+ */
362
+ domain?: string;
363
+ /**
364
+ * Language two letters code, sometimes with region, eg.: pt_br, fr, en_us
365
+ */
366
+ lang?: string;
367
+ }
368
+ /**
369
+ * The mailing address associated with the payment method
370
+ */
371
+ export interface Address {
372
+ /**
373
+ * ZIP (CEP, postal...) code
374
+ */
375
+ zip: string;
376
+ /**
377
+ * Street or public place name
378
+ */
379
+ street?: string;
380
+ /**
381
+ * House or building street number
382
+ */
383
+ number?: number;
384
+ /**
385
+ * Address complement or second line, such as apartment number
386
+ */
387
+ complement?: string;
388
+ /**
389
+ * Borough name
390
+ */
391
+ borough?: string;
392
+ /**
393
+ * Some optional other reference for this address
394
+ */
395
+ near_to?: string;
396
+ /**
397
+ * Full in line mailing address, should include street, number and borough
398
+ */
399
+ line_address?: string;
400
+ /**
401
+ * City name
402
+ */
403
+ city?: string;
404
+ /**
405
+ * Country name
406
+ */
407
+ country?: string;
408
+ /**
409
+ * An ISO 3166-2 country code
410
+ */
411
+ country_code?: string;
412
+ /**
413
+ * Province or state name
414
+ */
415
+ province?: string;
416
+ /**
417
+ * The two-letter code for the province or state
418
+ */
419
+ province_code?: string;
420
+ /**
421
+ * The name of recipient, generally is the customer's name
422
+ */
423
+ name?: string;
424
+ /**
425
+ * The recipient's last name
426
+ */
427
+ last_name?: string;
428
+ /**
429
+ * Customer phone number for this mailing address
430
+ */
431
+ phone?: {
432
+ /**
433
+ * Country calling code (without +), defined by standards E.123 and E.164
434
+ */
435
+ country_code?: number;
436
+ /**
437
+ * The actual phone number, digits only
438
+ */
439
+ number: string;
440
+ };
441
+ }
442
+ /**
443
+ * Shipping address (recipient)
444
+ */
445
+ export interface Address1 {
446
+ /**
447
+ * ZIP (CEP, postal...) code
448
+ */
449
+ zip: string;
450
+ /**
451
+ * Street or public place name
452
+ */
453
+ street?: string;
454
+ /**
455
+ * House or building street number
456
+ */
457
+ number?: number;
458
+ /**
459
+ * Address complement or second line, such as apartment number
460
+ */
461
+ complement?: string;
462
+ /**
463
+ * Borough name
464
+ */
465
+ borough?: string;
466
+ /**
467
+ * Some optional other reference for this address
468
+ */
469
+ near_to?: string;
470
+ /**
471
+ * Full in line mailing address, should include street, number and borough
472
+ */
473
+ line_address?: string;
474
+ /**
475
+ * City name
476
+ */
477
+ city?: string;
478
+ /**
479
+ * Country name
480
+ */
481
+ country?: string;
482
+ /**
483
+ * An ISO 3166-2 country code
484
+ */
485
+ country_code?: string;
486
+ /**
487
+ * Province or state name
488
+ */
489
+ province?: string;
490
+ /**
491
+ * The two-letter code for the province or state
492
+ */
493
+ province_code?: string;
494
+ /**
495
+ * The name of recipient, generally is the customer's name
496
+ */
497
+ name?: string;
498
+ /**
499
+ * The recipient's last name
500
+ */
501
+ last_name?: string;
502
+ /**
503
+ * Customer phone number for this mailing address
504
+ */
505
+ phone?: {
506
+ /**
507
+ * Country calling code (without +), defined by standards E.123 and E.164
508
+ */
509
+ country_code?: number;
510
+ /**
511
+ * The actual phone number, digits only
512
+ */
513
+ number: string;
514
+ };
515
+ }