I need to delete the last ContactPerson from a contact in Xero.
Given this Contact:
<Contact>
<ContactID>4c7370e7-6f83-43b7-b943-a0b77e5dc348</ContactID>
<ContactStatus>ACTIVE</ContactStatus>
<!-- snip -->
<ContactPersons>
<ContactPerson>
<FirstName>Some</FirstName>
<LastName>Person</LastName>
<EmailAddress>p1@example.com</EmailAddress>
<IncludeInEmails>false</IncludeInEmails>
</ContactPerson>
<ContactPerson>
<FirstName>Another</FirstName>
<LastName>Person</LastName>
<EmailAddress>p2@example.com</EmailAddress>
<IncludeInEmails>false</IncludeInEmails>
</ContactPerson>
</ContactPersons>
</Contact>
I can delete one of them by issuing a POST to Contacts with the following payload:
<Contact>
<ContactID>4c7370e7-6f83-43b7-b943-a0b77e5dc348</ContactID>
<ContactPersons>
<ContactPerson>
<FirstName>Some</FirstName>
<LastName>Person</LastName>
<EmailAddress>p1@example.com</EmailAddress>
<IncludeInEmails>false</IncludeInEmails>
</ContactPerson>
</ContactPersons>
</Contact>
This will delete Another Person from the list of contact persons from this contact. By this logic, if I want to delete Some Person, I'd POST a request with an empty <ContactPersons />
tag. However that doesn't work - I get back a contact with the contact person intact.
Is there a way to actually delete the last contact person?