XeroAPI / Xero-NetStandard

A wrapper of the Xero API in the .NetStandard 2.0 framework. Supports Accounting, Payroll AU/US, and Files
MIT License
118 stars 119 forks source link

CreateInvoicesAsync throws 403 error for Token / Tenant with accounting.transactions that works for other calls #515

Closed DevelopmentDan closed 1 month ago

DevelopmentDan commented 1 month ago

SDK you're using (please complete the following information):

Describe the bug CreateInvoicesAsync throws a 403 error for Token / Tenant with accounting.transactions scope that works for other calls.

To Reproduce Steps to reproduce the behavior:

  1. Reset Demo Company (UK)
  2. Get a token for Demo Company (UK) - with the scopes: offline_access openid profile email accounting.transactions.read accounting.transactions accounting.settings.read accounting.contacts
  3. Refresh the token
  4. Get the TenantId for Demo Company (UK)
  5. Make some calls, such as GetAccountsAsync, GetTaxRatesAsync, GetContactsAsync, CreateContactsAsync, UpdateContactAsync - they all work fine with the Token and TenantId (all are logged in the developer console)
  6. Now try calling CreateInvoicesAsync with the same Token and TenantId - it crashes with a 403, and makes no entry in the developer console history log.

Expected behavior To create the invoice just as it did before updating the NuGet package to the latest version.

There is insufficient information to understand what's going wrong here. Rolling back to the previous NeGet versions is not resolving the issue.

github-actions[bot] commented 1 month ago

PETOSS-426

github-actions[bot] commented 1 month ago

Thanks for raising an issue, a ticket has been created to track your request

DevelopmentDan commented 1 month ago

This problem is caused by the plethora of NuGet packages used by the Xero API - if any are not quite the right version (i.e. upgraded to the latest version), the API randomly starts playing up. I think I'm going to have to move anything to do with Xero to its own isolated solution / project so that I can keep all the NuGet packages for our other projects up-to-date without worrying about the Xero API falling over. It is worth noting that CreateInvoiceAsync is still throwing a 403 error in some circumstances, without giving any detail on what is wrong with the invoice causing that error to be thrown.