# Best Practices

## Recommended setup

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Choose the right data source</strong></td><td>Use <strong>Xero</strong> (entities) when you need raw transactional data like invoices, contacts, or bank transactions. Use <strong>Xero Reports</strong> when you need formatted financial summaries like P&#x26;L, Balance Sheet, or Trial Balance. Many teams use both — entities for granular data and reports for high-level dashboards.</td></tr><tr><td><strong>Use Detailed report type where available</strong></td><td>For Invoices, Contacts, Bank Transactions, Credit Notes, Manual Journals, Overpayments, and Prepayments, choose the <strong>Detailed</strong> report type. This returns extended fields that are essential for comprehensive analysis. Use Simple only when you need a lightweight export.</td></tr><tr><td><strong>Use Split by for line-item data</strong></td><td>When exporting Invoices, Credit Notes, or Journals, set the <strong>Split by</strong> parameter to <code>LineItems</code> (or <code>JournalLines</code> for Journals). This gives you one row per line item — essential for product-level or account-level analysis.</td></tr><tr><td><strong>Use Date-by-row format for analytics</strong></td><td>When pulling P&#x26;L, Balance Sheet, Budget Summary, or Executive Summary reports, choose <strong>Date-by-row format</strong> instead of Xero-style. This returns one row per date with Date, Account, and Value columns — much easier to filter, pivot, and use in BI tools.</td></tr></tbody></table>

## Data refresh and scheduling

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Daily refresh for most data</strong></td><td>Transactions in Xero are typically entered during business hours, so a morning refresh captures the previous day's entries. Daily is the sweet spot for most accounting workflows.</td></tr><tr><td><strong>Hourly refresh for busy teams</strong></td><td>If multiple people are entering data throughout the day and you need near-real-time dashboards, switch to hourly refresh. This is especially useful during month-end close.</td></tr><tr><td><strong>Use date filters to limit scope</strong></td><td>Set the Changed after parameter to a date 30 days ago to pull recently modified records. For P&#x26;L reports, use the first and last day of your target year as Start and End dates — for example, <code>2025-01-01</code> and <code>2025-12-31</code>. Update the dates at the start of each new year.</td></tr><tr><td><strong>Use Changed after for incremental updates</strong></td><td>Instead of pulling the entire dataset every time, use the Changed after parameter (available on most entities) to pull only records modified since the last run. This reduces API load and speeds up data flows.</td></tr></tbody></table>

## Performance optimization

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Filter at the API level</strong></td><td>Use the Where parameter to pre-filter data before it reaches your destination. This is much more efficient than pulling everything and filtering downstream. For example, <code>Status=="AUTHORISED"</code> on Invoices avoids pulling drafts and voided records.</td></tr><tr><td><strong>Batch large Journal exports</strong></td><td>If you have thousands of journals, use the <strong>Journal number more than</strong> / <strong>less than</strong> parameters to pull in batches. This avoids timeout errors on large Xero organizations.</td></tr><tr><td><strong>Limit the Detailed report type</strong></td><td>Only use Detailed when you actually need the extended fields. For large datasets, Simple is significantly faster and less likely to time out.</td></tr><tr><td><strong>Stagger multiple data flows</strong></td><td>If you have many Xero data flows against the same tenant, stagger their refresh schedules so they don't run simultaneously. This avoids Xero API rate limits and failed runs.</td></tr></tbody></table>

## Dashboard accuracy

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>P&#x26;L End Date — use 31-day months</strong></td><td>Always use an End Date in a month with 31 days (12-31, 10-31, 08-31, 07-31, 05-31, 03-31, 01-31). If the current month has only 30 days, use the next month with 31 days. This ensures all months in the report include the full month of data.</td></tr><tr><td><strong>Look up Tracking Category IDs first</strong></td><td>When filtering P&#x26;L or Balance Sheet by tracking category, use the category and option IDs (GUIDs), not the display names. First export the Tracking Categories entity with Split by = <code>Options</code> to get all IDs.</td></tr><tr><td><strong>Align report periods when combining data</strong></td><td>When combining data from multiple reports (e.g., P&#x26;L + Balance Sheet), ensure the date ranges match exactly. Balance Sheet shows data as of end-of-month regardless of the specific day selected.</td></tr><tr><td><strong>Year-over-year comparison</strong></td><td>Use two data flows — one for this year (e.g., <code>2025-01-01</code> to <code>2025-12-31</code>) and one for last year (<code>2024-01-01</code> to <code>2024-12-31</code>) — both in Date-by-row format. Append them and add a Year formula column for easy comparison.</td></tr></tbody></table>

## Common pitfalls to avoid

{% columns %}
{% column %}
**Do**

* Use End Dates in months with 31 days for P\&L reports
* Use `Split by = LineItems` for invoice line-item exports
* Use Date-by-row format for BI tool destinations
* Use End Dates in 31-day months for P\&L reports (e.g., `2025-12-31`)
* Export Tracking Categories entity first to get IDs for report filtering
  {% endcolumn %}

{% column %}
**Don't**

* Don't expect custom Xero reports to appear in Coupler.io — only the 9 predefined report types are available
* Don't set P\&L End Date to a month with 30 days — you'll lose a day of data from 31-day months
* Don't assume Aged Payables/Receivables returns all contacts — it requires one Contact ID per flow
* Don't ignore the Where parameter DateTime format — Xero requires `DateTime(YYYY, MM, DD)`, not ISO dates
* Don't forget to reconnect after adding a new Xero tenant — new organizations aren't detected automatically
  {% endcolumn %}
  {% endcolumns %}

{% hint style="danger" %}
**Custom reports and Account Transactions are not supported.** Coupler.io pulls from Xero's predefined report types and entity endpoints via the API. Custom reports created in the Xero UI, as well as the "Account Transactions" report, are not available through the Xero API. Use the Journals or Invoices entity with Where filters to approximate transactional detail by account.
{% endhint %}
