We will sunset v2 of the Content API on March 29th, 2021. To avoid disruptions with your integration, please migrate to v2.1 as soon as possible. For more information, see Migrating to v2.1.

Method: inventory.set

Updates price and availability of a product in your Merchant Center account.

HTTP request

POST https://shoppingcontent.googleapis.com/content/v2/{merchantId}/inventory/{storeCode}/products/{productId}

Path parameters

Parameters
merchantId

string

The ID of the account that contains the product. This account cannot be a multi-client account.

storeCode

string

The code of the store for which to update price and availability. Use online to update price and availability of an online product.

productId

string

The REST ID of the product for which to update price and availability.

Query parameters

Parameters
dryRun

boolean

Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).

Request body

The request body contains an instance of InventorySetRequest.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "kind": string
}
Fields
kind

string

Identifies what kind of resource this is. Value: the fixed string

"content#inventorySetResponse"

.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

InventorySetRequest

JSON representation
{
  "price": {
    object (Price)
  },
  "availability": string,
  "salePrice": {
    object (Price)
  },
  "salePriceEffectiveDate": string,
  "quantity": integer,
  "sellOnGoogleQuantity": integer,
  "installment": {
    object (Installment)
  },
  "loyaltyPoints": {
    object (LoyaltyPoints)
  },
  "pickup": {
    object (InventoryPickup)
  },
  "instoreProductLocation": string,
  "customLabel0": string,
  "customLabel1": string,
  "customLabel2": string,
  "customLabel3": string,
  "customLabel4": string
}
Fields
price

object (Price)

The price of the product.

availability

string

The availability of the product.

Acceptable values are:

  • "in stock"
  • "out of stock"
  • "preorder"

salePrice

object (Price)

The sale price of the product. Mandatory if salePriceEffectiveDate is defined.

salePriceEffectiveDate

string

A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided.

quantity

integer (uint32 format)

The quantity of the product. Must be equal to or greater than zero. Supported only for local products.

sellOnGoogleQuantity

integer (uint32 format)

The quantity of the product that is available for selling on Google. Supported only for online products.

installment

object (Installment)

Number and amount of installments to pay for an item. Brazil only.

loyaltyPoints

object (LoyaltyPoints)

Loyalty points that users receive after purchasing the item. Japan only.

pickup

object (InventoryPickup)

Store pickup information. Only supported for local inventory. Not setting pickup means "don't update" while setting it to the empty value ({} in JSON) means "delete". Otherwise, pickupMethod and pickupSla must be set together, unless pickupMethod is "not supported".

instoreProductLocation

string

The instore product location. Supported only for local products.

customLabel0

string

Custom label 0 for custom grouping of items in a Shopping campaign. Only supported for online products.

customLabel1

string

Custom label 1 for custom grouping of items in a Shopping campaign. Only supported for online products.

customLabel2

string

Custom label 2 for custom grouping of items in a Shopping campaign. Only supported for online products.

customLabel3

string

Custom label 3 for custom grouping of items in a Shopping campaign. Only supported for online products.

customLabel4

string

Custom label 3 for custom grouping of items in a Shopping campaign. Only supported for online products.