我正在测试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“与顺序中的一项匹配。
发布于 2021-03-21 03:03:06
您正在为请求中的端点提供所需的一切。它返回的错误具有一定的误导性。"Can't be really“会暗示你错过了一个参数,而这实际上是你提供的值的问题。
行项目ID很容易与Shopify使用的各种其他ID(例如产品或变体)混淆。您需要使用订单中的行项目ID。这些ID对于每个订单的每个行项目都是唯一的,并且与产品相关的ID不同。
https://stackoverflow.com/questions/66678171
复制相似问题