ledgerbackup

v0.1.0
io.github.CloudCorpRecords/ledgerbackup Checked 2 days ago Published 28 days ago

Read-only backup and export of Xero accounting data: organisations, exports, manifests, downloads.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_organisations List accounting organisations

List the accounting organisations (Xero, Sage, Reckon, or QuickBooks) connected to the authenticated Boxkite account.

start_export Start a one-off accounting data export

Starts a read-only export of one accounting organisation's data (Xero, Sage, Reckon, or QuickBooks). Costs $39 per organisation: when payment is outstanding the response is status 'awaiting_payment' with a Stripe checkoutUrl for the user to complete in a browser, and the export begins once that payment settles. This is not a status endpoint: it reports only the state at creation, and repeat calls return the existing export for that organisation rather than creating or charging for a second one. Export progress is reported by get_export_status, and newly created exports appear in list_exports.…

ParameterTypeDescription
organisationId *stringOrganisation id from list_organisations

list_exports List exports

List one-off exports (newest first), optionally for one organisation. Use this to find an export after payment and to poll its status until it is 'ready'. Side-effect free: it never starts a new export or charges anything. Each entry carries progress, parkedUntil and pollAfterSeconds.

ParameterTypeDescription
organisationIdstringOnly list exports for this Xero organisation id; leave it out to list exports for all organisations.

get_export_status Get export status

Reports the state of one export: status (queued | running | ready | failed) and whether its download is available yet. Also returns progress {discovered, transferred, percent}; parkedUntil; and pollAfterSeconds, the interval after which this status is expected to have changed. A large export runs for hours, so pollAfterSeconds can be a long interval. parkedUntil is a timestamp, present whenever work on the organisation is paused and expected to resume. How long varies by cause and is not worth guessing at: hitting Xero's per-minute limit pauses for under a minute, approaching its daily quota p…

ParameterTypeDescription
exportId *stringThe id of the export whose status should be reported.

get_export_manifest Get export manifest

See what an IN-PROGRESS export contains so far (entities included, per-entity record/file counts, and per-file checksums), growing as discovery and downloading proceed. The per-file list is paged: check filesPage.hasMore and pass fileOffset to walk it. Once the export finishes, this returns status 'complete' with a pointer instead of a list, because the full manifest travels inside the ZIP as manifest.json: get a download URL, then read manifest.json from the archive.

ParameterTypeDescription
exportId *stringThe id of the in-progress export whose manifest (contents so far) should be returned.
fileLimitintegerFiles per page (default 500, max 5000)
fileOffsetintegerIndex of the first file to return (default 0)

get_export_mapping Get export file→object mapping

For an IN-PROGRESS export, get the mapping of each file discovered so far to the accounting object it represents or is attached to (e.g. which invoice a receipt PDF belongs to). Paged (default 200 files, max 500): check filesPage.hasMore and pass fileOffset for the next page; the `objects` map covers only the files on the current page. Once the export finishes, this returns status 'complete' with a pointer instead: the full mapping ships under Info/ inside the ZIP, so download the archive and read Info/files.json from it.

ParameterTypeDescription
exportId *stringThe id of the in-progress export whose file-to-object mapping should be returned.
fileLimitintegerFiles per page (default 200, max 500)
fileOffsetintegerIndex of the first file to return (default 0)

get_download_url Get export download URL

Returns a short-lived signed URL for the export ZIP, valid within the export's 7-day retention window, along with byteSize (the archive's size in bytes, null if unavailable) and fileCount. These archives range from a few MB to several GB. The archive contains the exported files plus manifest.json (every file with its sha256) and Info/ (the file-to-Xero-object mapping).

ParameterTypeDescription
exportId *stringThe id of the export whose signed download URL should be returned.