Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Create Product succeeds with 201, but has null product id by Adam

$
0
0

sending this JSON:

{"product":{"metafields":[
         {"key":"id","value":100001,"value_type":"integer","namespace":"springboard"
         }
      ],"body_html":"test\ntest\ntest","handle":"100001","title":"Super Nintendo","product_type":"GAMES","variants":[
         {"barcode":"SR100001","inventory_management":"springboard-retail","price":199.99,"requires_shipping":true,"sku":"100001","title":"Super Nintendo","fulfillment_service":"springboard-retail","inventory_quantity":0.0
         }
      ]
   }
}

results in (json formatted for clarity)

< HTTP/1.1 201 Created< Server: nginx< Date: Fri, 21 Feb 2014 16:12:57 GMT< Content-Type: application/json; charset=utf-8< Transfer-Encoding: chunked< Status: 201 Created< X-ShopId: 3806073< X-ShardId: 0< X-Shopify-Asset-Version: 9955e9a74a325f7d2f9c7c15d2461b16ca413f51< X-Shopify-Shop-Api-Call-Limit: 1/40< HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40< Location: https://adam-80.myshopify.com/admin/products< X-Frame-Options: SAMEORIGIN< X-UA-Compatible: IE=Edge,chrome=1< Set-Cookie: request_method=POST; path=/< Set-Cookie: cacheable_no_cache=true; path=/; HttpOnly< Set-Cookie: _secure_admin_session_id=7148c3461befd9b7d1b72cd3a764a0ba; path=/; secure; HttpOnly< X-Request-Id: 89707408-24c6-4724-a894-49f033ade39b< P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR"

{
   "product":{"body_html":"test\ntest\ntest","created_at":"2014-02-21T11:27:48-05:00","handle":"100001","id":null,"product_type":"GAMES","published_at":"2014-02-21T11:27:48-05:00","published_scope":"global","template_suffix":null,"title":"Super Nintendo","updated_at":"2014-02-21T11:27:48-05:00","vendor":"adam","tags":"","variants":[
         {"barcode":"SR100001","compare_at_price":null,"created_at":"2014-02-21T11:27:48-05:00","fulfillment_service":"springboard-retail","grams":0,"id":558549769,"inventory_management":"springboard-retail","inventory_policy":"deny","option1":"Default","option2":null,"option3":null,"position":1,"price":"199.99","product_id":245636581,"requires_shipping":true,"sku":"100001","taxable":true,"title":"Default","updated_at":"2014-02-21T11:27:48-05:00","inventory_quantity":0
         }
      ],"options":[
         {"id":291915285,"name":"Title","position":1,"product_id":245636581
         }
      ],"images":[

      ]
   }
}

notice that while the variant is created with a valid id, the id key in the product object is null!!!!  I assume i'm sending something incorrectly but i'm not sure what.  Any help would be appreciated.

 


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>