Xero + icon

Xero +

Consume Xero API

Report → Get Profit and Loss Report

AI-generated

Summary

Retrieve the Profit and Loss report from a specified Xero organization with optional customization of date ranges, periods, formatting, and tracking categories.

Inputs

  • Organization Name or ID (required) — Select the Xero organization to query by name or ID, loaded dynamically from available tenants.
  • Options — Configure report parameters such as date range (From Date, To Date), number of periods to compare, period size (Month, Quarter, Year), whether to get cash basis totals (Payments Only), layout style (Standard Layout), formatting in a simplified flat array (Format Report in Simple Format), and filtering or grouping by up to two tracking category IDs and options.

Output shape

A single JSON object representing the Profit and Loss report data as returned by Xero, optionally simplified into flat arrays per the formatting option.

The report reflects the configuration options provided and is scoped to the specified organization. If 'Format Report in Simple Format' is true, the complex hierarchical report structure is transformed into a simpler array of line items. Date options default to the current month if omitted. The operation returns the full report JSON; no pagination applies.

Examples

Example 1: Retrieve current month's Profit and Loss report for a specified organization with default formatting.

Organization ID selected, default options without date range or formatting changes.

Example 2: Get a quarterly Profit and Loss report with two periods compared and simplified formatting.

Set 'Periods' to 2, 'Timeframe' to Quarter, and enable 'Format Report in Simple Format', specifying From Date and To Date as needed.

Links

Discussion