create order failed

Topic summary

通过 Shopify API 创建订单返回空列表且无错误信息,问题主要出现在疑似新注册的店铺,其他店铺可正常创建订单。传入字段包含 line_items 等,但未获明确错误反馈。

初步建议:参考开发者文档的订单示例代码,并确认应用已启用 Orders 访问权限(scope)。

进展:已验证示例在非问题店铺可成功;问题聚焦为新店铺可能缺少必要店铺级配置。

最新建议:检查是否已启用 Online Store 销售渠道;确认店铺已开启支付处理。测试阶段可使用 bogus gateway(测试支付网关)进行下单验证。

术语说明:

  • 访问权限 scope=应用调用订单资源所需授权。
  • 销售渠道(Online Store)=允许店铺通过在线商店接单的渠道设置。
  • bogus gateway=用于模拟支付的测试通道。

状态:尚未完全解决,讨论仍在进行。关键未决点是新开店铺是否需要额外配置以允许订单创建。

行动项:

  • 启用 Online Store 销售渠道与支付设置。
  • 使用 bogus gateway 测试下单流程。
  • 再次验证应用的 Orders 权限是否到位。
Summarized with AI on January 24. AI used: gpt-5.

当我们创建订单时,shopify 的 api 返回一个空列表,没有任何错误消息,我们不明白出了什么问题。

参数:“tags”,“financial_status”,“fulfillment_status”,“inventory_behaviour”,“line_items”,“customer”,“shipping_address”,“note_attributes”,“source_name”,“source_identifier”,“discount_codes”,“shipping_lines”
,“tax_lines”,“total_tax”

Hi MeakLi,

It looks like your trying to create an order- you could use [this example from our developer docs as a model](http:////%20Session is built by the OAuth process const order = new shopify.rest.Order({session: session}); order.line_items = [ { “title”: “Big Brown Bear Boots”, “price”: 74.99, “grams”: “1300”, “quantity”: 3, “tax_lines”: [ { “price”: 13.5, “rate”: 0.06, “title”: “State tax” } ] } ]; order.transactions = [ { “kind”: “sale”, “status”: “success”, “amount”: 238.47 } ]; order.total_tax = 13.5; order.currency = “EUR”; await order.save({ update: true, });), but you must ensure your app has orders access scope enabled.

Hope this helps!

1 Like

Hi Liam:

Yes, I can confirm that we can successfully create an order by using these fields; it is just a problem with individual shopify stores, but we found that this shopify store may be newly registered, because it does not have an order in shopify middle. Do I need to enable any configuration in shopify?

I really need your help, thanks.

Is the Online Store sales channel enabled? You may also need to ensure the store has payment processing enabled? If you’re testing you can use the bogus gateway.

1 Like