@biggora/claude-plugins 1.2.0 → 1.3.0
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/README.md +13 -4
- package/package.json +1 -1
- package/registry/registry.json +334 -244
- package/specs/coding.md +30 -0
- package/specs/pod.md +2 -0
- package/src/commands/skills/add.js +63 -7
- package/src/commands/skills/list.js +23 -52
- package/src/commands/skills/remove.js +26 -27
- package/src/commands/skills/resolve.js +155 -0
- package/src/commands/skills/update.js +58 -74
- package/src/skills/captcha/README.md +221 -0
- package/src/skills/captcha/SKILL.md +355 -0
- package/src/skills/captcha/references/captcha-types.md +254 -0
- package/src/skills/captcha/references/services.md +172 -0
- package/src/skills/captcha/references/stealth.md +238 -0
- package/src/skills/captcha/scripts/solve_captcha.py +323 -0
- package/src/skills/captcha/scripts/solve_image_grid.py +350 -0
- package/src/skills/google-merchant-api/SKILL.md +581 -0
- package/src/skills/google-merchant-api/references/accounts.md +247 -0
- package/src/skills/google-merchant-api/references/content-api-legacy.md +216 -0
- package/src/skills/google-merchant-api/references/datasources.md +233 -0
- package/src/skills/google-merchant-api/references/inventories.md +201 -0
- package/src/skills/google-merchant-api/references/migration.md +267 -0
- package/src/skills/google-merchant-api/references/products.md +316 -0
- package/src/skills/google-merchant-api/references/promotions.md +201 -0
- package/src/skills/google-merchant-api/references/reports.md +240 -0
- package/src/skills/lv-aggregators-api/SKILL.md +113 -0
- package/src/skills/lv-aggregators-api/references/integration-guide.md +368 -0
- package/src/skills/lv-aggregators-api/references/kurpirkt.md +103 -0
- package/src/skills/lv-aggregators-api/references/salidzini.md +122 -0
- package/src/skills/nest-best-practices/SKILL.md +251 -0
- package/src/skills/nest-best-practices/references/best-practices-request-lifecycle.md +158 -0
- package/src/skills/nest-best-practices/references/cli-monorepo.md +106 -0
- package/src/skills/nest-best-practices/references/cli-overview.md +157 -0
- package/src/skills/nest-best-practices/references/core-controllers.md +165 -0
- package/src/skills/nest-best-practices/references/core-dependency-injection.md +179 -0
- package/src/skills/nest-best-practices/references/core-middleware.md +139 -0
- package/src/skills/nest-best-practices/references/core-modules.md +138 -0
- package/src/skills/nest-best-practices/references/core-providers.md +188 -0
- package/src/skills/nest-best-practices/references/faq-raw-body-hybrid.md +122 -0
- package/src/skills/nest-best-practices/references/fundamentals-circular-dependency.md +89 -0
- package/src/skills/nest-best-practices/references/fundamentals-custom-decorators.md +107 -0
- package/src/skills/nest-best-practices/references/fundamentals-dynamic-modules.md +125 -0
- package/src/skills/nest-best-practices/references/fundamentals-exception-filters.md +202 -0
- package/src/skills/nest-best-practices/references/fundamentals-execution-context.md +107 -0
- package/src/skills/nest-best-practices/references/fundamentals-guards.md +136 -0
- package/src/skills/nest-best-practices/references/fundamentals-interceptors.md +187 -0
- package/src/skills/nest-best-practices/references/fundamentals-lazy-loading.md +89 -0
- package/src/skills/nest-best-practices/references/fundamentals-lifecycle-events.md +87 -0
- package/src/skills/nest-best-practices/references/fundamentals-module-reference.md +107 -0
- package/src/skills/nest-best-practices/references/fundamentals-pipes.md +197 -0
- package/src/skills/nest-best-practices/references/fundamentals-provider-scopes.md +92 -0
- package/src/skills/nest-best-practices/references/fundamentals-testing.md +142 -0
- package/src/skills/nest-best-practices/references/graphql-overview.md +233 -0
- package/src/skills/nest-best-practices/references/graphql-resolvers-mutations.md +199 -0
- package/src/skills/nest-best-practices/references/graphql-scalars-unions-enums.md +180 -0
- package/src/skills/nest-best-practices/references/graphql-subscriptions.md +228 -0
- package/src/skills/nest-best-practices/references/microservices-grpc.md +175 -0
- package/src/skills/nest-best-practices/references/microservices-overview.md +221 -0
- package/src/skills/nest-best-practices/references/microservices-transports.md +119 -0
- package/src/skills/nest-best-practices/references/openapi-swagger.md +207 -0
- package/src/skills/nest-best-practices/references/recipes-authentication.md +97 -0
- package/src/skills/nest-best-practices/references/recipes-cqrs.md +176 -0
- package/src/skills/nest-best-practices/references/recipes-crud-generator.md +87 -0
- package/src/skills/nest-best-practices/references/recipes-documentation.md +93 -0
- package/src/skills/nest-best-practices/references/recipes-mongoose.md +153 -0
- package/src/skills/nest-best-practices/references/recipes-prisma.md +98 -0
- package/src/skills/nest-best-practices/references/recipes-terminus.md +148 -0
- package/src/skills/nest-best-practices/references/recipes-typeorm.md +122 -0
- package/src/skills/nest-best-practices/references/security-authorization.md +196 -0
- package/src/skills/nest-best-practices/references/security-cors-helmet-rate-limiting.md +204 -0
- package/src/skills/nest-best-practices/references/security-encryption-hashing.md +93 -0
- package/src/skills/nest-best-practices/references/techniques-caching.md +142 -0
- package/src/skills/nest-best-practices/references/techniques-compression-streaming-sse.md +194 -0
- package/src/skills/nest-best-practices/references/techniques-configuration.md +132 -0
- package/src/skills/nest-best-practices/references/techniques-database.md +153 -0
- package/src/skills/nest-best-practices/references/techniques-events.md +163 -0
- package/src/skills/nest-best-practices/references/techniques-fastify.md +137 -0
- package/src/skills/nest-best-practices/references/techniques-file-upload.md +140 -0
- package/src/skills/nest-best-practices/references/techniques-http-module.md +176 -0
- package/src/skills/nest-best-practices/references/techniques-logging.md +146 -0
- package/src/skills/nest-best-practices/references/techniques-mvc-serve-static.md +132 -0
- package/src/skills/nest-best-practices/references/techniques-queues.md +162 -0
- package/src/skills/nest-best-practices/references/techniques-serialization.md +158 -0
- package/src/skills/nest-best-practices/references/techniques-sessions-cookies.md +167 -0
- package/src/skills/nest-best-practices/references/techniques-task-scheduling.md +166 -0
- package/src/skills/nest-best-practices/references/techniques-validation.md +126 -0
- package/src/skills/nest-best-practices/references/techniques-versioning.md +153 -0
- package/src/skills/nest-best-practices/references/websockets-advanced.md +96 -0
- package/src/skills/nest-best-practices/references/websockets-gateways.md +215 -0
- package/src/skills/tailwindcss-best-practices/SKILL.md +180 -0
- package/src/skills/tailwindcss-best-practices/references/best-practices-utility-patterns.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/core-installation.md +109 -0
- package/src/skills/tailwindcss-best-practices/references/core-preflight.md +200 -0
- package/src/skills/tailwindcss-best-practices/references/core-responsive.md +163 -0
- package/src/skills/tailwindcss-best-practices/references/core-source-detection.md +114 -0
- package/src/skills/tailwindcss-best-practices/references/core-theme.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/core-utility-classes.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/core-variants.md +204 -0
- package/src/skills/tailwindcss-best-practices/references/effects-form-controls.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/effects-mask.md +91 -0
- package/src/skills/tailwindcss-best-practices/references/effects-scroll-snap.md +59 -0
- package/src/skills/tailwindcss-best-practices/references/effects-text-shadow.md +78 -0
- package/src/skills/tailwindcss-best-practices/references/effects-transition-animation.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/effects-visibility-interactivity.md +82 -0
- package/src/skills/tailwindcss-best-practices/references/features-content-detection.md +175 -0
- package/src/skills/tailwindcss-best-practices/references/features-custom-styles.md +203 -0
- package/src/skills/tailwindcss-best-practices/references/features-dark-mode.md +137 -0
- package/src/skills/tailwindcss-best-practices/references/features-functions-directives.md +241 -0
- package/src/skills/tailwindcss-best-practices/references/features-upgrade.md +160 -0
- package/src/skills/tailwindcss-best-practices/references/layout-aspect-ratio.md +39 -0
- package/src/skills/tailwindcss-best-practices/references/layout-columns.md +80 -0
- package/src/skills/tailwindcss-best-practices/references/layout-display.md +110 -0
- package/src/skills/tailwindcss-best-practices/references/layout-flexbox.md +112 -0
- package/src/skills/tailwindcss-best-practices/references/layout-grid.md +87 -0
- package/src/skills/tailwindcss-best-practices/references/layout-height.md +97 -0
- package/src/skills/tailwindcss-best-practices/references/layout-inset.md +103 -0
- package/src/skills/tailwindcss-best-practices/references/layout-logical-properties.md +92 -0
- package/src/skills/tailwindcss-best-practices/references/layout-margin.md +126 -0
- package/src/skills/tailwindcss-best-practices/references/layout-min-max-sizing.md +63 -0
- package/src/skills/tailwindcss-best-practices/references/layout-object-fit-position.md +64 -0
- package/src/skills/tailwindcss-best-practices/references/layout-overflow.md +57 -0
- package/src/skills/tailwindcss-best-practices/references/layout-padding.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/layout-position.md +85 -0
- package/src/skills/tailwindcss-best-practices/references/layout-tables.md +67 -0
- package/src/skills/tailwindcss-best-practices/references/layout-width.md +102 -0
- package/src/skills/tailwindcss-best-practices/references/transform-base.md +68 -0
- package/src/skills/tailwindcss-best-practices/references/transform-rotate.md +70 -0
- package/src/skills/tailwindcss-best-practices/references/transform-scale.md +83 -0
- package/src/skills/tailwindcss-best-practices/references/transform-skew.md +62 -0
- package/src/skills/tailwindcss-best-practices/references/transform-translate.md +77 -0
- package/src/skills/tailwindcss-best-practices/references/typography-font-text.md +142 -0
- package/src/skills/tailwindcss-best-practices/references/typography-list-style.md +65 -0
- package/src/skills/tailwindcss-best-practices/references/typography-text-align.md +60 -0
- package/src/skills/tailwindcss-best-practices/references/visual-background.md +76 -0
- package/src/skills/tailwindcss-best-practices/references/visual-border.md +108 -0
- package/src/skills/tailwindcss-best-practices/references/visual-effects.md +111 -0
- package/src/skills/tailwindcss-best-practices/references/visual-svg.md +82 -0
- package/src/skills/test-mobile-app/SKILL.md +11 -6
- package/src/skills/test-mobile-app/scripts/analyze_apk.py +15 -4
- package/src/skills/test-mobile-app/scripts/check_environment.py +5 -5
- package/src/skills/test-mobile-app/scripts/run_tests.py +1 -1
- package/src/skills/test-web-ui/SKILL.md +264 -84
- package/src/skills/test-web-ui/scripts/discover.py +25 -12
- package/src/skills/test-web-ui/scripts/run_tests.py +3 -2
- package/src/skills/typescript-expert/SKILL.md +145 -0
- package/src/skills/typescript-expert/commands/typescript-fix.md +65 -0
- package/src/skills/typescript-expert/references/advanced-conditional-types.md +190 -0
- package/src/skills/typescript-expert/references/advanced-decorators.md +243 -0
- package/src/skills/typescript-expert/references/advanced-mapped-types.md +223 -0
- package/src/skills/typescript-expert/references/advanced-template-literals.md +209 -0
- package/src/skills/typescript-expert/references/advanced-type-guards.md +308 -0
- package/src/skills/typescript-expert/references/best-practices-patterns.md +313 -0
- package/src/skills/typescript-expert/references/best-practices-performance.md +185 -0
- package/src/skills/typescript-expert/references/best-practices-tsconfig.md +242 -0
- package/src/skills/typescript-expert/references/core-generics.md +246 -0
- package/src/skills/typescript-expert/references/core-interfaces-types.md +231 -0
- package/src/skills/typescript-expert/references/core-type-system.md +261 -0
- package/src/skills/typescript-expert/references/core-utility-types.md +235 -0
- package/src/skills/typescript-expert/references/features-ts5x.md +370 -0
- package/src/skills/vite-best-practices/SKILL.md +115 -0
- package/src/skills/vite-best-practices/references/build-and-ssr.md +255 -0
- package/src/skills/vite-best-practices/references/core-config.md +231 -0
- package/src/skills/vite-best-practices/references/core-features.md +222 -0
- package/src/skills/vite-best-practices/references/core-plugin-api.md +294 -0
- package/src/skills/vite-best-practices/references/environment-api.md +108 -0
- package/src/skills/vite-best-practices/references/rolldown-migration.md +242 -0
- package/codex-cli-workspace/iteration-1/benchmark.json +0 -122
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/outputs/response.md +0 -163
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/grading.json +0 -58
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/outputs/response.md +0 -151
- package/codex-cli-workspace/iteration-1/eval-1-ci-integration/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -86
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -58
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
- package/codex-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/eval_metadata.json +0 -13
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/grading.json +0 -52
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/outputs/response.md +0 -130
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/with_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/grading.json +0 -64
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/outputs/response.md +0 -209
- package/codex-cli-workspace/iteration-1/eval-3-profiles-troubleshooting/without_skill/timing.json +0 -5
- package/codex-cli-workspace/iteration-1/review.html +0 -1325
- package/gemini-cli-workspace/iteration-1/benchmark.json +0 -86
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/outputs/response.md +0 -401
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/outputs/response.md +0 -405
- package/gemini-cli-workspace/iteration-1/eval-1-cicd-setup/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -212
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -427
- package/gemini-cli-workspace/iteration-1/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/eval_metadata.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -171
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -199
- package/gemini-cli-workspace/iteration-1/eval-3-custom-slash-command/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-1/review.html +0 -1325
- package/gemini-cli-workspace/iteration-2/benchmark.json +0 -173
- package/gemini-cli-workspace/iteration-2/benchmark.md +0 -28
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/outputs/response.md +0 -195
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/outputs/response.md +0 -377
- package/gemini-cli-workspace/iteration-2/eval-1-cicd-setup/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/eval_metadata.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/outputs/response.md +0 -127
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/grading.json +0 -37
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/outputs/response.md +0 -164
- package/gemini-cli-workspace/iteration-2/eval-2-mcp-server-config/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/eval_metadata.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/outputs/response.md +0 -91
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/with_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/grading.json +0 -32
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/outputs/response.md +0 -112
- package/gemini-cli-workspace/iteration-2/eval-3-custom-slash-command/without_skill/timing.json +0 -5
- package/gemini-cli-workspace/iteration-2/eval-viewer.html +0 -1325
- package/screen-recording-workspace/evals.json +0 -41
- package/screen-recording-workspace/iteration-1/benchmark.json +0 -102
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/outputs/demo.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/outputs/demo.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-0-fullscreen/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/outputs/region_capture.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/outputs/region_capture.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-1-region-audio/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/eval_metadata.json +0 -31
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/outputs/fallback_recording.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/with_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/grading.json +0 -11
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/fallback_recording.mp4 +0 -0
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/outputs/record_screen.py +0 -67
- package/screen-recording-workspace/iteration-1/eval-2-python-fallback/without_skill/timing.json +0 -5
- package/screen-recording-workspace/iteration-1/review.html +0 -1325
- package/src/skills/codex-cli/evals/evals.json +0 -47
- package/src/skills/gemini-cli/evals/evals.json +0 -46
- package/src/skills/tm-search/evals/evals.json +0 -23
|
@@ -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
|
+
```
|