Webhooks

Webhooks v3

Get notified when specific events occur on a BigCommerce store. For more information, see the Webhooks Overview, Webhooks Events, or Webhooks Tutorial.

In general, webhook usage follows the workflow

  1. Create a webhook for a specific scope using Create a Webhook
  2. Receive event callback payload at the destination URL
  3. Respond to callback with success status 2xx or any failure status
    1. On failure, await second callback attempt
    2. On success, move to event handling
  4. Handle event based on payload

Callback payloads have a uniform structure, including the minimum information to uniquely identify what event occurred, on what store, with respect to what data, and at what time. The data object serves as the only variable data structure in the payload.

For inventory and location events, data will include location_id, and variant_id or product_id as necessary. For all other events data will include type, id, and any scope-specific information (such as couponId for the store/cart/couponApplied). Scope-specific fields are outlined in the Webhooks Events.

An example of payload structure is include below. Datatypes are outlined in the following table.

FieldTypeExample
producerstringstores/abc123
hashstringdd70c0976e06b67aaf671e73f49dcb79230ebf9d
created_atinteger1561479335
store_idstring1025646
scopestringstore/order/created
dataobjectvariable
data.typestringproduct
data.idinteger223
Example callback structure
{
  "producer": "stores/<STORE_HASH>"
  "hash": <EVENT_HASH>,
  "created_at": <EVENT_TIMESTAMP>,
  "store_id": <STORE_ID>,
  "scope": <WEBHOOK_SCOPE>,
  "data": {
    <EVENT_DATA>
  },
}
Did you find what you were looking for?