Version v2 of the Content API is scheduled for sunset on September 30th, 2021. Onboarding to v2 ended on April 30, 2021. To avoid disruptions with your integration, please migrate to v2.1 as soon as possible.

For more information, see Migrating to v2.1 and this blog post.

Method: products.custombatch

Retrieves, inserts, and deletes multiple products in a single request.

HTTP request

POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch

Request body

The request body contains an instance of ProductsCustomBatchRequest.

Response body

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

JSON representation
{
  "entries": [
    {
      object (ProductsCustomBatchResponseEntry)
    }
  ],
  "kind": string
}
Fields
entries[]

object (ProductsCustomBatchResponseEntry)

The result of the execution of the batch requests.

kind

string

Identifies what kind of resource this is. Value: the fixed string "content#productsCustomBatchResponse".

Authorization Scopes

Requires one of the following OAuth scopes:

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

For more information, see the OAuth 2.0 Overview.

ProductsCustomBatchRequest

JSON representation
{
  "entries": [
    {
      object (ProductsCustomBatchRequestEntry)
    }
  ]
}
Fields
entries[]

object (ProductsCustomBatchRequestEntry)

The request entries to be processed in the batch.

ProductsCustomBatchRequestEntry

A batch entry encoding a single non-batch products request.

JSON representation
{
  "batchId": integer,
  "merchantId": string,
  "method": string,
  "productId": string,
  "product": {
    object (Product)
  },
  "feedId": string,
  "updateMask": string
}
Fields
batchId

integer (uint32 format)

An entry ID, unique within the batch request.

merchantId

string

The ID of the managing account.

method

string

The method of the batch entry.

Acceptable values are:

  • "delete"
  • "get"
  • "insert"
  • "update"

productId

string

The ID of the product to get or delete. Only defined if the method is get or delete.

product

object (Product)

The product to insert. Only required if the method is insert.

feedId

string

The Content API Supplemental Feed ID. If present then product insertion or deletion applies to a supplemental feed instead of primary Content API feed.

updateMask

string (FieldMask format)

The comma-separated list of product attributes to be updated. Example: "title,salePrice". Attributes specified in the update mask without a value specified in the body will be deleted from the product. Only top-level product attributes can be updated. If not defined, product attributes with set values will be updated and other attributes will stay unchanged. Only defined if the method is update.

ProductsCustomBatchResponseEntry

A batch entry encoding a single non-batch products response.

JSON representation
{
  "batchId": integer,
  "kind": string,
  "product": {
    object (Product)
  },
  "errors": {
    object (Errors)
  }
}
Fields
batchId

integer (uint32 format)

The ID of the request entry this entry responds to.

kind

string

Identifies what kind of resource this is. Value: the fixed string "content#productsCustomBatchResponseEntry"

product

object (Product)

The inserted product. Only defined if the method is insert and if the request was successful.

errors

object (Errors)

A list of errors defined if and only if the request failed.