xero.finance
Module xero.finance
API
Definitions
ballerinax/xero.finance Ballerina library
Overview
Xero is a cloud-based accounting platform for small and medium-sized businesses. The Xero Finance API gives lenders and financial partners read access to an organisation's financial statements, bank statement data and cash validation summaries so that they can assess a loan application with confidence.
The Xero Finance connector lets Ballerina applications call the Xero Finance API, version 19.0.0. It provides methods for financial statement reports, revenue and expense by contact reports, cash validation and bank statement accounting data.
Key features
- Retrieve balance sheet, profit and loss, cash flow and trial balance reports
- Analyse revenue and expense totals by customer and supplier contact
- Validate cash positions across bank accounts and reconciled statement lines
- Access bank statement data together with the matching accounting transactions
- Authenticate with OAuth 2.0 using a refresh token or a bearer token
Setup guide
To use the Xero Finance connector you need a Xero account, a registered app and an access token that grants the finance scopes.
-
Sign in to the Xero developer portal and select New app.
-
Enter an app name and company URL, choose Web app, and add a redirect URI that your application controls.
-
Open the Configuration page of the app and copy the Client id. Generate a Client secret and copy it.
-
Request the scopes your use case needs when you authorise the app:
offline_access,finance.statements.read,finance.cashvalidation.readandfinance.bankstatementsplus.read. -
Complete the authorisation code flow to obtain a refresh token. The token endpoint is
https://identity.xero.com/connect/token. -
Call the
GET https://api.xero.com/connectionsendpoint with the access token and copy thetenantIdof the organisation you want to query.
Note: The Finance API is available to Xero partners with the required finance scopes enabled for the app.
Quickstart
To use the xero.finance connector in your Ballerina application, update the .bal file as follows:
Step 1: Import the module
import ballerinax/xero.finance;
Step 2: Instantiate a new connector
Create a Config.toml file with your credentials:
clientId = "<CLIENT_ID>" clientSecret = "<CLIENT_SECRET>" refreshToken = "<REFRESH_TOKEN>" tenantId = "<TENANT_ID>"
Then create a finance:Client using them:
configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; configurable string tenantId = ?; finance:Client xero = check new ({ auth: { clientId, clientSecret, refreshToken, refreshUrl: "https://identity.xero.com/connect/token" } });
Step 3: Invoke the connector operation
Retrieve the balance sheet report:
public function main() returns error? { finance:BalanceSheetResponse _ = check xero->getFinancialStatementBalanceSheet({xeroTenantId: tenantId}); }
Step 4: Run the Ballerina application
bal run
Examples
The Xero Finance connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Period-end financial review - Summarise the balance sheet, profit and loss and trial balance for a reporting period.
- Contact revenue and expense analysis - Compare revenue and expense by contact and check the cash validation position.
Clients
xero.finance: Client
The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
Constructor
Gets invoked to initialize the connector.
init (ConnectionConfig config, string serviceUrl)- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.xero.com/finance.xro/1.0" - URL of the target service
getCashValidation
function getCashValidation(GetCashValidationHeaders headers, *GetCashValidationQueries queries) returns CashValidationResponse[]|errorGet cash validation
Parameters
- headers GetCashValidationHeaders - Headers to be sent with the request
- queries *GetCashValidationQueries - Queries to be sent with the request
Return Type
- CashValidationResponse[]|error - Cash validation summary for each account
getFinancialStatementBalanceSheet
function getFinancialStatementBalanceSheet(GetFinancialStatementBalanceSheetHeaders headers, *GetFinancialStatementBalanceSheetQueries queries) returns BalanceSheetResponse|errorGet Balance Sheet report
Parameters
- headers GetFinancialStatementBalanceSheetHeaders - Headers to be sent with the request
- queries *GetFinancialStatementBalanceSheetQueries - Queries to be sent with the request
Return Type
- BalanceSheetResponse|error - Balance sheet report
getFinancialStatementCashflow
function getFinancialStatementCashflow(GetFinancialStatementCashflowHeaders headers, *GetFinancialStatementCashflowQueries queries) returns CashflowResponse|errorGet Cash flow report
Parameters
- headers GetFinancialStatementCashflowHeaders - Headers to be sent with the request
- queries *GetFinancialStatementCashflowQueries - Queries to be sent with the request
Return Type
- CashflowResponse|error - Cash flow report
getFinancialStatementProfitAndLoss
function getFinancialStatementProfitAndLoss(GetFinancialStatementProfitAndLossHeaders headers, *GetFinancialStatementProfitAndLossQueries queries) returns ProfitAndLossResponse|errorGet Profit & Loss report
Parameters
- headers GetFinancialStatementProfitAndLossHeaders - Headers to be sent with the request
- queries *GetFinancialStatementProfitAndLossQueries - Queries to be sent with the request
Return Type
- ProfitAndLossResponse|error - Profit and loss report
getFinancialStatementTrialBalance
function getFinancialStatementTrialBalance(GetFinancialStatementTrialBalanceHeaders headers, *GetFinancialStatementTrialBalanceQueries queries) returns TrialBalanceResponse|errorGet Trial Balance report
Parameters
- headers GetFinancialStatementTrialBalanceHeaders - Headers to be sent with the request
- queries *GetFinancialStatementTrialBalanceQueries - Queries to be sent with the request
Return Type
- TrialBalanceResponse|error - Trial balance report
getFinancialStatementContactsRevenue
function getFinancialStatementContactsRevenue(GetFinancialStatementContactsRevenueHeaders headers, *GetFinancialStatementContactsRevenueQueries queries) returns IncomeByContactResponse|errorGet revenue by contacts report
Parameters
- headers GetFinancialStatementContactsRevenueHeaders - Headers to be sent with the request
- queries *GetFinancialStatementContactsRevenueQueries - Queries to be sent with the request
Return Type
- IncomeByContactResponse|error - Revenue by contacts report
getFinancialStatementContactsExpense
function getFinancialStatementContactsExpense(GetFinancialStatementContactsExpenseHeaders headers, *GetFinancialStatementContactsExpenseQueries queries) returns IncomeByContactResponse|errorGet expense by contacts report
Parameters
- headers GetFinancialStatementContactsExpenseHeaders - Headers to be sent with the request
- queries *GetFinancialStatementContactsExpenseQueries - Queries to be sent with the request
Return Type
- IncomeByContactResponse|error - Expense by contacts report
getBankStatementAccounting
function getBankStatementAccounting(GetBankStatementAccountingHeaders headers, *GetBankStatementAccountingQueries queries) returns BankStatementAccountingResponse|errorGet Bank Statement Accounting
Parameters
- headers GetBankStatementAccountingHeaders - Headers to be sent with the request
- queries *GetBankStatementAccountingQueries - Queries to be sent with the request
Return Type
- BankStatementAccountingResponse|error - Bank statement accounting data
Records
xero.finance: BalanceSheetAccountDetail
Fields
- accountID? string - ID of the account
- total? decimal - Total movement on this account
- code? string - Accounting code
- name? string - Account name
- reportingCode? string - Reporting code
xero.finance: BalanceSheetAccountGroup
Fields
- total? decimal - Total value of all the accounts in this type
- accountTypes? BalanceSheetAccountType[] -
xero.finance: BalanceSheetAccountType
Fields
- total? decimal - Total value of all the accounts in this type
- accountType? string - The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a>
- accounts? BalanceSheetAccountDetail[] - A list of all accounts of this type. Refer to the Account section below for each account element detail
xero.finance: BalanceSheetResponse
Fields
- balanceDate? string - Balance date of the report
- liability? BalanceSheetAccountGroup -
- asset? BalanceSheetAccountGroup -
- equity? BalanceSheetAccountGroup -
xero.finance: BankStatementAccountingResponse
Fields
- bankAccountName? string - Name of bank account
- bankAccountId? string - Xero Identifier of bank account
- bankAccountCurrencyCode? string - Currency code of the bank account
- statements? StatementResponse[] - List of bank statements and linked accounting data for the requested period
xero.finance: BankStatementResponse
Fields
- statementLines? StatementLinesResponse -
- currentStatement? CurrentStatementResponse -
xero.finance: BankTransactionResponse
Fields
- bankTransactionId? string - Xero Identifier of transaction
- date? string - Date of transaction - YYYY-MM-DD
- lineItems? LineItemResponse[] - The LineItems element can contain any number of individual LineItem sub-elements. Not included in summary mode
- amount? decimal - Amount of transaction
- contact? ContactResponse -
- batchPaymentId? string - Xero Identifier of batch payment. Present if the transaction is part of a batch
xero.finance: CashAccountResponse
Fields
- unreconciledAmountPos? decimal - Total value of transactions in the journals which are not reconciled to bank statement lines, and have a positive (debit) value
- unreconciledAmountNeg? decimal - Total value of transactions in the journals which are not reconciled to bank statement lines, and have a negative (credit) value
- accountBalance? decimal - Current cash at bank accounting value from the journals
- balanceCurrency? string - Currency which the cashAccount transactions relate to
- startingBalance? decimal - Starting (or historic) balance from the journals (manually keyed in by users on account creation - unverified)
xero.finance: CashBalance
Fields
- netCashMovement? decimal - Net movement of cash and cash equivalents for the period
- openingCashBalance? decimal - Opening balance of cash and cash equivalents
- closingCashBalance? decimal - Closing balance of cash and cash equivalents
xero.finance: CashflowAccount
Fields
- accountId? string - ID of the account
- total? decimal - Total amount for the account
- code? string - Account code
- accountClass? string - The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a>
- accountType? string - The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a>
- name? string - Account name
- reportingCode? string - Reporting code used for cash flow classification
xero.finance: CashflowActivity
Fields
- total? decimal - Total value of the activity type
- cashflowTypes? CashflowType[] -
- name? string - Name of the cashflow activity type. It will be either Operating Activities, Investing Activities or Financing Activities
xero.finance: CashflowResponse
Fields
- endDate? string - End date of the report
- cashBalance? CashBalance -
- cashflowActivities? CashflowActivity[] - Break down of cash and cash equivalents for the period
- startDate? string - Start date of the report
xero.finance: CashflowType
Fields
- total? decimal - Total value of the activity
- name? string - Name of the activity
- accounts? CashflowAccount[] - List of the accounts in this activity
xero.finance: CashValidationResponse
Fields
- accountId? string - The Xero identifier for an account
- statementBalance? StatementBalanceResponse -
- cashAccount? CashAccountResponse -
- statementBalanceDate? string - UTC Date when the last bank statement item was entered into Xero. This date is represented in ISO 8601 format
- bankStatement? BankStatementResponse -
xero.finance: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth BearerTokenConfig|OAuth2RefreshTokenGrantConfig - Configurations related to client authentication
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 30) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded/x-forwardedheader
- followRedirects? FollowRedirects - Configurations associated with Redirection
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- cookieConfig? CookieConfig - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- socketConfig ClientSocketConfig(default {}) - Provides settings related to client socket configuration
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
- laxDataBinding boolean(default true) - Enables relaxed data binding on the client side. When enabled,
nilvalues are treated as optional, and absent fields are handled asnilabletypes. Enabled by default.
xero.finance: ContactDetail
Fields
- total? decimal - Total value for the contact
- contactId? string - ID of the contact associated with the transactions. Transactions with no contact will be grouped under the special ID: 86793108-198C-46D8-90A3-43C1D12686CE. Transactions that are receive or spend bank transfers will be grouped under the special ID: 207322B3-6A58-4BE7-80F1-430123914AD6
- name? string - Name of the contact associated with the transactions. If no contact is associated with the transactions this will appear as “None Provided”, For receive or spend bank transfer transactions, this will appear as “Bank Transfer”
- totalDetail? ContactTotalDetail -
- accountCodes? string[] - A list of account codes involved in transactions
- totalOther? ContactTotalOther -
xero.finance: ContactResponse
Fields
- contactId? string - Xero Identifier of contact
- contactName? string - Full name of contact/organisation
xero.finance: ContactTotalDetail
Fields
- totalCreditedUnApplied? decimal - Total unapplied credited value for the contact within the period
- totalOutstanding? decimal - Total outstanding invoice value for the contact within the period
- totalPaid? decimal - Total paid invoice and cash value for the contact within the period
xero.finance: ContactTotalOther
Fields
- totalCredited? decimal - Total credited value for the contact
- totalVoided? decimal - Total voided value for the contact
- transactionCount? Signed32 - Number of transactions for the contact
- totalOutstandingAged? decimal - Total outstanding invoice value for the contact within the period where the invoices are more than 90 days old
xero.finance: CreditNoteResponse
Fields
- lineItems? LineItemResponse[] - Not included in summary mode
- total? decimal - Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode
- contact? ContactResponse -
- creditNoteId? string - Xero Identifier of credit note
xero.finance: CurrentStatementResponse
Fields
- endDate? string - Looking at the most recent bank statement, this field indicates the last date which transactions on this statement pertain to. This date is represented in ISO 8601 format
- endBalance? decimal - Looking at the most recent bank statement, this field indicates the balance after the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%))
- importedDateTimeUtc? string - Looking at the most recent bank statement, this field indicates when the document was imported into Xero. This date is represented in ISO 8601 format
- importSourceType? string - Looking at the most recent bank statement, this field indicates the source of the data (direct bank feed, file upload, or manual keying)
- startDate? string - Looking at the most recent bank statement, this field indicates the first date which transactions on this statement pertain to. This date is represented in ISO 8601 format
- startBalance? decimal - Looking at the most recent bank statement, this field indicates the balance before the transactions on the statement are applied (note, this is not always populated by the bank in every single instance (~10%))
xero.finance: DataSourceResponse
Fields
- directBankFeed? decimal - Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data
- fileUploadNeg? decimal - Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included
- otherNeg? decimal - Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included
- other? decimal - Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data
- fileUploadPos? decimal - Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included
- otherPos? decimal - Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included
- directBankFeedNeg? decimal - Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included
- manualNeg? decimal - Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included
- directBankFeedPos? decimal - Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included
- fileUpload? decimal - Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data
- manual? decimal - Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data
- manualPos? decimal - Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included
xero.finance: GetBankStatementAccountingHeaders
Represents the Headers record for the operation: getBankStatementAccounting
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetBankStatementAccountingQueries
Represents the Queries record for the operation: getBankStatementAccounting
Fields
- bankAccountID string - string, GUID Bank account Id
- fromDate string - date, yyyy-MM-dd Specifies the start date of the query period. The maximum range of the query period is 12 months. If the specified query period is more than 12 months the request will be rejected
- toDate string - date, yyyy-MM-dd Specifies the end date of the query period. If the end date is a future date, the request will be rejected
- summaryOnly? boolean - boolean, true/false The default value is true if no parameter is provided. In summary mode, the response will exclude the computation-heavy LineItems fields from bank transaction, invoice, credit note, prepayment and overpayment data, making the API calls quicker and more efficient
xero.finance: GetCashValidationHeaders
Represents the Headers record for the operation: getCashValidation
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetCashValidationQueries
Represents the Queries record for the operation: getCashValidation
Fields
- beginDate? string - date, yyyy-MM-dd If no parameter is provided, the aggregate results will be drawn from the user’s total history. The ‘begin date’ will return transactions based on the accounting date entered by the user. Transactions after the beginDate will be included. The user has discretion as to which accounting period the transaction relates to
- balanceDate? string - date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘balance date’ will return transactions based on the accounting date entered by the user. Transactions before the balanceDate will be included. The user has discretion as to which accounting period the transaction relates to. The ‘balance date’ will control the latest maximum date of transactions included in the aggregate numbers. Balance date does not affect the CurrentStatement object, as this will always return the most recent statement before asAtSystemDate (if specified)
- asAtSystemDate? string - date, yyyy-MM-dd If no parameter is provided, the current date will be used. The ‘as at’ date will return transactions based on the creation date. It reflects the date the transactions were entered into Xero, not the accounting date. The ‘as at’ date can not be overridden by the user. This can be used to estimate a ‘historical frequency of reconciliation’. The ‘as at’ date will affect the current statement in the response, as any candidate statements created after this date will be filtered out. Thus the current statement returned will be the most recent statement prior to the specified ‘as at’ date. Be aware that neither the begin date, nor the balance date, will affect the current statement. Note; information is only presented when system architecture allows, meaning historical cash validation information will be an estimate. In addition, delete events are not aware of the ‘as at’ functionality in this endpoint, meaning that transactions deleted at the time the API is accessed will be considered to always have been deleted
xero.finance: GetFinancialStatementBalanceSheetHeaders
Represents the Headers record for the operation: getFinancialStatementBalanceSheet
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetFinancialStatementBalanceSheetQueries
Represents the Queries record for the operation: getFinancialStatementBalanceSheet
Fields
- balanceDate? string - Specifies the date for balance sheet report. Format yyyy-MM-dd. If no parameter is provided, the current date will be used
xero.finance: GetFinancialStatementCashflowHeaders
Represents the Headers record for the operation: getFinancialStatementCashflow
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetFinancialStatementCashflowQueries
Represents the Queries record for the operation: getFinancialStatementCashflow
Fields
- endDate? string - Date e.g. yyyy-MM-dd Specifies the end date for cash flow report. If no parameter is provided, the current date will be used
- startDate? string - Date e.g. yyyy-MM-dd Specifies the start date for cash flow report. If no parameter is provided, the date of 12 months before the end date will be used
xero.finance: GetFinancialStatementContactsExpenseHeaders
Represents the Headers record for the operation: getFinancialStatementContactsExpense
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetFinancialStatementContactsExpenseQueries
Represents the Queries record for the operation: getFinancialStatementContactsExpense
Fields
- includeManualJournals? boolean - Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included
- endDate? string - Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency
- contactIds? string[] - Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included
- startDate? string - Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency
xero.finance: GetFinancialStatementContactsRevenueHeaders
Represents the Headers record for the operation: getFinancialStatementContactsRevenue
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetFinancialStatementContactsRevenueQueries
Represents the Queries record for the operation: getFinancialStatementContactsRevenue
Fields
- includeManualJournals? boolean - Specifies whether to include the manual journals in the report. If no parameter is provided, manual journals will not be included
- endDate? string - Date yyyy-MM-dd Specifies the end date for the report. If no parameter is provided, the current date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency
- contactIds? string[] - Specifies the customer contacts to be included in the report. If no parameter is provided, all customer contacts will be included
- startDate? string - Date yyyy-MM-dd Specifies the start date for the report. If no parameter is provided, the date of 12 months before the end date will be used. It is recommended to always specify both a start date and end date; While the initial range may be set to 12 months, this may need to be reduced for high volume organisations in order to improve latency
xero.finance: GetFinancialStatementProfitAndLossHeaders
Represents the Headers record for the operation: getFinancialStatementProfitAndLoss
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetFinancialStatementProfitAndLossQueries
Represents the Queries record for the operation: getFinancialStatementProfitAndLoss
Fields
- endDate? string - Date e.g. yyyy-MM-dd Specifies the end date for profit and loss report If no parameter is provided, the current date will be used
- startDate? string - Date e.g. yyyy-MM-dd Specifies the start date for profit and loss report If no parameter is provided, the date of 12 months before the end date will be used
xero.finance: GetFinancialStatementTrialBalanceHeaders
Represents the Headers record for the operation: getFinancialStatementTrialBalance
Fields
- xeroTenantId string - Xero identifier for Tenant
xero.finance: GetFinancialStatementTrialBalanceQueries
Represents the Queries record for the operation: getFinancialStatementTrialBalance
Fields
- endDate? string - Date e.g. yyyy-MM-dd Specifies the end date for trial balance report If no parameter is provided, the current date will be used
xero.finance: IncomeByContactResponse
Fields
- total? decimal - Total value
- endDate? string - End date of the report
- totalDetail? TotalDetail -
- startDate? string - Start date of the report
- contacts? ContactDetail[] -
- totalOther? TotalOther -
- manualJournals? ManualJournalTotal -
xero.finance: InvoiceResponse
Fields
- lineItems? LineItemResponse[] - Not included in summary mode
- total? decimal - Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode
- contact? ContactResponse -
- invoiceId? string - Xero Identifier of invoice
xero.finance: LineItemResponse
Fields
- accountId? string - Xero Identifier of account
- accountType? string - Account type
- reportingCode? string - Shown if set
- lineAmount? decimal - Amount of line item
xero.finance: ManualJournalTotal
Fields
- total? decimal - Total value of manual journals
xero.finance: OAuth2RefreshTokenGrantConfig
OAuth2 Refresh Token Grant Configs
Fields
- Fields Included from *OAuth2RefreshTokenGrantConfig
- refreshUrl string(default "https://identity.xero.com/connect/token") - Refresh URL
xero.finance: OverpaymentResponse
Fields
- lineItems? LineItemResponse[] - Not included in summary mode
- total? decimal - Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode
- overpaymentId? string - Xero Identifier of overpayment
- contact? ContactResponse -
xero.finance: PaymentResponse
Fields
- date? string - Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06
- creditNote? CreditNoteResponse -
- amount? decimal - The amount of the payment
- bankAmount? decimal - The bank amount of the payment
- paymentId? string - Xero Identifier of payment
- overpayment? OverpaymentResponse -
- batchPaymentId? string - Xero Identifier of batch payment. Present if the payment was created as part of a batch
- currencyRate? decimal - Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500
- invoice? InvoiceResponse -
- prepayment? PrepaymentResponse -
xero.finance: PnlAccount
Fields
- accountID? string - ID of the account
- total? decimal - Total movement on this account
- code? string - Account code
- accountType? string - The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a>
- name? string - Account name
- reportingCode? string - Reporting code (Shown if set)
xero.finance: PnlAccountClass
Fields
- total? decimal - Total revenue/expense value
- accountTypes? PnlAccountType[] - Contains trading income and other income for revenue section / operating expenses and direct cost for expense section if the data is available for each section. Refer to the account type element below
xero.finance: PnlAccountType
Fields
- total? decimal - Total movement on this account type
- accounts? PnlAccount[] - A list of the movement on each account detail during the query period. Refer to the account detail element below
- title? string - Name of this account type, it will be either Trading Income or Other Income for Revenue section / Direct Cost or Operating Expenses for Expense section
xero.finance: PrepaymentResponse
Fields
- lineItems? LineItemResponse[] - Not included in summary mode
- total? decimal - Total of Invoice tax inclusive (i.e. SubTotal + TotalTax); Not included in summary mode
- contact? ContactResponse -
- prepaymentId? string - Xero Identifier of prepayment
xero.finance: ProfitAndLossResponse
Fields
- revenue? PnlAccountClass -
- endDate? string - End date of the report
- netProfitLoss? decimal - Net profit loss value
- expense? PnlAccountClass -
- startDate? string - Start date of the report
xero.finance: StatementBalanceResponse
Fields
- 'type? string - The DEBIT or CREDIT status of the account. Cash accounts in credit have a negative balance
- value? decimal - Total closing balance of the account. This includes both reconciled and unreconciled bank statement lines. The closing balance will always be represented as a positive number, with it’s debit/credit status defined in the statementBalanceDebitCredit field
xero.finance: StatementLineResponse
Fields
- isReconciled? boolean - Boolean to show if statement line is reconciled
- amount? decimal - Amount of statement line
- notes? string - Notes description of statement line
- chequeNo? string - Cheque number of statement line
- payments? PaymentResponse[] - List of payments associated with reconciled statement lines
- transactionDate? string - Transaction date of statement line
- 'type? string - Type of statement line
- statementLineId? string - Xero Identifier of statement line
- postedDate? string - Date of when statement line was posted
- payee? string - Payee description of statement line
- reference? string - Reference description of statement line
- isDeleted? boolean - Boolean to show if statement line is deleted
- isDuplicate? boolean - Boolean to show if statement line is duplicate
- bankTransactions? BankTransactionResponse[] - List of bank transactions associated with reconciled statement lines
xero.finance: StatementLinesResponse
Fields
- latestUnreconciledTransaction? string - UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format
- reconciledAmountNeg? decimal - Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is negative
- totalAmountNeg? decimal - Sum of the amounts of all statement lines where the amount is negative
- reconciledAmountPos? decimal - Sum of the amounts of all statement lines where both the reconciled flag is set to TRUE, and the amount is positive
- totalAmountPos? decimal - Sum of the amounts of all statement lines where the amount is positive
- avgDaysUnreconciledPos? decimal - Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is positive. Provides an indication of the age of unreconciled transactions
- avgDaysUnreconciledNeg? decimal - Sum-product of age of statement line in days multiplied by transaction amount, divided by the sum of transaction amount - in for those statement lines in which the reconciled flag is set to FALSE, and the amount is negative. Provides an indication of the age of unreconciled transactions
- earliestUnreconciledTransaction? string - UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to FALSE. This date is represented in ISO 8601 format
- deletedAmount? decimal - Sum of the amounts of all deleted statement lines. Transactions may be deleted due to duplication or otherwise
- totalAmount? decimal - Sum of the amounts of all statement lines. This is used as a metric of comparison to the unreconciled figures above
- earliestReconciledTransaction? string - UTC Date which is the earliest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format
- reconciledLines? Signed32 - Count of all statement lines where the reconciled flag is set to TRUE
- unreconciledAmountPos? decimal - Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is positive
- unreconciledAmountNeg? decimal - Sum of the amounts of all statement lines where both the reconciled flag is set to FALSE, and the amount is negative
- dataSource? DataSourceResponse -
- unreconciledLines? Signed32 - Count of all statement lines where the reconciled flag is set to FALSE
- latestReconciledTransaction? string - UTC Date which is the latest transaction date of a statement line for which the reconciled flag is set to TRUE. This date is represented in ISO 8601 format
xero.finance: StatementResponse
Fields
- indicativeEndBalance? decimal - Closing statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true
- statementLines? StatementLineResponse[] - List of statement lines
- endDate? string - End date of statement
- endBalance? decimal - Closing balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0
- statementId? string - Xero Identifier of statement
- importSource? string - Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL)
- importedDateTimeUtc? string - Utc date time of when the statement was imported in Xero
- startDate? string - Start date of statement
- startBalance? decimal - Opening balance sourced from imported bank statements (if supplied). Note, for manually uploaded statements, this balance is also manual and usually not supplied. Where not supplied, the value will be 0
- indicativeStartBalance? decimal - Opening statement balance calculated in Xero (= bank account conversion balance plus sum of imported bank statement lines). Note: If indicative statement balance doesn't match imported statement balance for the same date, either the conversion (opening at inception) balance in Xero is wrong or there's an error in the bank statement lines in Xero. Ref: https://central.xero.com/s/article/Compare-the-statement-balance-in-Xero-to-your-actual-bank-balance?userregion=true
xero.finance: TotalDetail
Fields
- totalCreditedUnApplied? decimal - Total unapplied credited value within the period
- totalOutstanding? decimal - Total outstanding invoice value within the period
- totalPaid? decimal - Total paid invoice and cash value within the period
xero.finance: TotalOther
Fields
- totalCredited? decimal - Total credited value
- totalVoided? decimal - Total voided value
- totalOutstandingAged? decimal - Total outstanding invoice value within the period where the invoices are more than 90 days old
xero.finance: TrialBalanceAccount
Fields
- accountId? string - ID of the account
- signedBalance? decimal - Value of balance. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative
- accountMovement? TrialBalanceMovement -
- accountCode? string - Customer defined alpha numeric account code e.g 200 or SALES
- accountClass? string - The class of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountClassTypes'>Account Class Types</a>
- balance? TrialBalanceEntry -
- accountName? string - Name of the account
- accountType? string - The type of the account. See <a href='https://developer.xero.com/documentation/api/types#AccountTypes'>Account Types</a>
- reportingCode? string - Reporting code (Shown if set)
- status? string - Accounts with a status of ACTIVE can be updated to ARCHIVED. See <a href='https://developer.xero.com/documentation/api/types#AccountStatusCodes'>Account Status Codes</a>
xero.finance: TrialBalanceEntry
Fields
- entryType? string - Sign (Debit/Credit) of the movement of balance in the account
- value? decimal - Net movement or net balance in the account
xero.finance: TrialBalanceMovement
Fields
- debits? decimal - Debit amount
- credits? decimal - Credit amount
- signedMovement? decimal - Value of movement. Expense and Asset accounts code debits as positive. Revenue, Liability, and Equity accounts code debits as negative
- movement? TrialBalanceEntry -
xero.finance: TrialBalanceResponse
Fields
- endDate? string - End date of the report
- accounts? TrialBalanceAccount[] - Refer to the accounts section below
- startDate? string - Start date of the report
Import
import ballerinax/xero.finance;Metadata
Released date: about 22 hours ago
Version: 2.0.0
License: Apache-2.0
Security
No known vulnerabilities in libraries
Checked on 2026-11-20 via OSV.dev
Compatibility
Platform: any
Ballerina version: 2201.13.0
GraalVM compatible: Yes
Pull count
Total: 46
Current verison: 1
Weekly downloads
Keywords
Vendor/Xero
Area/Finance & Accounting
Type/Connector
Contributors