B2B Edition Webhooks

B2B Edition is BigCommerce’s all-in-one solution that offers enterprise-level B2B functionality to businesses of all types and sizes. It enables business owners to facilitate their B2B operations online and to provide customers with self-service account capabilities and seamless transactions.

This page is a reference for B2B Edition webhooks and it assumes that you’re familiar with webhooks. For a general introduction to webhooks, see Webhooks Overview.

Note: B2B Edition currently does not support storefront channel-specific webhooks.

Creating a webhook

To create a webhook, send a request to the Create a webhook endpoint. You must use a BigCommerce store- or app-level API account to authenticate the request; it does not support the API tokens created in your B2B Edition API Account settings. Your API account must have the B2B Edition scope set to modify.

The following example creates a webhook that subscribes to creation events for Company accounts.

Example request: Create a webhook
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/hooks
X-Auth-Token: {{ACCESS_TOKEN}}
Content-Type: application/json
Accept: application/json
{
"scope": "store/company/created",
"destination": "https://example.com/webhooks", // replace with your HTTPS endpoint URL
"is_active": true
}
  • The destination URL must be served on port 443; custom ports are not currently supported.
  • It can take up to one minute for a newly created webhook to work.

For information on creating a webhook, consult the creating a webhook section of the Webhooks Overview.

Callback structure

For information on webhook callback payload properties, see Webhook Events.

Companies

The following webhooks fire in response to changes to Company account records. You can use them to track new Company account requests across your storefront channels, updates to Company information, or changes in a Company’s activity status.

Name / ScopeDescription
store/company/createdFires when a new Company account is created in the storefront, from the B2B Edition control panel, or via the Server to Server API. Note that this webhook does not fire when the REST Management Bulk Create Companies endpoint is used.
store/company/updatedFires when a Company’s basic information is updated, including:
- Company name
- Email address
- Phone number
- Assigned customer group ID (Must be using Independent Companies behavior)
- Legal address
- UUID
- Activity status
- Parent Company (Must be using Account Hierarchy)
- Assigned price list (Must be using Dependent Companies behavior)
- Company extra field values
store/company/deletedFires when a Company account is deleted from the B2B Edition control panel or via the API.
store/company/statusUpdatedFires when a Company’s activity status changes, such as when a pending Company account is approved.
Example Company created payload object
{
"scope": "store/company/created",
"store_id": "123456",
"data": {
"company_id": 1234
},
"hash": "352e4afc6dd3fc85ea26bfdf3f91852604d57528",
"created_at": 1561482670,
"producer": "stores/{store_hash}"
}

Company Users

The following webhooks fire in response to changes to Company users. These are B2B customers with a Buyer Portal account connected to a Company. Changes to B2C customers, guest shoppers, and Super Admins do not trigger these webhooks.

Name / ScopeDescription
store/company/user/createdFires when a new Company user is created in the storefront, from the B2B Edition control panel, or via the API.
store/company/user/updatedFires when a Company user’s account information is updated, including:
- User name
- Email address
- Phone number
- Company user extra field values
store/company/user/deletedFires when a Company user is deleted in the storefront, from the B2B Edition control panel, or via the API.
store/company/superadmin/assignmentUpdatedFires when a Super Admin is assigned to or unassigned from a Company.
Example Company user created payload object
{
"scope": "store/company/user/created",
"store_id": "123456",
"data": {
"company_id": 123456,
"user_id": 321
},
"hash": "352e4afc6dd3fc85ea26bfdf3f91852604d57528",
"created_at": 1561482670,
"producer": "stores/{store_hash}"
}

Company Addresses

The following webhooks fire in response to changes to addresses saved to Company accounts. Changes to addresses on B2C customer accounts use Customers webhooks instead.

Name / ScopeDescription
store/company/address/createdFires when a new Company address is saved to a Company in the storefront, from the B2B Edition control panel, or via the API.
store/company/address/updatedFires when any field on an existing Company address is updated, including Company address extra field values.
store/company/address/deletedFires when a Company address is deleted in the storefront, from the B2B Edition control panel, or via the API.
Example Company address created payload object
{
"scope": "store/company/address/created",
"store_id": "123456",
"data": {
"company_id": 123456,
"address_id": 1234
},
"hash": "352e4afc6dd3fc85ea26bfdf3f91852604d57528",
"created_at": 1561482670,
"producer": "stores/{store_hash}"
}

Super Admins

The following webhooks fire in response to changes to Super Admins, sales staff who assist Company users from the Buyer Portal.

Name / ScopeDescription
store/superadmin/createdFires when a new Super Admin is created the B2B Edition control panel or via the API.
store/superadmin/updatedFires when a Super Admin’s account information is updated, including:
- Email address
- Name
- Phone number
- Assigned/Unassigned Company accounts
store/superadmin/deletedFires when a Super Admin is deleted from the B2B Edition control panel or via the API.
store/superadmin/assignmentUpdatedFires when a Super Admin’s Company assignments are updated.
Example Company address created payload object
{
"scope": "store/superadmin/created",
"store_id": "123456",
"data": {
"user_id": 1234
},
"hash": "352e4afc6dd3fc85ea26bfdf3f91852604d57528",
"created_at": 1561482670,
"producer": "stores/{store_hash}"
}

Quotes

The following webhooks fire in response to changes to quotes. You can use them to track quote lifecycle events such as creation, updates, status changes, and deletions.

Name / ScopeDescription
store/quote/createdFires when a new quote is created.
store/quote/updatedFires when a quote is updated.
store/quote/statusUpdatedFires when a quote’s status is changed.
store/quote/deletedFires when a quote is deleted.
Example quote created payload object
{
"created_at": 1561482670,
"store_id": "1025646",
"producer": "stores/{store_hash}",
"scope": "store/quote/created",
"hash": "352e4afc6dd3fc85ea26bfdf3f91db8c86f74f09",
"data": {
"type": "quote",
"id": 123
}
}

Resources