Xero: Retrieves tax rates
Xero accounting.getTaxRates: arguments, response, policy and SDK examples.
← Accounting operations · Get started
Operation xero.gettaxrates
Provider route: GET /api.xro/2.0/TaxRates. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/xero with npm, or alter-sdk-xero with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { XeroIntegration } from "@alter-ai/xero";
async function execute(input: Parameters<XeroIntegration["accounting"]["getTaxRates"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new XeroIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.accounting.getTaxRates(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_xero import XeroIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = XeroIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.accounting.get_tax_rates(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.where | string | Optional | |
query.order | string | Optional | |
headers | object | Required within parent | Additional keys: not allowed |
headers.xero-tenant-id | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Updates tax rates — response body |
Referenced models: Updates tax rates — response body
Schemas
Section titled “Schemas”Updates tax rates — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
TaxRates | array | Optional | |
TaxRates[] | Model | Each item | Expand Updates tax rates — response body — Tax Rates item |
Referenced models: Updates tax rates — response body — Tax Rates item
Updates tax rates — response body — Tax Rates item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
CanApplyToAssets | boolean | Optional | Boolean to describe if tax rate can be used for asset accounts i.e. true,false Read only: true |
CanApplyToEquity | boolean | Optional | Boolean to describe if tax rate can be used for equity accounts i.e true,false Read only: true |
CanApplyToExpenses | boolean | Optional | Boolean to describe if tax rate can be used for expense accounts i.e. true,false Read only: true |
CanApplyToLiabilities | boolean | Optional | Boolean to describe if tax rate can be used for liability accounts i.e. true,false Read only: true |
CanApplyToRevenue | boolean | Optional | Boolean to describe if tax rate can be used for revenue accounts i.e. true,false Read only: true |
DisplayTaxRate | JSON | Optional | |
DisplayTaxRate (anyOf 1) | number | Alternative | Tax Rate (decimal to 4dp) e.g 12.5000 Format: double Read only: true |
DisplayTaxRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
EffectiveRate | JSON | Optional | |
EffectiveRate (anyOf 1) | number | Alternative | Effective Tax Rate (decimal to 4dp) e.g 12.5000 Format: double Read only: true |
EffectiveRate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Name | string | Optional | Name of tax rate |
ReportTaxType | string | Optional | See ReportTaxTypes Known values: AVALARA, BASEXCLUDED, CAPITALSALESOUTPUT, CAPITALEXPENSESINPUT, ECOUTPUT, ECOUTPUTSERVICES, ECINPUT, ECACQUISITIONS, EXEMPTEXPENSES, EXEMPTINPUT, EXEMPTOUTPUT, GSTONIMPORTS, INPUT, INPUTTAXED, MOSSSALES, NONE, NONEOUTPUT, OUTPUT, PURCHASESINPUT, SALESOUTPUT, EXEMPTCAPITAL, EXEMPTEXPORT, CAPITALEXINPUT, GSTONCAPIMPORTS, GSTONCAPITALIMPORTS, REVERSECHARGES, PAYMENTS, INVOICE, CASH, ACCRUAL, FLATRATECASH, FLATRATEACCRUAL, ACCRUALS, TXCA, SRCAS, DSOUTPUT, BLINPUT2, EPINPUT, IMINPUT2, MEINPUT, IGDSINPUT2, ESN33OUTPUT, OPINPUT, OSOUTPUT, TXN33INPUT, TXESSINPUT, TXREINPUT, TXPETINPUT, NRINPUT, ES33OUTPUT, ZERORATEDINPUT, ZERORATEDOUTPUT, DRCHARGESUPPLY, DRCHARGE, CAPINPUT, CAPIMPORTS, IMINPUT, INPUT2, CIUINPUT, SRINPUT, OUTPUT2, SROUTPUT, CAPOUTPUT, SROUTPUT2, CIUOUTPUT, ZROUTPUT, ZREXPORT, ACC28PLUS, ACCUPTO28, OTHEROUTPUT, SHOUTPUT, ZRINPUT, BADDEBT, OTHERINPUT, BADDEBTRELIEF, IGDSINPUT3, SROVR, TOURISTREFUND, TXRCN33, TXRCRE, TXRCESS, TXRCTS, CAPEXINPUT, UNDEFINED, CAPEXOUTPUT, ZEROEXPOUTPUT, GOODSIMPORT, NONEINPUT, NOTREPORTED, SROVRRS, SROVRLVG, SRLVG, IM, IMESS, IMN33, IMRE, BADDEBTRECOVERY, USSALESTAX, BLINPUT3 |
Status | string | Optional | See Status Codes Known values: ACTIVE, DELETED, ARCHIVED, PENDING |
TaxComponents | array | Optional | See TaxComponents |
TaxComponents[] | Model | Each item | Expand Updates tax rates — response body — Tax Rates item Tax Components item |
TaxType | string | Optional | The tax type |
Referenced models: Updates tax rates — response body — Tax Rates item Tax Components item
Updates tax rates — response body — Tax Rates item Tax Components item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
IsCompound | boolean | Optional | Boolean to describe if Tax rate is compounded. |
IsNonRecoverable | boolean | Optional | Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations |
Name | string | Optional | Name of Tax Component |
Rate | JSON | Optional | |
Rate (anyOf 1) | number | Alternative | Tax Rate (up to 4dp) Format: double |
Rate (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: xero.gettaxrates. Catalog operation: getTaxRates. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.