---
title: "Privacy · Tallio API reference"
description: "Erase a customer's personal data when they ask."
canonical: "https://tallio.dev/docs/api/privacy"
lang: "en"
---

# Privacy

Erase a customer's personal data when they ask.

## Erase a customer's data

`POST /api/v1/erasures`

Starts the erasure of one customer of a merchant, named by the external\_reference of each of their documents: one erasure per reference, run in the background. Each matching document keeps its type, status, number, the tax system's identifiers and totals; the parties in its stored request, its external\_reference and metadata, and the logged bodies tied to it are removed. A document still pending keeps its request until it is settled. A caller may name the customer's store orders instead (store\_orders, as a store's key does): each erasure then covers that store order's documents, its refunds' credit notes and corrections, its buyer's invoice request and the requests logged about it, and waits while the order is not yet mapped; an unknown store order is 404. Answer a privacy request (Shopify's customers/redact) well within its deadline: Tallio's own window is RETENTION\_DAYS. Each reference spends one token of the merchant's hourly erasure budget (429 rate\_limited), and a reference already being erased answers that erasure. While too many of the account's erasures are still running in this mode the answer is 429 too\_many\_pending\_erasures; retry after Retry-After.

*Bearer API key · Idempotency-Key required*

*Header parameters*

- `idempotency-key` · `string` · required
  A key you choose (1-255 printable ASCII characters, e.g. a UUID) that makes a create request safe to retry: the same key with the same body returns the first result instead of creating a second document. Keys starting with `store_order:`, `store_refund:`, `correction:`, `correction_credit:`, `credit_note:` are reserved for Tallio's own documents and refused.
  1 to 255 characters
  Pattern: `^[\x21-\x7E]*$`

*Request body*

- `merchant` · `string` · required
  The merchant whose customer asked to be erased (mer\_…).
  Pattern: `^mer_[0-9A-Za-z]{22}$`
- `external_references` · `string[]`
  The external\_reference of every document of that customer, exactly as you sent it: 1 to 50 distinct references. Each starts its own erasure. Send this or store\_orders, not both.
  1 to 50 items
  Each item: Your own reference for the document, e.g. an order number: 1 to 200 characters, trimmed. Not unique; list documents by it to find them. Up to 200 characters
  Pattern: `\S`
- `store_orders` · `string[]`
  The customer's store orders (ord\_…) of this merchant in the key's mode, as a store relays them: 1 to 50 distinct. Each starts its own erasure, of that store order's documents (its refunds' credit notes and corrections included), its buyer's invoice request and the requests logged about it; another order or document sharing its number is never touched. An order the store never sent is named as platform:external\_id (woocommerce:1042): its buyer's invoice request and the requests logged about it are erased, or, once the store sent it, its store order's as above. Send this or external\_references, not both.
  1 to 50 items
  Each item: A store order: its id (ord\_…), or the platform and its order id as platform:external\_id (woocommerce:1042).
  Pattern: `^(?:ord_[0-9A-Za-z]{22}|(?:shopify|woocommerce):.{1,64})$`

*Request*

*JSON*

```json
{
  "merchant": "mer_02y9O8rh7F50tGi0QcWRrx"
}
```

*curl*

```bash
curl -X POST 'https://tallio.dev/api/v1/erasures' \
  -H "Authorization: Bearer $TALLIO_API_KEY" \
  -H 'Idempotency-Key: order-1042' \
  -H "Content-Type: application/json" \
  -d '{
  "merchant": "mer_02y9O8rh7F50tGi0QcWRrx"
}'
```

*TypeScript SDK*

```ts
import { createTallioClient, unwrap } from "@tallio-dev/sdk";

const tallio = createTallioClient({
  apiKey: process.env.TALLIO_API_KEY!,
  baseUrl: "https://tallio.dev",
});

const result = await unwrap(tallio.http.POST("/api/v1/erasures", {
  body: {
    merchant: "mer_02y9O8rh7F50tGi0QcWRrx",
  },
}));
```

*Responses*

| Status | Description |
| --- | --- |
| `202` | The erasures started, one per reference. A replay returns the first answer. |
| 4XX, 5XX | An error: see Errors below. |

*Response body · 202*

- `object` · `string` · required
  Always "list".
  Always `list`
- `data` · `object[]` · required
  One erasure per reference, in the order the request named them.
  Each item: One customer erasure: the parties in each matching document's stored request, the document's external\_reference and metadata, the provider's words and the logged bodies tied to it are removed. The document's type, status, number, the tax system's identifiers and totals stay.
  - `id` · `string` · required
    Id of the erasure (era\_…).
    Pattern: `^era_[0-9A-Za-z]{22}$`
  - `object` · `string` · required
    Always "erasure".
    Always `erasure`
  - `merchant` · `string` · required
    Id of the merchant (mer\_…).
    Pattern: `^mer_[0-9A-Za-z]{22}$`
  - `external_reference` · `string` · required
    The reference this erasure covers; for a store order, the order number its documents carry; for an order the store never sent, the platform:external\_id the request named.
    Up to 200 characters
    Pattern: `\S`
  - `store_order` · `string`
    The store order this erasure covers, when the request named one.
    Pattern: `^ord_[0-9A-Za-z]{22}$`
  - `status` · `string` · required
    pending while it runs; done once the customer's data is removed; incomplete while a document of theirs is still pending, which keeps its payload until it is settled, when Tallio finishes the erasure.
    One of: `pending`, `done`, `incomplete`
  - `created` · `string` · required
    When the erasure was requested.
    Format: `date-time`
- `has_more` · `boolean` · required
  Always false: every erasure of the request is listed.
  Always `false`

*Example response · 202*

```json
{
  "object": "list",
  "data": [],
  "has_more": false
}
```

*Response headers*

- `x-request-id` · `string`
  The request's correlation id; quote it when reporting a problem. One of: req\_ plus a uuid (Tallio made it), client: plus the x-request-id you sent (8-128 of A-Z a-z 0-9 . \_ : -), or the hosting platform's id.
  With every response
  Pattern: `^(?:req_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|client:[A-Za-z0-9._:-]{8,128}|[A-Za-z0-9._-]{1,16}::[A-Za-z0-9._:-]{6,110})$`
- `ratelimit-limit` · `integer`
  Requests allowed in the current window for the bucket this request counted against.
  With 202, 400, 404, 409, 413, 415, 429 · At least 1
- `ratelimit-remaining` · `integer`
  Requests left in the current window; 0 means the next one is refused until the window resets.
  With 202, 400, 404, 409, 413, 415, 429 · At least 0
- `ratelimit-reset` · `integer`
  Seconds until the current window resets.
  With 202, 400, 404, 409, 413, 415, 429 · At least 0
- `idempotent-replayed` · `string`
  true when this answer replays an earlier request with the same Idempotency-Key (nothing new was created); absent on the request that created it.
  With 202 · Always `true`
- `www-authenticate` · `string`
  The bearer challenge: send a vendor secret key as `Authorization: Bearer <key>`.
  With 401 · Always `Bearer realm="tallio"`
- `retry-after` · `integer`
  Seconds to wait before retrying a request refused with 429 `rate_limited`.
  With 429 · At least 1

*Errors*

| Code | Status | Retryable | Meaning |
| --- | --- | --- | --- |
| `validation_failed` | 400 | No | Request validation failed. |
| `unauthorized` | 401 | No | Authentication is required. |
| `vendor_suspended` | 403 | No | This vendor's access to Tallio is suspended. Its owner can contact Tallio to restore it. |
| `not_found` | 404 | No | The requested resource was not found. |
| `store_url_mismatch` | 409 | No | This store key was granted to another store URL than the one this request names (Tallio-Store-Url). Connect this store again, or confirm that the store moved. |
| `idempotency_conflict` | 409 | No | This idempotency key was already used with a different request. |
| `idempotency_in_progress` | 409 | Yes | A request with this idempotency key is still in progress; retry it after Retry-After to get its answer. |
| `payload_too_large` | 413 | No | The request body is too large. |
| `unsupported_media_type` | 415 | No | The request body must be JSON (Content-Type: application/json). |
| `too_many_pending_erasures` | 429 | Yes | Too many of this account's erasures are still running in this mode. Retry once some have finished. |
| `rate_limited` | 429 | Yes | A rate limit was reached. Retry later. |
| `internal_error` | 500 | No | An unexpected server error occurred. |
