Architecture overview
The connector runs as an ASP.NET Core application on AWS Lambda. Incoming BigCommerce webhooks are validated synchronously for signature integrity, then handed off asynchronously via SQS. A separate Lambda function polls the SQS queue and processes events in parallel batches.Webhook authentication
Every incoming webhook from BigCommerce is verified before processing:- The connector extracts the store hash from the
producerfield of the payload. - It looks up the client secret for that store from the secrets store.
- It computes an HMAC-SHA256 digest of the raw request body using the client secret.
- The result is compared against the
X-BC-Signaturerequest header.
401 Unauthorized. If validation passes, the payload is queued for asynchronous processing.
Contact sync
Real-time webhook flow
The following BigCommerce webhook scopes trigger contact upserts in Engage:
When a
created or updated event arrives, the connector:
- Fetches full customer data from BigCommerce v3 (
customers?id:in={id}&include=addresses). - Extracts the
origin_channel_idto resolve which sales channel the customer belongs to. - Checks whether a contact with that email already exists in Engage.
- Creates a new contact or updates the existing one.
Contact field mapping
Phone numbers are validated and normalised to E.164 format using the libphonenumber library. Invalid numbers are omitted rather than stored in a broken format
Order sync
Webhook events
When
store/order/statusUpdated fires for a refund status (status ID 4 or 14), the connector skips it. The authoritative event for refunds is store/order/refund/created.
Two-phase processing
- Stage — When a webhook arrives, the connector fetches order and line item data from BigCommerce and writes a
Pendingrecord with the full payload. - Process — The event processor picks up pending records and sends the order to Engage.
Order status mapping
The following statuses are skipped — no action is taken in Engage:
- Awaiting Payment (7)
- Awaiting Shipment (9)
- Manual Verification Required (12)
- Declined (6)
- Any unrecognised status ID
Line items and promotions
For each order, the connector:- Maps each line item to a Voyado line item (SKU, quantity, price, discount) using
v2/orders/{id}/products. - Fetches payment methods from BigCommerce and attaches them to the order payload.
- Looks up any coupon code applied to the order and redeems the matching Engage promotion if found.
Return orders
Whenstore/order/refund/created fires:
- The
refund_idis extracted from the payload. - The connector fetches the parent order data.
- A pending record is written with the return type and
refund_idas a sub-identifier. - The event processor processes it as a RETURN order using the status mapping table above.
Cart tracking
The storefront posts cart data to the connector. The connector:- Resolves the store and channel from
hashandsaleschannelUrl. - Checks that Cart tracking is enabled.
- Fetches the store locale from BigCommerce (
v3/settings/store/locale). - Builds a cart payload and posts it to Voyado’s Collect API.
Cart-converted webhook
When BigCommerce firesstore/cart/converted, the connector:
- Extracts the
orderIdfrom the payload. - Fetches the order from BigCommerce to get the
channel_idandbilling_address.email. - Looks up the Engage contact ID for that email.
- Posts a cart event to the Collect API with the resolved contact ID, linking an empty cart session to the identified contact.
Product tracking
The storefront posts product view data to the connector. The connector:- Resolves the store and channel from
hashandsaleschannelUrl. - Checks that Product tracking is enabled.
- Fetches the product from BigCommerce by SKU (
v3/catalog/products?sku={sku}). - Resolves up to 5 category names from the product’s category IDs (most specific categories). Category names are joined with
/and capped at 255 characters. - Fetches the store locale.
- Builds a
productviewpayload and posts it to the Collect API.
Multi-channel support
A single BigCommerce store can have multiple sales channels, each with its own configuration and site record. The connector resolves the correct configuration by matching store hash and sales channel ID. For webhook scopes that don’t include achannel_id, the connector fetches the customer or order from BigCommerce to discover the channel before routing.
Webhook health and self-healing
A background job periodically checks all registered BigCommerce webhooks. It:- Re-activates inactive webhooks via a PUT to BigCommerce’s
v3/hooks/{id}. - Detects missing webhook scopes and registers them.