Receipts
Receipts and their files, read automatically (merchant, date, total, VAT), categories, the bin, and reprocessing.
| Method | Path | Summary |
|---|---|---|
| POST | /api/companies/:companyId/categories | Add a category |
| PATCH | /api/companies/:companyId/categories/:id | Update a category |
| GET | /api/companies/:companyId/receipts | List receipts |
| POST | /api/companies/:companyId/receipts | Add a receipt |
| GET | /api/companies/:companyId/receipts/:id | Get a receipt |
| PATCH | /api/companies/:companyId/receipts/:id | Update a receipt |
| DELETE | /api/companies/:companyId/receipts/:id | Move a receipt to the bin |
| POST | /api/companies/:companyId/receipts/:id/restore | Restore a receipt from the bin |
| POST | /api/companies/:companyId/receipts/:id/reprocess | Read a receipt again |
| GET | /api/companies/:companyId/receipts/:id/file/:kind | Decrypted file. Only ever served from here — authenticated and checked against the user's access to this receipt |
#Add a category
POST
/api/companies/:companyId/categories- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/categories- 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 |
|---|---|---|
name | string | |
tax_key | string | |
icon | any |
Response 201
| Field | Type | Description |
|---|---|---|
id | integer |
Example response
JSON
{
"id": 42
}Errors
| Status | Message |
|---|---|
| 400 | Give the category a name |
| 400 | Unknown tax heading |
| 409 | There is already a category with that name |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/categories', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Example name","tax_key":"…","icon":"…"}),
});
const data = await res.json();#Update a category
PATCH
/api/companies/:companyId/categories/:id- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/categories/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
idrequired | number |
Request body JSON
| Name | Type | Description |
|---|---|---|
name | string | |
tax_key | string | |
archived | any |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Errors
| Status | Message |
|---|---|
| 400 | Give the category a name |
| 400 | Unknown tax heading |
| 404 | Category not found |
| 409 | There is already a category with that name |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/categories/12.5', {
method: 'PATCH',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Example name","tax_key":"…","archived":"…"}),
});
const data = await res.json();#List receipts
GET
/api/companies/:companyId/receipts- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer |
Query parameters
| Name | Type | Description |
|---|---|---|
deleted | string | 1 for the bin. |
tax_year | string | A tax year, e.g. 2025-26. |
month | any | A month within it. |
status | string | Processing status. |
category_id | string | A category. |
q | string | Text to search for. |
limit | number | |
offset | number |
Response 200
| Field | Type | Description |
|---|---|---|
receipts | array of any | |
more | boolean |
Example response
JSON
{
"receipts": [],
"more": false
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Add a receipt
POST
/api/companies/:companyId/receiptsmultipart/form-data with the photo or PDF. It's read automatically; check ocr_status.
- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts- 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
multipart/form-data with the file, plus these fields:
| Name | Type | Description |
|---|---|---|
client_ref | any | Your own reference, so a retried upload isn't added twice. |
source | any | Where it came from (camera, share, upload). |
Response duplicateUpload ? 200 : 201
| Field | Type | Description |
|---|---|---|
id | integer | |
duplicate_upload | any |
Example response
JSON
{
"id": 42,
"duplicate_upload": null
}Errors
| Status | Message |
|---|---|
| 400 | Attach a photo or PDF of the receipt |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"client_ref":"…","source":"…"}),
});
const data = await res.json();#Get a receipt
GET
/api/companies/:companyId/receipts/:id- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
idrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
receipt | any | |
suggestions | array of any | |
ocr_text | string | |
original | object, or null | |
original.mime | string | |
original.bytes | integer | |
original.sha256 | string | |
original.width | integer, or null | |
original.height | integer, or null | |
possible_duplicates | array of object | |
possible_duplicates[].id | integer | |
possible_duplicates[].merchant | string, or null | |
possible_duplicates[].total | number, or null | |
possible_duplicates[].receipt_date | string (date), or null | |
can_edit | boolean |
Example response
JSON
{
"receipt": null,
"suggestions": [],
"ocr_text": "string",
"original": {
"mime": "string",
"bytes": 1,
"sha256": "string",
"width": 1,
"height": 1
},
"possible_duplicates": [
{
"id": 42,
"merchant": "string",
"total": 12.5,
"receipt_date": "2026-11-12"
}
],
"can_edit": true
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts/42', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Update a receipt
PATCH
/api/companies/:companyId/receipts/:id- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
idrequired | integer |
Request body JSON
| Name | Type | Description |
|---|---|---|
merchant | string | |
description | string | |
notes | string | |
payment_method | any | |
receipt_date | string (date) | |
business_pct | number | The business share of it, 0–100. |
category_id | string | |
confirm | any |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Errors
| Status | Message |
|---|---|
| 400 | A receipt needs a total and a date before it can be saved |
| 403 | You can't change this receipt |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts/42', {
method: 'PATCH',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"merchant":"string","description":"string","notes":"string","payment_method":"…","receipt_date":"2026-11-12","business_pct":12.5,"category_id":"string","confirm":"…"}),
});
const data = await res.json();#Move a receipt to the bin
DELETE
/api/companies/:companyId/receipts/:id- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
idrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Errors
| Status | Message |
|---|---|
| 403 | You can't delete this receipt |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts/42', {
method: 'DELETE',
credentials: 'include',
});
const data = await res.json();#Restore a receipt from the bin
POST
/api/companies/:companyId/receipts/:id/restore- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts/:id/restore- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
idrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Errors
| Status | Message |
|---|---|
| 403 | You can't restore this receipt |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts/42/restore', {
method: 'POST',
credentials: 'include',
});
const data = await res.json();#Read a receipt again
POST
/api/companies/:companyId/receipts/:id/reprocess- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts/:id/reprocess- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
idrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Errors
| Status | Message |
|---|---|
| 400 | Text can only be read from photos |
| 403 | You can't change this receipt |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts/42/reprocess', {
method: 'POST',
credentials: 'include',
});
const data = await res.json();#Decrypted file. Only ever served from here — authenticated and checked against the user's access to this receipt
GET
/api/companies/:companyId/receipts/:id/file/:kind- Address
https://<your-org>.brambleit.cloud/simplebooks/api/companies/:companyId/receipts/:id/file/:kind- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: SimpleBooks.
Path parameters
| Name | Type | Description |
|---|---|---|
companyIdrequired | integer | |
idrequired | integer | |
kindrequired | string: "original" | "display" | "thumb" |
Query parameters
| Name | Type | Description |
|---|---|---|
download | string |
Response
An empty body, a download, a body.
Errors
| Status | Message |
|---|---|
| 404 | No file for this receipt |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/simplebooks/api/companies/1/receipts/42/file/original', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();Was this page helpful?
Thanks for your feedback.