Inventory: set

Requires authorization

Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This method can only be called for non-multi-client accounts. Try it now.

Request

HTTP request

POST https://www.googleapis.com/content/v2/merchantId/inventory/storeCode/products/productId

Parameters

Parameter name Value Description
Path parameters
merchantId unsigned long The ID of the managing account.
productId string The ID of the product for which to update price and availability.
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.
Optional query parameters
dryRun boolean Flag to run the request in dry-run mode.

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

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

Request body

In the request body, supply data with the following structure:

JSON

{
  "price": {
    "value": string,
    "currency": string
  },
  "availability": string,
  "salePrice": {
    "value": string,
    "currency": string
  },
  "salePriceEffectiveDate": string,
  "quantity": unsigned integer,
  "sellOnGoogleQuantity": unsigned integer,
  "installment": {
    "months": long,
    "amount": {
      "value": string,
      "currency": string
    }
  },
  "loyaltyPoints": {
    "name": string,
    "pointsValue": long,
    "ratio": double
  },
  "pickup": {
    "pickupMethod": string,
    "pickupSla": string
  }
}
Property name Value Description Notes
price nested object The price of the product. writable
price.value string The price represented as a number. writable
price.currency string The currency of the price. writable
availability string The availability of the product.

Acceptable values are:
  • "in stock"
  • "out of stock"
  • "preorder"
writable
salePrice nested object The sale price of the product. Mandatory if sale_price_effective_date is defined. writable
salePrice.value string The price represented as a number. writable
salePrice.currency string The currency of the price. writable
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. writable
quantity unsigned integer The quantity of the product. Must be equal to or greater than zero. Supported only for local products. writable
sellOnGoogleQuantity unsigned integer The quantity of the product that is reserved for sell-on-google ads. Supported only for online products. writable
installment nested object Number and amount of installments to pay for an item. Brazil only. writable
installment.months long The number of installments the buyer has to pay. writable
installment.amount nested object The amount the buyer has to pay per month. writable
installment.amount.value string The price represented as a number. writable
installment.amount.currency string The currency of the price. writable
loyaltyPoints nested object Loyalty points that users receive after purchasing the item. Japan only. writable
loyaltyPoints.name string Name of loyalty points program. It is recommended to limit the name to 12 full-width characters or 24 Roman characters. writable
loyaltyPoints.pointsValue long The retailer's loyalty points in absolute value. writable
loyaltyPoints.ratio double The ratio of a point when converted to currency. Google assumes currency based on Merchant Center settings. If ratio is left out, it defaults to 1.0. writable
pickup nested object 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".
pickup.pickupMethod string Whether store pickup is available for this offer and whether the pickup option should be shown as buy, reserve, or not supported. Only supported for local inventory. Unless the value is "not supported", must be submitted together with pickupSla.

Acceptable values are:
  • "buy"
  • "not supported"
  • "reserve"
writable
pickup.pickupSla string The expected date that an order will be ready for pickup, relative to when the order is placed. Only supported for local inventory. Must be submitted together with pickupMethod.

Acceptable values are:
  • "multi day"
  • "next day"
  • "same day"
writable

XML

<inventory>
  <price currency="string">
    string
  </price>
  <availability>
    string
  </availability>
  <sale_price currency="string">
    string
  </sale_price>
  <sale_price_effective_date>
    string
  </sale_price_effective_date>
  <quantity>
    unsigned integer
  </quantity>
  <sell_on_google_quantity>
    unsigned integer
  </sell_on_google_quantity>
  <installment>
    <months>
      long
    </months>
    <amount currency="string">
      string
    </amount>
  </installment>
  <loyalty_points>
    <name>
      string
    </name>
    <points_value>
      long
    </points_value>
    <ratio>
      double
    </ratio>
  </loyalty_points>
  <pickup>
    <pickup_method>
      string
    </pickup_method>
    <pickup_sla>
      string
    </pickup_sla>
  </pickup>
</inventory>
Property name Value Description Notes
price string The price represented as a number. writable
price/currency string The currency of the price. writable
availability string The availability of the product.

Acceptable values are:
  • "in stock"
  • "out of stock"
  • "preorder"
writable
sale_price string The price represented as a number. writable
sale_price/currency string The currency of the price. writable
sale_price_effective_date 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. writable
quantity unsigned integer The quantity of the product. Must be equal to or greater than zero. Supported only for local products. writable
installment object Number and amount of installments to pay for an item. Brazil only. writable
installment/months long The number of installments the buyer has to pay. writable
installment/amount string The price represented as a number. writable
installment/amount/currency string The currency of the price. writable
loyalty_points object Loyalty points that users receive after purchasing the item. Japan only. writable
loyalty_points/name string Name of loyalty points program. It is recommended to limit the name to 12 full-width characters or 24 Roman characters. writable
loyalty_points/points_value long The retailer's loyalty points in absolute value. writable
loyalty_points/ratio double The ratio of a point when converted to currency. Google assumes currency based on Merchant Center settings. If ratio is left out, it defaults to 1.0. writable
pickup object 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".
pickup/pickup_method string
pickup/pickup_sla string

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "content#inventorySetResponse"
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#inventorySetResponse".

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Send feedback about...

Content API for Shopping