BuddyStat

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

  1. Create a webhook in Commerce (in your site's sidebar).
  2. BuddyStat gives you a webhook URL and you set a secret.
  3. Your platform calls the webhook when an order is placed or refunded.
  4. BuddyStat verifies the signature and writes the event.

Shopify

  1. 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.
  2. Copy the displayed webhook URL.
  3. In your Shopify admin: Settings → Notifications → Webhooks → Create webhook and add two webhooks:
    • Event: Order createdURL: your webhook URL
    • Event: Refund createdURL: your webhook URL
  4. Save. Shopify signs every request with X-Shopify-Hmac-Sha256; BuddyStat verifies it with your secret.

Shopify payload mapping

Shopify fieldBuddyStat event
total_pricepurchase revenue
total_discountspurchase discount
total_taxpurchase tax
shipping_lines[].price (sum)purchase shipping
discount_codes[0].codepurchase 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}/webhook

with the header:

X-Commerce-Webhook-Secret: your-secret

Order 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)

On this page