我需要从已发货订单的SQL Server 2016表导出到BigCommerce OrderShipments表。
BC API要求Order行项目作为数组对象。
我已将SQL表items
列的数据类型设置为nvarchar(max)
。
这是我的SQL发货订单表中的最终items
数组
[
{“order_product_id”:16,“product_id”:1920,“quantity”:1},
{“order_product_id”:17,“product_id”:1921,“quantity”:1}
]
此操作失败并出现错误
此数组文本正确吗,有什么建议吗?
谢谢
看来product_id字段为只读,您是否尝试删除此字段?发出此请求后,您还可以分享看到的错误吗?我在下面提供了一个我在沙盒上所做的示例请求。
作为POST请求发送到/ v2 / orders / {order_id} /货件:
{
"order_address_id":"1",
"shipping_provider":"",
"items": [
{
"order_product_id": 1,
"quantity":1
},
{
"order_product_id": 2,
"quantity":1
}
]
}