We build custom applications 5x faster and cheaper 🚀
Book a Free Consultation
Stuck on an error? Book a 30-minute call with an engineer and get a direct fix + next steps. No pressure, no commitment.
Integrate Shopify with OpenClaw by installing a Shopify skill in ClawHub, performing Shopify’s OAuth (or using a Shopify custom app token) to obtain and securely store API credentials, exposing a reliable webhook receiver outside the agent for event-driven flows, and implementing signed REST/GraphQL calls from your skill/agent to the Shopify Admin APIs. Keep long-running, stateful, and public endpoints outside the agent runtime; the agent should only call the Shopify APIs or your external services using properly-scoped tokens you manage in ClawHub or your secrets store.
Merchant authorization:
# <b>//</b> Direct merchant to this URL (replace placeholders)
# <b>//</b> GET https://{shop}.myshopify.com/admin/oauth/authorize?client_id={client_id}&scope={scopes}&redirect_uri={redirect_uri}
Exchange code for token (server-side):
curl -X POST "https://{shop}.myshopify.com/admin/oauth/access_token" \
-H "Content-Type: application/json" \
-d '{
"client_id":"YOUR_CLIENT_ID",
"client_secret":"YOUR_CLIENT_SECRET",
"code":"AUTHORIZATION_CODE"
}'
Response contains an access\_token you must store securely.
curl -X GET "https://{shop}.myshopify.com/admin/api/2023-10/products.json" \
-H "X-Shopify-Access-Token: YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"
Or GraphQL (POST), using the same header or the documented GraphQL header for the API you call.
// <b>//</b> Example Express middleware to verify Shopify webhook HMAC
const crypto = require('crypto');
// <b>//</b> Keep raw body for HMAC verification
app.use(express.json({
verify: (req, res, buf) => { req.rawBody = buf; }
}));
function verifyShopifyWebhook(req, res, next) {
const hmacHeader = req.get('X-Shopify-Hmac-Sha256');
const secret = process.env.SHOPIFY_CLIENT_SECRET; // <b>//</b> stored securely
const computed = crypto.createHmac('sha256', secret).update(req.rawBody).digest('base64');
// <b>//</b> constant-time compare
if (!crypto.timingSafeEqual(Buffer.from(computed), Buffer.from(hmacHeader))) {
return res.status(401).send('Invalid HMAC');
}
next();
}
app.post('/webhook/orders/create', verifyShopifyWebhook, (req, res) => {
// <b>//</b> process webhook: queue event, call agent, etc.
res.status(200).send('OK');
});
Speak one‑on‑one with a senior engineer about your no‑code app, migration goals, and budget. In just half an hour you’ll leave with clear, actionable next steps—no strings attached.
1
The webhook signature fails when the HMAC Shopify sends (in X-Shopify-Hmac-Sha256) doesn’t match the HMAC you compute—usually because the raw request body was altered (JSON parsed or normalized), the wrong secret is used, you compare base64 vs hex, or you don’t use a constant-time compare.
const crypto = require('crypto');
function verifyShopify(bodyRaw, secret, header) {
const hmac = crypto.createHmac('sha256', secret).update(bodyRaw, 'utf8').digest('base64');
return crypto.timingSafeEqual(Buffer.from(hmac), Buffer.from(header));
}
module.exports = { verifyShopify };
2
A 401 Unauthorized means Shopify rejected the credential the OpenClaw Connector sent. In practice that’s almost always an invalid/expired/revoked token, the wrong token type (storefront vs admin), a bad header or endpoint, or the Connector isn’t loading the correct environment variable/secret before the skill call.
fetch('https://your-store.myshopify.com/admin/api/2023-10/shop.json', {
method: 'GET',
headers: {
// X-Shopify-Access-Token must be the Admin access token
'X-Shopify-Access-Token': process.env.SHOPIFY_ADMIN_TOKEN
}
})3
Direct answer: The common causes are that the Claw Mapping Profile is pointing at the product-level SKU field while Shopify stores SKUs on variants, the Sync Job is not configured to iterate or expand variants, or the Shopify API/credentials return variant objects without a populated sku field. Verify mapping targets, job settings, and the API response.
Check the raw Shopify API payload in logs to confirm where SKU appears (product.sku vs variant.sku). Ensure the Sync Job is configured to process variant records (or map a variant collection to the OpenClaw SKU field). Confirm OAuth/API token has read_products scope so variants are returned, and that variant.sku values aren’t empty. Update the Claw Mapping Profile to reference the correct JSON path or iterate variants, then re-run a single-product sync and inspect mapping errors in the job log.
4
OpenClaw shows wrong stock after Shopify fulfillment when the runtime missed or misapplied Shopify events (webhook delivery failures, permission/auth issues, wrong location/SKU mapping, or race conditions). Reconcile by re-reading Shopify’s authoritative inventory, applying idempotent updates to the OpenClaw skill’s datastore (or external DB), and repairing missed events.
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
From startups to enterprises and everything in between, see for yourself our incredible impact.
Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We’ll discuss your project and provide a custom quote at no cost.Â