Cannot delete a company contact with existing orders or draft orders

Trying to delete a company contact using mutation companyContactDelete after the customer has placed an order results in an error:

Cannot delete a company contact with existing orders or draft orders.

This presents a problem, because in our use cases a customer may be re-assigned between multiple companies as a buyer using the GraphQL API. This seems to no longer work.

I am quite certain it has worked in the past and appears to work fine when done manually through the ADMIN.

Edit: using companyContactRemoveFromCompany seems to work - what is the difference?

1 Like

Hi Evaldas,

Glad to hear the companyContactRemoveFromCompany mutation work for you - my guess is that companyContactRemoveFromCompany is not deleting the company contact, just removing it’s association with a specific company.

1 Like

Hmm we were under the impression that company contact is a relation entity between a company and a customer.

Based on your reply it would appear that’s not the case, as a contact can be removed and then connected to another company without generating a new company contact ID - is that correct?

If I a new ID is generated anyway, then I still don’t see when we should use one mutation over the othe or if one of them will he removed in the future?