approveTimesheet
Approves a specific timesheet
/Timesheets/{TimesheetID}/Approve
Usage and SDK Samples
await xero.setTokenSet(tokenSet);
const xeroTenantId = 'xeroTenantId_example';
const timesheetID = '38400000-8cf0-11bd-b23e-10b96e4ef00d';
const idempotencyKey = 'KEY_VALUE';
try {
const response = await xero.accountingApi.approveTimesheet(xeroTenantId, timesheetID, idempotencyKey);
console.log(response.body || response.response.statusCode)
} catch (err) {
const error = JSON.stringify(err.response.body, null, 2)
console.log(`Status Code: ${err.response.statusCode} => ${error}`);
}
Scopes
payroll.timesheets | Grant read-write access to payroll timesheets |
Parameters
Name | Description |
---|---|
TimesheetID* |
UUID
(uuid)
Identifier for the timesheet
Required
|
Name | Description |
---|---|
Xero-Tenant-Id* |
String
Xero identifier for Tenant
Required
|
Idempotency-Key |
String
This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|