Commerce Ingestion
Sync orders and refunds server-side from Shopify, WooCommerce, BigCommerce or any commerce platform — no tracking script changes needed.
Commerce ingestion lets you send order and refund data from your backend (Shopify webhooks, WooCommerce webhooks, or any custom integration) straight into BuddyStat. Orders become purchase events, refunds become refund events — the same events your e-commerce tracking script sends, so all product, funnel, order and attribution analytics light up with zero client-side changes.
Only product IDs/SKUs, quantities and money amounts are stored. No customer names, emails, addresses or other PII ever reaches BuddyStat.
How it works
- Create a webhook in Commerce (in your site's sidebar).
- BuddyStat gives you a webhook URL and you set a secret.
- Your platform calls the webhook when an order is placed or refunded.
- BuddyStat verifies the signature and writes the event.
Shopify
- Open Commerce for your site, choose Shopify, and enter:
- Webhook secret — your Shopify Admin API access token is not used; use the Shopify API secret for HMAC verification (create an app or use an existing one to get
API secret). - Shop domain — e.g.
mystore.myshopify.com.
- Webhook secret — your Shopify Admin API access token is not used; use the Shopify API secret for HMAC verification (create an app or use an existing one to get
- Copy the displayed webhook URL.
- In your Shopify admin: Settings → Notifications → Webhooks → Create webhook and add two webhooks:
- Event:
Order created→ URL: your webhook URL - Event:
Refund created→ URL: your webhook URL
- Event:
- Save. Shopify signs every request with
X-Shopify-Hmac-Sha256; BuddyStat verifies it with your secret.
Shopify payload mapping
| Shopify field | BuddyStat event |
|---|---|
total_price | purchase revenue |
total_discounts | purchase discount |
total_tax | purchase tax |
shipping_lines[].price (sum) | purchase shipping |
discount_codes[0].code | purchase coupon |
line_items[] (product_id, title, price, quantity, variant_title) | purchase items[] |
refunds/create (transactions[] sum, refund_line_items[]) | refund event |
Generic commerce webhook (WooCommerce, BigCommerce, custom)
For any other platform, choose Generic Commerce (or WooCommerce to label the connection) and set a webhook secret. Then POST to:
{BACKEND_URL}/v1/ingest/commerce/{SITE_ID}/webhookwith the header:
X-Commerce-Webhook-Secret: your-secretOrder created
{
"event": "order.created",
"order": {
"orderId": "ORD-12345",
"revenue": 129.98,
"currency": "EUR",
"coupon": "SAVE10",
"tax": 20.0,
"shipping": 5.99,
"discount": 10.0,
"items": [
{ "id": "sku-123", "name": "Canvas Tote", "price": 49.99, "quantity": 2, "category": "Bags", "variant": "Black" }
]
}
}Refund created
{
"event": "order.refunded",
"refund": {
"orderId": "ORD-12345",
"revenue": 49.99,
"currency": "EUR",
"items": [{ "id": "sku-123", "price": 49.99, "quantity": 1 }]
}
}Supported events: order.created, order.paid, order.refunded, refund.created.
What lights up
Once orders flow in, the following all work without the tracking script on your storefront:
- Products — views/ATC/checkouts/purchases/revenue/AOV per product
- Revenue — order metrics, net vs gross, refunds, repeat-purchase rate
- Orders — the order browser with line-item drill-down
- Attribution — coupon-attributed revenue (promo tracking)