Skip to main content

Merge Customers

POST 

/api/v2/customers/merge

Merge the secondary customer into the primary customer. This is a destructive operation performed in a single transaction:

Required scope: customers:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

  • All related records - sales orders, sales credits, customer SKU mappings, order document extractions, and linked QuickBooks customer records - are reassigned from the secondary to the primary customer.
  • Contact fields (email, company, phone, fax, tax number, default shipping/billing address) are copied from the secondary onto the primary only where the primary's value is empty; existing primary data is never overwritten.
  • The secondary customer is archived.
  • A merge log is written capturing a snapshot of both customers and the per-table reassignment counts (fk_moves).

The returned merge_log_id can be used to reverse the merge within 30 days via Undo Customer Merge. The request fails if the secondary customer is already archived.

Body fields:

  • primary_customer_id (integer, required): the customer to keep; must reference an existing customer.
  • secondary_customer_id (integer, required): the customer to merge away; must reference an existing customer and differ from primary_customer_id.

Authentication: Requires Bearer token with the customers read/write scope and the customer merge permission.

Request

Responses

OK

Response Headers
    Content-Type