ActiveCampaign Forum

Duplicate e-commerce customers created


#1

I am using the ecomCustomers endpoint to create e-commerce customers via the API. Every time I create an e-commerce customer, a duplicate e-commerce customer with the same email, but with connectionid and externalid set to 0 is also created. Here is an example of a request I use:
post https://:account.api-us1.com/api/3/ecomCustomers Content-Type: "application/json" {"ecomCustomer":{"connectionid":"1","externalid":"123","email":"test@gmail.com"}}

And the two customers created:
normal:
{“connectionid”=>“1”,
“externalid”=>“123”,
“email”=>"test@gmail.com",
“totalRevenue”=>“0”,
“totalOrders”=>“0”,
“totalProducts”=>“0”,
“avgRevenuePerOrder”=>“0”,
“avgProductCategory”=>"",
“tstamp”=>“2019-07-01T17:43:12-05:00”,
“acceptsMarketing”=>“0”,
“links”=>{…},
“id”=>“3”,
“connection”=>“1”}

duplicate:
{“connectionid”=>“0”,
“externalid”=>“0”,
“email”=>"test@gmail.com",
“totalRevenue”=>“0”,
“totalOrders”=>“0”,
“totalProducts”=>“0”,
“avgRevenuePerOrder”=>“0”,
“avgProductCategory”=>"",
“tstamp”=>“2019-07-01T17:43:12-05:00”,
“acceptsMarketing”=>“0”,
“links”=>{…},
“id”=>“4”,
“connection”=>nil}

Is there any way to make it so only one customer is created?