Shopify API,无法创造秩序 [英] Shopify API, unable to create order

查看:227
本文介绍了Shopify API,无法创造秩序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的测试店创建私有应用程序,我试图通过Shopify API按照指示找到这里来创建简单的命令:

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

我使用的是最后一个例子,并在请求的主体发送POST请求管理员/ orders.json这一点:

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是一个有效变种标识。

我得到的回应是:

{
    "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?

感谢您的帮助!

推荐答案

尝试添加这些定制标题:

Try adding these custom headers:

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

这篇关于Shopify API,无法创造秩序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆