Forked from princesslea/Shopify Webhooks: How to Prep Your App This Black Friday Cyber Monday.json
Last active
February 16, 2022 19:03
-
-
Save shopifypartners/cd71f09a3ab21307c278e6a35b5914cb to your computer and use it in GitHub Desktop.
mapping.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set($inputRoot = $input.path('$')) | |
{ | |
"X-Shopify-Shop-Domain": "$input.params().header.get('X-Shopify-Shop-Domain')", | |
"X-Shopify-Topic": "$input.params().header.get('X-Shopify-Topic')", | |
"X-Shopify-Hmac-SHA256": "$input.params().header.get('X-Shopify-Hmac-SHA256')", | |
"body": "$util.base64Encode($input.body)", | |
"queue": "$stageVariables.sqs_queue", | |
"client_secret": "$stageVariables.client_secret" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A few things to note:
a) We set up stage variables so we can easily manage a development/staging/production environment.
b) Those stage variables contain the API key that Shopify gives us from our partner dashboard. This is what we use to verify the webhooks are coming from Shopify.
c) We also set the SQS queue name in a stage variable. We send webhooks to different queues, so development webhooks don't get sent to production servers.