【发布时间】:2019-11-20 21:41:43
【问题描述】:
我正在使用 BigCommerce 订单 API 端点来创建订单,以前它工作正常,但在上周,我遇到了错误。 API 返回 500 内部服务器错误,没有任何描述性响应:
我已经通过实时聊天和电话支持联系了 BigCommerce,但没有人能提供解释,我几乎把我送到了开发者社区论坛。以下是我正在使用的请求正文以及其他详细信息:
Endpoint:
https://api.bigcommerce.com/stores/{code}/v2/orders
Method: POST
Headers:
X-Auth-Client: {token}
X-Auth-Token: {token}
Content-Type:application/json
{
"customer_id": 0,
"status_id": 10,
"date_created": "Mon, 14 Oct 2019 23:25:58 GMT",
"subtotal_ex_tax": 265.00,
"subtotal_inc_tax": 265.00,
"base_shipping_cost": 0.00,
"shipping_cost_ex_tax": 0.00,
"shipping_cost_inc_tax": 0.00,
"base_handling_cost": 0,
"handling_cost_ex_tax": 0,
"handling_cost_inc_tax": 0,
"base_wrapping_cost": 0,
"wrapping_cost_ex_tax": 0,
"wrapping_cost_inc_tax": 0,
"total_ex_tax": 265.00,
"total_inc_tax": 265.00,
"refunded_amount": 0,
"order_is_digital": false,
"staff_notes": "",
"customer_message": "",
"discount_amount": 0,
"billing_address": {
"city": "Secaucus",
"company": "Test",
"country": "United States",
"country_iso2": "US",
"email": "test@test.com",
"first_name": "Carlos",
"last_name": "Dominguez",
"phone": "555-555-5555",
"state": "New Jersey",
"street_1": "Test Av 749",
"street_2": "",
"zip": "07094"
},
"shipping_addresses": [
{
"city": "Secaucus",
"company": "Test",
"country": "United States",
"country_iso2": "US",
"email": "test@test.com",
"first_name": "Carlos",
"last_name": "Dominguez",
"phone": "555-555-5555",
"state": "New Jersey",
"street_1": "Test Av 749",
"street_2": "",
"zip": "07094"
}
],
"products": [
{
"product_id": 100,
"quantity": 1,
"price_ex_tax": "40.00",
"price_inc_tax": "40.00",
"name": "Product 1",
"sku": "ABC123",
"product_options": [
{
"id": "1000",
"value": "100"
}
]
},
{
"product_id": 101,
"quantity": 1,
"price_ex_tax": "75.00",
"price_inc_tax": "75.00",
"name": "Product 2",
"sku": "ABCXYZ",
"product_options": [
{
"id": "1001",
"value": "1001"
}
]
},
{
"product_id": 102,
"quantity": 1,
"price_ex_tax": "75.00",
"price_inc_tax": "75.00",
"name": " Product 3",
"sku": "QWERT12",
"product_options": [
{
"id": "1003",
"value": "105"
}
]
},
{
"product_id": 105,
"quantity": 1,
"price_ex_tax": "75.00",
"price_inc_tax": "75.00",
"name": "Product 4",
"sku": "PLPOO54",
"product_options": [
{
"id": 1333,
"value": "270"
}
]
}
],
"external_source": "CompanyName",
"payment_method": "CompanyName",
"payment_provider_id": ""
}
我应该提到的一件事是,如果我从请求中删除某个产品,则订单创建工作。该产品有库存,与请求的其他产品没有区别
【问题讨论】:
-
我注意到,除了一个产品选项之外,所有产品选项都有数字字符串作为 ID。端点期望这些是整数。
标签: api bigcommerce