Testing the products resource

Here are some examples you can use to test your implementation with the products resource.

Add a product

  1. Construct valid JSON for a product .

  2. Make an insert request with the product data and your merchant ID:

     POST https://shoppingcontent.googleapis.com/content/v2.1/ merchantId 
    /products 
    
  3. Verify that you receive an HTTP 200 status code.

View a product

  1. Make a get request with your merchant ID, and the product's productId :

     GET https://shoppingcontent.googleapis.com/content/v2.1/ merchantId 
    /products/ productId 
     
    
  2. Verify that you receive an HTTP 200 status code, and the JSON data for the product.

Update a product

  1. Construct the new JSON for a product. For example, change a single field in the JSON availability: in stock , to availability: out of stock for the product you used to test the insert call.

  2. Make an insert request with the new product data and your merchant ID:

     POST https://shoppingcontent.googleapis.com/content/v2.1/ merchantId 
    /products 
    
  3. Verify that you receive an HTTP 200 status code. After at least five minutes, you can make another get request to confirm the updated value, availability: out of stock , was applied.

Delete a product

  1. Make a delete request with your merchant ID, and the product's productId :

     DELETE https://shoppingcontent.googleapis.com/content/v2.1/ merchantId 
    /products/ productId 
     
    
  2. Verify that you receive an HTTP 204 status code.

Design a Mobile Site
View Site in Mobile | Classic
Share by: