Skip to content

Xero: Sets the chart of accounts, the conversion date and conversion balances

Xero accounting.postSetup: arguments, response, policy and SDK examples.

← Accounting operations · Get started

Operation xero.postsetup

Provider route: POST /api.xro/2.0/Setup. Alter supplies the connection’s credentials and routing.

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"]["postSetup"]>[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.postSetup(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from 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.post_setup(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
headersobjectRequired within parentAdditional keys: not allowed
headers.xero-tenant-idstringRequired within parent
headers.Idempotency-KeystringOptional
bodyModelRequired within parentExpand Sets the chart of accounts, the conversion date and conversion balances — request body — body

Referenced models: Sets the chart of accounts, the conversion date and conversion balances — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Sets the chart of accounts, the conversion date and conversion balances — response body

Referenced models: Sets the chart of accounts, the conversion date and conversion balances — response body

1 more schema is linked from the tables above, on the schema pages.

Sets the chart of accounts, the conversion date and conversion balances — response body
FieldTypePresenceDescription and constraints
$JSONRoot
ImportSummaryModelOptionalExpand Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary

Referenced models: Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary

Sets the chart of accounts, the conversion date and conversion balances — request body — body
FieldTypePresenceDescription and constraints
$JSONRoot
AccountsarrayOptional
Accounts[]ModelEach itemExpand Creates a new chart of accounts — request body — body
ConversionBalancesarrayOptionalBalance supplied for each account that has a value as at the conversion date.
ConversionBalances[]ModelEach itemExpand Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Balances item
ConversionDateModelOptionalExpand Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Date

Referenced models: Creates a new chart of accounts — request body — body, Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Balances item, Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Date

Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary
FieldTypePresenceDescription and constraints
$objectRootA summary of the import from setup endpoint
AccountsModelOptionalExpand Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary Accounts
OrganisationModelOptionalExpand Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary Organisation

Referenced models: Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary Organisation, Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary Accounts

Creates a new chart of accounts — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
AccountIDstringOptionalThe Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9
Format: uuid
AddToWatchlistbooleanOptionalBoolean – describes whether the account is shown in the watchlist widget on the dashboard
BankAccountNumberstringOptionalFor bank accounts only (Account Type BANK)
BankAccountTypestringOptionalFor bank accounts only. See Bank Account types
One of: BANK, CREDITCARD, PAYPAL, NONE,
ClassstringOptionalSee Account Class Types
One of: ASSET, EQUITY, EXPENSE, LIABILITY, REVENUE
Read only: true
CodestringOptionalCustomer defined alpha numeric account code e.g 200 or SALES (max length = 10)
CreatedDateUTCstringOptionalCreated date UTC format. Only returned by GET Accounts and GET Accounts/{AccountID}, not on POST or PUT responses
Read only: true
CurrencyCodeModelOptionalExpand Create a new currency for a Xero organisation — request body — body Code
DescriptionstringOptionalDescription of the Account. Valid for all types of accounts except bank accounts (max length = 4000)
EnablePaymentsToAccountbooleanOptionalBoolean – describes whether account can have payments applied to it
HasAttachmentsbooleanOptionalboolean to indicate if an account has an attachment (read only)
Default: false
Read only: true
NamestringOptionalName of account (max length = 150)
Maximum length: 150
ReportingCodestringOptionalShown if set
ReportingCodeNamestringOptionalShown if set
Read only: true
ShowInExpenseClaimsbooleanOptionalBoolean – describes whether account code is available for use with expense claims
StatusstringOptionalAccounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes
One of: ACTIVE, ARCHIVED, DELETED
SystemAccountstringOptionalIf this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null.
One of: DEBTORS, CREDITORS, BANKCURRENCYGAIN, GST, GSTONIMPORTS, HISTORICAL, REALISEDCURRENCYGAIN, RETAINEDEARNINGS, ROUNDING, TRACKINGTRANSFERS, UNPAIDEXPCLM, UNREALISEDCURRENCYGAIN, WAGEPAYABLES, CISASSETS, CISASSET, CISLABOUR, CISLABOUREXPENSE, CISLABOURINCOME, CISLIABILITY, CISMATERIALS,
Read only: true
TaxTypestringOptionalThe tax type from taxRates
TypestringOptionalSee Account Types
One of: BANK, CURRENT, CURRLIAB, DEPRECIATN, DIRECTCOSTS, EQUITY, EXPENSE, FIXED, INVENTORY, LIABILITY, NONCURRENT, OTHERINCOME, OVERHEADS, PREPAYMENT, REVENUE, SALES, TERMLIAB, PAYG
UpdatedDateUTCstringOptionalLast modified date UTC format
Read only: true
ValidationErrorsarrayOptionalDisplays array of validation error messages from the API
ValidationErrors[]ModelEach itemExpand Retrieves journals — response body — Warnings item

Referenced models: Create a new currency for a Xero organisation — request body — body Code, Retrieves journals — response body — Warnings item

Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Balances item
FieldTypePresenceDescription and constraints
$objectRootBalance supplied for each account that has a value as at the conversion date.
AccountCodestringOptionalThe account code for a account
BalancenumberOptionalThe opening balances of the account. Debits are positive, credits are negative values
Format: double
BalanceDetailsarrayOptional
BalanceDetails[]ModelEach itemExpand Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Balances item Balance Details item

Referenced models: Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Balances item Balance Details item

Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Date
FieldTypePresenceDescription and constraints
$objectRootThe date when the organisation starts using Xero
MonthintegerOptionalThe month the organisation starts using Xero. Value is an integer between 1 and 12
YearintegerOptionalThe year the organisation starts using Xero. Value is an integer greater than 2006
Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary Organisation
FieldTypePresenceDescription and constraints
$objectRoot
PresentbooleanOptional
Create a new currency for a Xero organisation — request body — body Code
FieldTypePresenceDescription and constraints
$stringRoot3 letter alpha code for the currency – see list of currency codes
One of: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BYR, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EEK, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MRU, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SKK, SLE, SLL, SOS, SRD, STD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW, ZMK, ZWD
Retrieves journals — response body — Warnings item
FieldTypePresenceDescription and constraints
$objectRoot
MessagestringOptionalValidation error message
Sets the chart of accounts, the conversion date and conversion balances — request body — body Conversion Balances item Balance Details item
FieldTypePresenceDescription and constraints
$objectRootAn array to specify multiple currency balances of an account
BalancenumberOptionalThe opening balances of the account. Debits are positive, credits are negative values
Format: double
CurrencyCodestringOptionalThe currency of the balance (Not required for base currency)
CurrencyRatenumberOptional(Optional) Exchange rate to base currency when money is spent or received. If not specified, XE rate for the day is applied
Format: double

SDK function policy ID: xero.postsetup. Catalog operation: postSetup. 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.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.