Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

New Contact not found in Xero.com

Started by Zero Alpha -   in API Endpoints

I recently created my first xero api app and everything was working fine for only 1 week.

When I post a new contact using the api I get a Successful responses return with a HTTP 200 status code. I also get a new "ContactID": "5e94a3ea-c73e-413b-b41b-112e0bf334c3"

However this contact does not appear when I login to xero.com and search the Contacts page.

If I try to manually view the contact with: https://go.xero.com/Contacts/View/5e94a3ea-c73e-413b-b41b-112e0bf334c3

I get: Sorry, something went wrong, Go back and try again. If the issue continues, check out our Status Page. Error code: 500

If I call the contacts api from my app (https://api.xero.com/api.xro/2.0/Contacts) then the contact appears in the response:

'ContactID': '5e94a3ea-c73e-413b-b41b-112e0bf334c3', 'ContactStatus': 'ACTIVE'

If I try to create a new invoice in xero.com the contact does not appear in the list. If I try to create a new invoice using the API i get a 200 Status and a successfuly InvoiceID:

'Id': '080f04b0-41ae-434a-9ae0-fad3f9c35b54', 'Status': 'OK',

But if I try to view the invoice in xero.com (https://invoicing.xero.com/edit/1516bf8c-fd79-40b4-8d1b-df9d0d61e523) I get an error:

Invoice not found
Sorry, we couldn’t find that invoice.
Create new invoice
This would most typically occur if you're connected to the wrong tenant within your app. Can you make a call to the connections endpoint to confirm which tenants you have access to?

For your invoices this can also occur if you are looking in the wrong section within Xero. An ACCREC invoice will appear as a sales invoice whilst an ACCPAY invoice will appear as a Bill.

If you are still experiencing issues, feel free to raise a support case. Please include the Client ID for your app, and details of the organisation you are expecting to connect with.

Robin Blackstone (Community Manager)  

You are correct. It is sending everything to the 'Demo Company'. When I authorise the app it says:

Organisation data

2 connected organisations
View and manage your business transactions and contacts
By allowing access, you agree to the transfer of your data between Xero and this application in accordance with Xero’s Terms of use and the application provider’s terms of use and privacy policy.

You can disconnect at any time by going to Connected apps in your Xero settings.

Continue with 2 organisations

I need to figure out how to remove the Demo Company

Zero Alpha  

I fixed my problem. I had to perform these steps from this manual:


5. Check the tenants you're authorized to access

Find the stupid demo company connection id and then this step:

Removing connections
If you would like to remove an individual tenant connection from your app (e.g. a user wants to disconnect one of their orgs) you can make a DELETE request on the Connections endpoint:

DELETE https://api.xero.com/connections/{connectionId}

Zero Alpha