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

3 more schemas are 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)
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
Sets the chart of accounts, the conversion date and conversion balances — response body — Import Summary Accounts
FieldTypePresenceDescription and constraints
$objectRootA summary of the accounts changes
DeletedJSONOptional
Deleted (anyOf 1)integerAlternativeThe number of accounts deleted
Format: int32
Deleted (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
ErroredJSONOptional
Errored (anyOf 1)integerAlternativeThe number of accounts that had an error
Format: int32
Errored (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
LockedJSONOptional
Locked (anyOf 1)integerAlternativeThe number of locked accounts
Format: int32
Locked (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
NewJSONOptional
New (anyOf 1)integerAlternativeThe number of new accounts created
Format: int32
New (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
NewOrUpdatedJSONOptional
NewOrUpdated (anyOf 1)integerAlternativeThe number of new or updated accounts
Format: int32
NewOrUpdated (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
PresentbooleanOptional
SystemJSONOptional
System (anyOf 1)integerAlternativeThe number of system accounts
Format: int32
System (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
TotalJSONOptional
Total (anyOf 1)integerAlternativeThe total number of accounts in the org
Format: int32
Total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
UpdatedJSONOptional
Updated (anyOf 1)integerAlternativeThe number of accounts updated
Format: int32
Updated (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

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.