Unable to proceed with TypeError: update_token() argument after ** must be a mapping, not str
Hey guys,
I need help as I am not able to resolve this issue for so long. Now I am stuck in the last function, Any help would be really appreciated. I used the code from here: https://github.com/XeroAPI/xero-python-custom-connections-starter/issues/1 to get the tocken.
``
Traceback (most recent call last):
File "
Here is the code: I have a custom connection setup in the xero. I have setup the app and collected the client id and client secret. I have a cron job file which push the invoice. So, I dont want to use flask. I am able to get the token. The error is when I run accounting_api.create_invoices(xero_tenant_id, invoice, True) `` def invoiceGetActiveProviders(): xero_tenant_id = "Replaced by my tenant id" xero_client = ApiClient( Configuration( debug=False, oauth2_token=OAuth2Token( client_id="REPLACED BY CLIENT ID WORKING FINE", client_secret="REPLACED BY SECRET WORKING FINE" ), ), pool_threads=1, ) accounting_api = AccountingApi(xero_client) #my oauth v1 code to create invoice invoice = '[{'Type': 'ACCREC', 'Contact': {'ContactID': 'REPLACED BY CONTACT ID'}, 'Date': datetime.datetime(2021, 12, 1, 18, 50, 52, 587675), 'DateString': '2021-11-30 18:50:52', 'Reference': 'Nov 2021 Leads', 'DueDate': datetime.datetime(2022, 1, 2, 18, 50, 52, 587668), 'DueDateString': '2022-01-02 18:50:52', 'CurrencyCode': 'AUD', 'LineItems': [{'Description': 'CareerFAQs.com.au AUS Lead', 'Quantity': 1, 'UnitAmount': 65.0, 'AccountCode': '41000', 'ItemCode': '1060'}]}]'
accounting_api.create_invoices(xero_tenant_id, invoice, True) ``