createEmployees
-Creates new employees used in Xero payrun
-This endpoint is deprecated and will be removed April 28, 2026
- --
/Employees
- -
Usage and SDK Samples
- - -# configure api_client for use with xero-python sdk client
-api_client = ApiClient(
- Configuration(
- debug=false,
- oauth2_token=OAuth2Token(
- client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET"
- ),
- ),
- pool_threads=1,
-)
-
-api_client.set_oauth2_token("YOUR_ACCESS_TOKEN")
-
-def accounting_create_employees():
- api_instance = AccountingApi(api_client)
- xero_tenant_id = 'YOUR_XERO_TENANT_ID'
- summarize_errors = 'True'
- idempotency_key = 'KEY_VALUE'
-
- employee = Employee(
- first_name = "Nick",
- last_name = "Fury")
-
- employees = Employees(
- employees = [employee])
-
- try:
- api_response = api_instance.create_employees(xero_tenant_id, employees, summarize_errors, idempotency_key)
- print(api_response)
- except AccountingBadRequestException as e:
- print("Exception when calling AccountingApi->createEmployees: %s\n" % e)
- 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
-
- |
-