create_xero_timesheet
create_xero_timesheetProposes a DRAFT timesheet for one employee/period, for Australian, New Zealand or United Kingdom organisations - it does NOT touch Xero itself, and never will on its own. This queues a pending change that a human must explicitly approve (your Xero MCP connector - the exact link is this response's own approvalUrl field) before Xero is touched at all; you have no way to approve it yourself. employeeId and payrollCalendarId must both come from list_xero_payroll_employees (never invented) - use that SAME employee's own payrollCalendarId field. lines is date-keyed: one entry per day actually worked, each naming an earningsRateId and how many hours. For Australia, use that SAME employee's own ordinaryEarningsRateId (from list_xero_payroll_employees) unless the user names a different rate. For New Zealand and the United Kingdom, an employee record carries no earnings rate of its own - call list_xero_payroll_earnings_rates first and use the RegularEarnings-type rate unless the user names a different one. Use an hourly pay item: Xero refuses an allowance or a per-unit pay item on a timesheet. In every region startDate/endDate must be exactly ONE WHOLE pay period of the employee's own pay calendar in Xero (7 days on a weekly calendar, 14 on a fortnightly one, 28 on a four-weekly one, one month on a monthly one), not just the days actually worked; days with no hours simply carry no line. This tool reads the employee's calendar and checks the period when it drafts: if the dates are not one whole period it refuses and tells you the start and end dates to use, so draft again with those. The created timesheet starts as a Xero-side DRAFT once approved - a human remains free to review or change it inside Xero afterwards, unlike post_xero_pay_run. This tool cannot say whether Xero will accept the earnings rate - that is refused, with Xero's own reason, only once a human approves.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"employeeId": "<employeeId>",
"payrollCalendarId": "<payrollCalendarId>",
"startDate": "<startDate>",
"endDate": "<endDate>",
"lines": "<lines>"
},
"name": "create_xero_timesheet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | One entry per day actually worked - omit days with no hours rather than including a zero. | |
| endDate | Yes | End of the timesheet period, YYYY-MM-DD (the last day of that pay period). If the user wrote a bare numeric date with no month name ("9/8", "08/09"), do NOT settle it on your own judgement - it is 9 August to most of the world and 8 September in the US, and nothing downstream of this field can tell which you meant once it is a date. Follow the DATES instruction in this tool's description. In every region the period must be exactly ONE WHOLE pay period of the employee's own pay calendar in Xero - 7 days on a weekly calendar, 14 on a fortnightly one, 28 on a four-weekly one, one month on a monthly one - starting on a day that calendar's periods start on, not just the days actually worked. Days with no hours simply carry no line at all. This tool checks the period against the calendar when it drafts and, if it does not match, refuses and names the start and end dates to use. | |
| startDate | Yes | Start of the timesheet period, YYYY-MM-DD. If the user wrote a bare numeric date with no month name ("9/8", "08/09"), do NOT settle it on your own judgement - it is 9 August to most of the world and 8 September in the US, and nothing downstream of this field can tell which you meant once it is a date. Follow the DATES instruction in this tool's description. In every region the period must be exactly ONE WHOLE pay period of the employee's own pay calendar in Xero - 7 days on a weekly calendar, 14 on a fortnightly one, 28 on a four-weekly one, one month on a monthly one - starting on a day that calendar's periods start on, not just the days actually worked. Days with no hours simply carry no line at all. This tool checks the period against the calendar when it drafts and, if it does not match, refuses and names the start and end dates to use. | |
| employeeId | Yes | Get this from list_xero_payroll_employees first - never invent one. | |
| organisation | No | The Xero organisation to use, by its display name. Only needed if this connection reaches more than one organisation - omit it when there is only one. | |
| payrollCalendarId | Yes | Get this from the SAME employee's own payrollCalendarId field on list_xero_payroll_employees - never invent one. |