Developers
Sign inGet API keys
API reference/Money and books

Expenses

ExpensesService records money the business spends, who it paid and what for, with photos of the receipts.

Recording an expense posts it to the ledger: its category's expense account (and any reclaimable tax) is debited and the Cash Account it was paid from is credited. Amounts never change afterwards; voiding posts the reversing entry, and the expense can be entered again.

Managers, admins and owners use it. Voiding needs owner or admin.

holygrail.expenses.v1.ExpensesService13 methodsbooks.read · books.write

ListCategories#

books.readRead
POST/holygrail.expenses.v1.ExpensesService/ListCategories

Request body

No fields: send {}.

Response

A business starts with a set of common categories.

Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/ListCategories \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "categories": [
    {
      "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
      "name": "Amina Mushi",
      "ledgerAccountId": "",
      "code": "",
      "archived": false
    }
  ]
}

CreateCategory#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/CreateCategory

Request body

namestring

Response

Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/CreateCategory \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Amina Mushi"
}'
Response example
{
  "category": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "name": "Amina Mushi",
    "ledgerAccountId": "",
    "code": "",
    "archived": false
  }
}

UpdateCategory#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/UpdateCategory

Request body

idstring
namestring
archivedboolean

Response

Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/UpdateCategory \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
  "name": "Amina Mushi"
}'
Response example
{
  "category": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "name": "Amina Mushi",
    "ledgerAccountId": "",
    "code": "",
    "archived": false
  }
}

ListVendors#

books.readRead
POST/holygrail.expenses.v1.ExpensesService/ListVendors

Request body

No fields: send {}.

Response

vendorsVendor[]
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/ListVendors \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "vendors": [
    {
      "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
      "name": "Amina Mushi",
      "email": "amina@example.co.tz",
      "phone": "+255712345678",
      "notes": "",
      "archived": false
    }
  ]
}

CreateVendor#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/CreateVendor

Request body

namestring
emailstring
phonestring
notesstring

Response

vendorVendor
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/CreateVendor \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Amina Mushi",
  "email": "amina@example.co.tz",
  "phone": "+255712345678"
}'
Response example
{
  "vendor": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "name": "Amina Mushi",
    "email": "amina@example.co.tz",
    "phone": "+255712345678",
    "notes": "",
    "archived": false
  }
}

UpdateVendor#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/UpdateVendor

Request body

idstring
namestring
emailstring
phonestring
notesstring
archivedboolean

Response

vendorVendor
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/UpdateVendor \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
  "name": "Amina Mushi",
  "email": "amina@example.co.tz",
  "phone": "+255712345678"
}'
Response example
{
  "vendor": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "name": "Amina Mushi",
    "email": "amina@example.co.tz",
    "phone": "+255712345678",
    "notes": "",
    "archived": false
  }
}

ListExpenses#

books.readRead
POST/holygrail.expenses.v1.ExpensesService/ListExpenses

Request body

categoryIdstringcategory_id

Optional filters.

vendorIdstringvendor_id
cashAccountIdstringcash_account_id
locationIdstringlocation_id
includeVoidedbooleaninclude_voided
pageSizeintegerpage_size

Newest first; pass the previous response's next_page_token.

pageTokenstringpage_token
fromDatestringfrom_date

Optional: only expenses on these local dates (YYYY-MM-DD, both inclusive) in time_zone. Both dates or neither.

toDatestringto_date
timeZonestringtime_zone

Response

expensesExpense[]
nextPageTokenstringnext_page_token
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/ListExpenses \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
  "pageSize": 50,
  "fromDate": "2026-12-05",
  "toDate": "2026-12-05"
}'
Response example
{
  "expenses": [
    {
      "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
      "categoryId": "",
      "vendorId": "",
      "cashAccountId": "",
      "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
      "occurredAt": "",
      "amount": "150000",
      "tax": "150000",
      "reference": "",
      "note": "",
      "voided": false,
      "voidedAt": "",
      "voidReason": "",
      "createdAt": ""
    }
  ],
  "nextPageToken": ""
}

GetExpense#

books.readRead
POST/holygrail.expenses.v1.ExpensesService/GetExpense

Request body

idstring

Response

expenseExpense
journalEntryIdstringjournal_entry_id

The ledger entry it posted, for the Books link.

Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/GetExpense \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'
Response example
{
  "expense": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "categoryId": "",
    "vendorId": "",
    "cashAccountId": "",
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "occurredAt": "",
    "amount": "150000",
    "tax": "150000",
    "reference": "",
    "note": "",
    "voided": false,
    "voidedAt": "",
    "voidReason": "",
    "createdAt": ""
  },
  "journalEntryId": ""
}

CreateExpense#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/CreateExpense

Request body

idstring

Client-chosen UUID, so a retried request records one expense.

categoryIdstringcategory_id
vendorIdstringvendor_id
cashAccountIdstringcash_account_id
locationIdstringlocation_id
occurredAtstringoccurred_at

RFC 3339. Defaults to now.

amountint64 string
taxint64 string
referencestring
notestring
attachmentIdsstring[]attachment_ids

Response

expenseExpense
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/CreateExpense \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
  "amount": "150000",
  "tax": "150000",
  "attachmentIds": [
    ""
  ]
}'
Response example
{
  "expense": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "categoryId": "",
    "vendorId": "",
    "cashAccountId": "",
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "occurredAt": "",
    "amount": "150000",
    "tax": "150000",
    "reference": "",
    "note": "",
    "voided": false,
    "voidedAt": "",
    "voidReason": "",
    "createdAt": ""
  }
}

UpdateExpense#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/UpdateExpense

UpdateExpense changes what does not touch the books: vendor, location, reference, note, and adds attachments.

Request body

idstring
vendorIdstringvendor_id
locationIdstringlocation_id
referencestring
notestring
addAttachmentIdsstring[]add_attachment_ids

Attachments to add; existing ones stay.

Response

expenseExpense
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/UpdateExpense \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
  "addAttachmentIds": [
    ""
  ]
}'
Response example
{
  "expense": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "categoryId": "",
    "vendorId": "",
    "cashAccountId": "",
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "occurredAt": "",
    "amount": "150000",
    "tax": "150000",
    "reference": "",
    "note": "",
    "voided": false,
    "voidedAt": "",
    "voidReason": "",
    "createdAt": ""
  }
}

VoidExpense#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/VoidExpense

Request body

idstring
reasonstring

Response

expenseExpense
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/VoidExpense \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'
Response example
{
  "expense": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "categoryId": "",
    "vendorId": "",
    "cashAccountId": "",
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "occurredAt": "",
    "amount": "150000",
    "tax": "150000",
    "reference": "",
    "note": "",
    "voided": false,
    "voidedAt": "",
    "voidReason": "",
    "createdAt": ""
  }
}

UploadAttachment#

books.writeWrite
POST/holygrail.expenses.v1.ExpensesService/UploadAttachment

UploadAttachment stores a receipt photo or PDF of up to 10 MB. Attach it by id when creating or updating an expense.

Request body

database64 string

JPEG, PNG, WebP, HEIC or PDF, at most 10 MB.

contentTypestringcontent_type
filenamestring

Response

attachmentAttachment
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/UploadAttachment \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "attachment": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "contentType": "",
    "sizeBytes": "0",
    "filename": "",
    "createdAt": ""
  }
}

GetAttachment#

books.readRead
POST/holygrail.expenses.v1.ExpensesService/GetAttachment

Request body

idstring

Response

attachmentAttachment
database64 string
Request
curl https://api.buziin.tech/holygrail.expenses.v1.ExpensesService/GetAttachment \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'
Response example
{
  "attachment": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "contentType": "",
    "sizeBytes": "0",
    "filename": "",
    "createdAt": ""
  },
  "data": ""
}

Types

The messages and enums these methods use. Field names are lowerCamelCase in JSON; the snake_case names work too. Enum values are sent as their names.

ListCategoriesRequest

holygrail.expenses.v1.ListCategoriesRequest

No fields.

ListCategoriesResponse

holygrail.expenses.v1.ListCategoriesResponse

A business starts with a set of common categories.

CreateCategoryRequest

holygrail.expenses.v1.CreateCategoryRequest

namestring

CreateCategoryResponse

holygrail.expenses.v1.CreateCategoryResponse

UpdateCategoryRequest

holygrail.expenses.v1.UpdateCategoryRequest

idstring
namestring
archivedboolean

UpdateCategoryResponse

holygrail.expenses.v1.UpdateCategoryResponse

ListVendorsRequest

holygrail.expenses.v1.ListVendorsRequest

No fields.

ListVendorsResponse

holygrail.expenses.v1.ListVendorsResponse

vendorsVendor[]

CreateVendorRequest

holygrail.expenses.v1.CreateVendorRequest

namestring
emailstring
phonestring
notesstring

CreateVendorResponse

holygrail.expenses.v1.CreateVendorResponse

vendorVendor

UpdateVendorRequest

holygrail.expenses.v1.UpdateVendorRequest

idstring
namestring
emailstring
phonestring
notesstring
archivedboolean

UpdateVendorResponse

holygrail.expenses.v1.UpdateVendorResponse

vendorVendor

ListExpensesRequest

holygrail.expenses.v1.ListExpensesRequest

categoryIdstringcategory_id

Optional filters.

vendorIdstringvendor_id
cashAccountIdstringcash_account_id
locationIdstringlocation_id
includeVoidedbooleaninclude_voided
pageSizeintegerpage_size

Newest first; pass the previous response's next_page_token.

pageTokenstringpage_token
fromDatestringfrom_date

Optional: only expenses on these local dates (YYYY-MM-DD, both inclusive) in time_zone. Both dates or neither.

toDatestringto_date
timeZonestringtime_zone

ListExpensesResponse

holygrail.expenses.v1.ListExpensesResponse

expensesExpense[]
nextPageTokenstringnext_page_token

GetExpenseRequest

holygrail.expenses.v1.GetExpenseRequest

idstring

GetExpenseResponse

holygrail.expenses.v1.GetExpenseResponse

expenseExpense
journalEntryIdstringjournal_entry_id

The ledger entry it posted, for the Books link.

CreateExpenseRequest

holygrail.expenses.v1.CreateExpenseRequest

idstring

Client-chosen UUID, so a retried request records one expense.

categoryIdstringcategory_id
vendorIdstringvendor_id
cashAccountIdstringcash_account_id
locationIdstringlocation_id
occurredAtstringoccurred_at

RFC 3339. Defaults to now.

amountint64 string
taxint64 string
referencestring
notestring
attachmentIdsstring[]attachment_ids

CreateExpenseResponse

holygrail.expenses.v1.CreateExpenseResponse

expenseExpense

UpdateExpenseRequest

holygrail.expenses.v1.UpdateExpenseRequest

idstring
vendorIdstringvendor_id
locationIdstringlocation_id
referencestring
notestring
addAttachmentIdsstring[]add_attachment_ids

Attachments to add; existing ones stay.

UpdateExpenseResponse

holygrail.expenses.v1.UpdateExpenseResponse

expenseExpense

VoidExpenseRequest

holygrail.expenses.v1.VoidExpenseRequest

idstring
reasonstring

VoidExpenseResponse

holygrail.expenses.v1.VoidExpenseResponse

expenseExpense

UploadAttachmentRequest

holygrail.expenses.v1.UploadAttachmentRequest

database64 string

JPEG, PNG, WebP, HEIC or PDF, at most 10 MB.

contentTypestringcontent_type
filenamestring

UploadAttachmentResponse

holygrail.expenses.v1.UploadAttachmentResponse

attachmentAttachment

GetAttachmentRequest

holygrail.expenses.v1.GetAttachmentRequest

idstring

GetAttachmentResponse

holygrail.expenses.v1.GetAttachmentResponse

attachmentAttachment
database64 string

ExpenseCategory

holygrail.expenses.v1.ExpenseCategory

idstring
namestring
ledgerAccountIdstringledger_account_id

The expense account behind it in the chart of accounts.

codestring
archivedboolean

Vendor

holygrail.expenses.v1.Vendor

idstring
namestring
emailstring
phonestring
notesstring
archivedboolean

Expense

holygrail.expenses.v1.Expense

Amounts are integer minor units in the organization's currency.

idstring
categoryIdstringcategory_id
vendorIdstringvendor_id

Empty when no vendor was recorded.

cashAccountIdstringcash_account_id

The Cash Account the money came out of.

locationIdstringlocation_id

Empty for the whole business.

occurredAtstringoccurred_at

RFC 3339.

amountint64 string

Total paid, including tax.

taxint64 string

Reclaimable tax included in amount.

referencestring
notestring
attachmentsAttachment[]
voidedboolean
voidedAtstringvoided_at
voidReasonstringvoid_reason
createdAtstringcreated_at

Attachment

holygrail.expenses.v1.Attachment

idstring
contentTypestringcontent_type
sizeBytesint64 stringsize_bytes
filenamestring
createdAtstringcreated_at

Base URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.