MobiariDocs
Admin APICustomers

Merge a duplicate into a customer

POST
/stores/{store_id}/customers/{customer_id}/merge

Every record pointing at from_customer_id (orders, conversations, e-mail activity, identities, consent) is repointed to the customer in the path, profile gaps are filled from the duplicate, tags and consent are unioned, and the duplicate is deleted. The merge is recorded in the audit log with a snapshot of the deleted record.

Authorization

bearer_auth
AuthorizationBearer <token>

Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.

In: header

Path Parameters

store_id*string

Store id

Formatuuid
customer_id*string

The customer to keep

Formatuuid

Header Parameters

Idempotency-Key?string

A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/merge" \  -H "Content-Type: application/json" \  -d '{    "from_customer_id": "e4caa38c-f7d8-451e-8b2e-05d2c5600460"  }'
{
  "into": "c58e12ca-d5d2-41ff-8e4d-d9e138fc4b7e",
  "removed": "b07f53d7-69c3-4e70-b8bd-5f0f78ddacb1",
  "tables": 0
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}