Exports
A tax year as CSV, or a zip of receipts and files for one or more years.
| Method | Path | Summary |
|---|---|---|
| POST | /api/companies/:companyId/exports | Start a zip export |
| GET | /api/companies/:companyId/exports/:exportId | An export's progress |
| GET | /api/companies/:companyId/exports/:exportId/download | Download an export |
#Start a zip export
POST
/api/companies/:companyId/exportsBulk 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_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer |
Request body JSON
| Name | Type | Description |
|---|---|---|
tax_years | array of any | The years to include. |
Response 202
| Field | Type | Description |
|---|---|---|
export | any |
Example response
JSON
{
"export": null
}Errors
| Status | Message |
|---|---|
| 400 | There 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_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
exportIdrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
export | any |
Example response
JSON
{
"export": null
}Errors
| Status | Message |
|---|---|
| 404 | That 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_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
exportIdrequired | integer |
Response
A download, a file or page.
Errors
| Status | Message |
|---|---|
| 404 | That 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();Was this page helpful?
Thanks for your feedback.