0

I am building an OAuth2 based app talking to Xero API based on the following official starter repo:

https://github.com/XeroAPI/xero-netstandard-oauth2-starter-dotnet-core

When I connect it to my organisation's playground app, it works fine for most API calls.

However, when I hit the Finance API > Profit and Loss, it generates:

ApiException: Xero API error calling GetFinancialStatementProfitAndLoss: 
{"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthorizationUnsuccessful",
"Instance":"179ac5b4-ed64-4f25-bc25-35392867c4dc","Extensions":{}}

When I add "finance.statements.scope" to the list of scopes, I get:

Error code: 500
Error: unauthorized_client : Invalid scope for client

How can I call financial statements like P&L from the Xero API from my app?

Brendan Hill
  • 3,406
  • 4
  • 32
  • 61

1 Answers1

1

This is a restricted scope as the Finance API is for financial institutions such as banks, credit cards and commercial lenders etc.

If you are part of this group, you would need to complete an application to be a financial partner with Xero before being given access to the Finance API.

Xero Financial Web: Contact Us

Some of the reports such as profit & loss, balance sheet, trial balance can be obtained through the normal accounting API using the accounting.reports.read scope.

Xero Developer Centre: Reports

sallyhornet
  • 364
  • 2