Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to fix: Error: Could not validate request HMAC

How to fix: Error: Could not validate request HMAC

bovojon
Shopify Partner
24 0 1

Hi all,

 

I am using the shopifyApp from @Shopify/shopify-app-express to setup the Shopify webserver but I keep running into this error:

 

Failed to process webhook: Error: Could not validate request HMAC

I suspect that I am not passing the correct hostName to the api key but not sure how to fix this issue.

 

Can someone please help me understand what I am doing wrong? Thank you!

 

The setup:

const shopify = shopifyApp({

api: {

apiVersion: LATEST_API_VERSION,

restResources,

billing: undefined,

apiKey: 'hidden',

apiSecretKey: 'hidden',

accessMode: 'offline',

scopes: ['read_products','write_products','write_customers','write_draft_orders','unauthenticated_read_product_listings','read_product_listings','unauthenticated_write_checkouts'],

hostScheme: 'http',

hostName: 'localhost:3030',

isEmbeddedApp: true,

},

auth: {

path: "/api/auth",

callbackPath: "/api/auth/callback",

},

webhooks: {

path: "/api/webhooks",

},

sessionStorage: new CustomSessionStorage()

});
Reply 1 (1)

francescarop
Shopify Partner
4 0 1

Anyone? I'm facing the same problem and can't find a solution.