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 mutate. Only defined if the method is get, delete, or update.

product

object (Product)

The product to insert or update. Only required if the method is insert or update. If the update method is used with updateMask only to delete a field, then this isn't required. For example, setting salePrice on the updateMask and not providing a product will result in an existing sale price on the product specified by productId being deleted.

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. You must specify the update mask to delete attributes. 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 for failed custombatch entries.