cloudcommerce 0.0.32 → 0.0.36
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.
- package/CHANGELOG.md +36 -0
- package/action.yml +4 -0
- package/package.json +6 -6
- package/packages/__skeleton/package.json +4 -1
- package/packages/__skeleton/src/{index.js → index.ts} +0 -0
- package/packages/__skeleton/tsconfig.json +3 -0
- package/packages/api/{tests/fetch-polyfill.js → fetch-polyfill.js} +0 -0
- package/packages/api/lib/index.d.ts +2 -112
- package/packages/api/lib/types.d.ts +1 -1
- package/packages/api/package.json +1 -1
- package/packages/api/src/types.ts +4 -0
- package/packages/api/tests/index.test.ts +1 -1
- package/packages/apps/discounts/lib/index.js +4 -0
- package/packages/apps/discounts/lib/index.js.map +1 -0
- package/packages/apps/discounts/package.json +4 -1
- package/packages/apps/discounts/src/index.ts +7 -0
- package/packages/apps/discounts/tsconfig.json +3 -0
- package/packages/cli/lib/index.js +11 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/index.ts +12 -3
- package/packages/firebase/lib/config.d.ts +15 -0
- package/packages/firebase/lib/config.js +3 -0
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/lib/defaults.d.ts +4 -0
- package/packages/firebase/lib/env.d.ts +8 -0
- package/packages/firebase/lib/handlers/check-store-events.d.ts +2 -0
- package/packages/firebase/lib/{methods → handlers}/check-store-events.js +10 -0
- package/packages/firebase/lib/handlers/check-store-events.js.map +1 -0
- package/packages/firebase/lib/index.d.ts +5 -0
- package/packages/firebase/lib/index.js +5 -4
- package/packages/firebase/lib/index.js.map +1 -1
- package/packages/firebase/lib/types.d.ts +6 -0
- package/packages/firebase/lib/types.js +2 -0
- package/packages/firebase/lib/types.js.map +1 -0
- package/packages/firebase/package.json +4 -1
- package/packages/firebase/src/config.ts +3 -0
- package/packages/firebase/src/{methods → handlers}/check-store-events.ts +11 -0
- package/packages/firebase/src/index.ts +5 -5
- package/packages/firebase/src/types.ts +11 -0
- package/packages/firebase/tsconfig.json +4 -1
- package/packages/modules/CHANGELOG.md +1 -0
- package/packages/modules/README.md +1 -0
- package/packages/modules/lib/firebase/index.js +15 -0
- package/packages/modules/lib/firebase/index.js.map +1 -0
- package/packages/modules/lib/index.js +21 -0
- package/packages/modules/lib/index.js.map +1 -0
- package/packages/modules/package.json +33 -0
- package/packages/modules/schemas/@checkout.cjs +1015 -0
- package/packages/modules/schemas/apply_discount.cjs +324 -0
- package/packages/modules/schemas/calculate_shipping.cjs +666 -0
- package/packages/modules/schemas/create_transaction.cjs +1001 -0
- package/packages/modules/schemas/list_payments.cjs +852 -0
- package/packages/modules/scripts/build-types.sh +33 -0
- package/packages/modules/src/firebase/index.ts +15 -0
- package/packages/modules/src/index.ts +21 -0
- package/packages/modules/tsconfig.json +3 -0
- package/packages/storefront/package.json +2 -2
- package/packages/types/CHANGELOG.md +1 -0
- package/packages/types/README.md +1 -0
- package/packages/types/index.ts +66 -0
- package/packages/types/modules/@checkout:params.d.ts +920 -0
- package/packages/types/modules/apply_discount:params.d.ts +154 -0
- package/packages/types/modules/apply_discount:response.d.ts +71 -0
- package/packages/types/modules/calculate_shipping:params.d.ts +275 -0
- package/packages/types/modules/calculate_shipping:response.d.ts +402 -0
- package/packages/types/modules/create_transaction:params.d.ts +515 -0
- package/packages/types/modules/create_transaction:response.d.ts +261 -0
- package/packages/types/modules/list_payments:params.d.ts +323 -0
- package/packages/types/modules/list_payments:response.d.ts +266 -0
- package/packages/types/package.json +21 -0
- package/pnpm-lock.yaml +505 -274
- package/packages/firebase/lib/methods/check-store-events.js.map +0 -1
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
/* eslint-disable quote-props, comma-dangle, array-bracket-spacing */
|
|
2
|
+
|
|
3
|
+
const schema = {
|
|
4
|
+
'description': 'Triggered to calculate shipping options, must return calculated values and times',
|
|
5
|
+
'type': 'object',
|
|
6
|
+
'additionalProperties': false,
|
|
7
|
+
'definitions': {
|
|
8
|
+
'address': {
|
|
9
|
+
'type': 'object',
|
|
10
|
+
'additionalProperties': false,
|
|
11
|
+
'required': [ 'zip' ],
|
|
12
|
+
'properties': {
|
|
13
|
+
'zip': {
|
|
14
|
+
'type': 'string',
|
|
15
|
+
'maxLength': 30,
|
|
16
|
+
'description': 'ZIP (CEP, postal...) code'
|
|
17
|
+
},
|
|
18
|
+
'street': {
|
|
19
|
+
'type': 'string',
|
|
20
|
+
'maxLength': 200,
|
|
21
|
+
'description': 'Street or public place name'
|
|
22
|
+
},
|
|
23
|
+
'number': {
|
|
24
|
+
'type': 'integer',
|
|
25
|
+
'min': 1,
|
|
26
|
+
'max': 9999999,
|
|
27
|
+
'description': 'House or building street number'
|
|
28
|
+
},
|
|
29
|
+
'complement': {
|
|
30
|
+
'type': 'string',
|
|
31
|
+
'maxLength': 100,
|
|
32
|
+
'description': 'Address complement or second line, such as apartment number'
|
|
33
|
+
},
|
|
34
|
+
'borough': {
|
|
35
|
+
'type': 'string',
|
|
36
|
+
'maxLength': 100,
|
|
37
|
+
'description': 'Borough name'
|
|
38
|
+
},
|
|
39
|
+
'near_to': {
|
|
40
|
+
'type': 'string',
|
|
41
|
+
'maxLength': 100,
|
|
42
|
+
'description': 'Some optional other reference for this address'
|
|
43
|
+
},
|
|
44
|
+
'line_address': {
|
|
45
|
+
'type': 'string',
|
|
46
|
+
'maxLength': 255,
|
|
47
|
+
'description': 'Full in line mailing address, should include street, number and borough'
|
|
48
|
+
},
|
|
49
|
+
'city': {
|
|
50
|
+
'type': 'string',
|
|
51
|
+
'maxLength': 100,
|
|
52
|
+
'description': 'City name'
|
|
53
|
+
},
|
|
54
|
+
'country': {
|
|
55
|
+
'type': 'string',
|
|
56
|
+
'maxLength': 50,
|
|
57
|
+
'description': 'Country name'
|
|
58
|
+
},
|
|
59
|
+
'country_code': {
|
|
60
|
+
'type': 'string',
|
|
61
|
+
'minLength': 2,
|
|
62
|
+
'maxLength': 2,
|
|
63
|
+
'pattern': '^[A-Z]+$',
|
|
64
|
+
'description': 'An ISO 3166-2 country code'
|
|
65
|
+
},
|
|
66
|
+
'province': {
|
|
67
|
+
'type': 'string',
|
|
68
|
+
'maxLength': 100,
|
|
69
|
+
'description': 'Province or state name'
|
|
70
|
+
},
|
|
71
|
+
'province_code': {
|
|
72
|
+
'type': 'string',
|
|
73
|
+
'minLength': 2,
|
|
74
|
+
'maxLength': 2,
|
|
75
|
+
'pattern': '^[A-Z]+$',
|
|
76
|
+
'description': 'The two-letter code for the province or state'
|
|
77
|
+
},
|
|
78
|
+
'name': {
|
|
79
|
+
'type': 'string',
|
|
80
|
+
'maxLength': 70,
|
|
81
|
+
'description': 'The name of recipient, generally is the customer\'s name'
|
|
82
|
+
},
|
|
83
|
+
'last_name': {
|
|
84
|
+
'type': 'string',
|
|
85
|
+
'maxLength': 70,
|
|
86
|
+
'description': 'The recipient\'s last name'
|
|
87
|
+
},
|
|
88
|
+
'phone': {
|
|
89
|
+
'type': 'object',
|
|
90
|
+
'additionalProperties': false,
|
|
91
|
+
'required': [ 'number' ],
|
|
92
|
+
'properties': {
|
|
93
|
+
'country_code': {
|
|
94
|
+
'type': 'integer',
|
|
95
|
+
'min': 1,
|
|
96
|
+
'max': 999,
|
|
97
|
+
'description': 'Country calling code (without +), defined by standards E.123 and E.164'
|
|
98
|
+
},
|
|
99
|
+
'number': {
|
|
100
|
+
'type': 'string',
|
|
101
|
+
'maxLength': 19,
|
|
102
|
+
'pattern': '^[0-9]+$',
|
|
103
|
+
'description': 'The actual phone number, digits only'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
'description': 'Customer phone number for this mailing address'
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
'description': 'Address object'
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
'properties': {
|
|
113
|
+
'items': {
|
|
114
|
+
'type': 'array',
|
|
115
|
+
'maxItems': 3000,
|
|
116
|
+
'items': {
|
|
117
|
+
'type': 'object',
|
|
118
|
+
'additionalProperties': false,
|
|
119
|
+
'required': [ 'product_id', 'quantity', 'price' ],
|
|
120
|
+
'properties': {
|
|
121
|
+
'product_id': {
|
|
122
|
+
'type': 'string',
|
|
123
|
+
'pattern': '^[a-f0-9]{24}$',
|
|
124
|
+
'description': 'Product ID'
|
|
125
|
+
},
|
|
126
|
+
'variation_id': {
|
|
127
|
+
'type': 'string',
|
|
128
|
+
'pattern': '^[a-f0-9]{24}$',
|
|
129
|
+
'description': 'ID to specify the variation added to cart, if product has variations'
|
|
130
|
+
},
|
|
131
|
+
'sku': {
|
|
132
|
+
'type': 'string',
|
|
133
|
+
'minLength': 2,
|
|
134
|
+
'maxLength': 100,
|
|
135
|
+
'pattern': '^[A-Za-z0-9-_.]+$',
|
|
136
|
+
'description': 'Product or variation unique reference code'
|
|
137
|
+
},
|
|
138
|
+
'name': {
|
|
139
|
+
'type': 'string',
|
|
140
|
+
'maxLength': 255,
|
|
141
|
+
'description': 'Product or variation full name, or other label for this cart item'
|
|
142
|
+
},
|
|
143
|
+
'quantity': {
|
|
144
|
+
'type': 'number',
|
|
145
|
+
// 'multipleOf': 0.0001,
|
|
146
|
+
'minimum': 0,
|
|
147
|
+
'maximum': 9999999,
|
|
148
|
+
'description': 'Item quantity in cart'
|
|
149
|
+
},
|
|
150
|
+
'inventory': {
|
|
151
|
+
'type': 'object',
|
|
152
|
+
'additionalProperties': false,
|
|
153
|
+
'maxProperties': 100,
|
|
154
|
+
'patternProperties': {
|
|
155
|
+
'^[A-Za-z0-9-_]{2,30}$': {
|
|
156
|
+
'type': 'number',
|
|
157
|
+
// 'multipleOf': 0.0001,
|
|
158
|
+
'minimum': 0,
|
|
159
|
+
'maximum': 9999999,
|
|
160
|
+
'description': 'Product quantity available for sale from current warehouse'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
'description': 'Warehouses by code and respective product stock'
|
|
164
|
+
},
|
|
165
|
+
'currency_id': {
|
|
166
|
+
'type': 'string',
|
|
167
|
+
'pattern': '^[A-Z]{3}$',
|
|
168
|
+
'default': 'BRL',
|
|
169
|
+
'description': 'Designator of currency according to ISO 4217 (3 uppercase letters)'
|
|
170
|
+
},
|
|
171
|
+
'currency_symbol': {
|
|
172
|
+
'type': 'string',
|
|
173
|
+
'maxLength': 20,
|
|
174
|
+
'default': 'R$',
|
|
175
|
+
'description': 'Graphic symbol used as a shorthand for currency\'s name'
|
|
176
|
+
},
|
|
177
|
+
'price': {
|
|
178
|
+
'type': 'number',
|
|
179
|
+
// 'multipleOf': 0.00001,
|
|
180
|
+
'minimum': 0,
|
|
181
|
+
'maximum': 999999999,
|
|
182
|
+
'description': 'Product sale price specifically for this cart'
|
|
183
|
+
},
|
|
184
|
+
'final_price': {
|
|
185
|
+
'type': 'number',
|
|
186
|
+
// 'multipleOf': 0.00001,
|
|
187
|
+
'minimum': 0,
|
|
188
|
+
'maximum': 999999999,
|
|
189
|
+
'description': 'Final item price including additions due to customizations and gift wrap'
|
|
190
|
+
},
|
|
191
|
+
'dimensions': {
|
|
192
|
+
'type': 'object',
|
|
193
|
+
'additionalProperties': false,
|
|
194
|
+
'patternProperties': {
|
|
195
|
+
'^width|height|length$': {
|
|
196
|
+
'type': 'object',
|
|
197
|
+
'required': [ 'value' ],
|
|
198
|
+
'additionalProperties': false,
|
|
199
|
+
'properties': {
|
|
200
|
+
'value': {
|
|
201
|
+
'type': 'number',
|
|
202
|
+
// 'multipleOf': 0.001,
|
|
203
|
+
'minimum': 0,
|
|
204
|
+
'maximum': 999999,
|
|
205
|
+
'description': 'Size in specified unit'
|
|
206
|
+
},
|
|
207
|
+
'unit': {
|
|
208
|
+
'type': 'string',
|
|
209
|
+
'enum': [ 'mm', 'cm', 'm', 'ft', 'in', 'yd', 'mi' ],
|
|
210
|
+
'default': 'cm',
|
|
211
|
+
'description': 'Unit of measurement'
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
'description': 'Package width, height and length'
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
'description': 'Product dimensions with packaging for freight calculation'
|
|
218
|
+
},
|
|
219
|
+
'weight': {
|
|
220
|
+
'type': 'object',
|
|
221
|
+
'required': [ 'value' ],
|
|
222
|
+
'additionalProperties': false,
|
|
223
|
+
'properties': {
|
|
224
|
+
'value': {
|
|
225
|
+
'type': 'number',
|
|
226
|
+
// 'multipleOf': 0.001,
|
|
227
|
+
'minimum': 0,
|
|
228
|
+
'maximum': 999999,
|
|
229
|
+
'description': 'Size in specified unit'
|
|
230
|
+
},
|
|
231
|
+
'unit': {
|
|
232
|
+
'type': 'string',
|
|
233
|
+
'enum': [ 'mg', 'g', 'kg', 'lb', 'oz' ],
|
|
234
|
+
'default': 'g',
|
|
235
|
+
'description': 'Unit of measurement'
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
'description': 'Package weight for freight calculation'
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
'description': 'One of the cart items'
|
|
242
|
+
},
|
|
243
|
+
'description': 'Products composing the cart'
|
|
244
|
+
},
|
|
245
|
+
'subtotal': {
|
|
246
|
+
'type': 'number',
|
|
247
|
+
// 'multipleOf': 0.00001,
|
|
248
|
+
'minimum': 0,
|
|
249
|
+
'maximum': 9999999999,
|
|
250
|
+
'description': 'The sum of all items prices'
|
|
251
|
+
},
|
|
252
|
+
'from': {
|
|
253
|
+
'$ref': '#/definitions/address',
|
|
254
|
+
'description': 'Sender\'s address'
|
|
255
|
+
},
|
|
256
|
+
'to': {
|
|
257
|
+
'$ref': '#/definitions/address',
|
|
258
|
+
'description': 'Shipping address (recipient)'
|
|
259
|
+
},
|
|
260
|
+
'own_hand': {
|
|
261
|
+
'type': 'boolean',
|
|
262
|
+
'default': false,
|
|
263
|
+
'description': 'Whether the package must be delivered with additional service "own hand"'
|
|
264
|
+
},
|
|
265
|
+
'receipt': {
|
|
266
|
+
'type': 'boolean',
|
|
267
|
+
'default': false,
|
|
268
|
+
'description': 'If the package will be delivered with acknowledgment of receipt'
|
|
269
|
+
},
|
|
270
|
+
'service_code': {
|
|
271
|
+
'type': 'string',
|
|
272
|
+
'maxLength': 70,
|
|
273
|
+
'description': 'Code of service defined by carrier, if shipping method is already defined'
|
|
274
|
+
},
|
|
275
|
+
'lang': {
|
|
276
|
+
'type': 'string',
|
|
277
|
+
'pattern': '^[a-z]{2}(_[a-z]{2})?$',
|
|
278
|
+
'description': 'Language two letters code, sometimes with region, eg.: pt_br, fr, en_us'
|
|
279
|
+
},
|
|
280
|
+
'is_checkout_confirmation': {
|
|
281
|
+
'type': 'boolean',
|
|
282
|
+
'default': false,
|
|
283
|
+
'description': 'Whether shipping were already chosen and is just being confirmed to complete checkout'
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
exports.params = schema;
|
|
289
|
+
|
|
290
|
+
exports.response = {
|
|
291
|
+
'description': `Response - ${schema.description}`,
|
|
292
|
+
'type': 'object',
|
|
293
|
+
'required': [ 'shipping_services' ],
|
|
294
|
+
'additionalProperties': false,
|
|
295
|
+
'definitions': {
|
|
296
|
+
...schema.definitions
|
|
297
|
+
},
|
|
298
|
+
'properties': {
|
|
299
|
+
'free_shipping_from_value': {
|
|
300
|
+
'type': 'number',
|
|
301
|
+
// 'multipleOf': 0.00001,
|
|
302
|
+
'minimum': 0,
|
|
303
|
+
'maximum': 9999999999,
|
|
304
|
+
'description': 'Optional minimum cart subtotal to earn free shipping with some shipping service'
|
|
305
|
+
},
|
|
306
|
+
'shipping_services': {
|
|
307
|
+
'type': 'array',
|
|
308
|
+
'maxItems': 30,
|
|
309
|
+
'items': {
|
|
310
|
+
'type': 'object',
|
|
311
|
+
'additionalProperties': false,
|
|
312
|
+
'required': [ 'label', 'shipping_line' ],
|
|
313
|
+
'properties': {
|
|
314
|
+
'label': {
|
|
315
|
+
'type': 'string',
|
|
316
|
+
'maxLength': 50,
|
|
317
|
+
'description': 'Name of shipping method shown to customers'
|
|
318
|
+
},
|
|
319
|
+
'carrier': {
|
|
320
|
+
'type': 'string',
|
|
321
|
+
'maxLength': 200,
|
|
322
|
+
'description': 'Carrier name'
|
|
323
|
+
},
|
|
324
|
+
'carrier_doc_number': {
|
|
325
|
+
'type': 'string',
|
|
326
|
+
'maxLength': 19,
|
|
327
|
+
'pattern': '^[0-9]+$',
|
|
328
|
+
'description': 'Carrier document number (only numbers)'
|
|
329
|
+
},
|
|
330
|
+
'service_name': {
|
|
331
|
+
'type': 'string',
|
|
332
|
+
'maxLength': 70,
|
|
333
|
+
'description': 'Name of service (shipping method) defined by carrier'
|
|
334
|
+
},
|
|
335
|
+
'service_code': {
|
|
336
|
+
'type': 'string',
|
|
337
|
+
'maxLength': 70,
|
|
338
|
+
'description': 'Code of service defined by carrier'
|
|
339
|
+
},
|
|
340
|
+
'contract': {
|
|
341
|
+
'type': 'string',
|
|
342
|
+
'maxLength': 70,
|
|
343
|
+
'description': 'Contract number of the shop with carrier, if exists'
|
|
344
|
+
},
|
|
345
|
+
'icon': {
|
|
346
|
+
'type': 'string',
|
|
347
|
+
'maxLength': 255,
|
|
348
|
+
'format': 'uri',
|
|
349
|
+
'description': 'Shipping method icon image URI'
|
|
350
|
+
},
|
|
351
|
+
'shipping_line': {
|
|
352
|
+
'type': 'object',
|
|
353
|
+
'additionalProperties': false,
|
|
354
|
+
'required': [ 'from', 'to' ],
|
|
355
|
+
'properties': {
|
|
356
|
+
'from': {
|
|
357
|
+
'$ref': '#/definitions/address',
|
|
358
|
+
'description': 'Sender\'s address'
|
|
359
|
+
},
|
|
360
|
+
'to': {
|
|
361
|
+
'$ref': '#/definitions/address',
|
|
362
|
+
'description': 'Shipping address (recipient)'
|
|
363
|
+
},
|
|
364
|
+
'package': {
|
|
365
|
+
'type': 'object',
|
|
366
|
+
'additionalProperties': false,
|
|
367
|
+
'properties': {
|
|
368
|
+
'dimensions': {
|
|
369
|
+
'type': 'object',
|
|
370
|
+
'additionalProperties': false,
|
|
371
|
+
'patternProperties': {
|
|
372
|
+
'^width|height|length$': {
|
|
373
|
+
'type': 'object',
|
|
374
|
+
'required': [ 'value' ],
|
|
375
|
+
'additionalProperties': false,
|
|
376
|
+
'properties': {
|
|
377
|
+
'value': {
|
|
378
|
+
'type': 'number',
|
|
379
|
+
// 'multipleOf': 0.001,
|
|
380
|
+
'minimum': 0,
|
|
381
|
+
'maximum': 999999,
|
|
382
|
+
'description': 'Size in specified unit'
|
|
383
|
+
},
|
|
384
|
+
'unit': {
|
|
385
|
+
'type': 'string',
|
|
386
|
+
'enum': [ 'mm', 'cm', 'm', 'ft', 'in', 'yd', 'mi' ],
|
|
387
|
+
'default': 'cm',
|
|
388
|
+
'description': 'Unit of measurement'
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
'description': 'Package width, height and length'
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
'description': 'Package dimensions'
|
|
395
|
+
},
|
|
396
|
+
'weight': {
|
|
397
|
+
'type': 'object',
|
|
398
|
+
'required': [ 'value' ],
|
|
399
|
+
'additionalProperties': false,
|
|
400
|
+
'properties': {
|
|
401
|
+
'value': {
|
|
402
|
+
'type': 'number',
|
|
403
|
+
// 'multipleOf': 0.001,
|
|
404
|
+
'minimum': 0,
|
|
405
|
+
'maximum': 999999,
|
|
406
|
+
'description': 'Size in specified unit'
|
|
407
|
+
},
|
|
408
|
+
'unit': {
|
|
409
|
+
'type': 'string',
|
|
410
|
+
'enum': [ 'mg', 'g', 'kg', 'lb', 'oz' ],
|
|
411
|
+
'default': 'g',
|
|
412
|
+
'description': 'Unit of measurement'
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
'description': 'Package weight for freight calculation'
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
'description': 'Shipping object information'
|
|
419
|
+
},
|
|
420
|
+
'pick_up': {
|
|
421
|
+
'type': 'string',
|
|
422
|
+
'enum': [ 'store', 'locker', 'point', 'other' ],
|
|
423
|
+
'description': 'Pick up option when no (or optional) freight'
|
|
424
|
+
},
|
|
425
|
+
'price': {
|
|
426
|
+
'type': 'number',
|
|
427
|
+
// 'multipleOf': 0.00001,
|
|
428
|
+
'minimum': 0,
|
|
429
|
+
'maximum': 9999999999,
|
|
430
|
+
'description': 'Freight cost for this shipping line, without additionals'
|
|
431
|
+
},
|
|
432
|
+
'declared_value': {
|
|
433
|
+
'type': 'number',
|
|
434
|
+
// 'multipleOf': 0.00001,
|
|
435
|
+
'minimum': 0,
|
|
436
|
+
'maximum': 9999999999,
|
|
437
|
+
'description': 'The package value declared to carrier, generally the sum of all items prices'
|
|
438
|
+
},
|
|
439
|
+
'declared_value_price': {
|
|
440
|
+
'type': 'number',
|
|
441
|
+
// 'multipleOf': 0.00001,
|
|
442
|
+
'minimum': 0,
|
|
443
|
+
'maximum': 999999,
|
|
444
|
+
'description': 'Cost for the "declared value" additional service'
|
|
445
|
+
},
|
|
446
|
+
'own_hand': {
|
|
447
|
+
'type': 'boolean',
|
|
448
|
+
'default': false,
|
|
449
|
+
'description': 'Whether the package must be delivered with additional service "own hand"'
|
|
450
|
+
},
|
|
451
|
+
'own_hand_price': {
|
|
452
|
+
'type': 'number',
|
|
453
|
+
// 'multipleOf': 0.00001,
|
|
454
|
+
'minimum': 0,
|
|
455
|
+
'maximum': 999999,
|
|
456
|
+
'description': 'Cost for the "own hand" additional service'
|
|
457
|
+
},
|
|
458
|
+
'receipt': {
|
|
459
|
+
'type': 'boolean',
|
|
460
|
+
'default': false,
|
|
461
|
+
'description': 'If the package will be delivered with acknowledgment of receipt'
|
|
462
|
+
},
|
|
463
|
+
'receipt_price': {
|
|
464
|
+
'type': 'number',
|
|
465
|
+
// 'multipleOf': 0.00001,
|
|
466
|
+
'minimum': 0,
|
|
467
|
+
'maximum': 999999,
|
|
468
|
+
'description': 'Cost for the "acknowledgment of receipt" additional service'
|
|
469
|
+
},
|
|
470
|
+
'other_additionals': {
|
|
471
|
+
'type': 'array',
|
|
472
|
+
'maxItems': 30,
|
|
473
|
+
'items': {
|
|
474
|
+
'type': 'object',
|
|
475
|
+
'additionalProperties': false,
|
|
476
|
+
'required': [ 'label' ],
|
|
477
|
+
'properties': {
|
|
478
|
+
'tag': {
|
|
479
|
+
'type': 'string',
|
|
480
|
+
'maxLength': 20,
|
|
481
|
+
'pattern': '^[a-z0-9_]+$',
|
|
482
|
+
'description': 'Tag to identify object, use only lowercase letters, digits and underscore'
|
|
483
|
+
},
|
|
484
|
+
'label': {
|
|
485
|
+
'type': 'string',
|
|
486
|
+
'maxLength': 50,
|
|
487
|
+
'description': 'Name of the additional service'
|
|
488
|
+
},
|
|
489
|
+
'price': {
|
|
490
|
+
'type': 'number',
|
|
491
|
+
// 'multipleOf': 0.00001,
|
|
492
|
+
'minimum': 0,
|
|
493
|
+
'maximum': 999999,
|
|
494
|
+
'description': 'Cost for this additional service'
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
'description': 'Additional service'
|
|
498
|
+
},
|
|
499
|
+
'description': 'List of other additional services for this shipping line'
|
|
500
|
+
},
|
|
501
|
+
'taxes': {
|
|
502
|
+
'type': 'array',
|
|
503
|
+
'maxItems': 30,
|
|
504
|
+
'items': {
|
|
505
|
+
'type': 'object',
|
|
506
|
+
'additionalProperties': false,
|
|
507
|
+
'required': [ 'label' ],
|
|
508
|
+
'properties': {
|
|
509
|
+
'tag': {
|
|
510
|
+
'type': 'string',
|
|
511
|
+
'maxLength': 20,
|
|
512
|
+
'pattern': '^[a-z0-9_]+$',
|
|
513
|
+
'description': 'Tag to identify object, use only lowercase letters, digits and underscore'
|
|
514
|
+
},
|
|
515
|
+
'label': {
|
|
516
|
+
'type': 'string',
|
|
517
|
+
'maxLength': 50,
|
|
518
|
+
'description': 'Tax title'
|
|
519
|
+
},
|
|
520
|
+
'price': {
|
|
521
|
+
'type': 'number',
|
|
522
|
+
// 'multipleOf': 0.00001,
|
|
523
|
+
'minimum': 0,
|
|
524
|
+
'maximum': 999999999,
|
|
525
|
+
'description': 'Tax value applied'
|
|
526
|
+
},
|
|
527
|
+
'rate': {
|
|
528
|
+
'type': 'number',
|
|
529
|
+
// 'multipleOf': 0.0001,
|
|
530
|
+
'minimum': 0,
|
|
531
|
+
'maximum': 100,
|
|
532
|
+
'description': 'Tax rate as a function of package value'
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
'description': 'Applied tax or additional service'
|
|
536
|
+
},
|
|
537
|
+
'description': 'List of taxes or other additional services for this shipping line'
|
|
538
|
+
},
|
|
539
|
+
'discount': {
|
|
540
|
+
'type': 'number',
|
|
541
|
+
// 'multipleOf': 0.0001,
|
|
542
|
+
'minimum': -999999999,
|
|
543
|
+
'maximum': 999999999,
|
|
544
|
+
'description': 'Discount on shipping price, negative if value was additionated (not discounted)'
|
|
545
|
+
},
|
|
546
|
+
'total_price': {
|
|
547
|
+
'type': 'number',
|
|
548
|
+
// 'multipleOf': 0.00001,
|
|
549
|
+
'minimum': 0,
|
|
550
|
+
'maximum': 9999999999,
|
|
551
|
+
'description': 'Total cost for this shipping line, with additionals and taxes'
|
|
552
|
+
},
|
|
553
|
+
'posting_deadline': {
|
|
554
|
+
'type': 'object',
|
|
555
|
+
'required': [ 'days' ],
|
|
556
|
+
'additionalProperties': false,
|
|
557
|
+
'properties': {
|
|
558
|
+
'days': {
|
|
559
|
+
'type': 'integer',
|
|
560
|
+
'minimum': 0,
|
|
561
|
+
'maximum': 999999,
|
|
562
|
+
'description': 'Number of days to post the product after purchase'
|
|
563
|
+
},
|
|
564
|
+
'working_days': {
|
|
565
|
+
'type': 'boolean',
|
|
566
|
+
'default': true,
|
|
567
|
+
'description': 'If the deadline is calculated in working days'
|
|
568
|
+
},
|
|
569
|
+
'after_approval': {
|
|
570
|
+
'type': 'boolean',
|
|
571
|
+
'default': true,
|
|
572
|
+
'description': 'Whether days will be counted after payment approval'
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
'description': 'Deadline for sending the package'
|
|
576
|
+
},
|
|
577
|
+
'delivery_time': {
|
|
578
|
+
'type': 'object',
|
|
579
|
+
'required': [ 'days' ],
|
|
580
|
+
'additionalProperties': false,
|
|
581
|
+
'properties': {
|
|
582
|
+
'days': {
|
|
583
|
+
'type': 'integer',
|
|
584
|
+
'minimum': 0,
|
|
585
|
+
'maximum': 999999,
|
|
586
|
+
'description': 'Number of days for delivery after shipping'
|
|
587
|
+
},
|
|
588
|
+
'working_days': {
|
|
589
|
+
'type': 'boolean',
|
|
590
|
+
'default': true,
|
|
591
|
+
'description': 'If the deadline is calculated in working days'
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
'description': 'Estimated delivery time'
|
|
595
|
+
},
|
|
596
|
+
'scheduled_delivery': {
|
|
597
|
+
'type': 'object',
|
|
598
|
+
'additionalProperties': false,
|
|
599
|
+
'patternProperties': {
|
|
600
|
+
'^start|end$': {
|
|
601
|
+
'type': 'string',
|
|
602
|
+
'format': 'date-time',
|
|
603
|
+
'description': 'Scheduled date and time on the ISO 8601 representation'
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
'description': 'Date range when delivery will be made'
|
|
607
|
+
},
|
|
608
|
+
'delivery_instructions': {
|
|
609
|
+
'type': 'string',
|
|
610
|
+
'maxLength': 1000,
|
|
611
|
+
'description': 'Additional text instructions for pick up or custom delivery process'
|
|
612
|
+
},
|
|
613
|
+
'warehouse_code': {
|
|
614
|
+
'type': 'string',
|
|
615
|
+
'pattern': '^[A-Za-z0-9-_]{2,30}$',
|
|
616
|
+
'description': 'For multi DC, set warehouse where the stock will be handled'
|
|
617
|
+
},
|
|
618
|
+
'flags': {
|
|
619
|
+
'type': 'array',
|
|
620
|
+
'uniqueItems': true,
|
|
621
|
+
'maxItems': 10,
|
|
622
|
+
'items': {
|
|
623
|
+
'type': 'string',
|
|
624
|
+
'maxLength': 20,
|
|
625
|
+
'description': 'Flag title'
|
|
626
|
+
},
|
|
627
|
+
'description': 'Flags to associate additional info'
|
|
628
|
+
},
|
|
629
|
+
'custom_fields': {
|
|
630
|
+
'type': 'array',
|
|
631
|
+
'maxItems': 10,
|
|
632
|
+
'items': {
|
|
633
|
+
'type': 'object',
|
|
634
|
+
'additionalProperties': false,
|
|
635
|
+
'required': [ 'field', 'value' ],
|
|
636
|
+
'properties': {
|
|
637
|
+
'field': {
|
|
638
|
+
'type': 'string',
|
|
639
|
+
'maxLength': 50,
|
|
640
|
+
'description': 'Field name'
|
|
641
|
+
},
|
|
642
|
+
'value': {
|
|
643
|
+
'type': 'string',
|
|
644
|
+
'maxLength': 255,
|
|
645
|
+
'description': 'Field value'
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
'description': 'Custom field object'
|
|
649
|
+
},
|
|
650
|
+
'description': 'List of custom fields'
|
|
651
|
+
},
|
|
652
|
+
'notes': {
|
|
653
|
+
'type': 'string',
|
|
654
|
+
'maxLength': 2000,
|
|
655
|
+
'description': 'Optional notes with additional info about this shipping line'
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
'description': 'Order shipping line object'
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
'description': 'Shipping method option (service)'
|
|
662
|
+
},
|
|
663
|
+
'description': 'Shipping method options list'
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
};
|