Xero Accounting Endpoint: ProfitAndLossMultiPeriodTable

Disclaimer

The ProfitAndLossMultiPeriodTable is the recommend endpoint for building Profit and Loss reports.


Overview

The Xero ProfitAndLossMultiPeriodTable endpoint provides profit and loss values for a given date range.

This endpoint allows you to query multiple profit and loss values broken down either by Month, Quarter, Year, Week or Fortnight. Because of this, it is the recommended endpoint to generate Profit and Loss data for Xero.

Note this endpoint is an alternate format of the ProfitAndLoss endpoint. It provides a format that can more easily integrate with Tableau, SSIS and Azure Data Factory.

It is a function that accepts a series of parameters.


Parameters

The ProfitAndLossMultiPeriodTableis a function that accepts the following parameters.

FromDate
A date field that determines the start date for which to produce values.
If omitted, it will use the first date of the last calendar month.
ToDate
A date field that determines the end date for which to produce values.
If omitted, it will use the last date of the last calendar month.
Period
A text field that determines the periods that will be queried
If omitted, it will be set to Month.
Possible values are:
  • Week
  • Fortnight
  • Month
  • Quarter
  • Year
PaymentsOnly
A true/false field that determines if only payments are included.
If omitted, it will be set to False.
StandardLayout
A true/false field that determines if the values are produced only for accounts that are in the accounts endpoint.
If omitted, it will be set to True.


Fields

The following fields are available for the ProfitAndLossTable endpoint.

DataFileID
A guid field that provides the id of the xero data file as setup in OdataLink.
DataFileName
A text field provides the name of the xero data file as setup in OdataLink.
DataFileCode
A text field provides the code of the xero data file as setup in OdataLink.
FromDate
A date field that indicates the start date used to produce the values.
This will match the FromDate entered as parameter.
ToDate
A date field that indicates the end date used to produce the values.
This will match the ToDate entered as parameter.
Period
A text field that indicates the periods that are being queried.
Possible values are:
  • Week
  • Fortnight
  • Month
  • Quarter
  • Year
PaymentsOnly
A true/false field that indicates if only payments are included.
This will match the PaymentsOnly entered as parameter.
StandardLayout
A true/false field that indicates if values are produced only for accounts that are in the accounts endpoint.
This will match the StandardLayout entered as parameter.
LineType
A text field that indicates the type of line.
Possible values are:
  • Header: Indicates the row contains a header.
  • Detail: Indicates the row contains the value of a given account.
  • Total: Indicates the row contains a calculated value.
AccountID
A GUID field that provides the id of the account.
This field can be used to link to the Accounts endpoints.
This field will be set to null for rows whose LineType is not set to Detail.
AccountName
A text field that provides the account name or the name of a header or total.
AccountLineType
A text field that provides the a descriptive field to indicate the type of account or row.
Amount
A decimal field that provides the value for the row.


Xero API

For a detailed run through of the endpoint, you can see the Xero API.


Related Fields

None


Related Endpoints

Accounts
ProfitAndLoss
ProfitAndLossAdvanced
ProfitAndLossByMonth
ProfitAndLossByTrackingCategory
ProfitAndLossByTrackingOption
ProfitAndLossTable


Related Topics

Xero Accounting Models
Xero Accounting Endpoints