curl --request POST \
--url https://api.loopreturns.com/api/2026-10/privacy/customer/redact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"id": 123,
"email": "jsmith@example.com",
"external_id": "<string>"
},
"orders_to_redact": [
123
],
"orders_to_redact_external": [
"<string>"
]
}
'import requests
url = "https://api.loopreturns.com/api/2026-10/privacy/customer/redact"
payload = {
"customer": {
"id": 123,
"email": "jsmith@example.com",
"external_id": "<string>"
},
"orders_to_redact": [123],
"orders_to_redact_external": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {id: 123, email: 'jsmith@example.com', external_id: '<string>'},
orders_to_redact: [123],
orders_to_redact_external: ['<string>']
})
};
fetch('https://api.loopreturns.com/api/2026-10/privacy/customer/redact', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loopreturns.com/api/2026-10/privacy/customer/redact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer' => [
'id' => 123,
'email' => 'jsmith@example.com',
'external_id' => '<string>'
],
'orders_to_redact' => [
123
],
'orders_to_redact_external' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loopreturns.com/api/2026-10/privacy/customer/redact"
payload := strings.NewReader("{\n \"customer\": {\n \"id\": 123,\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\"\n },\n \"orders_to_redact\": [\n 123\n ],\n \"orders_to_redact_external\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loopreturns.com/api/2026-10/privacy/customer/redact")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"id\": 123,\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\"\n },\n \"orders_to_redact\": [\n 123\n ],\n \"orders_to_redact_external\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/2026-10/privacy/customer/redact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"id\": 123,\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\"\n },\n \"orders_to_redact\": [\n 123\n ],\n \"orders_to_redact_external\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": true
}Redact Customer
Queue GDPR customer redaction for a Loop Anywhere (Commerce Data) shop.
Shopify shops receive 403 and should keep using Shopify’s customers/redact
webhook.
Send at least one of customer.id, customer.email, or customer.external_id.
Send customer.id or customer.external_id, not both. Identifiers combine as
a union: when a customer id and an email are both sent, Loop redacts orders
that match the id plus orders that match the email. Optionally send
orders_to_redact or orders_to_redact_external (1–100 ids each, not both)
to narrow each of those matches to the listed orders.
customer.id and orders_to_redact are Loop Commerce Data global ids.
customer.external_id and orders_to_redact_external are merchant ids sent
at ingest.
Redaction anonymizes PII on matching Loop orders, returns, and Commerce
Data customers and orders. It is not a hard delete. After the jobs run,
GET /customers/{id} and GET /orders/{id} return the anonymized values.
DELETE /customers is not a substitute.
Auth: Public API key or OAuth with scope customers:write.
A 202 {"accepted": true} means the job is queued asynchronously.
curl --request POST \
--url https://api.loopreturns.com/api/2026-10/privacy/customer/redact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"id": 123,
"email": "jsmith@example.com",
"external_id": "<string>"
},
"orders_to_redact": [
123
],
"orders_to_redact_external": [
"<string>"
]
}
'import requests
url = "https://api.loopreturns.com/api/2026-10/privacy/customer/redact"
payload = {
"customer": {
"id": 123,
"email": "jsmith@example.com",
"external_id": "<string>"
},
"orders_to_redact": [123],
"orders_to_redact_external": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {id: 123, email: 'jsmith@example.com', external_id: '<string>'},
orders_to_redact: [123],
orders_to_redact_external: ['<string>']
})
};
fetch('https://api.loopreturns.com/api/2026-10/privacy/customer/redact', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loopreturns.com/api/2026-10/privacy/customer/redact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer' => [
'id' => 123,
'email' => 'jsmith@example.com',
'external_id' => '<string>'
],
'orders_to_redact' => [
123
],
'orders_to_redact_external' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loopreturns.com/api/2026-10/privacy/customer/redact"
payload := strings.NewReader("{\n \"customer\": {\n \"id\": 123,\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\"\n },\n \"orders_to_redact\": [\n 123\n ],\n \"orders_to_redact_external\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loopreturns.com/api/2026-10/privacy/customer/redact")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"id\": 123,\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\"\n },\n \"orders_to_redact\": [\n 123\n ],\n \"orders_to_redact_external\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/2026-10/privacy/customer/redact")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"id\": 123,\n \"email\": \"jsmith@example.com\",\n \"external_id\": \"<string>\"\n },\n \"orders_to_redact\": [\n 123\n ],\n \"orders_to_redact_external\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": true
}403. Continue using Shopify’s customers/redact
webhook, which Loop already handles.202 {"accepted": true} and runs asynchronously.
After the jobs finish, the matched Commerce Data customer and orders are
anonymized, not deleted.
Get Customer and
Get Order then return the
anonymized values.
A customer.id or customer.external_id for a deleted customer is accepted
(202) and that customer’s data is anonymized. A customer.id or
customer.external_id that does not resolve returns 404. An
orders_to_redact or orders_to_redact_external value that is unknown
or not owned by the supplied customer or email returns 202
{"accepted": true} and is not redacted. An owned deleted order sent by
its original external id in orders_to_redact_external is redacted.
These identifier rules decide which records are redacted (customer.id or
external_id, the email union, and orders_to_redact or
orders_to_redact_external, 1–100 ids each). An empty orders_to_redact or
orders_to_redact_external array returns 422. orders_to_redact and
orders_to_redact_external only redact orders the identified customer owns:
a core order whose customer or email matches, or a Commerce Data order
belonging to that customer, including when identified by email. Any other customer’s order id in the
list is ignored entirely, including its order-edit session data. If nothing
in the list is owned, no orders are redacted, and the customer record is
still anonymized.
- Customer:
first_nameandlast_namebecomegdpr;emailbecomes{id}_gdpr@loopreturns.com, where{id}is an internal identifier;phonebecomesnull. - Order:
browser_ipandclient_details_user_agentbecomenull. - Shipping and billing address:
name,first_name,last_name,address1,city, andpostal_codebecomegdpr;company,address2, andphonebecomenull;region,province_code,country, andcountry_codeare kept.
Authorizations
Body
Merchant order ids, 1–100 inclusive. Narrows each customer match to these orders. Do not send with orders_to_redact. An owned deleted order sent by its original external id is redacted. An unknown or unowned value is not redacted.
1 - 100 elements100