This works: ✔️
tenant_id = client.connections.first['tenantId']
client.accounting_api.get_organisations(tenant_id)
#<XeroRuby::Accounting::Organisations:0x00007fc485ca4530
# @organisations= ...
But once rewritten as a single expression, it does not: ❌
client.accounting_api.get_organisations(client.connections.first['tenantId'])
# Error message: the server returns an error (XeroRuby::ApiError)
# HTTP status code: 404
This is because client.connections overwrites the @base_url of the client used in client.accounting_api, so the account api ends up making requests to https://api.xero.com instead of https://api.xero.com/api.xro/2.0.
Combining any two or more APIs in the same expression leads to this bug.