Setting up Front-Commerce
You need to setup the webhook secret within your Front-Commerce app with the
FRONT_COMMERCE_BIG_COMMERCE_WEBHOOK_SECRET environment variable.
Create a random secret by running
openssl rand -hex 25 in your terminal.
Setting up BigCommerce
We will now create webhooks for the following scopes:
We first need to setup Authentication for your BigCommerce account (you can refer to the documentation).
We will need to create the webhook api to get an Access Token and the Store Hash
Navigate to your BigCommerce account and click on the
Settingstab, scroll down and open
API > API accounts.
Click on the
+ Create API Accountbutton.
API pathas it contains the
Create a new webhook with
read-onlyaccess on the following scopes
Information & settings
Get payment methods
Sites & routes
Save the API account, and copy the
Access Token. (see figure below)https://store-yhowbpps2e.mybigcommerce.com/manage/settings/api-accounts
You are now ready to get started with your webhooks, we have created a
BigCommerce Webhook API
in postman to simplify this process, you can hit the
Run in Postman button and
simply replace all the relevant variables to get started
creating your webhooks.
Creating a webhook
You can refer to the Create folder in the BigCommerce Webhook API, to create the correct webhooks.
All listed webhooks are required for cache invalidation.
Updating a webhook
To update a webhook, you first need to run the
GET ALL WEBHOOKS api to get an
array of webhooks. You can then replace the
WEBHOOK_ID variable with the id of
the webhook that you want to remove. Once that has been done you can
Create a new webhook with the new settings.