我正在使用php使用Bigcommerce API。我已经成功创建了store/order/created
webhook,但只有在我使用商店控制面板创建订单时才触发,当我在代码中向orders
端点发布订单时,即使我的订单有已成功创建。
我发布的示例订单如下:
$product = new \stdClass();
$product->product_id = 194;
$product->sku = 'test-prod-1';
$product->quantity = 1;
$shippingAddress = new \stdClass();
$shippingAddress->first_name = "Trisha";
$shippingAddress->last_name = "McLaughlin";
$shippingAddress->street_1 = "Mikonkatu 15A";
$shippingAddress->city = "Helsinki";
$shippingAddress->zip = "00100";
$shippingAddress->country_iso2 = "FI";
$shippingAddress->phone = "0452507625";
$orderData = array(
'date_created' => 'Wed, 14 Nov 2012 19:26:23 +0000',
'customer_id' => 1,
'payment_method' => 'Cash',
'external_source' => 'Test',
'billing_address' => $shippingAddress,
'status_id' => 11,
'products' => array(
$product
)
);
$bcOrder = Bigcommerce::createOrder($orderData);
任何人都有同样的问题吗?
由于
答案 0 :(得分:1)
成功下单后,您更有可能看到store/order/updated
正确触发。尝试不成功的订单和其他一些变量时,store/order/created
可能会触发,但第一个store/order/updated
应正确识别系统中的新订单。