Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

An existing contact could not be found using the specified contact details. The contact name field i

Started by Brian Pribis -   in API Endpoints

I have a demo application called "Boxcar Stage". Things were working fine until the demo app reset (Which I suppose it does every 30 days (?) or so ). It wiped out all of my invoices. Which is fine. I deleted my application and created a new one (mentioned above). Now I get the above message when my code tries to push up an invoice.

The user exists and an ID is returned. When this happens my mode just puts the contact id in with the invoice xml in the <contract></contract> area. Since my application looks the user up via the email address, I changed the email address on the xero contract, but I still get the same ID and message. I tried with a couple other invoices which had contacts I had tried using the last expired application. They have the same FN, LN but different email addresses. These too gave me the error message and the same contact id. Finally I tried uploading an invoice with a contact I had never used, and that works fine. I can even change the invoice number in xero and reupload the invoice.

Here is what is being returned on one of the problem invoices:

<ApiException xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ErrorNumber>10</ErrorNumber>
<Type>ValidationException</Type>
<Message>A validation exception occurred</Message>
<Elements>
<DataContractBase xsi:type="Invoice">
<ValidationErrors>
<ValidationError>
<Message>An existing contact could not be found using the specified contact details. The contact name field is required to create a new contact.</Message>
</ValidationError>
</ValidationErrors>
<Contact>
<ContactID>eb4432f8-ad98-484a-b95f-e4ddf906661e</ContactID>
</Contact>
<Date>2019-07-22T00:00:00</Date>
<DueDate>2019-07-15T00:00:00</DueDate>
<Status>AUTHORISED</Status>
<LineAmountTypes>Exclusive</LineAmountTypes>
<LineItems>
<LineItem>
<Description>PM, Photopolymer platemaking</Description>
<UnitAmount>35.50</UnitAmount>
<TaxType>OUTPUT</TaxType>
<TaxAmount>2.84</TaxAmount>
<LineAmount>35.50</LineAmount>
<AccountCode>400</AccountCode>
<Quantity>1.0000</Quantity>
</LineItem>
<LineItem>
<Description>Shipping</Description>
<UnitAmount>25.00</UnitAmount>
<TaxType>NONE</TaxType>
<TaxAmount>0.00</TaxAmount>
<LineAmount>25.00</LineAmount>
<AccountCode>4444</AccountCode>
<Quantity>1.0000</Quantity>
</LineItem>
</LineItems>
<SubTotal>60.50</SubTotal>
<TotalTax>2.84</TotalTax>
<Total>63.34</Total>
<CurrencyCode>USD</CurrencyCode>
<Type>ACCREC</Type>
<InvoiceID>00000000-0000-0000-0000-000000000000</InvoiceID>
<InvoiceNumber>T464092</InvoiceNumber>
</DataContractBase>
</Elements>
</ApiException>