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

Girish_Rajwani
Shopify Partner
81 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 🙂

*If my answer was helpful, then please click like and accept solution
*Looking for a solution to a problem in your store? Looking for a custom app or theme customisations? Email me at: appsbygirish@gmail.com
*My Shopify Apps: https://apps.shopify.com/partners/girish-rajwani
Replies 3 (3)

Moeed
Shopify Partner
3804 962 1193

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 developer? Chat on WhatsApp


- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications
- Your Coffee Tip and my code, A perfect blend. ❤️
Girish_Rajwani
Shopify Partner
81 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 🙂

*If my answer was helpful, then please click like and accept solution
*Looking for a solution to a problem in your store? Looking for a custom app or theme customisations? Email me at: appsbygirish@gmail.com
*My Shopify Apps: https://apps.shopify.com/partners/girish-rajwani
nikola_seo
Shopify Partner
5 0 0

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