Shopify
Check Shopify orders with a theme snippet and a small server of your own. No app needed.
What you get
A decision on each order, moments after it is placed. You need a theme you can edit and a server that can receive a webhook.
Add the tag to your theme
In layout/theme.liquid, before </head>. It runs on every page your theme serves, such as the storefront and the cart.
<script async src="https://signetsentry.com/v1/tag.js" data-site-key="pk_live_..."></script>
Carry the session to the order
Save the session ID as a cart attribute. Shopify keeps cart attributes with the order.
<script>
addEventListener('signet:session', function (e) {
fetch(window.Shopify.routes.root + 'cart/update.js', {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ attributes: { signet_session_id: e.detail.session_id } })
});
});
</script>
Place a test order and check that the attribute is on it. An order that skips the cart may arrive without one: check it by hand.
Assess the order
In Shopify, open Settings, Notifications, Webhooks and create one for Order creation in JSON, sent to your server. There, read the session from note_attributes:
const { Signet } = require('./signet');
const signet = new Signet({ secretKey: process.env.SIGNET_SECRET_KEY });
async function orderCreated(order) {
const a = (order.note_attributes || []).find(x => x.name === 'signet_session_id');
if (!a) return tellStaff(order.name, 'No Signet session'); // check it by hand
const v = await signet.assess({
sessionId: a.value, event: 'checkout', email: order.email,
amount: Number(order.total_price), currency: order.currency, transactionId: String(order.id),
ip: order.browser_ip, userAgent: order.client_details && order.client_details.user_agent });
if (v.decision !== 'allow') await tellStaff(order.name, v.summary); // your own alert
}
Check the X-Shopify-Hmac-SHA256 header against the raw body before you trust a webhook. Use Send test on the Webhooks page to confirm your check passes. Answer with 200 quickly: Shopify deletes a webhook that keeps failing.
Label confirmed fraud with feedback.
Act on the decision
| Decision | What to do |
|---|---|
allow | Fulfill the order. |
review | Tag it and check it by hand. |
deny | Tag it and do not fulfill it. |
What this does not do
- Checkout. No theme script runs on Shopify’s checkout pages.
- Sign-in. Current customer accounts are hosted by Shopify, so login and registration are not covered. Stores still on legacy accounts use theme pages, which are.
- Stopping payment. The order is checked after it is placed.
- Holding or canceling. Doing it from code needs an app with order permissions. Shopify Flow can tag an order or hold its fulfillment.
Checked against Shopify’s developer documentation and Help Center on November 24, 2026.