Create GDPR Webhooks
POST https://api.ecartapi.com/api/v2/webhooks
Requirements:
Before we start setting up the Shopify GDPR webhooks first you need to already have all of the following:
A Shopify access token.
An App in Shopify's Partner program.
An Endpoint on your app to receive webhook information.
Setting Up Webhooks on EcartAPI:
Create the 3 types of GDPR webhooks through EcartAPI using a POST request. Make sure to save the
gdprReference
for each webhook.Set up your GDPR URL for Shopify as follows:
- URL format: `https://api.ecartapi.com/api/v2/webhooks/shopify/callback/{{gdprReference}}/{{webhook_type}}`
- Replace the information within the double curly braces `{{ }}` with the appropriate values:
- `{{gdprReference}}` with the `gdprReference` you saved in step 1.
- `{{webhook_type}}` with the specific type of GDPR webhook (_"customer_request", "customer_redact", "shop_redact"_).
Now, let's proceed to configure these webhooks in your Shopify Partner Dashboard:
Configuring Webhooks in Shopify Partner Dashboard:
Log in to your Shopify Partner Dashboard.
Go to
Apps
in the Partner Dashboard.Locate and click on the specific app that you want to update.
Inside the app, find and click on
App setup.
In the GDPR mandatory webhooks section, update the endpoints for the three GDPR webhook types with the URLs you generated in step 2.
After updating the endpoints, click
Save
to save your changes.
These steps ensure that your EcartAPI app is set up to receive GDPR webhooks from Shopify. Once configured, Shopify will send webhook events to the specified URLs, and your EcartAPI app can process the incoming data as needed.
Remember that you only need to set up these webhooks once, as duplicate setups can lead to duplicated requests. Make sure to handle the incoming webhook data in your EcartAPI app as per your requirements for GDPR compliance.
Request Body
{"webhook"=>{"resource"=>"gdpr", "action"=>"shop_redact", "url"=>"YOUR APP URL", "auth"=>"Token will be send on the authorization header to the url"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | string |
RESPONSES
status: OK
{"success":true,"webhook":{"id":"63d00818524aba0004f1969c","resource":"gdpr","action":"customer_request","url":"YOUR APP URL","name":"ecartapi.com","active":true,"gdprReference":"MmlqNFB1bWgxNjc0NTc3OTQ0OTgw","createdAt":"2023-01-24T16:32:24.981Z"}}