Method: accounts.products.update
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在 Manufacturer Center 账号中插入或更新商品的属性。
使用提供的属性创建商品。如果商品已存在,则所有属性都会替换为新属性。上传时的检查非常少。商品必须包含所有必需属性,才能有效。即使 API 已接受新上传的商品数据,问题也可能会在稍后显示,并且可能会使用无效商品数据覆盖现有的有效商品数据。为了检测到这种情况,您应在有新版本可用时检索相应商品并检查是否存在问题。
上传的属性需要先经过处理,然后才能检索。在此之前,新商品将无法使用,并且检索之前上传的商品将返回商品的原始状态。
HTTP 请求
PUT https://manufacturers.googleapis.com/v1/{parent=accounts/*}/products/{name}
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
父级 ID,格式为 accounts/{account_id} 。 account_id - Manufacturer Center 账号的 ID。
|
name |
string
名称采用 {targetCountry}:{contentLanguage}:{productId} 格式。 targetCountry - 商品的目标国家/地区,以 CLDR 地区代码(例如 US)表示。
contentLanguage - 商品的内容语言,以双字母 ISO 639-1 语言代码表示(例如,en)。
productId - 商品的 ID。如需了解详情,请参阅 https://support.google.com/manufacturers/answer/6124116#id。
|
请求正文
请求正文包含一个 Attributes
实例。
响应正文
如果成功,则响应正文为空的 JSON 对象。
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/manufacturercenter
如需了解详情,请参阅 OAuth 2.0 Overview。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-17。
[null,null,["最后更新时间 (UTC):2025-08-17。"],[[["\u003cp\u003eUpdates or creates product attributes within a Manufacturer Center account, potentially overwriting existing data.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing product details like target country, content language, and a unique product ID within the request.\u003c/p\u003e\n"],["\u003cp\u003eUploaded product data needs processing time before becoming visible or retrievable in its updated state.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the \u003ccode\u003ePUT\u003c/code\u003e method and specific path parameters for identifying the account and product in the request URL.\u003c/p\u003e\n"],["\u003cp\u003eNeeds authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/manufacturercenter\u003c/code\u003e scope for access.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.products.update\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nInserts or updates the attributes of the product in a Manufacturer Center account.\n\nCreates a product with the provided attributes. If the product already exists, then all attributes are replaced with the new ones. The checks at upload time are minimal. All required attributes need to be present for a product to be valid. Issues may show up later after the API has accepted a new upload for a product and it is possible to overwrite an existing valid product with an invalid product. To detect this, you should retrieve the product and check it for issues once the new version is available.\n\nUploaded attributes first need to be processed before they can be retrieved. Until then, new products will be unavailable, and retrieval of previously uploaded products will return the original state of the product.\n\n### HTTP request\n\n`PUT https://manufacturers.googleapis.com/v1/{parent=accounts/*}/products/{name}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. |\n| `name` | `string` Name in the format `{targetCountry}:{contentLanguage}:{productId}`. `targetCountry` - The target country of the product as a CLDR territory code (for example, US). `contentLanguage` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `productId` - The ID of the product. For more information, see \u003chttps://support.google.com/manufacturers/answer/6124116#id\u003e. |\n\n### Request body\n\nThe request body contains an instance of [Attributes](/manufacturers/reference/rest/v1/Attributes).\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/manufacturercenter`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]