SuperAPI AI 工具集

google-merchant-api

编程与开发

查看项目

更新于 10-15 17:26

技能介绍

用途:该技能面向需要以编程方式管理 Google Merchant Center 的场景,支持新版 Merchant API (v1) 与旧版 Content API for Shopping (v2.1)。新版为当前标准,旧版将于 2026 年 8 月 18 日停用,新集成应优先使用 Merchant API。

主要能力:Merchant API 由 14 个独立子 API 组成,包括 Accounts、Products、Inventories、Data Sources、Reports、Promotions、Conversions、Notifications、Reviews、Order Tracking、LFP、Quota、Issue Resolution、Product Studio。可插入与读取商品、更新本地及区域库存、创建数据源、查询报表、管理促销与推送通知等。

使用方式:认证使用 Google OAuth 2.0,可选服务账号(服务端)或 OAuth 客户端(用户交互),所需 scope 为 https://www.googleapis.com/auth/content。基础 URL 为 https://merchantapi.googleapis.com,URL 结构为 /{SUB_API}/{VERSION}/{RESOURCE_NAME}:{METHOD}。资源采用层级命名,商品标识格式为 {contentLanguage}~{feedLabel}~{offerId}。写入操作必须提供 dataSource 查询参数。官方提供 Node.js、Python、Java、PHP 客户端库,按子 API 分包安装,例如 npm install @google-shopping/products @google-shopping/accounts 或 pip install google-shopping-merchant-products google-shopping-merchant-accounts。

适用场景:自动化商品上架与更新、库存同步、报表分析、促销管理、商品变更通知订阅,以及从 Content API 迁移到 Merchant API。

限制:需先在 Google Cloud 创建项目、启用 API、创建凭据并在 Merchant Center 完成开发者注册。需处理 400、401、403、404、429、409 等错误码,429 应实现指数退避。配额可通过 Quota 子 API 查询。部分子 API 仍为 v1beta 或 v1alpha。具体字段级文档需查阅对应 references 文件。