Skip to content

feat(accountdata): add Account Data API OpenAPI spec - #853

Draft
brandon-nicholson-xero wants to merge 5 commits into
XeroAPI:masterfrom
brandon-nicholson-xero:feat/account-data-api
Draft

brandon-nicholson-xero wants to merge 5 commits into
XeroAPI:masterfrom
brandon-nicholson-xero:feat/account-data-api

Conversation

@brandon-nicholson-xero

Copy link
Copy Markdown

Description

Adds the beta Account Data API spec (xero-accountdata.yaml) and registers it in manifest.json as accountData (canPreview: false).

The API exposes three read-only endpoints under https://api.xero.com/accountdata.xro/1.0:

  • GET /account-balances (scope accountdata.balances.read)
  • GET /account-movements (scope accountdata.movements.read)
  • GET /account-transactions (scope accountdata.transactions.read)

Status: draft

Kept as a draft while the pagination next link is resolved (below). The spec was checked against the current service implementation and against live responses in a UAT environment for balances, movements and transactions.

Known issue

GET /account-transactions returns pagination.links.next as a relative path without the public prefix (/v1/account-transactions?token=…), so following it as-is returns 404. Sending only the token to /accountdata.xro/1.0/account-transactions?token=… works. The spec example currently shows the public-prefixed form and will be corrected once the intended behaviour is agreed.

Notes for review

  • Beta API: the info block says so, and canPreview is false.
  • Error responses document the real validation (ValidationProblem) and gateway (GatewayProblem) shapes. The 500 response is intentionally generic.

Checklist

  • feat commit title
  • Spec registered in manifest.json
  • yamllint passes; spec validates as OpenAPI 3.0
  • Pagination next link behaviour agreed

brandon-nicholson-xero and others added 5 commits October 8, 2026 07:51
- Register accountData in the API Explorer manifest (canPreview: false)

- Publish the beta Account Data API contract: account balances, account movements and account transactions

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Split Account into Account (no id) for balances and movements and TransactionAccount (with id) for transactions

- Make systemAccountCode required and non-null, documented as NONE when absent

- Document transactions source, taxRate and description as always present and pagination as null on the last page

- Document omitted zero results, bank account handling, type matching and movement range overlap

- Replace invented error examples with the ValidationProblem shape and real 403/404 behaviour

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…or bodies

- Document the gateway PascalCase 401 and 403 bodies, including the missing-scope case

- Replace error examples with verified 400 and 404 bodies and type URIs

- Document the empty-body 429 with Retry-After and X-Rate-Limit-Problem

- Remove the unverified 500 example

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…type URIs from examples

- Add DELETED to the account status values

- Remove internal service type URIs from the 400 and 404 error examples

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…on lines

- Document trackingCategories as omitted when not requested and an empty object when a line has no tracking

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread xero-accountdata.yaml
pagination:
pageSize: 200
links:
next: /accountdata.xro/1.0/account-transactions?token=eyJvcmdJZCI6ImIwNDRlNGVhLWEyOTAtNGYxMS04ZGY4LTQwMTc5ZGZhNmNhZSJ9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we replace this example token to a fake or dummy value? it seems decoding to an org id?

Comment thread xero-accountdata.yaml
paths:
/account-balances:
get:
tags:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need to only use one tag per API for all three endpoints, instead of one per endpoint. Our SDK codegen expects one API per spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants