Why is the webhook request body undefined in my server processing?

Can you please give me, and everybody, the code that you are using for the verification?

The code that I am using is

let hmac = ctx.request.headers[“x-shopify-hmac-sha256”]

let calculatedHmac= crypto.createHmac(“sha256”, process.env.SHOPIFY_API_SECRET)
.update(JSON.stringify(ctx.request.body))
.digest(“base64”)
if hmac=== calculatedHmac then the verification succeeds.
PLEASE GIVE YOUR CODE

1 Like