App reviews, troubleshooting, and recommendations
I am trying to verify a Shopify webhook request for the topic orders/create, but the verification is returning False, I am not able to figure out the reason. Here's the code snippet I am using to verify the request.
class ShopifyWebhookOrderCreate(APIView): def post(self, request): verified = verify_webhook(request.body, request.META.get('HTTP_X_SHOPIFY_HMAC_SHA256')) if not verified: return Response(status=status.HTTP_401_UNAUTHORIZED) ... ... ...
and for verifying the request I am doing this:-
def verify_webhook(data, hmac_header): CLIENT_SECRET = config('SHOPIFY_CLIENT_SECRET') digest = hmac.new(CLIENT_SECRET.encode('utf-8'), data, digestmod=hashlib.sha256).digest() computed_hmac = base64.b64encode(digest) return hmac.compare_digest(computed_hmac, hmac_header.encode('utf-8'))
request.body format is b'{'the': 'data'}'
I verified the SECRET with the Shopify app.
Were you able to solve this? I'm having the same problem
my verify class is returning False. Not sure why.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025