@biggora/claude-plugins 1.1.1 → 1.2.2

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.
Files changed (104) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/README.md +24 -17
  3. package/package.json +1 -1
  4. package/registry/registry.json +319 -244
  5. package/specs/coding.md +24 -0
  6. package/specs/pod.md +2 -0
  7. package/src/skills/captcha/README.md +221 -0
  8. package/src/skills/captcha/SKILL.md +355 -0
  9. package/src/skills/captcha/references/captcha-types.md +254 -0
  10. package/src/skills/captcha/references/services.md +172 -0
  11. package/src/skills/captcha/references/stealth.md +238 -0
  12. package/src/skills/captcha/scripts/solve_captcha.py +323 -0
  13. package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
  14. package/src/skills/codex-cli/SKILL.md +21 -11
  15. package/src/skills/gemini-cli/SKILL.md +27 -13
  16. package/src/skills/gemini-cli/references/commands.md +21 -14
  17. package/src/skills/gemini-cli/references/configuration.md +23 -18
  18. package/src/skills/gemini-cli/references/headless-and-scripting.md +7 -17
  19. package/src/skills/gemini-cli/references/mcp-and-extensions.md +12 -6
  20. package/src/skills/google-merchant-api/SKILL.md +581 -0
  21. package/src/skills/google-merchant-api/references/accounts.md +247 -0
  22. package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
  23. package/src/skills/google-merchant-api/references/datasources.md +233 -0
  24. package/src/skills/google-merchant-api/references/inventories.md +201 -0
  25. package/src/skills/google-merchant-api/references/migration.md +267 -0
  26. package/src/skills/google-merchant-api/references/products.md +316 -0
  27. package/src/skills/google-merchant-api/references/promotions.md +201 -0
  28. package/src/skills/google-merchant-api/references/reports.md +240 -0
  29. package/src/skills/lv-aggregators-api/SKILL.md +113 -0
  30. package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
  31. package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
  32. package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
  33. package/src/skills/notebook-lm/SKILL.md +1 -1
  34. package/src/skills/screen-recording/SKILL.md +243 -213
  35. package/src/skills/screen-recording/references/design-patterns.md +4 -2
  36. package/src/skills/screen-recording/references/ffmpeg-recording.md +473 -0
  37. package/src/skills/screen-recording/references/{approach1-programmatic.md → programmatic-generation.md} +45 -22
  38. package/src/skills/screen-recording/references/python-fallback.md +222 -0
  39. package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
  40. package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
  41. package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
  42. package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
  43. package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
  44. package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
  45. package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
  46. package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
  47. package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
  48. package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
  49. package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
  50. package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
  51. package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
  52. package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
  53. package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
  54. package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
  55. package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
  56. package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
  57. package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
  58. package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
  59. package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
  60. package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
  61. package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
  62. package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
  63. package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
  64. package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
  65. package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
  66. package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
  67. package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
  68. package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
  69. package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
  70. package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
  71. package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
  72. package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
  73. package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
  74. package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
  75. package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
  76. package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
  77. package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
  78. package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
  79. package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
  80. package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
  81. package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
  82. package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
  83. package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
  84. package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
  85. package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
  86. package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
  87. package/src/skills/test-mobile-app/SKILL.md +11 -6
  88. package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
  89. package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
  90. package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
  91. package/src/skills/test-web-ui/SKILL.md +264 -84
  92. package/src/skills/test-web-ui/scripts/discover.py +25 -12
  93. package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
  94. package/src/skills/tm-search/SKILL.md +242 -106
  95. package/src/skills/tm-search/references/scraping-fallback.md +60 -95
  96. package/src/skills/tm-search/scripts/tm_search.py +453 -375
  97. package/src/skills/vite-best-practices/SKILL.md +115 -0
  98. package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
  99. package/src/skills/vite-best-practices/references/core-config.md +231 -0
  100. package/src/skills/vite-best-practices/references/core-features.md +222 -0
  101. package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
  102. package/src/skills/vite-best-practices/references/environment-api.md +108 -0
  103. package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
  104. package/src/skills/screen-recording/references/approach2-xvfb.md +0 -232
@@ -0,0 +1,316 @@
1
+ # Products Sub-API Reference
2
+
3
+ Base: `https://merchantapi.googleapis.com/products/v1`
4
+
5
+ ## Resources
6
+
7
+ ### ProductInput (Write)
8
+
9
+ Used to submit product data. Changes take several minutes to process.
10
+
11
+ **Endpoints:**
12
+ - `POST /accounts/{account}/productInputs:insert` - Insert product
13
+ - `PATCH /accounts/{account}/productInputs/{productInput}` - Update product
14
+ - `DELETE /accounts/{account}/productInputs/{productInput}` - Delete product
15
+
16
+ All write operations require `dataSource` query parameter:
17
+ ```
18
+ ?dataSource=accounts/{account}/dataSources/{dataSourceId}
19
+ ```
20
+
21
+ **ProductInput fields:**
22
+
23
+ | Field | Type | Required | Notes |
24
+ |-------|------|----------|-------|
25
+ | `name` | string | Output | `accounts/{account}/productInputs/{id}` |
26
+ | `product` | string | Output | Name of processed product |
27
+ | `offerId` | string | Required, immutable | Your unique SKU/ID |
28
+ | `contentLanguage` | string | Required, immutable | ISO 639-1 (e.g., `en`) |
29
+ | `feedLabel` | string | Required, immutable | Max 20 chars, A-Z 0-9 hyphen underscore |
30
+ | `legacyLocal` | boolean | Optional, immutable | Set true for local-only products |
31
+ | `productAttributes` | object | Optional | All product attributes (see below) |
32
+ | `customAttributes[]` | array | Optional | Max 2500 attrs, 102.4KB total |
33
+ | `versionNumber` | int64 | Optional, immutable | Prevents out-of-order updates |
34
+
35
+ ### Product (Read-only)
36
+
37
+ The processed product with status and validation results.
38
+
39
+ **Endpoints:**
40
+ - `GET /accounts/{account}/products/{product}` - Get single product
41
+ - `GET /accounts/{account}/products` - List products (paginated)
42
+
43
+ **Product fields include everything from ProductInput plus:**
44
+
45
+ | Field | Type | Description |
46
+ |-------|------|-------------|
47
+ | `productStatus` | object | Processing status, destination statuses, item-level issues |
48
+ | `productStatus.destinationStatuses[]` | array | Per-destination approval status |
49
+ | `productStatus.itemLevelIssues[]` | array | Validation warnings/errors |
50
+
51
+ ## ProductAttributes
52
+
53
+ All typed product attributes live under `productAttributes`:
54
+
55
+ ### Identity
56
+
57
+ | Field | Type | Description |
58
+ |-------|------|-------------|
59
+ | `title` | string | Product name (max 150 chars) |
60
+ | `description` | string | Product description (max 5000 chars) |
61
+ | `link` | string | Landing page URL |
62
+ | `canonicalLink` | string | Canonical URL |
63
+ | `imageLink` | string | Primary image (min 100x100px) |
64
+ | `additionalImageLinks[]` | string[] | Up to 10 additional images |
65
+ | `brand` | string | Brand name |
66
+ | `gtin` | string | Global Trade Item Number |
67
+ | `mpn` | string | Manufacturer Part Number |
68
+ | `identifierExists` | boolean | False if no GTIN/MPN/brand |
69
+
70
+ ### Classification
71
+
72
+ | Field | Type | Description |
73
+ |-------|------|-------------|
74
+ | `googleProductCategory` | string | Google taxonomy ID or path |
75
+ | `productTypes[]` | string[] | Your own category hierarchy |
76
+ | `channel` | enum | `ONLINE` or `LOCAL` |
77
+ | `condition` | enum | `new`, `refurbished`, `used` |
78
+ | `adult` | boolean | Adult content flag |
79
+ | `ageGroup` | enum | `newborn`, `infant`, `toddler`, `kids`, `adult` |
80
+ | `gender` | enum | `male`, `female`, `unisex` |
81
+
82
+ ### Pricing
83
+
84
+ | Field | Type | Description |
85
+ |-------|------|-------------|
86
+ | `price` | Price | Regular price |
87
+ | `salePrice` | Price | Sale price |
88
+ | `salePriceEffectiveDate` | Interval | When sale price applies |
89
+ | `costOfGoodsSold` | Price | COGS for reporting |
90
+ | `autoPricingMinPrice` | Price | Minimum for auto-pricing |
91
+ | `installment` | Installment | Monthly payment info |
92
+ | `subscriptionCost` | SubscriptionCost | Recurring charge |
93
+ | `loyaltyPrograms[]` | LoyaltyProgram[] | Loyalty pricing |
94
+
95
+ **Price object (Merchant API v1):**
96
+ ```json
97
+ {
98
+ "amountMicros": "79990000",
99
+ "currencyCode": "USD"
100
+ }
101
+ ```
102
+ 1 unit = 1,000,000 micros. $79.99 = `79990000`.
103
+
104
+ **Installment object:**
105
+ ```json
106
+ {
107
+ "months": "12",
108
+ "amount": { "amountMicros": "6660000", "currencyCode": "USD" },
109
+ "downpayment": { "amountMicros": "0", "currencyCode": "USD" },
110
+ "creditType": "finance"
111
+ }
112
+ ```
113
+
114
+ ### Availability & Inventory
115
+
116
+ | Field | Type | Values |
117
+ |-------|------|--------|
118
+ | `availability` | enum | `in_stock`, `out_of_stock`, `preorder`, `backorder` |
119
+ | `availabilityDate` | Timestamp | When preorder/backorder becomes available |
120
+ | `expirationDate` | Timestamp | Auto-deletion date (max 30 days) |
121
+ | `sellOnGoogleQuantity` | int64 | Buy on Google quantity |
122
+
123
+ ### Shipping & Dimensions
124
+
125
+ | Field | Type | Description |
126
+ |-------|------|-------------|
127
+ | `shipping[]` | Shipping[] | Per-country/region shipping overrides |
128
+ | `shippingWeight` | Weight | Package weight |
129
+ | `shippingLength` | Dimension | Package length |
130
+ | `shippingWidth` | Dimension | Package width |
131
+ | `shippingHeight` | Dimension | Package height |
132
+ | `shippingLabel` | string | Maps to account-level shipping settings |
133
+ | `transitTimeLabel` | string | Maps to transit time tables |
134
+ | `freeShippingThreshold[]` | FreeShippingThreshold[] | Free shipping minimums |
135
+ | `minHandlingTime` | int64 | Business days |
136
+ | `maxHandlingTime` | int64 | Business days |
137
+
138
+ **Shipping object:**
139
+ ```json
140
+ {
141
+ "price": { "amountMicros": "5990000", "currencyCode": "USD" },
142
+ "country": "US",
143
+ "region": "CA",
144
+ "service": "Standard",
145
+ "minHandlingTime": "0",
146
+ "maxHandlingTime": "1",
147
+ "minTransitTime": "3",
148
+ "maxTransitTime": "7"
149
+ }
150
+ ```
151
+
152
+ ### Physical Attributes
153
+
154
+ | Field | Type | Description |
155
+ |-------|------|-------------|
156
+ | `color` | string | Product color |
157
+ | `material` | string | Material composition |
158
+ | `pattern` | string | Design pattern |
159
+ | `sizes[]` | string[] | Available sizes |
160
+ | `sizeSystem` | enum | Sizing system (US, EU, UK, etc.) |
161
+ | `sizeType` | enum | `regular`, `petite`, `plus`, `big_and_tall`, `maternity` |
162
+ | `productHeight` | Dimension | Product height |
163
+ | `productLength` | Dimension | Product length |
164
+ | `productWidth` | Dimension | Product width |
165
+ | `productWeight` | Weight | Product weight |
166
+ | `itemGroupId` | string | Groups variants together |
167
+ | `multipack` | int64 | Number of identical items in pack |
168
+ | `isBundle` | boolean | Merchant-defined bundle |
169
+
170
+ ### Destinations & Ads
171
+
172
+ | Field | Type | Description |
173
+ |-------|------|-------------|
174
+ | `includedDestinations[]` | string[] | Opt-in destinations |
175
+ | `excludedDestinations[]` | string[] | Opt-out destinations |
176
+ | `adsRedirect` | string | Ads-specific redirect URL |
177
+ | `adsLabels[]` | string[] | Campaign grouping labels |
178
+ | `customLabel0` - `customLabel4` | string | Shopping campaign labels |
179
+ | `promotionIds[]` | string[] | Associated promotion IDs |
180
+ | `pause` | string | Set to `"ads"` to pause |
181
+
182
+ ### Structured Content
183
+
184
+ ```json
185
+ {
186
+ "structuredTitle": {
187
+ "content": "AI-optimized product title",
188
+ "digitalSourceType": "trained_algorithmic_media"
189
+ },
190
+ "structuredDescription": {
191
+ "content": "AI-optimized description",
192
+ "digitalSourceType": "trained_algorithmic_media"
193
+ }
194
+ }
195
+ ```
196
+
197
+ ### Tax (Content API only, auto-calculated in Merchant API)
198
+
199
+ ```json
200
+ {
201
+ "taxes": [
202
+ {
203
+ "rate": 8.25,
204
+ "country": "US",
205
+ "region": "TX",
206
+ "taxShip": true
207
+ }
208
+ ]
209
+ }
210
+ ```
211
+
212
+ ### Certifications
213
+
214
+ ```json
215
+ {
216
+ "certifications": [
217
+ {
218
+ "certificationAuthority": "European_Commission",
219
+ "certificationName": "EPREL",
220
+ "certificationCode": "123456",
221
+ "certificationValue": "A+"
222
+ }
223
+ ]
224
+ }
225
+ ```
226
+
227
+ ### Product Details & Highlights
228
+
229
+ ```json
230
+ {
231
+ "productDetails": [
232
+ {
233
+ "sectionName": "Technical Specs",
234
+ "attributeName": "Battery Life",
235
+ "attributeValue": "30 hours"
236
+ }
237
+ ],
238
+ "productHighlights": [
239
+ "Active noise cancellation",
240
+ "30-hour battery life",
241
+ "Bluetooth 5.3"
242
+ ]
243
+ }
244
+ ```
245
+
246
+ ## Insert Example (Full)
247
+
248
+ ```javascript
249
+ const productInput = {
250
+ offerId: 'HEADPHONE-PRO-001',
251
+ contentLanguage: 'en',
252
+ feedLabel: 'US',
253
+ productAttributes: {
254
+ title: 'ProAudio X500 Wireless Headphones',
255
+ description: 'Premium noise-cancelling headphones with 30hr battery, Bluetooth 5.3, and Hi-Res audio support.',
256
+ link: 'https://store.example.com/proaudio-x500',
257
+ imageLink: 'https://cdn.example.com/images/x500-main.jpg',
258
+ additionalImageLinks: [
259
+ 'https://cdn.example.com/images/x500-side.jpg',
260
+ 'https://cdn.example.com/images/x500-case.jpg',
261
+ ],
262
+ availability: 'in_stock',
263
+ condition: 'new',
264
+ price: { amountMicros: '149990000', currencyCode: 'USD' },
265
+ salePrice: { amountMicros: '119990000', currencyCode: 'USD' },
266
+ brand: 'ProAudio',
267
+ gtin: '0123456789012',
268
+ googleProductCategory: 'Electronics > Audio > Headphones',
269
+ productTypes: ['Electronics', 'Audio', 'Wireless Headphones'],
270
+ channel: 'ONLINE',
271
+ color: 'Midnight Black',
272
+ sizes: ['One Size'],
273
+ itemGroupId: 'X500-GROUP',
274
+ shipping: [
275
+ {
276
+ price: { amountMicros: '0', currencyCode: 'USD' },
277
+ country: 'US',
278
+ service: 'Free Standard',
279
+ minTransitTime: '3',
280
+ maxTransitTime: '7',
281
+ },
282
+ ],
283
+ productHighlights: [
284
+ 'Active noise cancellation with transparency mode',
285
+ '30-hour battery, 5-min quick charge for 3 hours',
286
+ 'Bluetooth 5.3 with multipoint connection',
287
+ ],
288
+ customLabel0: 'electronics-sale',
289
+ customLabel1: 'high-margin',
290
+ },
291
+ customAttributes: [
292
+ { name: 'warranty_years', value: '2' },
293
+ { name: 'driver_size_mm', value: '40' },
294
+ ],
295
+ };
296
+ ```
297
+
298
+ ## Pagination
299
+
300
+ List responses include `nextPageToken`:
301
+
302
+ ```javascript
303
+ let pageToken = '';
304
+ const allProducts = [];
305
+
306
+ do {
307
+ const url = new URL(`https://merchantapi.googleapis.com/products/v1/accounts/${MERCHANT_ID}/products`);
308
+ url.searchParams.set('pageSize', '250');
309
+ if (pageToken) url.searchParams.set('pageToken', pageToken);
310
+
311
+ const res = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
312
+ const data = await res.json();
313
+ allProducts.push(...(data.products || []));
314
+ pageToken = data.nextPageToken || '';
315
+ } while (pageToken);
316
+ ```
@@ -0,0 +1,201 @@
1
+ # Promotions Sub-API Reference
2
+
3
+ Base: `https://merchantapi.googleapis.com/promotions/v1`
4
+
5
+ Manage promotional offers that display alongside your product listings on Google Shopping.
6
+
7
+ ## Endpoints
8
+
9
+ | Method | Endpoint | Description |
10
+ |--------|----------|-------------|
11
+ | `POST` | `/accounts/{account}/promotions:insert` | Create promotion |
12
+ | `GET` | `/accounts/{account}/promotions/{promotion}` | Get promotion |
13
+ | `GET` | `/accounts/{account}/promotions` | List promotions |
14
+
15
+ ## Promotion Object
16
+
17
+ ```json
18
+ {
19
+ "name": "accounts/123456/promotions/SUMMER_SALE_2024",
20
+ "promotionId": "SUMMER_SALE_2024",
21
+ "contentLanguage": "en",
22
+ "targetCountry": "US",
23
+ "redemptionChannel": ["ONLINE"],
24
+ "promotionStatus": {
25
+ "destinationStatuses": [
26
+ {
27
+ "reportingContext": "FREE_LISTINGS",
28
+ "status": "APPROVED"
29
+ }
30
+ ],
31
+ "itemLevelIssues": []
32
+ },
33
+ "attributes": {
34
+ "longTitle": "20% off all headphones - Summer Sale",
35
+ "promotionDisplayTimePeriod": {
36
+ "startTime": "2024-06-01T00:00:00Z",
37
+ "endTime": "2024-08-31T23:59:59Z"
38
+ },
39
+ "promotionEffectiveTimePeriod": {
40
+ "startTime": "2024-06-01T00:00:00Z",
41
+ "endTime": "2024-08-31T23:59:59Z"
42
+ },
43
+ "offerType": "GENERIC_CODE",
44
+ "genericRedemptionCode": "SUMMER20",
45
+ "percentOff": 20,
46
+ "couponValueType": "PERCENT_OFF",
47
+ "productApplicability": "SPECIFIC_PRODUCTS",
48
+ "productTypeInclusion": ["Electronics > Audio > Headphones"],
49
+ "storeApplicability": "ALL_STORES"
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Key Fields
55
+
56
+ ### Identification
57
+
58
+ | Field | Type | Required | Description |
59
+ |-------|------|----------|-------------|
60
+ | `promotionId` | string | Required | Unique promotion identifier |
61
+ | `contentLanguage` | string | Required | ISO 639-1 language code |
62
+ | `targetCountry` | string | Required | CLDR territory code |
63
+ | `redemptionChannel[]` | enum[] | Required | `ONLINE`, `IN_STORE`, or both |
64
+
65
+ ### Promotion Attributes
66
+
67
+ | Field | Type | Description |
68
+ |-------|------|-------------|
69
+ | `longTitle` | string | Promotion title (max 60 chars) |
70
+ | `promotionDisplayTimePeriod` | Interval | When promotion is shown to users |
71
+ | `promotionEffectiveTimePeriod` | Interval | When promotion can be redeemed |
72
+ | `offerType` | enum | `NO_CODE`, `GENERIC_CODE`, `UNIQUE_CODE` (see below) |
73
+ | `genericRedemptionCode` | string | Code for `GENERIC_CODE` type |
74
+ | `couponValueType` | enum | Discount type (see below) |
75
+
76
+ ### Discount Types (`couponValueType`)
77
+
78
+ | Value | Required Fields |
79
+ |-------|-----------------|
80
+ | `MONEY_OFF` | `moneyOffAmount` (Price object) |
81
+ | `PERCENT_OFF` | `percentOff` (integer 1-100) |
82
+ | `BUY_M_GET_N_MONEY_OFF` | `minimumPurchaseQuantity`, `getMoney`, `moneyOffAmount` |
83
+ | `BUY_M_GET_N_PERCENT_OFF` | `minimumPurchaseQuantity`, `freeGiftValue`, `percentOff` |
84
+ | `BUY_M_GET_MONEY_OFF` | `minimumPurchaseQuantity`, `moneyOffAmount` |
85
+ | `BUY_M_GET_PERCENT_OFF` | `minimumPurchaseQuantity`, `percentOff` |
86
+ | `FREE_GIFT` | `freeGiftDescription`, `freeGiftValue` (optional), `freeGiftItemId` (optional) |
87
+ | `FREE_SHIPPING_STANDARD` | (no extra fields) |
88
+ | `FREE_SHIPPING_OVERNIGHT` | (no extra fields) |
89
+ | `FREE_SHIPPING_TWO_DAY` | (no extra fields) |
90
+
91
+ ### Offer Types
92
+
93
+ | Value | Description |
94
+ |-------|-------------|
95
+ | `NO_CODE` | Automatic discount, no code needed |
96
+ | `GENERIC_CODE` | Single code shared by all customers |
97
+ | `UNIQUE_CODE` | Unique code per customer (requires file upload) |
98
+
99
+ ### Product Targeting
100
+
101
+ | Field | Type | Description |
102
+ |-------|------|-------------|
103
+ | `productApplicability` | enum | `ALL_PRODUCTS` or `SPECIFIC_PRODUCTS` |
104
+ | `productTypeInclusion[]` | string[] | Product types to include |
105
+ | `productTypeExclusion[]` | string[] | Product types to exclude |
106
+ | `brandInclusion[]` | string[] | Brands to include |
107
+ | `brandExclusion[]` | string[] | Brands to exclude |
108
+ | `itemIdInclusion[]` | string[] | Specific offer IDs to include |
109
+ | `itemIdExclusion[]` | string[] | Specific offer IDs to exclude |
110
+ | `itemGroupIdInclusion[]` | string[] | Item group IDs to include |
111
+ | `itemGroupIdExclusion[]` | string[] | Item group IDs to exclude |
112
+
113
+ ### Minimum Purchase
114
+
115
+ | Field | Type | Description |
116
+ |-------|------|-------------|
117
+ | `minimumPurchaseAmount` | Price | Minimum cart value |
118
+ | `minimumPurchaseQuantity` | int64 | Minimum item count |
119
+ | `limitQuantity` | int64 | Max uses per order |
120
+ | `limitValue` | Price | Max discount per order |
121
+
122
+ ## Examples
123
+
124
+ ### Percentage Discount with Code
125
+
126
+ ```javascript
127
+ const promotion = {
128
+ promotionId: 'SPRING_SALE_2024',
129
+ contentLanguage: 'en',
130
+ targetCountry: 'US',
131
+ redemptionChannel: ['ONLINE'],
132
+ attributes: {
133
+ longTitle: '15% off electronics with code SPRING15',
134
+ promotionDisplayTimePeriod: {
135
+ startTime: '2024-03-01T00:00:00Z',
136
+ endTime: '2024-03-31T23:59:59Z',
137
+ },
138
+ promotionEffectiveTimePeriod: {
139
+ startTime: '2024-03-01T00:00:00Z',
140
+ endTime: '2024-03-31T23:59:59Z',
141
+ },
142
+ offerType: 'GENERIC_CODE',
143
+ genericRedemptionCode: 'SPRING15',
144
+ couponValueType: 'PERCENT_OFF',
145
+ percentOff: 15,
146
+ productApplicability: 'SPECIFIC_PRODUCTS',
147
+ productTypeInclusion: ['Electronics'],
148
+ },
149
+ };
150
+
151
+ await fetch(
152
+ `https://merchantapi.googleapis.com/promotions/v1/accounts/${MERCHANT_ID}/promotions:insert`,
153
+ {
154
+ method: 'POST',
155
+ headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
156
+ body: JSON.stringify(promotion),
157
+ }
158
+ );
159
+ ```
160
+
161
+ ### Free Shipping (No Code)
162
+
163
+ ```javascript
164
+ const promotion = {
165
+ promotionId: 'FREE_SHIP_50',
166
+ contentLanguage: 'en',
167
+ targetCountry: 'US',
168
+ redemptionChannel: ['ONLINE'],
169
+ attributes: {
170
+ longTitle: 'Free standard shipping on orders over $50',
171
+ promotionDisplayTimePeriod: {
172
+ startTime: '2024-01-01T00:00:00Z',
173
+ endTime: '2024-12-31T23:59:59Z',
174
+ },
175
+ promotionEffectiveTimePeriod: {
176
+ startTime: '2024-01-01T00:00:00Z',
177
+ endTime: '2024-12-31T23:59:59Z',
178
+ },
179
+ offerType: 'NO_CODE',
180
+ couponValueType: 'FREE_SHIPPING_STANDARD',
181
+ productApplicability: 'ALL_PRODUCTS',
182
+ minimumPurchaseAmount: { amountMicros: '50000000', currencyCode: 'USD' },
183
+ },
184
+ };
185
+ ```
186
+
187
+ ### Linking Promotions to Products
188
+
189
+ Add the `promotionIds` field to product inputs:
190
+
191
+ ```javascript
192
+ const productInput = {
193
+ offerId: 'SKU-001',
194
+ contentLanguage: 'en',
195
+ feedLabel: 'US',
196
+ productAttributes: {
197
+ // ... other attributes
198
+ promotionIds: ['SPRING_SALE_2024', 'FREE_SHIP_50'],
199
+ },
200
+ };
201
+ ```