Inventory: custombatch

Requires authorization

Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. Try it now.

Request

HTTP request

POST https://www.googleapis.com/content/v2/inventory/batch

Parameters

Parameter name Value Description
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

{
  "entries": [
    {
      "batchId": unsigned integer,
      "merchantId": unsigned long,
      "storeCode": string,
      "productId": string,
      "inventory": {
        "kind": "content#inventory",
        "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
entries[] list The request entries to be processed in the batch.
entries[].batchId unsigned integer An entry ID, unique within the batch request.
entries[].merchantId unsigned long The ID of the managing account.
entries[].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.
entries[].productId string The ID of the product for which to update price and availability.
entries[].inventory nested object Price and availability of the product.
entries[].inventory.kind string Identifies what kind of resource this is. Value: the fixed string "content#inventory".
entries[].inventory.price nested object The price of the product. writable
entries[].inventory.price.value string The price represented as a number. writable
entries[].inventory.price.currency string The currency of the price. writable
entries[].inventory.availability string The availability of the product.

Acceptable values are:
  • "in stock"
  • "out of stock"
  • "preorder"
writable
entries[].inventory.salePrice nested object The sale price of the product. Mandatory if sale_price_effective_date is defined. writable
entries[].inventory.salePrice.value string The price represented as a number. writable
entries[].inventory.salePrice.currency string The currency of the price. writable
entries[].inventory.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
entries[].inventory.quantity unsigned integer The quantity of the product. Must be equal to or greater than zero. Supported only for local products. writable
entries[].inventory.installment nested object Number and amount of installments to pay for an item. Brazil only. writable
entries[].inventory.installment.months long The number of installments the buyer has to pay. writable
entries[].inventory.installment.amount nested object The amount the buyer has to pay per month. writable
entries[].inventory.installment.amount.value string The price represented as a number. writable
entries[].inventory.installment.amount.currency string The currency of the price. writable
entries[].inventory.loyaltyPoints nested object Loyalty points that users receive after purchasing the item. Japan only. writable
entries[].inventory.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
entries[].inventory.loyaltyPoints.pointsValue long The retailer's loyalty points in absolute value. writable
entries[].inventory.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
entries[].inventory.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".
entries[].inventory.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
entries[].inventory.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

<batch>
  (foreach)
    <entry batch_id="unsigned integer">
      <merchant_id>
        unsigned long
      </merchant_id>
      <store_code>
        string
      </store_code>
      <product_id>
        string
      </product_id>
      <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>
    </entry>
  (/foreach)
</batch>
Property name Value Description Notes
batch object
batch/entry object A batch entry encoding a single non-batch inventory request.
batch/entry/batch_id unsigned integer An entry ID, unique within the batch request.
batch/entry/merchant_id unsigned long The ID of the managing account.
batch/entry/store_code string The code of the store for which to update price and availability. Use online to update price and availability of an online product.
batch/entry/product_id string The ID of the product for which to update price and availability.
batch/entry/inventory nested object Price and availability of the product.
batch/entry/inventory/price string The price represented as a number. writable
batch/entry/inventory/price/currency string The currency of the price. writable
batch/entry/inventory/availability string The availability of the product.

Acceptable values are:
  • "in stock"
  • "out of stock"
  • "preorder"
writable
batch/entry/inventory/sale_price string The price represented as a number. writable
batch/entry/inventory/sale_price/currency string The currency of the price. writable
batch/entry/inventory/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
batch/entry/inventory/quantity unsigned integer The quantity of the product. Must be equal to or greater than zero. Supported only for local products. writable
batch/entry/inventory/installment object Number and amount of installments to pay for an item. Brazil only. writable
batch/entry/inventory/installment/months long The number of installments the buyer has to pay. writable
batch/entry/inventory/installment/amount string The price represented as a number. writable
batch/entry/inventory/installment/amount/currency string The currency of the price. writable
batch/entry/inventory/loyalty_points object Loyalty points that users receive after purchasing the item. Japan only. writable
batch/entry/inventory/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
batch/entry/inventory/loyalty_points/points_value long The retailer's loyalty points in absolute value. writable
batch/entry/inventory/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
batch/entry/inventory/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".
batch/entry/inventory/pickup/pickup_method string
batch/entry/inventory/pickup/pickup_sla string

Response

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

JSON

{
  "kind": "content#inventoryCustomBatchResponse",
  "entries": [
    {
      "kind": "content#inventoryCustomBatchResponseEntry",
      "batchId": unsigned integer,
      "errors": {
        "errors": [
          {
            "domain": string,
            "reason": string,
            "message": string
          }
        ],
        "code": unsigned integer,
        "message": string
      }
    }
  ]
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#inventoryCustomBatchResponse".
entries[] list The result of the execution of the batch requests.
entries[].kind string Identifies what kind of resource this is. Value: the fixed string "content#inventoryCustomBatchResponseEntry".
entries[].batchId unsigned integer The ID of the request entry this entry responds to.
entries[].errors nested object A list of errors defined if and only if the request failed.
entries[].errors.errors[] list A list of errors.
entries[].errors.errors[].domain string The domain of the error.
entries[].errors.errors[].reason string The error code.
entries[].errors.errors[].message string A description of the error.
entries[].errors.code unsigned integer The HTTP status of the first error in errors.
entries[].errors.message string The message of the first error in errors.

XML

<batch>
  (foreach)
    <entry batch_id="unsigned integer">
      <errors xmlns="http://schemas.google.com/g/2005">
        (foreach)
          <error>
            <domain>
              GData
              string
            </domain>
            <code>
              string
            </code>
            <internalReason>
              string
            </internalReason>
          </error>
        (/foreach)
      </errors>
    </entry>
  (/foreach)
</batch>
Property name Value Description Notes
batch object
batch/entry object A batch entry encoding a single non-batch transferproducts response.
batch/entry/batch_id unsigned integer The ID of the request entry this entry responds to.
batch/entry/errors nested object A list of errors defined if and only if the request failed. A list of errors returned by a failed batch entry.
batch/entry/errors/error object A list of errors. An error returned by the API.
batch/entry/errors/error/domain string The domain of the error.
batch/entry/errors/error/code string The error code.
batch/entry/errors/error/internalReason string A description of the error.

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