【发布时间】:2021-03-17 17:23:37
【问题描述】:
我正在 Postman 中测试 Shopify API 并运行此请求:
https://shopify.dev/docs/admin-api/rest/reference/orders/refund#calculate-2021-01
https://{{api_key}}:{{api_password}}@{{store_name}}.myshopify.com/admin/api/{{api_version}}/orders/{{order_id}}/refunds/calculate.json
用这个身体:
"refund": {
"shipping": {
"full_refund": false
},
"refund_line_items": [
{
"line_item_id": 5843458293926,
"quantity": 1,
"restock_type": "no_restock"
}
]
}
}
我收到此错误:
{
"errors": {
"refund_line_items.line_item": [
"can't be blank"
]
}
}
我检查了我在请求中使用的所有变量都是正确的,并且“line_item_id”与订单中的项目匹配。
【问题讨论】:
-
no_restock 类型需要每个文档位置 ID
-
当您说您检查了 line_item_id 与订单中的某个项目匹配时,您能否确认您检查了它与实际订单项 ID 而不是产品或变体 ID 匹配?您从哪里获得订单项 ID?
-
@blrsk 很高兴我能帮上忙。我想很多其他人也陷入了同样的陷阱,所以我把它写下来作为将来参考的答案。
标签: postman shopify shopify-api