Common Xero integration errors

This article is to help explain the various error codes you might experience when using the Stock&Buy - Xero add-on. 
Common Xero integration errors
Error message Description How to fix
Could not push payment PA-00000002 to Xero: The remote server returned an error: (401) Unauthorized. This error occurs when Stock&Buy tries to update to push an item (a payment in this case) to your Xero account.
This usually occurs when the authorization to use your Xero account data has expired.
Uninstall and reinstall your Xero add-on.
Note that uninstalling the Xero add-on will not remove any data. All items previously synced with your Xero Account will remain untouched.  
Could not push SO-00001034 to Xero: { "Message": "This document cannot be edited as it has a payment or credit note allocated to it." } This error occurs when Stock&Buy attempts to update an order which has already been paid. 
If you would still like to modify the invoice in Xero, then you need to void the attached Payments and/or Credit Note first and then retry to sync again.
Could not push payment PA-00000001 to Xero: { "Message": "Account type is invalid for making a payment to/from" } -
This error occurs when Stock&Buy attempts to push a payment to an account which does not accept payments.
Go to your Xero account, under Chart of Accounts, click on the account you setup for payments. Check "Enable payments to this account" in the account settings dialog.
Could not sync inventory adjustments to Xero: { "Message": "Organisation is not subscribed to currency USD" } -  
This error occurs when Stock&Buy attempts to push data in a currency which is not defined in your Xero Account. In this specific case, Stock&Buy was trying to push inventory adjustments in USD to a Xero account which had NOK defined as the only currency. 
Go to your Xero account, under 'General settings', click on the Currencies link. A new page will open up where you can add a new currency to your Xero account.
You cannot save this transaction using an inventory account type
This error occurs when Stock&Buy attempts to push data to the default Xero Inventory account. This is a restriction built into Xero where the Inventory account can only be used by Xero itself. 
You need to change your mapping and not use the default Xero Inventory account. 
Please let us know if you are experiencing an error which is not in the table above.

Feedback and Knowledge Base