Shopify API, unable to create order

匿名 (未验证) 提交于 2019-12-03 09:52:54

问题:

I created private application on my test shop and I am trying to create simple order via the Shopify API following the instructions found here:

http://docs.shopify.com/api/order#create

I am using the last example, and sending POST request to admin/orders.json with this in the body of the request:

{   "order": {     "line_items": [       {         "quantity": 1,         "variant_id": 500775053       }     ]   } }

500775053 is a valid variant id.

The response I'm getting is:

{     "errors": {         "line_items": [             "must have at least one line item"         ]     } }

I don't understand what am I doing wrong? Is there some special parameter that I should pass along the request? Some special header?

Thank you for your help!

回答1:

Try adding these custom headers:

Content-Type: application/json Accept: application/json


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!