class Products extends Resource (View source)

The "products" collection of methods.

Typical usage is:

 $contentService = new Google\Service\ShoppingContent(...);
 $products = $contentService->products;

Methods

custombatch(ProductsCustomBatchRequest $postBody, array $optParams = [])

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

delete(string $merchantId, string $productId, array $optParams = [])

Deletes a product from your Merchant Center account. (products.delete)

get(string $merchantId, string $productId, array $optParams = [])

Retrieves a product from your Merchant Center account. (products.get)

insert(string $merchantId, Product $postBody, array $optParams = [])

Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. (products.insert)

listProducts(string $merchantId, array $optParams = [])

Lists the products in your Merchant Center account. The response might contain fewer items than specified by maxResults. Rely on nextPageToken to determine if there are more items to be requested. (products.listProducts)

update(string $merchantId, string $productId, Product $postBody, array $optParams = [])

Updates an existing product in your Merchant Center account. Only updates attributes provided in the request. (products.update)

Details

ProductsCustomBatchResponse custombatch(ProductsCustomBatchRequest $postBody, array $optParams = [])

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

(products.custombatch)

Parameters

ProductsCustomBatchRequest $postBody
array $optParams

Optional parameters.

Return Value

ProductsCustomBatchResponse

Exceptions

Exception

delete(string $merchantId, string $productId, array $optParams = [])

Deletes a product from your Merchant Center account. (products.delete)

Parameters

string $merchantId

The ID of the account that contains the product. This account cannot be a multi-client account.

string $productId

The REST ID of the product.

array $optParams

Optional parameters.

Exceptions

Exception

Product get(string $merchantId, string $productId, array $optParams = [])

Retrieves a product from your Merchant Center account. (products.get)

Parameters

string $merchantId

The ID of the account that contains the product. This account cannot be a multi-client account.

string $productId

The REST ID of the product.

array $optParams

Optional parameters.

Return Value

Product

Exceptions

Exception

Product insert(string $merchantId, Product $postBody, array $optParams = [])

Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. (products.insert)

Parameters

string $merchantId

The ID of the account that contains the product. This account cannot be a multi-client account.

Product $postBody
array $optParams

Optional parameters.

Return Value

Product

Exceptions

Exception

ProductsListResponse listProducts(string $merchantId, array $optParams = [])

Lists the products in your Merchant Center account. The response might contain fewer items than specified by maxResults. Rely on nextPageToken to determine if there are more items to be requested. (products.listProducts)

Parameters

string $merchantId

The ID of the account that contains the products. This account cannot be a multi-client account.

array $optParams

Optional parameters.

Return Value

ProductsListResponse

Exceptions

Exception

Product update(string $merchantId, string $productId, Product $postBody, array $optParams = [])

Updates an existing product in your Merchant Center account. Only updates attributes provided in the request. (products.update)

Parameters

string $merchantId

The ID of the account that contains the product. This account cannot be a multi-client account.

string $productId

The REST ID of the product for which to update.

Product $postBody
array $optParams

Optional parameters.

Return Value

Product

Exceptions

Exception