2 of 3 different customer_id with same name and email are missing

I have 3 orders that are paid for using the same name, email and other information, but stored in the API with a different customer_id. Other times, 2 out of 3 customer_id are missing from customer API. And on the dashboard, all payment history from the 2 customer_id goes to the remaining 1 customer_id. But when I check in the API, the payment and the order are still records from the different customer_id. Then how do I get all the payment and order histories that have the same email but also have different customer_id which already missing like on the dashboard?

That sounds like the customer profiles were merged and this is expected. You can still use RetrieveCustomer with the old customer_id and that will return the new customer_id. When duplicate customer profiles are identified and merged, either manually by the seller or using automated detection, the existing profiles are merged into a single profile that is assigned a new ID.

If you specify the ID of a customer profile that was deleted in a merge operation, the Customers API returns the new customer profile. For example, suppose customers A and B are merged and a new customer C is created. If you call RetrieveCustomer using the ID of customer A or B, the Customers API returns customer C. :slightly_smiling_face:

I get the point. This means we have to get the old customer_id first, right? So we can’t group orders and invoices using SearchOrder and SearchInvoice based on customer_id in customer API because there is only a new customer_id? Or is there another way?

Yes, any time you don’t have a matching customer_id you’ll need to call the Customers API to see if that’s a merged profile. :slightly_smiling_face:

@nabilahk11 - Could you please share the order IDs on which you are seeing this behavior? I wanted to ask if any of these orders were created through the API.

Here is the order ID:
S7H0XyYge7qewWlVztKMxRulMYOZY
8YHYwh7mINexWyvZdnDe54F0JsEZY
AyZnQELPIeb31J0eIT7GqhsYCIfZY

By the way, I’ve managed to group the orders from the payment API then filtered them manually. And it works :slightly_smiling_face: