Testing the products resource

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

  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://shoppingcontent.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 a product

  1. Perform a GET to the API endpoint as:

    GET https://shoppingcontent.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 a product

  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://shoppingcontent.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 a 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://shoppingcontent.googleapis.com/content/v2.1/merchantId/products/productId
    
  3. You should receive an HTTP 204 status code for a successful API call.