Skip to main content
POST
https://api.stateset.com
/
v1
/
customers
/
merge
curl --location --request POST 'https://api.stateset.com/v1/customers/merge' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
    "primary_customer_id": "cust_primary_123",
    "duplicate_customer_ids": ["cust_dup_456", "cust_dup_789"],
    "merge_strategy": {
        "contacts": "merge_all",
        "orders": "transfer_all",
        "addresses": "merge_unique",
        "preferences": "most_recent"
    },
    "reason": "Duplicate accounts identified during data cleanup"
}'
{
  "id": "cust_primary_123",
  "merged_customer_ids": ["cust_dup_456", "cust_dup_789"],
  "merge_summary": {
    "orders_transferred": 15,
    "addresses_merged": 3,
    "contacts_merged": 2,
    "total_lifetime_value": 4567.89,
    "loyalty_points_combined": 2500
  },
  "conflicts_resolved": [
    {
      "field": "email",
      "primary_value": "[email protected]",
      "duplicate_values": ["[email protected]", "[email protected]"],
      "resolution": "kept_primary"
    },
    {
      "field": "phone",
      "primary_value": "+1-555-0123",
      "duplicate_values": ["+1-555-0124"],
      "resolution": "kept_all_as_secondary"
    }
  ],
  "merged_at": "2024-01-15T14:30:00Z",
  "merged_by": "user_admin_123",
  "success": true
}

Body

primary_customer_id
string
The customer ID that will be kept as the primary record
duplicate_customer_ids
array
Array of customer IDs to be merged into the primary record
merge_strategy
object
Strategy for handling conflicting data during merge
reason
string
The reason for merging these customer records

Response

id
string
The ID of the primary customer record after merge
merged_customer_ids
array
Array of customer IDs that were merged
merge_summary
object
Summary of what was merged
conflicts_resolved
array
List of conflicts that were resolved during merge
merged_at
string
Timestamp when the merge was completed
merged_by
string
User who performed the merge
success
boolean
Indicates whether the merge was successful
curl --location --request POST 'https://api.stateset.com/v1/customers/merge' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
    "primary_customer_id": "cust_primary_123",
    "duplicate_customer_ids": ["cust_dup_456", "cust_dup_789"],
    "merge_strategy": {
        "contacts": "merge_all",
        "orders": "transfer_all",
        "addresses": "merge_unique",
        "preferences": "most_recent"
    },
    "reason": "Duplicate accounts identified during data cleanup"
}'
{
  "id": "cust_primary_123",
  "merged_customer_ids": ["cust_dup_456", "cust_dup_789"],
  "merge_summary": {
    "orders_transferred": 15,
    "addresses_merged": 3,
    "contacts_merged": 2,
    "total_lifetime_value": 4567.89,
    "loyalty_points_combined": 2500
  },
  "conflicts_resolved": [
    {
      "field": "email",
      "primary_value": "[email protected]",
      "duplicate_values": ["[email protected]", "[email protected]"],
      "resolution": "kept_primary"
    },
    {
      "field": "phone",
      "primary_value": "+1-555-0123",
      "duplicate_values": ["+1-555-0124"],
      "resolution": "kept_all_as_secondary"
    }
  ],
  "merged_at": "2024-01-15T14:30:00Z",
  "merged_by": "user_admin_123",
  "success": true
}