You can use the Merchant API to manage local (in-store) and regional inventory.
Requests
Use the following request URL format for the Merchant Inventories API :
POST https://merchantapi.googleapis.com/inventories/v1/ {PARENT}
/regionalInventories
POST https://merchantapi.googleapis.com/inventories/v1/ {PARENT}
/localInventories
{PARENT} will have the format: accounts/ {ACCOUNT_ID} /products/ {PRODUCT_ID} .
Here's a sample comparison for local inventory requests:
Item | Content API for Shopping | Merchant API |
---|---|---|
URL
|
https://shoppingcontent.googleapis.com/content/v2.1/ {MERCHANT_ID} /products/ {PRODUCT_ID} /localinventory | https://merchantapi.googleapis.com/inventories/v1/ {PARENT} /localInventories |
Identifiers
|
{MERCHANT_ID}/products/{PRODUCT_ID}
|
{NAME}
|
Methods
The Merchant API introduces two new methods for inventory management:
-
list
: Lets you list local and regional inventory for your products. -
delete
: Lets you delete local and regional inventory for your products.
Here's a comparison of the available methods to manage inventories:
Method | Content API for Shopping | Merchant API |
---|---|---|
customBatch
|
Yes | No |
insert
|
Yes | Yes |
list
|
No | Yes |
delete
|
No | Yes |
Resources
Here's what's changed for local and regional inventories:
Content API for Shopping | Merchant API | Description |
---|---|---|
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
. |
Not supported
|
account:string
|
Added new field to identify the Merchant Center account the product
and LocalInventory
belong to. |
price: { object (Price)
}
|
price: {
|
Price
definition has changed. |
salePrice: {
|
Price
definition has changed. |
|
salePriceEffectiveDate: string
|
salePriceEffectiveDate: {
|
salePriceEffectiveDate
uses the new TimePeriod
object in the Merchant Inventories API. |
kind:string
|
Not supported | The API doesn't support kind
. |
quantity:string
|
quantity:integer
|
quantity
takes an integer instead of string in the local inventory. |
Not supported
|
localShippingLabel:string
|
Added new field to identify the merchant center account the product
and regionalInventory
belong to. |
"regionId": string
|
"region": string
|
regionID
is now called region
for the regional inventory. |
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. |