I created a webhook in BigCommerce using following code:
use Bigcommerce\Api\Connection;
$connection = new Connection();
$connection->setCipher('RC4-SHA');
$connection->verifyPeer(false);
$connection->addHeader('X-Auth-Client', $clientId);
$connection->addHeader('X-Auth-Token', $token);
$response = $connection->post('https://api.bigcommerce.com/stores/' . $hash . '/v2/hooks', json_encode(array(
    'scope'=>'store/order/created',
    'destination'=>'https://bigcommerce.example.com/order'
)));
I got the response as following:
stdClass Object
(
    [id] => 568
    [client_id] => lms4gxejy2xw2bia7w30v3bal1sz5yz
    [store_hash] => xxxxxx
    [scope] => store/order/created
    [destination] => https://bigcommerce.example.com/order
    [headers] => 
    [is_active] => 1
    [created_at] => 1403762563
    [updated_at] => 1403762563
)
However, I never got any callbacks to https://bigcommerce.example.com/order from BigCommerce whenever order is placed. The website is having a valid SSL. Any ideas?
ClientID & ClientSecret?
I assume you are using the standard (now old) authentication and not using OAuth for your integration? OAuth is required for webhooks (see the documentation).
I know you have HTTPS but you also need a valid cert from a trusted CA. (Only mentioned as it is commonly an issue)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With