Store the UTC timestamp of the last successful sync in durable storage per Xero tenant
Issue a GET request to the target Xero accounting endpoint (such as Invoices or Contacts) with the If-Modified-Since header set to the stored timestamp
Page through results using the page query parameter if the response includes a pagination object indicating more pages exist
Upsert each returned record into the local data store using the Xero entity ID as the natural key
After all pages are processed successfully, update the stored timestamp to the value returned in the response headers or to the current UTC time
Handle voided and deleted records by checking the Status field and applying soft-delete logic locally
Known gotchas
If-Modified-Since uses the LastModifiedUTC field on records; network latency and clock skew can cause records modified right at the boundary to be missed, so subtract a small buffer from the stored timestamp
Xero returns a maximum of 100 records per page for most endpoints; missing the pagination check will silently truncate large result sets
Deleted records are not returned by default; some endpoints require a specific includeArchived or status filter to surface voided and deleted records for reconciliation
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp