-
-
-
# 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)
-
-
-