feed-common 1.36.1 → 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/dist/utils/feed-templates/facebook.template.d.ts.map +1 -1
- package/dist/utils/feed-templates/facebook.template.js +4 -2
- package/dist/utils/feed-templates/facebook.template.js.map +1 -1
- package/dist/utils/feed-templates/google.template.d.ts +3 -0
- package/dist/utils/feed-templates/google.template.d.ts.map +1 -0
- package/dist/utils/feed-templates/google.template.js +837 -0
- package/dist/utils/feed-templates/google.template.js.map +1 -0
- package/dist/utils/feed-templates/index.d.ts +4 -1
- package/dist/utils/feed-templates/index.d.ts.map +1 -1
- package/dist/utils/feed-templates/index.js +38 -0
- package/dist/utils/feed-templates/index.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/feed-templates/facebook.template.ts +4 -2
- package/src/utils/feed-templates/google.template.ts +960 -0
- package/src/utils/feed-templates/index.ts +43 -1
@@ -0,0 +1,960 @@
|
|
1
|
+
/* eslint-disable quotes */
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
|
+
/* eslint-disable max-len */
|
4
|
+
import { dateRangeSchema, measureUnitsSchema, validateIfNoMacro } from './index.js';
|
5
|
+
import { SOURCE_LANGUAGE, XmlFeedFormat } from '../../constants/profile.constants.js';
|
6
|
+
import { XmlFeedTemplateType } from '../../types/profile.types.js';
|
7
|
+
import { z } from 'zod';
|
8
|
+
import { ulid } from 'ulid';
|
9
|
+
|
10
|
+
const additionalImageLinkMapping = {
|
11
|
+
attribute: 'additional_image_link',
|
12
|
+
label: 'Additional image link',
|
13
|
+
description:
|
14
|
+
'The URL of an additional image for your product. Submit up to 10 additional product images by including this attribute multiple times. Max 2000 characters. Example: http:// www.example.com/image1.jpg',
|
15
|
+
required: false,
|
16
|
+
type: 'macro-input' as any,
|
17
|
+
validator: (v: string | number) =>
|
18
|
+
validateIfNoMacro(
|
19
|
+
v,
|
20
|
+
z
|
21
|
+
.string()
|
22
|
+
.max(2000)
|
23
|
+
.refine(v => !v || z.string().url().safeParse(v).success, { message: 'invalid URL' })
|
24
|
+
),
|
25
|
+
defaultValue: '',
|
26
|
+
rules: { sections: [] },
|
27
|
+
};
|
28
|
+
|
29
|
+
const availabilityMapping = {
|
30
|
+
attribute: 'availability',
|
31
|
+
label: 'Availability',
|
32
|
+
description:
|
33
|
+
"Your product's availability. Supported values: in_stock, out_of_stock, preorder, backorder. Accurately submit the product's availability and match the availability from your landing page and checkout pages. Example: in_stock",
|
34
|
+
required: true,
|
35
|
+
type: 'macro-input' as any,
|
36
|
+
validator: (v: string | number) =>
|
37
|
+
validateIfNoMacro(v, z.enum(['in_stock', 'out_of_stock', 'preorder', 'backorder'])),
|
38
|
+
};
|
39
|
+
|
40
|
+
const customLabelMapping = {
|
41
|
+
description:
|
42
|
+
'Label that you assign to a product to help organize bidding and reporting in Shopping campaigns. Max 100 characters. Example: Seasonal',
|
43
|
+
required: true,
|
44
|
+
type: 'macro-input' as any,
|
45
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
|
46
|
+
};
|
47
|
+
|
48
|
+
export const googleFeedTemplate: XmlFeedTemplateType = {
|
49
|
+
formats: [XmlFeedFormat.XML],
|
50
|
+
documentation: 'https://support.google.com/merchants/answer/7052112',
|
51
|
+
mapping: [
|
52
|
+
{
|
53
|
+
attribute: 'id',
|
54
|
+
label: 'ID',
|
55
|
+
description: 'Your product’s unique identifier. Max 50 characters. Example: A2B4',
|
56
|
+
required: true,
|
57
|
+
type: 'macro-input',
|
58
|
+
validator: v => validateIfNoMacro(v, z.string().max(50).min(1)),
|
59
|
+
defaultValue: '{{shopify.id}}-{{shopify.variant_id}}',
|
60
|
+
rules: { sections: [] },
|
61
|
+
},
|
62
|
+
{
|
63
|
+
attribute: 'title',
|
64
|
+
label: 'Title',
|
65
|
+
description: 'Your product’s name. Plain text.Max 150 characters. Example: Mens Pique Polo Shirt',
|
66
|
+
required: true,
|
67
|
+
type: 'macro-input',
|
68
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(150).min(1)),
|
69
|
+
defaultValue: '{{shopify.title}}',
|
70
|
+
rules: { sections: [] },
|
71
|
+
},
|
72
|
+
{
|
73
|
+
attribute: 'description',
|
74
|
+
label: 'Description',
|
75
|
+
description:
|
76
|
+
'Your product’s description. Plain Text. Max 5000 characters. Example: Made from 100% organic cotton, this classic red men’s polo has a slim fit and signature logo embroidered on the left chest. Machine wash cold; imported.',
|
77
|
+
required: true,
|
78
|
+
type: 'macro-input',
|
79
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(5000).min(1)),
|
80
|
+
defaultValue: '{{shopify.description}}',
|
81
|
+
rules: { sections: [] },
|
82
|
+
},
|
83
|
+
{
|
84
|
+
attribute: 'link',
|
85
|
+
label: 'Link',
|
86
|
+
description:
|
87
|
+
'Your product’s landing page. Links must begin with http:// or https://. http://www.example.com/asp/sp.asp?cat=12&id=1030',
|
88
|
+
required: true,
|
89
|
+
type: 'macro-input',
|
90
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().url()),
|
91
|
+
defaultValue: 'https://{{shopify.shop_domain}}/products/{{shopify.handle}}',
|
92
|
+
rules: { sections: [] },
|
93
|
+
},
|
94
|
+
{
|
95
|
+
attribute: 'image_link',
|
96
|
+
label: 'Image link',
|
97
|
+
description: 'The URL of your product’s main image. Example: http:// www.example.com/image1.jpg',
|
98
|
+
required: true,
|
99
|
+
type: 'macro-input',
|
100
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().url()),
|
101
|
+
defaultValue: '{{shopify.image}}',
|
102
|
+
rules: { sections: [] },
|
103
|
+
},
|
104
|
+
...[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map(() => ({
|
105
|
+
...(additionalImageLinkMapping as any),
|
106
|
+
})),
|
107
|
+
{
|
108
|
+
attribute: 'virtual_model_link',
|
109
|
+
label: '3D model link',
|
110
|
+
description:
|
111
|
+
'Additional link to show a 3D model of your product. Available only in the US. This attribute is only available in the classic experience of Merchant Center. Limitation: valid URL, no more than 2000 characters long. Example: https://www.google.com/products/xyz.glb',
|
112
|
+
required: false,
|
113
|
+
type: 'macro-input',
|
114
|
+
validator: (v: string | number) =>
|
115
|
+
validateIfNoMacro(
|
116
|
+
v,
|
117
|
+
z
|
118
|
+
.string()
|
119
|
+
.max(2000)
|
120
|
+
.refine(v => !v || z.string().url().safeParse(v).success, { message: 'invalid URL' })
|
121
|
+
),
|
122
|
+
defaultValue: '',
|
123
|
+
rules: { sections: [] },
|
124
|
+
},
|
125
|
+
{
|
126
|
+
attribute: 'mobile_link',
|
127
|
+
label: 'Mobile link',
|
128
|
+
description:
|
129
|
+
'Your product’s mobile-optimized landing page when you have a different URL for mobile and desktop traffic. Limitation: valid URL, no more than 2000 characters long. Example: http://www.m.example.com/asp/ sp.asp?cat=12 id=1030',
|
130
|
+
required: false,
|
131
|
+
type: 'macro-input',
|
132
|
+
validator: (v: string | number) =>
|
133
|
+
validateIfNoMacro(
|
134
|
+
v,
|
135
|
+
z
|
136
|
+
.string()
|
137
|
+
.max(2000)
|
138
|
+
.refine(v => !v || z.string().url().safeParse(v).success, { message: 'invalid URL' })
|
139
|
+
),
|
140
|
+
defaultValue: '',
|
141
|
+
rules: { sections: [] },
|
142
|
+
},
|
143
|
+
{
|
144
|
+
...availabilityMapping,
|
145
|
+
defaultValue: 'in_stock',
|
146
|
+
rules: { sections: [] },
|
147
|
+
},
|
148
|
+
{
|
149
|
+
...availabilityMapping,
|
150
|
+
defaultValue: 'out_of_stock',
|
151
|
+
rules: {
|
152
|
+
sections: [
|
153
|
+
{
|
154
|
+
id: ulid(),
|
155
|
+
ruleItems: [
|
156
|
+
{
|
157
|
+
id: ulid(),
|
158
|
+
attribute: 'inventory_quantity',
|
159
|
+
operator: 'equals',
|
160
|
+
value: 0,
|
161
|
+
},
|
162
|
+
],
|
163
|
+
},
|
164
|
+
{
|
165
|
+
id: ulid(),
|
166
|
+
ruleItems: [
|
167
|
+
{
|
168
|
+
id: ulid(),
|
169
|
+
attribute: 'inventory_policy',
|
170
|
+
operator: 'equals',
|
171
|
+
value: 'deny',
|
172
|
+
},
|
173
|
+
],
|
174
|
+
},
|
175
|
+
],
|
176
|
+
},
|
177
|
+
},
|
178
|
+
{
|
179
|
+
attribute: 'availability_date',
|
180
|
+
label: 'Availability date',
|
181
|
+
description:
|
182
|
+
'Required if product availability is set to preorder. The date a preordered product becomes available for delivery. Provide a value up to one year in the future. The availability date should also be added to the product’s landing page and be clear to your customers (for example, “May 6, 2023”). Example: 2016-02-24T11:07+0100',
|
183
|
+
required: false,
|
184
|
+
type: 'macro-input',
|
185
|
+
validator: (v: string | number) =>
|
186
|
+
// TODO: make required if availability is preorder
|
187
|
+
validateIfNoMacro(
|
188
|
+
v,
|
189
|
+
z
|
190
|
+
.string()
|
191
|
+
.refine(v => !v || z.string().date().safeParse(v).success, { message: 'invalid date' })
|
192
|
+
.refine(v => !v || new Date(v).getTime() + 1000 * 60 * 60 * 24 * 365 > new Date().getTime(), {
|
193
|
+
message: 'The date should be up to one year in the future',
|
194
|
+
})
|
195
|
+
),
|
196
|
+
defaultValue: '',
|
197
|
+
rules: { sections: [] },
|
198
|
+
},
|
199
|
+
{
|
200
|
+
attribute: 'cost_of_goods_sold',
|
201
|
+
label: 'Cost of goods sold',
|
202
|
+
description:
|
203
|
+
'The costs associated with the sale of a particular product as defined by the accounting convention you set up. These costs may include material, labor, freight, or other overhead expenses. By submitting the COGS for your products, you gain insights about other metrics, such as your gross margin and the amount of revenue generated by your ads and free listings. The currency must be in the ISO 4217 format. For example, USD for US dollars. The decimal point must be a period (.). Example, 10.00 USD',
|
204
|
+
required: false,
|
205
|
+
type: 'macro-input',
|
206
|
+
defaultValue: '',
|
207
|
+
rules: { sections: [] },
|
208
|
+
},
|
209
|
+
{
|
210
|
+
attribute: 'expiration_date',
|
211
|
+
label: 'Expiration date',
|
212
|
+
description:
|
213
|
+
'The date that your product should stop showing. Use a date less than 30 days in the future. Example: 2016-07-11T11:07+0100',
|
214
|
+
required: false,
|
215
|
+
type: 'macro-input',
|
216
|
+
validator: (v: string | number) =>
|
217
|
+
validateIfNoMacro(
|
218
|
+
v,
|
219
|
+
z
|
220
|
+
.string()
|
221
|
+
.refine(v => !v || z.string().datetime().safeParse(v).success, { message: 'invalid date' })
|
222
|
+
.refine(v => !v || new Date(v).getTime() + 1000 * 60 * 60 * 24 * 30 > new Date().getTime(), {
|
223
|
+
message: 'The date should be less than 30 days in the future',
|
224
|
+
})
|
225
|
+
),
|
226
|
+
defaultValue: '',
|
227
|
+
rules: { sections: [] },
|
228
|
+
},
|
229
|
+
// TODO: add condition, checking if sale price is set
|
230
|
+
{
|
231
|
+
attribute: 'price',
|
232
|
+
label: 'Price',
|
233
|
+
description:
|
234
|
+
"Your products price. Accurately submit the product's price and currency, and match with the price from your landing page and at checkout. Example: 15.00 USD",
|
235
|
+
required: true,
|
236
|
+
type: 'macro-input',
|
237
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().min(1)),
|
238
|
+
defaultValue: '{{shopify.price}} {{shopify.shop_currency}}',
|
239
|
+
rules: { sections: [] },
|
240
|
+
},
|
241
|
+
{
|
242
|
+
attribute: 'sale_price',
|
243
|
+
label: 'Sale price',
|
244
|
+
description:
|
245
|
+
"Your product's sale price. Accurately submit the product's sale price, and match the sale price with your landing page and the checkout pages. Example: 15.00 USD",
|
246
|
+
required: false,
|
247
|
+
type: 'macro-input',
|
248
|
+
defaultValue: '',
|
249
|
+
rules: { sections: [] },
|
250
|
+
},
|
251
|
+
{
|
252
|
+
attribute: 'sale_price_effective_date',
|
253
|
+
label: 'Sale price effective date',
|
254
|
+
description:
|
255
|
+
"The date range during which the sale price applies. Use a date less than 30 days in the future. Use together with the sale price. If you don't submit this attribute (sale price effective date), the sale price always applies. Separate start date and end date with /. Use a start date before the end date. Example: 2016-07-11T11:07+0100/2016-08-11T11:07+0100",
|
256
|
+
required: false,
|
257
|
+
type: 'macro-input',
|
258
|
+
validator: (v: string | number) => validateIfNoMacro(v, dateRangeSchema),
|
259
|
+
defaultValue: '',
|
260
|
+
rules: { sections: [] },
|
261
|
+
},
|
262
|
+
{
|
263
|
+
attribute: 'unit_pricing_measure',
|
264
|
+
label: 'Unit pricing measure',
|
265
|
+
description:
|
266
|
+
'The measure and dimension of your product as it is sold. Optional (except when required by local laws or regulations). Use the measure or dimension of the product without packaging. Example: 1.5kg',
|
267
|
+
required: false,
|
268
|
+
type: 'macro-input',
|
269
|
+
validator: (v: string | number) =>
|
270
|
+
validateIfNoMacro(
|
271
|
+
v,
|
272
|
+
measureUnitsSchema([
|
273
|
+
'oz',
|
274
|
+
'lb',
|
275
|
+
'mg',
|
276
|
+
'g',
|
277
|
+
'kg',
|
278
|
+
'floz',
|
279
|
+
'pt',
|
280
|
+
'qt',
|
281
|
+
'gal',
|
282
|
+
'ml',
|
283
|
+
'cl',
|
284
|
+
'l',
|
285
|
+
'cbm',
|
286
|
+
'in',
|
287
|
+
'ft',
|
288
|
+
'yd',
|
289
|
+
'cm',
|
290
|
+
'm',
|
291
|
+
'sqft',
|
292
|
+
'sqm',
|
293
|
+
'ct',
|
294
|
+
])
|
295
|
+
),
|
296
|
+
defaultValue: '',
|
297
|
+
rules: { sections: [] },
|
298
|
+
},
|
299
|
+
{
|
300
|
+
attribute: 'unit_pricing_base_measure',
|
301
|
+
label: 'Unit pricing base measure',
|
302
|
+
description:
|
303
|
+
'The product’s base measure for pricing (for example, 100ml means the price is calculated based on a 100ml units). Optional (except when required by local laws or regulations). Example: 100g',
|
304
|
+
required: false,
|
305
|
+
type: 'macro-input',
|
306
|
+
validator: (v: string | number) =>
|
307
|
+
validateIfNoMacro(
|
308
|
+
v,
|
309
|
+
measureUnitsSchema([
|
310
|
+
'oz',
|
311
|
+
'lb',
|
312
|
+
'mg',
|
313
|
+
'g',
|
314
|
+
'kg',
|
315
|
+
'floz',
|
316
|
+
'pt',
|
317
|
+
'qt',
|
318
|
+
'gal',
|
319
|
+
'ml',
|
320
|
+
'cl',
|
321
|
+
'l',
|
322
|
+
'cbm',
|
323
|
+
'in',
|
324
|
+
'ft',
|
325
|
+
'yd',
|
326
|
+
'cm',
|
327
|
+
'm',
|
328
|
+
'sqft',
|
329
|
+
'sqm',
|
330
|
+
'ct',
|
331
|
+
])
|
332
|
+
),
|
333
|
+
defaultValue: '',
|
334
|
+
rules: { sections: [] },
|
335
|
+
},
|
336
|
+
{
|
337
|
+
attribute: 'installment',
|
338
|
+
label: 'Installment',
|
339
|
+
description:
|
340
|
+
"Details of an installment payment plan. This attribute uses 4 sub-attributes: Months [months] (Required) Integer, the number of installments the buyer has to pay. Amount [amount] (Required) ISO 4217, the amount the buyer has to pay per month. Downpayment [downpayment] (Optional) ISO 4217, the amount the buyer has to pay upfront as a one time payment. Note: if you don't submit the sub-attribute, the default value is 0 or “no down payment”. Credit type [credit_type] (Optional). This sub-attributes uses the following supported values: Finance [finance], Lease [lease]. Example: 6:30 EUR or 6:30 EUR:10 EUR:finance",
|
341
|
+
required: false,
|
342
|
+
type: 'macro-input',
|
343
|
+
// TODO: add validator
|
344
|
+
defaultValue: '',
|
345
|
+
rules: { sections: [] },
|
346
|
+
},
|
347
|
+
{
|
348
|
+
attribute: 'subscription_cost',
|
349
|
+
label: 'Subscription cost',
|
350
|
+
description:
|
351
|
+
'Details a monthly or annual payment plan that bundles a communications service contract with a wireless product. Optional (available in certain countries for showing wireless products and services only). Syntax: Period [period] (Required), The duration of a single subscription period. This sub-attribute uses the following supported values: Month [month] Year [year]. Period length [period_length] (Required), Integer, the number of subscription periods (months or years) that the buyer must pay. Amount [amount] (Required), ISO 4217, the amount the buyer has to pay per subscription period. Example: month:12:30.00EUR',
|
352
|
+
required: false,
|
353
|
+
type: 'macro-input',
|
354
|
+
// TODO: add validator
|
355
|
+
defaultValue: '',
|
356
|
+
rules: { sections: [] },
|
357
|
+
},
|
358
|
+
{
|
359
|
+
attribute: 'loyalty_program',
|
360
|
+
label: 'Loyalty program',
|
361
|
+
description:
|
362
|
+
'Allows setting up of member prices and loyalty points. Optional (available for Japan and the United States only). This attribute uses 6 sub-attributes: Program label [program_label] (Required). The loyalty program label set in your loyalty program settings in Merchant Center. Tier label [tier_label] (Required), The tier label set in your program settings in Merchant Center, used to differentiate benefits between each tier. Price [price] (Optional) The member specific price for the program and tier. This will display alongside the non-member price to give shoppers an idea of the benefits of joining your program. Only available in the United States. Cashback [cashback_for_future_use] (Optional) Currently not available. Loyalty points [loyalty_points] (Optional) The points that the members gain on purchasing the product on your website. This needs to be a whole number. Member price effective date [member_price_effective_date] (optional): This sub-attribute allows merchants to specify when their member pricing benefit begins and ends. Example: my_loyalty_program:silver:10 USD::10:',
|
363
|
+
required: false,
|
364
|
+
type: 'macro-input',
|
365
|
+
rules: { sections: [] },
|
366
|
+
},
|
367
|
+
{
|
368
|
+
attribute: 'auto_pricing_min_price',
|
369
|
+
label: 'Minimum price',
|
370
|
+
description:
|
371
|
+
"The lowest price to which a product's price can be reduced. Google uses this information for features such as sale price suggestions, automated discounts or dynamic promotions. Example: 15.00 USD",
|
372
|
+
required: false,
|
373
|
+
type: 'macro-input',
|
374
|
+
defaultValue: '',
|
375
|
+
rules: { sections: [] },
|
376
|
+
},
|
377
|
+
{
|
378
|
+
attribute: 'google_product_category',
|
379
|
+
label: 'Google product category',
|
380
|
+
description:
|
381
|
+
'Google-defined product category for your product. Example: Apparel & Accessories > Clothing > Outerwear > Coats & Jackets or 371',
|
382
|
+
required: false,
|
383
|
+
type: 'macro-input',
|
384
|
+
defaultValue: '',
|
385
|
+
rules: { sections: [] },
|
386
|
+
},
|
387
|
+
{
|
388
|
+
attribute: 'product_type',
|
389
|
+
label: 'Product type',
|
390
|
+
description:
|
391
|
+
'Product category that you define for your product. Max 750 alphanumeric character. Example: Home > Women > Dresses > Maxi Dresses',
|
392
|
+
required: false,
|
393
|
+
type: 'macro-input',
|
394
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(750)),
|
395
|
+
defaultValue: '{{shopify.category}}',
|
396
|
+
rules: { sections: [] },
|
397
|
+
},
|
398
|
+
{
|
399
|
+
attribute: 'brand',
|
400
|
+
label: 'Brand',
|
401
|
+
description: 'Your product’s brand name. Plain text. Max 70 characters. Example: Google',
|
402
|
+
required: true,
|
403
|
+
type: 'macro-input',
|
404
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(70).min(1)),
|
405
|
+
defaultValue: '{{shopify.vendor}}',
|
406
|
+
rules: { sections: [] },
|
407
|
+
},
|
408
|
+
{
|
409
|
+
attribute: 'gtin',
|
410
|
+
label: 'GTIN',
|
411
|
+
description:
|
412
|
+
'Your product’s Global Trade Item Number (GTIN). Required (For all products with a known GTIN to enable full offer performance). Max 50 numeric characters. Example: 3234567890126',
|
413
|
+
required: false,
|
414
|
+
type: 'macro-input',
|
415
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(50)),
|
416
|
+
defaultValue: '{{shopify.barcode}}',
|
417
|
+
rules: { sections: [] },
|
418
|
+
},
|
419
|
+
{
|
420
|
+
attribute: 'mpn',
|
421
|
+
label: 'MPN',
|
422
|
+
description:
|
423
|
+
'Your product’s Manufacturer Part Number (MPN). Required (Only if your product does not have a manufacturer assigned GTIN). Only submit MPNs assigned by a manufacturer. Max 70 alphanumeric characters. Example: GO12345OOGLE',
|
424
|
+
required: false,
|
425
|
+
type: 'macro-input',
|
426
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(70)),
|
427
|
+
defaultValue: '{{shopify.sku}}',
|
428
|
+
rules: { sections: [] },
|
429
|
+
},
|
430
|
+
{
|
431
|
+
attribute: 'identifier_exists',
|
432
|
+
label: 'Identifier exists',
|
433
|
+
description:
|
434
|
+
'Use to indicate whether or not the unique product identifiers (UPIs) GTIN, MPN, and brand are available for your product. Submit "no" if: Your product is a media item and the GTIN is unavailable (Note: ISBN and SBN codes are accepted as GTINs or Your product is an apparel (clothing) item and the brand is unavailable or In all other categories, your product doesn’t have a GTIN, or a combination of MPN and brand. If a product does have unique product identifiers, don’t submit this attribute with a value of “no” or the product may be disapproved. Example: no',
|
435
|
+
required: false,
|
436
|
+
type: 'macro-input',
|
437
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.enum(['yes', 'no', ''])),
|
438
|
+
defaultValue: 'yes',
|
439
|
+
rules: { sections: [] },
|
440
|
+
},
|
441
|
+
{
|
442
|
+
attribute: 'condition',
|
443
|
+
label: 'Condition',
|
444
|
+
description:
|
445
|
+
'The condition of your product at time of sale. Required if your product is used or refurbished. Supported values: new, refurbished, used. Example: new',
|
446
|
+
required: false,
|
447
|
+
type: 'macro-input',
|
448
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.enum(['new', 'refurbished', 'used', ''])),
|
449
|
+
defaultValue: '',
|
450
|
+
rules: { sections: [] },
|
451
|
+
},
|
452
|
+
{
|
453
|
+
attribute: 'adult',
|
454
|
+
label: 'Adult',
|
455
|
+
description:
|
456
|
+
'Indicate a product includes sexually suggestive content. Required (If a product contains adult content). Supported values: yes, no. Example: yes',
|
457
|
+
required: false,
|
458
|
+
type: 'macro-input',
|
459
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.enum(['yes', 'no', ''])),
|
460
|
+
defaultValue: '',
|
461
|
+
rules: { sections: [] },
|
462
|
+
},
|
463
|
+
{
|
464
|
+
attribute: 'multipack',
|
465
|
+
label: 'Multipack',
|
466
|
+
description:
|
467
|
+
"The number of identical products sold within a merchant-defined multipack. Required (For multipack products in Australia, Brazil, Czechia, France, Germany, Italy, Japan, Netherlands, Spain, Switzerland, the UK and the US). Required for free listings on Google if you’ve created a multipack. Submit this attribute if you defined a custom group of identical products and are selling them as a single unit of sale (for example, you're selling 6 bars of soap together). If the product's manufacturer assembled the multipack instead of you, don't submit this attribute. Example: 6",
|
468
|
+
required: false,
|
469
|
+
type: 'macro-input',
|
470
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.coerce.number().min(0)),
|
471
|
+
defaultValue: '',
|
472
|
+
rules: { sections: [] },
|
473
|
+
},
|
474
|
+
{
|
475
|
+
attribute: 'is_bundle',
|
476
|
+
label: 'Bundle',
|
477
|
+
description:
|
478
|
+
'Indicates a product is a merchant-defined custom group of different products featuring one main product. Required (For bundles in Australia, Brazil, Czechia, France, Germany, Italy, Japan, Netherlands, Spain, Switzerland, the UK and the US). Required for free listings on Google if you’ve created a bundle containing a main product. Supported values: yes, no. Example: yes',
|
479
|
+
required: false,
|
480
|
+
type: 'macro-input',
|
481
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.enum(['yes', 'no', ''])),
|
482
|
+
defaultValue: '',
|
483
|
+
rules: { sections: [] },
|
484
|
+
},
|
485
|
+
{
|
486
|
+
attribute: 'certification',
|
487
|
+
label: 'Certification',
|
488
|
+
description:
|
489
|
+
'Certifications, such as energy efficiency ratings, associated with your product. Available for the EU and EFTA countries and the UK. Required for products that require certain certification information to be shown in your Shopping ads or free listings, for example due to local energy efficiency labeling regulations. Example: EC:EPREL:123456',
|
490
|
+
required: false,
|
491
|
+
type: 'macro-input',
|
492
|
+
defaultValue: '',
|
493
|
+
rules: { sections: [] },
|
494
|
+
},
|
495
|
+
{
|
496
|
+
attribute: 'energy_efficiency_class',
|
497
|
+
label: 'Energy efficiency class',
|
498
|
+
description:
|
499
|
+
'Your product’s energy label. Available for the EU and EFTA countries and the UK. Note: This attribute is being deprecated. Please use the certification attribute instead to show the EU energy efficiency class. Supported values: A, A+, A++, A+++, B, C, D, E, F, G. Example: A+',
|
500
|
+
required: false,
|
501
|
+
type: 'macro-input',
|
502
|
+
validator: (v: string | number) =>
|
503
|
+
validateIfNoMacro(v, z.enum(['A', 'A+', 'A++', 'A+++', 'B', 'C', 'D', 'E', 'F', 'G', ''])),
|
504
|
+
defaultValue: '',
|
505
|
+
rules: { sections: [] },
|
506
|
+
},
|
507
|
+
{
|
508
|
+
attribute: 'age_group',
|
509
|
+
label: 'Age group',
|
510
|
+
description:
|
511
|
+
'The demographic for which your product is intended. Required (For all apparel products that are targeted to people in Brazil, France, Germany, Japan, the UK, and the US as well as all products with assigned age groups). Required for free listings for all Apparel & Accessories (ID: 166) products. Supported values: newborn, infant, toddler, kids, adult. Example: adult',
|
512
|
+
required: false,
|
513
|
+
type: 'macro-input',
|
514
|
+
// TODO: add to check if product is apparel
|
515
|
+
validator: (v: string | number) =>
|
516
|
+
validateIfNoMacro(v, z.enum(['newborn', 'infant', 'toddler', 'kids', 'adult', ''])),
|
517
|
+
defaultValue: '',
|
518
|
+
rules: { sections: [] },
|
519
|
+
},
|
520
|
+
{
|
521
|
+
attribute: 'color',
|
522
|
+
label: 'Color',
|
523
|
+
description:
|
524
|
+
'Your product’s color(s). Required (For all apparel products that are targeted to people in Brazil, France, Germany, Japan, the UK, and the US). Required for free listings for all Apparel & Accessories (ID: 166) products. Max 100 alphanumeric characters (max 40 characters per color). Example: Black',
|
525
|
+
required: false,
|
526
|
+
type: 'macro-input',
|
527
|
+
// TODO: add to check if product is apparel
|
528
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
|
529
|
+
rules: { sections: [] },
|
530
|
+
},
|
531
|
+
{
|
532
|
+
attribute: 'gender',
|
533
|
+
label: 'Gender',
|
534
|
+
description:
|
535
|
+
'The gender for which your product is intended. Required (Required for all apparel items that are targeted to people in Brazil, France, Germany, Japan, the UK, and the US as well as all gender-specific products). Required for free listings for all Google Apparel & Accessories (ID: 166) products. Supported values: male, female, unisex. Example: unisex',
|
536
|
+
required: false,
|
537
|
+
type: 'macro-input',
|
538
|
+
// TODO: add to check if product is apparel
|
539
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.enum(['male', 'female', 'unisex', ''])),
|
540
|
+
rules: { sections: [] },
|
541
|
+
},
|
542
|
+
{
|
543
|
+
attribute: 'material',
|
544
|
+
label: 'Material',
|
545
|
+
description:
|
546
|
+
'Your product’s fabric or material. Required (if relevant for distinguishing different products in a set of variants). Max 200 characters. Example: leather',
|
547
|
+
required: false,
|
548
|
+
type: 'macro-input',
|
549
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(200)),
|
550
|
+
rules: { sections: [] },
|
551
|
+
},
|
552
|
+
{
|
553
|
+
attribute: 'pattern',
|
554
|
+
label: 'Pattern',
|
555
|
+
description:
|
556
|
+
'Your product’s pattern or graphic print. Required (if relevant for distinguishing different products in a set of variants). Max 100 characters. Example: polka dot',
|
557
|
+
required: false,
|
558
|
+
type: 'macro-input',
|
559
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
|
560
|
+
rules: { sections: [] },
|
561
|
+
},
|
562
|
+
{
|
563
|
+
attribute: 'size',
|
564
|
+
label: 'Size',
|
565
|
+
description:
|
566
|
+
'Your product’s size. Required (Required for all apparel products in Apparel & Accessories > Clothing (ID:1604) and Apparel & Accessories > Shoes (ID:187) categories targeted to people in Brazil, France, Germany, Japan, the UK, and the US as well as all products available in different sizes). Required for free listings for all Apparel & Accessories > Clothing (ID:1604) and Apparel & Accessories > Shoes (ID:187) products. Max 100 characters. Example: XL',
|
567
|
+
required: false,
|
568
|
+
type: 'macro-input',
|
569
|
+
// TODO: add to check if product is apparel
|
570
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
|
571
|
+
rules: { sections: [] },
|
572
|
+
},
|
573
|
+
{
|
574
|
+
attribute: 'size_type',
|
575
|
+
label: 'Size type',
|
576
|
+
description:
|
577
|
+
'Your apparel product’s cut. Available for apparel products only. Submit up to 2 values. Supported values: regular, petite, maternity, big, tall, plus. Example: maternity',
|
578
|
+
required: false,
|
579
|
+
type: 'macro-input',
|
580
|
+
validator: (v: string | number) =>
|
581
|
+
validateIfNoMacro(
|
582
|
+
v,
|
583
|
+
z
|
584
|
+
.string()
|
585
|
+
.refine(
|
586
|
+
v =>
|
587
|
+
!v ||
|
588
|
+
(v.split(/\s+/).length < 3 &&
|
589
|
+
v
|
590
|
+
.split(/\s+/)
|
591
|
+
.every(st =>
|
592
|
+
['regular', 'petite', 'maternity', 'big', 'tall', 'plus'].includes(st)
|
593
|
+
)),
|
594
|
+
{
|
595
|
+
message: `Only 'regular', 'petite', 'maternity', 'big', 'tall', 'plus' supported. Max 2 values`,
|
596
|
+
}
|
597
|
+
)
|
598
|
+
),
|
599
|
+
rules: { sections: [] },
|
600
|
+
},
|
601
|
+
{
|
602
|
+
attribute: 'size_system',
|
603
|
+
label: 'Size system',
|
604
|
+
description:
|
605
|
+
"The country of the size system used by your product. If you don't submit the attribute, the default value is your target country. Supported values: US, EU, UK, DE, FR, JP, CN, IT, BR, MEX, AU. Example: US",
|
606
|
+
required: false,
|
607
|
+
type: 'macro-input',
|
608
|
+
validator: (v: string | number) =>
|
609
|
+
validateIfNoMacro(v, z.enum(['US', 'EU', 'UK', 'DE', 'FR', 'JP', 'CN', 'IT', 'BR', 'MEX', 'AU', ''])),
|
610
|
+
rules: { sections: [] },
|
611
|
+
},
|
612
|
+
{
|
613
|
+
attribute: 'item_group_id',
|
614
|
+
label: 'Item group ID',
|
615
|
+
description:
|
616
|
+
'ID for a group of products that come in different versions (variants). Required (Brazil, France, Germany, Japan, the United Kingdom, and the US if the product is a variant). Required for free listings for all product variants. Max 50 alphanumeric characters. Example: AB12345',
|
617
|
+
required: false,
|
618
|
+
type: 'macro-input',
|
619
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(50)),
|
620
|
+
defaultValue: '{{shopify.id}}',
|
621
|
+
rules: { sections: [] },
|
622
|
+
},
|
623
|
+
{
|
624
|
+
attribute: 'product_length',
|
625
|
+
label: 'Product length',
|
626
|
+
description:
|
627
|
+
"Your product's length. Supported values: 0-3000. Syntax: Number + unit. Supported units: cm, in. Example: 20 in",
|
628
|
+
required: false,
|
629
|
+
type: 'macro-input',
|
630
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['cm', 'in'])),
|
631
|
+
defaultValue: '',
|
632
|
+
rules: { sections: [] },
|
633
|
+
},
|
634
|
+
{
|
635
|
+
attribute: 'product_width',
|
636
|
+
label: 'Product width',
|
637
|
+
description:
|
638
|
+
"Your product's width. Supported values: 0-3000. Syntax: Number + unit. Supported units: cm, in. Example: 20 in",
|
639
|
+
required: false,
|
640
|
+
type: 'macro-input',
|
641
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['cm', 'in'])),
|
642
|
+
defaultValue: '',
|
643
|
+
rules: { sections: [] },
|
644
|
+
},
|
645
|
+
{
|
646
|
+
attribute: 'product_height',
|
647
|
+
label: 'Product height',
|
648
|
+
description:
|
649
|
+
"Your product's height. Supported values: 0-3000. Syntax: Number + unit. Supported units: cm, in. Example: 20 in",
|
650
|
+
required: false,
|
651
|
+
type: 'macro-input',
|
652
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['cm', 'in'])),
|
653
|
+
defaultValue: '',
|
654
|
+
rules: { sections: [] },
|
655
|
+
},
|
656
|
+
{
|
657
|
+
attribute: 'product_weight',
|
658
|
+
label: 'Product weight',
|
659
|
+
description:
|
660
|
+
"Your product's weight. Supported values: 0-2000. Syntax: Number + unit. Supported units: lb, oz, g, kb. Example: 3.5 lb",
|
661
|
+
required: false,
|
662
|
+
type: 'macro-input',
|
663
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['lb', 'oz', 'g', 'kg'])),
|
664
|
+
defaultValue: '{{shopify.weight}} {{shopify.weight_unit}}',
|
665
|
+
rules: { sections: [] },
|
666
|
+
},
|
667
|
+
{
|
668
|
+
attribute: 'product_detail',
|
669
|
+
label: 'Product detail',
|
670
|
+
description:
|
671
|
+
"Technical specifications or additional details of your product. This attribute uses 3 sub-attributes: Section name: Max 140 characters. Attribute name: Max 140 characters. Attribute value: Max 1000 characters. Don't add information covered in other attributes, all capital letters, gimmicky foreign characters, promotion text, or list keywords or search terms. Example: General:Product Type:Digital player",
|
672
|
+
required: false,
|
673
|
+
type: 'macro-input',
|
674
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(1280)),
|
675
|
+
defaultValue: '',
|
676
|
+
rules: { sections: [] },
|
677
|
+
},
|
678
|
+
{
|
679
|
+
attribute: 'product_highlight',
|
680
|
+
label: 'Product highlight',
|
681
|
+
description:
|
682
|
+
'The most relevant highlights of your products. Max 150 characters. Example: Supports thousands of apps, including Netflix, YouTube, and HBO Max',
|
683
|
+
required: false,
|
684
|
+
type: 'macro-input',
|
685
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(150)),
|
686
|
+
defaultValue: '',
|
687
|
+
rules: { sections: [] },
|
688
|
+
},
|
689
|
+
{
|
690
|
+
attribute: 'ads_redirect',
|
691
|
+
label: 'Ads redirect',
|
692
|
+
description:
|
693
|
+
'A URL used to specify additional parameters for your product page. Customers will be sent to this URL rather than the value that you submit for the link or mobile link attributes. Submit the same registered domain as for the link attribute (and the mobile link attribute, if present). Max 2000 characters. Example: http://www.example.com/product.html',
|
694
|
+
required: false,
|
695
|
+
type: 'macro-input',
|
696
|
+
// TODO: check for the same domain with link and mobile link
|
697
|
+
validator: z
|
698
|
+
.string()
|
699
|
+
.max(2000)
|
700
|
+
.refine(v => !v || z.string().url().safeParse(v).success, { message: 'invalid URL' }),
|
701
|
+
defaultValue: '',
|
702
|
+
rules: { sections: [] },
|
703
|
+
},
|
704
|
+
...[0, 1, 2, 3, 4].map(i => ({
|
705
|
+
...customLabelMapping,
|
706
|
+
attribute: `custom_label_${i}`,
|
707
|
+
label: `Custom Label ${i + 1}`,
|
708
|
+
})),
|
709
|
+
{
|
710
|
+
attribute: 'promotion_id',
|
711
|
+
label: 'Promotion ID',
|
712
|
+
description:
|
713
|
+
'An identifier that allows you to match products to promotions. Required for promotions in Australia, France, Germany, India, the UK and the US. Max 50 characters. Example: ABC123',
|
714
|
+
required: false,
|
715
|
+
type: 'macro-input',
|
716
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(15)),
|
717
|
+
defaultValue: '',
|
718
|
+
rules: { sections: [] },
|
719
|
+
},
|
720
|
+
{
|
721
|
+
attribute: 'lifestyle_image_link',
|
722
|
+
label: 'Lifestyle image link',
|
723
|
+
description:
|
724
|
+
'Attribute used to include the URL for a lifestyle image for your product. Only available for browsy surfaces. Max 2000 characters. Example: https://www.example.com/image1.jpg',
|
725
|
+
required: false,
|
726
|
+
type: 'macro-input',
|
727
|
+
validator: z
|
728
|
+
.string()
|
729
|
+
.max(2000)
|
730
|
+
.refine(v => !v || z.string().url().safeParse(v).success, { message: 'invalid URL' }),
|
731
|
+
defaultValue: '',
|
732
|
+
rules: { sections: [] },
|
733
|
+
},
|
734
|
+
{
|
735
|
+
attribute: 'external_seller_id',
|
736
|
+
label: 'External seller ID',
|
737
|
+
description:
|
738
|
+
'Note: Marketplaces is currently only available in the classic version of Merchant Center.Required for multi-seller account. Used by a marketplace to externally identify a seller. (For example, on a website). 1 - 50 characters. Example: SellerPublicName1991',
|
739
|
+
required: false,
|
740
|
+
type: 'macro-input',
|
741
|
+
validator: z.string().max(50),
|
742
|
+
defaultValue: '',
|
743
|
+
rules: { sections: [] },
|
744
|
+
},
|
745
|
+
{
|
746
|
+
attribute: 'exclude_destination',
|
747
|
+
label: 'Exclude destination',
|
748
|
+
description:
|
749
|
+
'A setting that you can use to exclude a product from participating in a specific type of advertising campaign. Supported values: Shopping_ads, Buy_on_Google_listings, Display_ads, Local_inventory_ads, Free_listings, Free_local_listings, YouTube_Shopping. Example: Shopping_ads',
|
750
|
+
required: false,
|
751
|
+
type: 'macro-input',
|
752
|
+
validator: (v: string | number) =>
|
753
|
+
validateIfNoMacro(
|
754
|
+
v,
|
755
|
+
z.array(
|
756
|
+
z.enum([
|
757
|
+
'Shopping_ads',
|
758
|
+
'Buy_on_Google_listings',
|
759
|
+
'Display_ads',
|
760
|
+
'Local_inventory_ads',
|
761
|
+
'Free_listings',
|
762
|
+
'Free_local_listings',
|
763
|
+
'YouTube_Shopping',
|
764
|
+
'',
|
765
|
+
])
|
766
|
+
)
|
767
|
+
),
|
768
|
+
defaultValue: '',
|
769
|
+
rules: { sections: [] },
|
770
|
+
},
|
771
|
+
{
|
772
|
+
attribute: 'included_destination',
|
773
|
+
label: 'Included destination',
|
774
|
+
description:
|
775
|
+
'A setting that you can use to include a product in a specific type of advertising campaign. Supported values: Shopping_ads, Buy_on_Google_listings, Display_ads, Local_inventory_ads, Free_listings, Free_local_listings, YouTube_Shopping. Example: Shopping_ads',
|
776
|
+
required: false,
|
777
|
+
type: 'macro-input',
|
778
|
+
validator: (v: string | number) =>
|
779
|
+
validateIfNoMacro(
|
780
|
+
v,
|
781
|
+
z.array(
|
782
|
+
z.enum([
|
783
|
+
'Shopping_ads',
|
784
|
+
'Buy_on_Google_listings',
|
785
|
+
'Display_ads',
|
786
|
+
'Local_inventory_ads',
|
787
|
+
'Free_listings',
|
788
|
+
'Free_local_listings',
|
789
|
+
'YouTube_Shopping',
|
790
|
+
'',
|
791
|
+
])
|
792
|
+
)
|
793
|
+
),
|
794
|
+
defaultValue: '',
|
795
|
+
rules: { sections: [] },
|
796
|
+
},
|
797
|
+
{
|
798
|
+
attribute: 'shopping_ads_excluded_country',
|
799
|
+
label: 'Shopping ads excluded country',
|
800
|
+
description:
|
801
|
+
'A setting that allows you to exclude countries where your products are advertised on Shopping ads. 2 characters. Must be an ISO_3166-1_alpha-2 country code. Only available for Shopping ads. Example: DE',
|
802
|
+
required: false,
|
803
|
+
type: 'select',
|
804
|
+
choices: [SOURCE_LANGUAGE],
|
805
|
+
defaultValue: '',
|
806
|
+
rules: { sections: [] },
|
807
|
+
},
|
808
|
+
{
|
809
|
+
attribute: 'pause',
|
810
|
+
label: 'Pause',
|
811
|
+
description:
|
812
|
+
'A setting you can use to pause and quickly reactivate a product for all ads (including Shopping ads, Display ads, and local inventory ads). A product can be paused for up to 14 days. If a product is paused for more than 14 days it will be disapproved. To re-approve, remove the attribute.. Supported values: ads, no. Example: ads',
|
813
|
+
required: false,
|
814
|
+
type: 'macro-input',
|
815
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.enum(['ads', ''])),
|
816
|
+
defaultValue: '',
|
817
|
+
rules: { sections: [] },
|
818
|
+
},
|
819
|
+
{
|
820
|
+
attribute: 'shipping',
|
821
|
+
label: 'Shipping',
|
822
|
+
description:
|
823
|
+
"Your product's shipping cost, shipping speeds, and the locations your product ships to. Shipping costs are required for Shopping ads and free listings for the following countries: Australia, Austria, Belgium, Canada, Czechia, France, Germany, India, Ireland, Israel, Italy, New Zealand, Japan, the Netherlands, Poland, Romania, South Korea, Spain, Switzerland, the UK, and the US. This attribute uses the following sub-attributes: Country (Required) ISO 3166 country code. Region (Optional). Postal code (Optional). Location ID (Optional). Location group name (Optional). Service (Optional) Service class or shipping speed. Price (Optional) Fixed shipping cost, including VAT if required. Minimum handling time and maximum handling time (Optional) To specify handling time. Minimum transit time and maximum transit time (Optional) To specify transit time. Supported prices: 0-1000 USD. Example: US:CA:Overnight:16.00 USD:1:1:2:3",
|
824
|
+
required: false,
|
825
|
+
type: 'macro-input',
|
826
|
+
defaultValue: '',
|
827
|
+
rules: { sections: [] },
|
828
|
+
},
|
829
|
+
{
|
830
|
+
attribute: 'shipping_label',
|
831
|
+
label: 'Shipping label',
|
832
|
+
description:
|
833
|
+
'Label that you assign to a product to help assign correct shipping costs in Merchant Center account settings. Max 100 characters. Example: perishable',
|
834
|
+
type: 'macro-input',
|
835
|
+
defaultValue: '',
|
836
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
|
837
|
+
rules: { sections: [] },
|
838
|
+
},
|
839
|
+
{
|
840
|
+
attribute: 'shipping_weight',
|
841
|
+
label: 'Shipping weight',
|
842
|
+
description:
|
843
|
+
'The weight of the product used to calculate the shipping cost. Required for carrier-calculated rates in your account shipping settings. Supported weights: 9-2000 lbs for imperial, 0-1000 kg from metric. Supported units: lb, oz, g, kg. Syntax: Number + unit. Example: 3 kg',
|
844
|
+
required: false,
|
845
|
+
type: 'macro-input',
|
846
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['lb', 'oz', 'g', 'kg'])),
|
847
|
+
defaultValue: '{{shopify.weight}} {{shopify.weight_unit}}',
|
848
|
+
rules: { sections: [] },
|
849
|
+
},
|
850
|
+
{
|
851
|
+
attribute: 'shipping_length',
|
852
|
+
label: 'Shipping length',
|
853
|
+
description:
|
854
|
+
'The length of the product used to calculate the shipping cost by dimensional weight. Supported values: 0-150 for inches, 1-400 for cm. Syntax: Number + unit. Supported units: cm, in. Example: 20 in',
|
855
|
+
required: false,
|
856
|
+
type: 'macro-input',
|
857
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['cm', 'in'])),
|
858
|
+
defaultValue: '',
|
859
|
+
rules: { sections: [] },
|
860
|
+
},
|
861
|
+
{
|
862
|
+
attribute: 'shipping_width',
|
863
|
+
label: 'Shipping width',
|
864
|
+
description:
|
865
|
+
'The width of the product used to calculate the shipping cost by dimensional weight. Required for carrier-calculated rates in your account shipping settings. Supported values: 0-3000. Syntax: Number + unit. Supported units: cm, in. Example: 20 in',
|
866
|
+
required: false,
|
867
|
+
type: 'macro-input',
|
868
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['cm', 'in'])),
|
869
|
+
defaultValue: '',
|
870
|
+
rules: { sections: [] },
|
871
|
+
},
|
872
|
+
{
|
873
|
+
attribute: 'shipping_height',
|
874
|
+
label: 'Shipping height',
|
875
|
+
description:
|
876
|
+
'The height of the product used to calculate the shipping cost by dimensional weight. Required for carrier-calculated rates in your account shipping settings. Supported values: 0-3000. Syntax: Number + unit. Supported units: cm, in. Example: 20 in',
|
877
|
+
required: false,
|
878
|
+
type: 'macro-input',
|
879
|
+
validator: (v: string | number) => validateIfNoMacro(v, measureUnitsSchema(['cm', 'in'])),
|
880
|
+
defaultValue: '',
|
881
|
+
rules: { sections: [] },
|
882
|
+
},
|
883
|
+
{
|
884
|
+
attribute: 'ships_from_country',
|
885
|
+
label: 'Ships from country',
|
886
|
+
description:
|
887
|
+
'A setting that allows you to provide the country from which your product will typically ship. 2 characters. Must be an ISO_3166-1_alpha-2 country code. Example: DE',
|
888
|
+
required: false,
|
889
|
+
type: 'select',
|
890
|
+
choices: [SOURCE_LANGUAGE],
|
891
|
+
defaultValue: '',
|
892
|
+
rules: { sections: [] },
|
893
|
+
},
|
894
|
+
{
|
895
|
+
attribute: 'max_handling_time',
|
896
|
+
label: 'Max handling time',
|
897
|
+
description:
|
898
|
+
'The longest amount of time between when an order is placed for a product and when the product ships. Submit the number of business days. For products ready to be shipped the same day, submit 0. Integer, greater than or equal to 0. Example: 3',
|
899
|
+
required: false,
|
900
|
+
type: 'macro-input',
|
901
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.coerce.number().min(0).int()),
|
902
|
+
defaultValue: '',
|
903
|
+
rules: { sections: [] },
|
904
|
+
},
|
905
|
+
{
|
906
|
+
attribute: 'transit_time_label',
|
907
|
+
label: 'Transit time label',
|
908
|
+
description:
|
909
|
+
'Label that you assign to a product to help assign different transit times in Merchant Center account settings. Max 100 characters. Example: From Seattle',
|
910
|
+
required: false,
|
911
|
+
type: 'macro-input',
|
912
|
+
defaultValue: '',
|
913
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
|
914
|
+
rules: { sections: [] },
|
915
|
+
},
|
916
|
+
{
|
917
|
+
attribute: 'min_handling_time',
|
918
|
+
label: 'Min handling time',
|
919
|
+
description:
|
920
|
+
'The shortest amount of time between when an order is placed for a product and when the product ships. Submit the number of business days. For products ready to be shipped the same day, submit 0. Integer, greater than or equal to 0. Example: 1',
|
921
|
+
required: false,
|
922
|
+
type: 'macro-input',
|
923
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.coerce.number().min(0).int()),
|
924
|
+
defaultValue: '',
|
925
|
+
rules: { sections: [] },
|
926
|
+
},
|
927
|
+
{
|
928
|
+
attribute: 'free_shipping_threshold',
|
929
|
+
label: 'Free shipping threshold',
|
930
|
+
description:
|
931
|
+
'Order cost above which shipping is free. This attribute uses the following sub-attributes: Country (Required) ISO 3166 country code. Price threshold (Required) Order cost above which shipping is free. Example: US:16.00 USD',
|
932
|
+
required: false,
|
933
|
+
type: 'macro-input',
|
934
|
+
defaultValue: '',
|
935
|
+
rules: { sections: [] },
|
936
|
+
},
|
937
|
+
{
|
938
|
+
attribute: 'tax',
|
939
|
+
label: 'Tax',
|
940
|
+
description:
|
941
|
+
'Your product’s sales tax rate in percent. Required (Available for the US only). This attribute uses 4 sub-attributes: Country (optional) ISO 3166 country code. Region or postal code or location ID (optional). Rate (required) Tax rate as a percentage. Shipping tax (optional) Specify if you charge tax on shipping, supported values: yes, no. Example: US:CA:5.00:y',
|
942
|
+
required: false,
|
943
|
+
type: 'macro-input',
|
944
|
+
defaultValue: '',
|
945
|
+
// TODO: add validator to check if US
|
946
|
+
rules: { sections: [] },
|
947
|
+
},
|
948
|
+
{
|
949
|
+
attribute: 'tax_category',
|
950
|
+
label: 'Tax category',
|
951
|
+
description:
|
952
|
+
'A category that classifies your product by specific tax rules. Recommended for custom tax rates at the account level. Max 100 characters. Example: Apparel',
|
953
|
+
required: false,
|
954
|
+
type: 'macro-input',
|
955
|
+
defaultValue: '',
|
956
|
+
validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
|
957
|
+
rules: { sections: [] },
|
958
|
+
},
|
959
|
+
],
|
960
|
+
};
|