🚧
Work in progress
We're still writing this guide — details may change as it's finalized.
Integrations Shopify

Shopify Order Webhook

Connect Shopify order events to SimplyClub so paid orders accrue loyalty and refunds reverse it — automatically.


Shopify Order Webhook

The Shopify Order Webhook is how a completed Shopify order becomes a SimplyClub loyalty event. When a customer checks out, Shopify sends an event to SimplyClub's server. SimplyClub uses that event to finalize the transaction — award points, lock in the chosen benefit, and (on refunds) reverse the loyalty impact.

Without this webhook, your store would still show benefits in the cart, but nothing would be recorded on the SimplyClub side after checkout.

What the webhook does

Topic What SimplyClub does Default state
orders/paid Finalizes the loyalty transaction tied to this order — accrues points, applies the selected benefit, marks the session complete. Enabled
orders/cancelled Acknowledged but ignored. Shopify also fires refunds/create on cancel, and that's the single source of truth for reversals — handling both would double-process. Always ignored
refunds/create Reverses the loyalty impact of the original order (full or partial). Disabled by default — opt in per POI from the dashboard

Endpoint

POST https://<simplyclub-server>/v1/transaction/shopify-webhook
Content-Type: application/json

Shopify must be configured to deliver the topics above to this URL.

How an order is linked to SimplyClub

Each order must carry a sc_transaction_code in its note_attributes. This is the key that links the Shopify order back to the SimplyClub session that produced its benefit.

If you installed via the SimplyClub Theme App Block (see Install on Shopify), this is wired automatically — the block stores sc_transaction_code on the cart as soon as the SimplyClub drop-in issues a transaction code, and Shopify carries cart attributes into the order's note_attributes.

If you're sending webhooks from a custom integration, the order body must contain:

{
  "id": 5001,
  "order_number": 1042,
  "customer": { "id": 9001 },
  "note_attributes": [
    { "name": "sc_transaction_code", "value": "TXN_abc123" }
  ]
}

Required headers

Header Purpose
x-shopify-topic The event topic (orders/paid, orders/cancelled, refunds/create)
x-shopify-shop-domain The myshopify.com domain — SimplyClub uses it to resolve your POI
x-shopify-hmac-sha256 HMAC signature Shopify generates using your webhook secret

Where to get the webhook secret

The webhook secret is what makes Shopify's signature verifiable on the SimplyClub side. How you obtain it depends on which path you used to install:

If you use the SimplyClub Shopify App (recommended)

You do not need to set the secret yourself. When you install the SimplyClub app from the Shopify App Store, it registers webhooks for your store and SimplyClub manages the secret end to end. Skip to Verify the webhook is firing.

If you're registering webhooks from a custom or partner-built Shopify app

You need to coordinate one shared secret between the Shopify side and the SimplyClub side.

Step 1 — Get a secret value. Either:

  • Generate one (a 64-character hex string is recommended), or
  • Request one from SimplyClub support so it's registered on SimplyClub's side first.

Step 2 — Configure it in Shopify. Open the right place depending on your app type:

App type Where to set the secret
Shopify Partner App (distributed app) Partner Dashboard → your app → App setup → Webhooks → Webhook API secret key
Custom App in a single store Shopify Admin → Settings → Apps and sales channels → your custom app → Webhooks → Webhook API secret key

Paste the secret and save. From this point on Shopify will sign every outgoing webhook with this key and include x-shopify-hmac-sha256 in the headers.

Step 3 — Register the same secret with SimplyClub. Send the secret to SimplyClub support so it can be stored against your merchant account, or use the vendor admin tools you've been given access to. The signature can only be verified once both sides agree on the same secret.

Important: Treat this secret like a password. Don't commit it to source control, don't expose it in client-side code, and don't paste it into logs. If you suspect it has leaked, rotate it on both sides simultaneously.

Configure webhook topics in Shopify

Whichever path you used, the webhook needs at least these topics pointed at the SimplyClub endpoint:

  • orders/paid — required for points to accrue
  • refunds/create — required if you want refunds to reverse points (and you have toggled the topic on in the SimplyClub dashboard for this POI)

In a Custom App, register topics under Settings → Notifications → Webhooks. In a Partner App, register them via the Admin API or the app's webhook configuration screen.

Per-POI topic toggles

Even with the webhook registered, SimplyClub will only act on topics that are enabled for your POI. You can toggle topics from the SimplyClub dashboard. Defaults:

  • orders/paid — on
  • refunds/create — off

Turning a topic off means SimplyClub will accept the webhook and return 200, but take no action.

Verify the webhook is firing

Place a test order in your store, then check the SimplyClub dashboard logs for an entry like:

💰 WEBHOOK RECEIVED | Topic: orders/paid | Order ID: <id> | Transaction Code: TXN_… | Domain: <yourshop>
✅ POI found
🔄 Processing webhook topic: orders/paid
💰 WEBHOOK COMPLETED | … | <ms>ms

If you don't see a log entry at all, the webhook isn't reaching SimplyClub — check the Shopify webhook delivery history for delivery attempts and error responses.

Common rejection reasons

Symptom Cause Fix
401 Webhook headers validation failed Missing x-shopify-topic or x-shopify-shop-domain Make sure Shopify is sending standard webhook headers; if you're forwarding the webhook through a proxy, preserve the original headers.
400 Note validation failed — sc_transaction_code not found The order doesn't carry the transaction code Confirm the SimplyClub Theme App Block is installed, or that your custom integration writes sc_transaction_code to cart attributes before checkout.
400 POI not found The x-shopify-shop-domain doesn't match a configured POI in SimplyClub Confirm the shop domain is exactly what you onboarded with (e.g. mystore.myshopify.com).
200 — skipped (topic disabled) The topic is turned off for this POI Enable the topic from the SimplyClub dashboard.
200 — orders/cancelled acknowledged — no action taken By design — see the What the webhook does table No fix needed; refunds/create does the work.

Related

  • Install on Shopify — how to add the SimplyClub block and where sc_transaction_code is set.
  • Membership CTA Web Component — for embedding the join/upgrade CTA outside the main drop-in.