ETLMCPData Conveyance Works
Log in Start free
Docs

Shopify customer data and the privacy webhooks

What etlmcp keeps from a Shopify store, and what it does with the customers/data_request, customers/redact and shop/redact webhooks.

Coming This connector is coming.

When the Shopify connector is available, etlmcp keeps only daily order totals for your store, never anything about an individual customer. Because of that, the two customer privacy webhooks, customers/data_request and customers/redact, find nothing to send back or erase. The third, shop/redact, deletes the store's saved access grant, unless you connected the store again after uninstalling the app. Every webhook is checked against its signature first; one that fails is refused with status 401 and changes nothing.

What etlmcp reads and keeps

The orders query asks Shopify, for each order, for its ID, when it was placed, the cancelled and test flags, whether its prices include tax, its item count, and its money amounts: subtotal, discounts, shipping, tax lines, refunds and total. It asks for no customer field: no name, email, address or phone number. A day's orders are read in memory, added up into the totals for the day they were placed, and then dropped. What remains is one row per day for the store, holding counts and money totals such as orders, net sales, shipping and taxes. No row names an order or a buyer. The columns are listed on the Shopify connector page, and what a sync delivers is in what the Shopify connector syncs.

Besides those rows, which carry the store's address and name, etlmcp holds the encrypted access grant that lets it read orders; a record of the install, with the permissions granted and when the app was installed and uninstalled; and the ID, topic and store of each webhook delivery. None of it identifies a customer.

The three privacy topics

Shopify requires every app in its App Store to subscribe to three privacy topics, to answer each delivery with a success status, and to carry out the request within 30 days.

Topic When Shopify sends it What etlmcp does
customers/data_request A customer asks the store owner for the data held about them Records that the delivery arrived and answers with success. There is no customer data to hand over.
customers/redact Five days after the store owner asks for a customer's data to be deleted Records the delivery and answers with success. There is no customer data to delete.
shop/redact 48 hours after the store owner uninstalls the app Deletes or empties the stored grant for that store and removes etlmcp's install record for it.

If a customer asks you for their data, you can tell them etlmcp holds none: its daily rows are totals across all of a day's orders.

Uninstalling and shop/redact

When an app/uninstalled delivery for your store arrives, etlmcp marks every grant for that store as needing a reconnect, along with the sources that use it, and emails the owners of each affected organization. A grant made after the uninstall happened is left alone, since Shopify retries a delivery it could not hand over for up to 4 hours.

48 hours after the uninstall, Shopify sends shop/redact. For each organization that had connected the store, etlmcp deletes the grant outright when no source uses it. When sources still point at it, the grant keeps its row so those sources stay intact, but its tokens and permissions are wiped and it is marked as needing a reconnect. etlmcp's install record for the store, with the permissions granted and the install times, is removed too.

If you reconnected the store after the uninstall and that new grant is working, shop/redact leaves it in place, so reinstalling does not break your syncs. A grant you made again but that has since stopped working is still erased.

shop/redact does not touch rows already delivered to your destination. Those are yours to keep or delete; see deleting data.

How a delivery is verified

Shopify signs each delivery with an HMAC-SHA256 of the raw body, keyed with the app's client secret and sent base64-encoded in the X-Shopify-Hmac-SHA256 header. etlmcp computes the same signature over the raw body and compares the two in constant time before it parses the body.

  • A signature that does not match gets 401 with invalid webhook signature. Nothing is recorded or changed, and the log line says only that a signature did not verify.
  • A verified body that is not a JSON object, or that names a different store from the delivery's headers, gets 400 with not a Shopify webhook. For app/uninstalled and shop/redact, the body must also name the store in a set field: myshopify_domain for app/uninstalled and shop_domain for shop/redact.
  • If the server has no Shopify client secret set, a delivery gets 503 with Shopify is not available yet before any signature check, rather than being checked against an empty key.

A verified delivery is recorded and applied in one database transaction. If applying it fails, it is not recorded, so Shopify's own retries can apply it later. A delivery that was already recorded is acknowledged with success and not applied twice. Owner emails go out after the answer is sent, because Shopify allows five seconds for the whole request.

What is stored and logged about a webhook

Webhook bodies can carry a customer's details. etlmcp never writes the body to its database or its logs. It stores the delivery's ID, topic and store address, so it can recognize a repeat, and its log lines name only the topic, the store and how many grants were affected. More on what is kept out of the logs is in log redaction.

Related

Sources

  1. Privacy law compliance — shopify.dev, checked
  2. Verify webhook deliveries — shopify.dev, checked