-
-
-
# 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_update_pay_run():
- api_instance = PayrollNzApi(api_client)
- xero_tenant_id = 'xeroTenantId_example'
- pay_run_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
- idempotency_key = 'KEY_VALUE'
- start_date = dateutil.parser.parse('2020-10-28T00:00:00Z')
- payment_date = dateutil.parser.parse('2020-10-30T00:00:00Z')
-
- pay_run_calendar = PayRunCalendar(
- calendar_type = calendar_type.WEEKLY,
- period_start_date = start_date,
- payment_date = payment_date)
-
- try:
- api_response = api_instance.update_pay_run(xero_tenant_id, pay_run_id, payRun, idempotency_key)
- print(api_response)
- except AccountingBadRequestException as e:
- print("Exception when calling PayrollNzApi->updatePayRun: %s\n" % e)
-
-
-