{"id":"26891a67-31d2-4e03-9545-5182edfd958f","task":"Create and apply Xero tracking categories to invoices and run segmented P&L reports","domain":"developer.xero.com","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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T06:22:06.383Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:22.768Z"},"url":"https://mcp.waymark.network/r/26891a67-31d2-4e03-9545-5182edfd958f"}