Erase Customer (GDPR)

Anonymize all personal data for an end-customer to comply with a GDPR right-to-erasure request.

DELETE/api/v1/customers

Use this endpoint to fulfill a GDPR (or similar privacy law) right-to-erasure request from one of your end-customers. It anonymizes every piece of personal data Anderro stores about that customer, while preserving the structural and financial records needed for accounting and affiliate commission integrity.

What gets anonymized

For every tracking event in your SaaS product matching the given email:

  • customer_email is set to null
  • provider_customer_id is set to null
  • ip is set to null
  • user_agent is set to null
  • visitor_id is replaced with a random anon_* token
  • anonymized_at is stamped with the current time

For every webhook delivery payload that referenced the email:

  • The data.customer_email field inside the stored payload is rewritten to null

For a user with the matching email, the affiliate profile's country_last_ip is cleared. This profile is shared across products. Matching customer emails in audit metadata for this product's commissions and tracking events are replaced with [erased]; affiliate fields are preserved.

What is preserved

Financial and structural fields are kept intact so commissions and payouts remain auditable:

  • amount_cents, event_type, created_at, partnership_id, saas_product_id on tracking events
  • All commissions and payouts rows referencing the anonymized event

Request body

ParameterTypeDescription
emailrequired
stringEmail address of the end-customer to erase. Input is trimmed and lowercased, then matched exactly against stored email values (not a case-insensitive database search).

Example request

bash
curl -X DELETE https://anderro.com/api/v1/customers \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_your_secret_key" \
  -d '{
    "email": "[email protected]"
  }'

Responses

200Erasure completed (or no-op if nothing matched)
json
{
  "data": {
    "anonymized": {
      "tracking_events": 3,
      "webhook_deliveries": 2,
      "affiliate_profiles_scrubbed": 1
    }
  }
}

The endpoint is idempotent. It returns 200 even when no records match, with all three counts at 0. Repeating erasure leaves tracking-event and webhook-delivery counts at 0. affiliate_profiles_scrubbed counts matching profiles updated, even if their IP was already null.

400Validation failed
json
{
  "error": "Validation failed",
  "details": {
    "fieldErrors": {
      "email": ["Invalid email address"]
    },
    "formErrors": []
  }
}

Scope

Tracking events, stored webhook payloads, and audit metadata are scoped to the product owning your API key. The matching user's affiliate-profile IP is also scrubbed; that profile is shared across products.

Irreversible

Anonymization cannot be undone. Once customer_email is set to null and visitor_id is rewritten, there is no way to re-attach the original identity to those events. Email-keyed refunds are impossible afterwards. The retained external_id or commission ID can still identify the payment for refunds.