We will sunset v2 of the Content API on March 29th, 2021. To avoid disruptions with your integration, please migrate to v2.1 as soon as possible. For more information, see Migrating to v2.1.

Testing the Products API

These test examples use base_url to refer to https://www.googleapis.com. In addition, all examples use /content/v2.1 in the URL in a production environment. In this example we add, view, update and delete a product.

Add a product using products.insert

  1. Construct valid JSON for a product (or use the one in the products.insert section above).

  2. Perform an INSERT to the API endpoint as:

    INSERT https://www.googleapis.com/content/v2.1/merchantId/products
    
  3. Use your own merchant ID and the product JSON.

  4. You should receive an HTTP 200 status code for success and your original JSON.

View product using products.get

  1. Perform a GET to the API endpoint as:

    GET https://www.googleapis.com/content/v2.1/merchantId/products/productId
    
  2. Use your own merchant ID and the product ID (Rest ID). To get the product that was inserted in the previous step, use the product ID online:en:US:1111111111.

  3. You should receive an HTTP 200 status code for success and the JSON for the product ID submitted.

Update product using products.insert

  1. Construct valid JSON for a product (modify the one in the products.insert section above). Use your own merchant ID. For example, you can change a single field in the JSON availability: in stock, to out of stock for the product ID online:en:US:1111111111 in the product.insert section above.

  2. Perform an INSERT to the API endpoint as:

    INSERT https://www.googleapis.com/content/v2.1/merchantId/products
    
  3. You should receive an HTTP 200 status code for success, and the JSON for the product ID submitted, with an updated value of availability: out of stock.

Delete Product

  1. Use your own merchant ID and product ID (Rest ID), for example: online:en:US:111111111.

  2. Perform a DELETE to the API endpoint as:

    DELETE https://www.googleapis.com/content/v2.1/merchantId/products/productId
    
  3. You should receive an HTTP 204 status code for a successful API call.