createEmployees
-Creates new employees used in Xero payrun
-This endpoint is deprecated and will be removed April 28, 2026
- --
/Employees
- -
Usage and SDK Samples
- - -await xero.setTokenSet(tokenSet);
-
-const xeroTenantId = 'YOUR_XERO_TENANT_ID';
-const summarizeErrors = true;
-const idempotencyKey = 'KEY_VALUE';
-
-const employee: Employee = {
- firstName: "Nick",
- lastName: "Fury"
-};
-
-const employees: Employees = {
- employees: [employee]
-};
-
-try {
- const response = await xero.accountingApi.createEmployees(xeroTenantId, employees, summarizeErrors,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
-| accounting.settings | -Grant read-write access to organisation and account settings | -
Parameters
-| 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.
-
- |
-
| Name | -Description | -
|---|---|
| employees * | -
-
-
-
-
-
- Employees
-
-
-
-
-Employees with array of Employee object in body of request
-
-
- Required
-
- |
| Name | -Description | -
|---|---|
| summarizeErrors | -
-
-
-
-
-
-
-
-
- Boolean
-
-
-
-
-If false return 200 OK and mix of successfully created objects and any with validation errors
-
- |
-