我正在尝试通过交易api获取针对结帐的交易,但是尽管我遵循了所有正确的步骤,但以某种方式它给了我404。有人可以帮我弄清楚吗?
POST /admin/orders/#{order_id}/transactions.json
{ “交易”:{ “货币:美元”, “ amount”:“ 10.00”, “ kind”:“捕获”, “ parent_id”:389404469 } }
答案 0 :(得分:0)
您传递的parent_id出现问题,并导致404(找不到)。
parent_id
:关联交易的ID。
如果有用,您可以尝试其他选择:
{
"transaction": {
"kind": "capture",
"authorization": "authorization-key"
}
}
来源:https://help.shopify.com/en/api/reference/orders/transaction
编辑:
parent_id
使用GET /admin/orders/#{order_id}/transactions.json API。您将获得一笔交易
{
transactions: [{
id: 656371876577,
order_id: 586887654355,
kind: "sale",
gateway: "Cash on Delivery (COD)",
status: "pending",
message: "Pending the Cash on Delivery (COD) payment from the buyer",
created_at: "2018-07-18T10:27:39-04:00",
test: false,
authorization: null,
location_id: null,
user_id: null,
parent_id: null,
device_id: null,
receipt: {},
error_code: null,
source_name: "web",
amount: "20.06",
currency: "USD"
}]
}
此处656371876577是交易的parent_id
。
如果没有父事务,则可以将null传递为parent_id