1

I have created a custom report layout for Profit and Loss report in Xero.

How can I use the API to fetch Profit and Loss report in said custom layout?

Xero API documentation talks about a parameter called standardLayout

If you set this parameter to "true" then no custom report layouts will be applied to response

But setting this parameter to true or false does not change result of the API call.

API call I making to retrieve Profit and Loss report: https://api.xero.com/api.xro/2.0/Reports/ProfitAndLoss?fromDate=2020-12-01&toDate=2020-12-31&periods=11&timeframe=MONTH&standardLayout=false

VishalDevgire
  • 4,232
  • 10
  • 33
  • 59

1 Answers1

1

The issue here is that there are Xero Reports 2.0 where most people create custom reports, and the legacy P&L and Balance Sheets where you can create custom layouts. The standardLayout is used with the older, less used report.

This guide helps explain how to edit the older report and set it as the default report (which can then be accessed via the API).

https://central.xero.com/s/article/Customise-report-layout-for-older-style-reports-US

After following the instructions in that guide and setting a new Default layout, the standardLayout acts as an override to request Xero's standard version of the report being requested.

Unfortunately until Xero updates the API to allow access to the V2 reports, this is the only way to customized the P&L and Balance Sheet reports that are accessed via the API.

FYI, this is a request to update the API

https://xero.uservoice.com/forums/5528-accounting-api/suggestions/38236264-please-update-your-reporting-apis-w-option-to-get

illdelph
  • 31
  • 2