File d’attente pour traitement asynchrone
/webhooksLes webhooks envoient des notifications en temps réel lorsqu’une action se produit dans une boutique BigCommerce, avec authentification OAuth.
<overview>
Webhooks allow real-time event notifications when actions occur in a BigCommerce store. Subscribe to events like order creation, product updates, or customer changes. Webhooks use OAuth authentication and JSON payloads.
</overview>
<endpoint>
POST/GET/PUT/DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/hooks</endpoint>
<creating_webhooks>
<basic_webhook>
POST /v3/hooks
X-Auth-Token: {access_token}
Content-Type: application/json
{
"scope": "store/order/created",
"destination": "https://your-app.com/webhooks/order-created",
"is_active": true,
"headers": {
"X-Custom-Header": "my-value",
"Authorization": "Bearer your-secret-token"
}
}</basic_webhook>
<response>
{
"data": {
"id": 12345,
"client_id": "your-client-id",
"store_hash": "abc123",
"scope": "store/order/created",
"destination": "https://your-app.com/webhooks/order-created",
"is_active": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}</response>
<custom_headers>
Use custom headers to validate incoming webhooks:
- Authentication tokens
- Shared secrets for signature verification
- App identifiers
</custom_headers>
</creating_webhooks>
<webhook_scopes>
<order_events>
store/order/* # All order events
store/order/created # New order placed
store/order/updated # Order modified
store/order/archived # Order archived
store/order/statusUpdated # Status changed
store/order/message/created # New order message
store/order/refund/created # Refund processed</order_events>
<product_events>
store/product/* # All product events
store/product/created # New product
store/product/updated # Product modified
store/product/deleted # Product removed
store/product/inventory/updated # Stock level changed
store/product/inventory/order/updated # Inventory from order</product_events>
<customer_events>
store/customer/* # All customer events
store/customer/created # New customer account
store/customer/updated # Customer modified
store/customer/deleted # Customer removed
store/customer/address/created # New address added
store/customer/address/updated # Address modified
store/customer/address/deleted # Address removed
store/customer/payment/instrument/default/updated # Default payment changed</customer_events>
<cart_events>
store/cart/* # All cart events
store/cart/created # New cart
store/cart/updated # Cart modified
store/cart/deleted # Cart removed
store/cart/abandoned # Cart abandoned
store/cart/converted # Cart became order
store/cart/lineItem/* # Line item changes</cart_events>
<category_events>
store/category/* # All category events
store/category/created
store/category/updated
store/category/deleted</category_events>
<subscriber_events>
store/subscriber/* # All subscriber events
store/subscriber/created
store/subscriber/updated
store/subscriber/deleted</subscriber_events>
<channel_events>
store/channel/* # All channel events
store/channel/created
store/channel/updated</channel_events>
<sku_events>
store/sku/* # All SKU events
store/sku/created
store/sku/updated
store/sku/deleted
store/sku/inventory/updated
store/sku/inventory/order/updated</sku_events>
<shipment_events>
store/shipment/* # All shipment events
store/shipment/created
store/shipment/updated
store/shipment/deleted</shipment_events>
</webhook_scopes>
<payload_structure>
<standard_payload>
{
"scope": "store/order/created",
"store_id": "12345",
"data": {
"type": "order",
"id": 67890
},
"hash": "abc123def456",
"created_at": 1705312200,
"producer": "stores/abc123"
}The payload contains minimal data - just enough to identify what changed. Fetch full details via API.
</standard_payload>
<data_object>
The data object varies by event type:
Order events:
"data": { "type": "order", "id": 12345 }Product events:
"data": { "type": "product", "id": 111 }Customer events:
"data": { "type": "customer", "id": 222 }Inventory events:
"data": {
"type": "product",
"id": 111,
"inventory": { "product_id": 111, "method": "absolute" }
}</data_object>
</payload_structure>
<channel_webhooks>
<creatingchannelwebhook>
Subscribe to events for a specific channel (storefront):
POST /v3/hooks
{
"scope": "store/order/created",
"destination": "https://your-app.com/webhooks/channel-2-orders",
"channel_id": 2,
"is_active": true
}Only fires for orders on that specific channel.
</creatingchannelwebhook>
</channel_