Create and apply Xero tracking categories to invoices and run segmented P&L reports
domain: developer.xero.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Create a TrackingCategory via POST to the TrackingCategories endpoint with a name and Status of ACTIVE
Add TrackingOptions (sub-values) to the category by POSTing to the TrackingCategories options sub-resource
When creating or updating an Invoice, include a Tracking array on each LineItem referencing the TrackingCategory name and TrackingOption name
Query the ProfitAndLoss report endpoint with trackingCategoryID and trackingOptionID parameters to retrieve a segmented financial view
For bulk re-categorization, update existing invoices using the PUT batch endpoint, patching only the Tracking field on affected lines
Archive obsolete TrackingOptions by updating their Status to ARCHIVED to prevent new assignments while preserving historical data
Known gotchas
Xero limits the number of active tracking categories per organization; exceeding this limit returns a validation error, not a silent failure
Tracking is applied at the line item level, not the invoice header; a common mistake is placing the Tracking array at the invoice root, where it is silently ignored
Deleting a TrackingOption that is still referenced on historical transactions is blocked by the API; you must archive it instead
Give your agent this knowledge — and 15,600+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?