I’m not familiar with NestJS, but I suspect the problem is with the rawBody field.
I had to use a raw-body package to correctly build the HMAC signature.
A couple of other things to try:
Use a hardcoded "x-shopify-hmac-sha256" property key instead, just in case the key is undefined in the ShopifyHeader.Hmac object.
Double check that SHOPIFY_CLIENT_SECRET is your private API key. And also make sure it’s from the right app. I’ve had this issue crop up when I’m using the wrong app’s config.
My code goes through the gateway and the req.body is parsed there, so I handled it by separating it from the gateway. As for the server, I’m sure the key is correct, but I don’t know where the problem is.