2

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?

Mark Amery
  • 143,130
  • 81
  • 406
  • 459
FilipW
  • 113
  • 5
  • I see that your question got an answer from the Xero staff over on the Xero Community site at https://community.xero.com/developer/discussion/11092960; anyone looking for an answer to this question should head over there. – Mark Amery Nov 02 '15 at 10:20

0 Answers0