gpt4 book ai didi

shopify - 如何使用Shopify API更改订单的付款状态?

转载 作者:行者123 更新时间:2023-12-02 15:06:29 39 4
gpt4 key购买 nike

我正在为我自己的 Shopify 商店构建 iOS 应用。我创建了一个私有(private)应用程序,并使用 API key 和密码来调用以下格式的 API:

https://apikey:password@hostname/admin/resource.json

当我尝试使用 API 更改订单的付款状态时出现问题。 (我可以毫无问题地创建新订单)。我没有找到任何用于更改订单财务状态的 API。我无法通过修改订单来更改财务状况,甚至无法通过 API 进行任何交易,无论交易的“种类”是:“授权”、“捕获”或“销售”。

那么如何使用 API 更改订单的财务状态?

以下是使用 API 的请求和响应的示例:

调用的对象:

/admin/orders/#{order_id}/transactions.json

请求:

{
"transaction": {
"amount": 50,
"test":true,
"kind": "sale"
}
}

回复:

{"errors":{"kind":["sale is not a valid transaction"]}}

最佳答案

只需尝试几件事:

我在 Transaction doco 中注意到金额周围有引号,但您的代码中没有这些引号(例如,尝试使用“50.00”而不是 50):

POST /admin/orders/#{id}/transactions.json

{
"transaction": {
"amount": "10.00",
"kind": "capture"
}
}

还有,你见过this discussion吗?在 Shopify 论坛上?

...it seems to work so long as the amount of the transaction doesn't exceed the total outstanding balance of the order. From what I have gathered you can not charge or create a transaction for more than the initial sale amount of the order...

关于shopify - 如何使用Shopify API更改订单的付款状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24340507/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com