Exports

A tax year as CSV, or a zip of receipts and files for one or more years.

#Start a zip export

POST/api/companies/:companyId/exports

Bulk download (lib/exports.js): POST starts collating a ZIP of one or more tax years in the background, GET polls it, /download fetches it. Submitters get a ZIP of their own receipts only.

Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/exports
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: SimpleBooks.

Path parameters

NameTypeDescription
companyIdrequiredinteger

Request body JSON

NameTypeDescription
tax_yearsarray of anyThe years to include.

Response 202

FieldTypeDescription
exportany
Example response
JSON
{
  "export": null
}

Errors

StatusMessage
400There are no receipts to download for that choice

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/exports', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"tax_years":[]}),
});
const data = await res.json();

#An export's progress

GET/api/companies/:companyId/exports/:exportId
Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/exports/:exportId
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: SimpleBooks.

Path parameters

NameTypeDescription
companyIdrequiredinteger
exportIdrequiredinteger

Response 200

FieldTypeDescription
exportany
Example response
JSON
{
  "export": null
}

Errors

StatusMessage
404That download has expired — start a new one

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/exports/1', {
  method: 'GET',
  credentials: 'include',
});
const data = await res.json();

#Download an export

GET/api/companies/:companyId/exports/:exportId/download
Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/exports/:exportId/download
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: SimpleBooks.

Path parameters

NameTypeDescription
companyIdrequiredinteger
exportIdrequiredinteger

Response

A download, a file or page.

Errors

StatusMessage
404That download has expired — start a new one

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/exports/1/download', {
  method: 'GET',
  credentials: 'include',
});
const data = await res.json();