Join us today @ 1pm EDT for an AMA with 2H Media: Holiday Marketing for Your Shopify Store and have your marketing questions answered by marketing experts 2H Media | Plus watch the 2H Media AMA Livestream on Twitch!

How do I set up and test GDRP webhooks for app development?

How do I set up and test GDRP webhooks for app development?

Girish_Rajwani
Shopify Partner
82 3 8

Hi Guys, hope you all are doing well.

 

I need help regarding GDRP webhooks. 

i am trying to build an app and the scaffold provided by Shopify, it has gdrp.js and we have to update GDRP webhook endpoints in App Setup in partner dashboard.

 

Can any one please let me know the procedure?

 

I executed npm run shopify webhook trigger, with cloudfare URL for example  https:example.cloudfare.com:3000/shop redact & same for other 2 webhooks and got below response.

 

Success! Webhook has been enqueued for delivery. 

 

How to test GDRP webhooks?

 

What to update in GDRP endpoints App setup ?

 

Thanks in advance 🙂

Girish | Shopify Expert  
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - My Shopify Apps: App Store | Looking for a solution to a problem in your store? Send me an email

Replies 3 (3)

Moeed
Shopify Partner
4999 1330 1610

Hey @Girish_Rajwani 

To set up GDPR webhooks for your Shopify app, you'll need to follow these steps:

  1. Update GDPR Webhook Endpoints: In your app's partner dashboard, go to the App Setup section. Look for the GDPR Webhooks section and provide the webhook endpoints for the following events:

    • shop/redact: This webhook is triggered when a merchant requests to delete their shop data.
    • customers/redact: This webhook is triggered when a merchant requests to delete customer data.
    • customers/data_request: This webhook is triggered when a merchant requests to access customer data.

    Enter the URL endpoints where you want to receive these webhooks. For example, https://example.com/webhooks/shop/redact, https://example.com/webhooks/customers/redact, etc. Make sure these URLs are properly configured and can handle incoming webhook requests.

  2. Test GDPR Webhooks: To test the GDPR webhooks, you can use the npm run shopify webhook trigger command followed by the appropriate webhook topic. For example, to trigger the shop/redact webhook, run:

 

 

npm run shopify webhook trigger shop/redact

 

 

  • This will enqueue the webhook for delivery. Check your webhook endpoint to ensure that it receives and processes the webhook payload correctly.

  • Update GDPR Endpoints in App Setup: Once your webhook endpoints are set up and tested, go back to the GDPR Webhooks section in App Setup in your partner dashboard. Enter the corresponding endpoints you've configured to handle GDPR webhooks.

    Make sure to include the full URL, including the protocol (e.g., https://) and the correct path to your webhook handling code.

    Save the changes in the partner dashboard.

By following these steps, you can update and test the GDPR webhook endpoints for your Shopify app. This will ensure that your app receives the necessary webhooks when GDPR-related events occur and can handle them accordingly.

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

-Need a Shopify Specialist? Chat on WhatsApp
- Custom Design | Advanced Coding | Store Modifications
- Your Coffee Tip and my code, A perfect blend. ❤️
Girish_Rajwani
Shopify Partner
82 3 8

Hey Moeed, 

 

Thanks for responding. I still have few confusions.

 

1. how can we get/generate endpoints for example https://example.com/webhooks/shop/redact

& how to test these endpoints?

2. what to enter in Address URL when we run npm run shopify webhook trigger shop/redact ?

3. There is GDRP code in Shopify default Scaffold, how to utilize that ? 

 

Thanks in advance 🙂

Girish | Shopify Expert  
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - My Shopify Apps: App Store | Looking for a solution to a problem in your store? Send me an email

nikola_seo
Shopify Partner
13 1 1

The data returned is  very weird since its placeholder

shopify-gateway-1 | "body": {
shopify-gateway-1 | "shop_domain": "{shop}.myshopify.com",
shopify-gateway-1 | "shop_id": 954889
shopify-gateway-1 | }

 

 

shopify app webhook trigger --address https://sxxxxxxxom/webhooks/shopify/shop-erasure --api-version 2024-04 --client-secret a0xxxxxxxxxx74xa --topic shop/redact --delivery-method http