---
title: "POST /v2/{+product}:addLocalInventories"
method: POST
path: "/v2/{+product}:addLocalInventories"
tags: ["projects"]
---

# POST /v2/{+product}:addLocalInventories

`POST /v2/{+product}:addLocalInventories`

Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete.

## Path parameters

- `product` string, required

## Request body

- GoogleCloudRetailV2AddLocalInventoriesRequest — Request message for ProductService.AddLocalInventories method.
  - `addMask` string, google-fieldmask — Indicates which inventory fields in the provided list of LocalInventory to update. The field is updated to the provided value. If a field is set while the place does not have a previous local inventory, the local inventory at that store is created. If a field is set while the value of that field is not provided, the original field value, if it exists, is deleted. If the mask is not set or set with empty paths, all inventory fields will be updated. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned and the entire update will be ignored.
  - `allowMissing` boolean — If set to true, and the Product is not found, the local inventory will still be processed and retained for at most 1 day and processed once the Product is created. If set to false, a NOT_FOUND error is returned if the Product is not found.
  - `localInventories` GoogleCloudRetailV2LocalInventory[] — Required. A list of inventory information at difference places. Each place is identified by its place ID. At most 3000 inventories are allowed per request.
    - `attributes` object — Optional. Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned: * At most 30 attributes are allowed. * The key must be a UTF-8 encoded string with a length limit of 32 characters. * The key must match the pattern: `a-zA-Z0-9*`. For example, key0LikeThis or KEY_1_LIKE_THIS. * The attribute values must be of the same type (text or number). * Only 1 value is allowed for each attribute. * For text values, the length limit is 256 UTF-8 characters. * The attribute does not support search. The `searchable` field should be unset or set to false. * The max summed total bytes of custom attribute keys and values per product is 5MiB.
    - `fulfillmentTypes` string[] — Optional. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values: * "pickup-in-store" * "ship-to-store" * "same-day-delivery" * "next-day-delivery" * "custom-type-1" * "custom-type-2" * "custom-type-3" * "custom-type-4" * "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.
    - `placeId` string — Optional. The place ID for the current set of inventory information.
    - `priceInfo` GoogleCloudRetailV2PriceInfo — The price information of a Product.
      - `originalPrice` number, float — Price of the product without any discount. If zero, by default set to be the price. If set, original_price should be greater than or equal to price, otherwise an INVALID_ARGUMENT error is thrown.
      - `priceEffectiveTime` string, google-datetime — The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time. Do not set if price is always effective because it will cause additional latency during search.
      - `priceRange` GoogleCloudRetailV2PriceInfoPriceRange — The price range of all variant Product having the same Product.primary_product_id.
        - `price` GoogleCloudRetailV2Interval — A floating point interval.
          - `exclusiveMaximum` number, double — Exclusive upper bound.
          - `minimum` number, double — Inclusive lower bound.
          - `maximum` number, double — Inclusive upper bound.
          - `exclusiveMinimum` number, double — Exclusive lower bound.
        - `originalPrice` GoogleCloudRetailV2Interval — A floating point interval.
          - `exclusiveMaximum` number, double — Exclusive upper bound.
          - `minimum` number, double — Inclusive lower bound.
          - `maximum` number, double — Inclusive upper bound.
          - `exclusiveMinimum` number, double — Exclusive lower bound.
      - `price` number, float — Price of the product. Google Merchant Center property [price](https://support.google.com/merchants/answer/6324371). Schema.org property [Offer.price](https://schema.org/price).
      - `cost` number, float — The costs associated with the sale of a particular product. Used for gross profit reporting. * Profit = price - cost Google Merchant Center property [cost_of_goods_sold](https://support.google.com/merchants/answer/9017895).
      - `priceExpireTime` string, google-datetime — The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time. Do not set if price is always effective because it will cause additional latency during search.
      - `currencyCode` string — The 3-letter currency code defined in [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html). If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned. The Product.Type.VARIANT Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.
  - `addTime` string, google-datetime — The time when the inventory updates are issued. Used to prevent out-of-order updates on local inventory fields. If not provided, the internal system time will be used.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/retail.md) · [All operations](https://skmtc.net/google/apis/retail/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/retail/versions/146c67e59640/schema)
