La API de Merchant presenta dos métodos nuevos para la administración del inventario:
list: Te permite enumerar el inventario local y regional de tus productos.
delete: Te permite borrar el inventario local y regional de tus productos.
A continuación, se incluye una comparación de los métodos disponibles para administrar inventarios:
Método
Content API for Shopping
API de Merchant
customBatch
Sí
No
insert
Sí
Sí
list
No
Sí
delete
No
Sí
Recursos
Estos son los cambios que se realizaron en los inventarios locales y regionales:
Content API for Shopping
API de Merchant
Descripción
No compatible
name:string
El campo diferencia los recursos LocalInventory y RegionalInventory dentro de un product. Content API for Shopping identifica el inventario local con storeCode y productId, y el inventario regional con regionId y productId.
No compatible
account:string
Se agregó un campo nuevo para identificar la cuenta de Merchant Center a la que pertenecen product y LocalInventory.
salePriceEffectiveDate usa el nuevo objeto TimePeriod en la API de Merchant Inventories.
kind:string
No compatible
La API no admite kind.
quantity:string
quantity:integer
quantity toma un número entero en lugar de una cadena en el inventario local.
No compatible
localShippingLabel:string
Se agregó un campo nuevo para identificar la cuenta de Merchant Center a la que pertenecen product y regionalInventory.
"regionId": string
"region": string
regionID ahora se llama region para el inventario regional.
Campos de tipo string con un conjunto de valores definidos
Campos de tipo enum con un conjunto de valores definidos
Los campos dentro de los atributos del inventario con un conjunto de valores definidos (por ejemplo, availability, pickupMethod) ahora son de tipo enum.
[null,null,["Última actualización: 2025-08-11 (UTC)"],[[["\u003cp\u003eThe Merchant API allows management of both local (in-store) and regional inventory for products.\u003c/p\u003e\n"],["\u003cp\u003eIt introduces new methods for inventory management like listing and removing local and regional inventory, replacing the Content API for Shopping for these operations.\u003c/p\u003e\n"],["\u003cp\u003eThere are key differences in how local and regional inventory are handled in the Merchant API compared to the Content API, including new fields and data types.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ename\u003c/code\u003e field is introduced to uniquely identify inventory resources, and \u003ccode\u003eaccount\u003c/code\u003e is added to link products and inventory to the merchant account.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eprice\u003c/code\u003e, \u003ccode\u003esalePrice\u003c/code\u003e, and \u003ccode\u003esalePriceEffectiveDate\u003c/code\u003e fields have been updated with new data types and structures in the Merchant Inventories API.\u003c/p\u003e\n"]]],["The Merchant API manages local and regional inventory, using the Inventories sub-API. Key actions include listing and removing both local and regional inventories. The API uses `POST` requests with a specific URL format. New fields like `name` and `account` were added for local and regional inventory. The `price` definition has been modified. `salePriceEffectiveDate` now uses the `TimePeriod` type and `quantity` is now an integer. Methods such as `list` and `delete` are now supported. The `customBatch` method is not.\n"],null,["# Migrate inventory management\n\nYou can use the Merchant API to manage local (in-store) and regional inventory.\n\nRequests\n--------\n\nUse the following request URL format for the [Merchant Inventories API](/merchant/api/guides/inventories/overview): \n\n POST https://merchantapi.googleapis.com/inventories/v1/\u003cvar translate=\"no\"\u003e{PARENT}\u003c/var\u003e/regionalInventories\n\n POST https://merchantapi.googleapis.com/inventories/v1/\u003cvar translate=\"no\"\u003e{PARENT}\u003c/var\u003e/localInventories\n\n\u003cvar translate=\"no\"\u003e{PARENT}\u003c/var\u003e will have the format:\naccounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/products/\u003cvar translate=\"no\"\u003e {PRODUCT_ID}\u003c/var\u003e.\n| **Note:** In Merchant API, the Merchant Inventories API and its related endpoints are referred using the plural form \"inventories\".\n\nHere's a sample comparison for local inventory requests:\n\n| Item | Content API for Shopping | Merchant API |\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| **URL** | https://shoppingcontent.googleapis.com/content/v2.1/\u003cvar translate=\"no\"\u003e{MERCHANT_ID}\u003c/var\u003e/products/\u003cvar translate=\"no\"\u003e{PRODUCT_ID}\u003c/var\u003e/localinventory | https://merchantapi.googleapis.com/inventories/v1/\u003cvar translate=\"no\"\u003e{PARENT}\u003c/var\u003e/localInventories |\n| **Identifiers** | `{MERCHANT_ID}/products/{PRODUCT_ID}` | `{NAME}` |\n\nMethods\n-------\n\nThe Merchant API introduces two new methods for inventory management:\n\n- `list`: Lets you list local and regional inventory for your products.\n- `delete`: Lets you delete local and regional inventory for your products.\n\nHere's a comparison of the available methods to manage inventories:\n\n| Method | Content API for Shopping | Merchant API |\n| `customBatch` | Yes | No |\n| `insert` | Yes | Yes |\n| `list` | No | Yes |\n| `delete` | No | Yes |\n|---------------|:------------------------:|:------------:|\n\nResources\n---------\n\nHere's what's changed for local and regional inventories:\n\n| Content API for Shopping | Merchant API | Description |\n|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Not supported | `name:string` | The field differentiates `LocalInventory` and `RegionalInventory` resources within a `product`. The Content API for Shopping identifies local inventory by `storeCode` and `productId`, and regional inventory by `regionId` and `productId`. |\n| Not supported | `account:string` | Added new field to identify the Merchant Center account the `product` and `LocalInventory` belong to. |\n| ` price: { `[object (Price)](/merchant/api/guides/compatibility/overview#price)` } ` | `price: {` ` `[object (Price)](/merchant/api/guides/compatibility/overview#price) `}` | [Price](/merchant/api/guides/compatibility/overview#price) definition has changed. |\n| `salePrice: {` ` `[object (Price)](/merchant/api/guides/compatibility/overview#price) `}` | `salePrice: {` ` `[object (Price)](/merchant/api/guides/compatibility/overview#price) `}` | [Price](/merchant/api/guides/compatibility/overview#price) definition has changed. |\n| `salePriceEffectiveDate: string` | `salePriceEffectiveDate: {` ` object (TimePeriod)` ` }` | `salePriceEffectiveDate` uses the new `TimePeriod` object in the Merchant Inventories API. |\n| `kind:string` | Not supported | The API doesn't support `kind`. |\n| `quantity:string` | `quantity:integer` | `quantity` takes an integer instead of string in the local inventory. |\n| Not supported | `localShippingLabel:string` | Added new field to identify the merchant center account the `product` and `regionalInventory` belong to. |\n| `\"regionId\": string` | `\"region\": string` | `regionID` is now called `region` for the regional inventory. |\n| `string` type fields with defined set of values | `enum` type fields with defined set of values | Fields within inventory attributes with defined set of values (for example `availability`, `pickupMethod`) are now `enum` type. |\n\n| **Note:** The `channel` field within product identifier is no longer present in Merchant API. Products with `LOCAL` channel in Content API for Shopping should instead set the `legacy_local` field to true."]]