Yeah you’re doing some extra encoding/decoding from the looks of it.
I would checkout the example provided by the Shopify team. Hmac doesn't match (python) - #4 by Dave-Shopify
Then just change the method for data to be the await body()
you have here.
Also ensure nothing else in fast api is messing with the body, as you want the raw bytes of the request