Xero Accounting Endpoint: ProfitAndLossAdvanced

Overview

The Xero ProfitAndLossAdvanced endpoint provides profit and loss values. It includes all parameters available within the #Xero API.

It is a function that accepts a series of parameters.


Parameters

The ProfitAndLossAdvanced is 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.
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.
Periods
A whole number field that determines the number of additional periods to include on the report. It must be used in conjunction with the TimeFrame parameter.
If omitted, it will not include additional periods.
Possible values are 1 to 11.
TimeFrame
A text field that specifies what type of periods to compare. It must be used in conjunction with the Periods parameter.
If omitted, it will not include additional periods.
Possible values are:
  • Month
  • Quarter
  • Year
TrackingCategoryID
A guid field that specifies the list tracking category options.
If ommitted, Xero will not provide data by tracking categories.
TrackingOptionID
A guid field that specifies the specific tracking category option.
If ommitted, Xero will not provide data by tracking categories.
TrackingCategoryID2
A guid field that specifies a secondary list tracking category options.
If ommitted, Xero will not provide data by tracking categories.
TrackingOptionID2
A guid field that specifies a secondary list tracking category options.
If ommitted, Xero will not provide data by tracking categories.


Fields

The following fields are available for the ProfitAndLossAdvanced endpoint.

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.
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.
Periods
A whole number field that indicates the number of additional comparison periods to include.
This will match the Periods entered as parameter.
TimeFrame
A table field that indicates what type of periods to compare.
This will match the TimeFrame entered as parameter.
TrackingCategoryID
A guid field that indicates the tracking category used.
This will match the TrackingCategoryID entered as parameter.
TrackingOptionID
A guid field that indicates the tracking option used.
This will match the TrackingOptionID entered as parameter.
TrackingCategoryID2
A guid field that indicates the secondary tracking category used.
This will match the TrackingCategoryID2 entered as parameter.
TrackingOptionID2
A guid field that indicates the tracking option used.
This will match the TrackingOptionID2 entered as parameter.
UpdatedDateUTC
A date time field that indicates when the data was calculated.
Lines
A table field that provides the list of values.
See Lines Fields for more information.


Lines Fields

The Lines Fields include the following sub fields.

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.
Amounts
A table field that provides the list of all amounts.
See Amounts Fields for more information.


Amounts Fields

The Amounts Fields includes the following sub-fields.

Description
A text field that provides the generic description for this amount.
Amount
A decimal field that provides the value for the row.


Known Issue

Xero does not validate the GUID specified by the TrackingCategoryID, TrackingOptionID, TrackingCategoryID2 and TrackingOptionID2 parameters. It is imperitive you use GUID that exists.

Some option must be used together:

  • Periods and TimeFrame.

Some options are mutually exclusive are cannot be used at the same time.

  • Periods and TimeFrame.
  • TrackingCategoryID, TrackingOptionID, TrackingCategoryID2 and TrackingOptionID2.


Xero API

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


Related Fields

None


Related Endpoints

Accounts
ProfitAndLoss
ProfitAndLossTable
ProfitAndLossByMonth
ProfitAndLossByTrackingCategory
ProfitAndLossByTrackingOption
ProfitAndLossMultiPeriodTable
TrackingCategories


Related Topics

Xero Accounting Models
Xero Accounting Endpoints