Invoices and estimates
InvoicesService writes estimates and invoices for customers and records what they pay.
A draft changes freely and posts nothing. Issuing an invoice fixes it and posts it to the ledger: Accounts receivable is debited with the total, and Sales and Sales tax are credited. Each payment debits the Cash Account it went into and credits Accounts receivable. Voiding posts reversing entries. Estimates never post; an accepted estimate becomes a draft invoice.
Customers see a document through its public link, where they can also accept or decline an estimate. Managers, admins and owners use the rest; voiding needs owner or admin.
ListInvoices#
Request body
kindInvoiceKindstatusInvoiceStatusOptional filters.
customerIdstringcustomer_idoverdueOnlybooleanoverdue_onlyIssued invoices past their due date with a balance.
pageSizeintegerpage_sizeNewest first; pass the previous response's next_page_token.
pageTokenstringpage_tokenResponse
invoicesInvoice[]nextPageTokenstringnext_page_tokencurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/ListInvoices \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"kind": "INVOICE_KIND_ESTIMATE",
"status": "INVOICE_STATUS_DRAFT",
"pageSize": 50
}'{
"invoices": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
],
"nextPageToken": ""
}GetInvoice#
Request body
idstringResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/GetInvoice \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}CreateInvoice#
Request body
idstringClient-chosen UUID, so a retried request creates one document.
kindInvoiceKinddraftInvoiceDraftResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/CreateInvoice \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"draft": {
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"lines": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"quantity": 1,
"unitPrice": "150000",
"discount": 1,
"taxRateIds": [
""
],
"tax": "150000"
}
],
"orderDiscount": 1
}
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}UpdateInvoice#
UpdateInvoice replaces a draft's contents.
Request body
idstringdraftInvoiceDraftResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/UpdateInvoice \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"draft": {
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"lines": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"quantity": 1,
"unitPrice": "150000",
"discount": 1,
"taxRateIds": [
""
],
"tax": "150000"
}
],
"orderDiscount": 1
}
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}IssueInvoice#
IssueInvoice finalizes a draft: an invoice posts to the books, an estimate becomes ready for the customer's answer.
Request body
idstringResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/IssueInvoice \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}SendInvoice#
SendInvoice emails the public link, issuing a draft first.
Request body
idstringemailstringDefaults to the customer's email.
Response
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/SendInvoice \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"email": "amina@example.co.tz"
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}RecordPayment#
Request body
idstringClient-chosen UUID, so a retried request records one payment.
invoiceIdstringinvoice_idcashAccountIdstringcash_account_idamountint64 stringpaidAtstringpaid_atRFC 3339; defaults to now.
referencestringResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/RecordPayment \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"amount": "150000"
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}VoidPayment#
Request body
invoiceIdstringinvoice_idpaymentIdstringpayment_idResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/VoidPayment \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}VoidInvoice#
VoidInvoice cancels an estimate, or an invoice with no live payments.
Request body
idstringreasonstringResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/VoidInvoice \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}SetEstimateResponse#
SetEstimateResponse records the customer's answer given in person.
Request body
idstringacceptedbooleanResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/SetEstimateResponse \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}ConvertEstimate#
ConvertEstimate makes a draft invoice from an issued or accepted estimate.
Request body
invoiceIdstringinvoice_idClient-chosen id for the new invoice.
estimateIdstringestimate_idResponse
invoiceInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/ConvertEstimate \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"invoice": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerId": "",
"customerName": "Amina Mushi",
"customerEmail": "amina@example.co.tz",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"orderDiscount": 1,
"amountPaid": "0",
"balance": "150000",
"publicUrl": "",
"estimateId": "",
"invoiceId": "",
"issuedAt": "",
"respondedAt": "",
"voidedAt": "",
"voidReason": "",
"createdAt": ""
}
}GetPublicInvoice#
Public: the customer's view through the link, no sign-in.
Request body
tokenstringResponse
invoicePublicInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/GetPublicInvoice \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"invoice": {
"businessName": "Amina Mushi",
"currencyCode": "TZS",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerName": "Amina Mushi",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"amountPaid": "0",
"balance": "150000"
}
}RespondToEstimate#
Request body
tokenstringacceptedbooleanResponse
invoicePublicInvoicecurl https://api.buziin.tech/holygrail.invoices.v1.InvoicesService/RespondToEstimate \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"invoice": {
"businessName": "Amina Mushi",
"currencyCode": "TZS",
"kind": "INVOICE_KIND_ESTIMATE",
"number": "",
"status": "INVOICE_STATUS_DRAFT",
"customerName": "Amina Mushi",
"issueDate": "2026-12-05",
"dueDate": "2026-12-05",
"note": "",
"amountPaid": "0",
"balance": "150000"
}
}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.
ListInvoicesRequest
holygrail.invoices.v1.ListInvoicesRequest
kindInvoiceKindstatusInvoiceStatusOptional filters.
customerIdstringcustomer_idoverdueOnlybooleanoverdue_onlyIssued invoices past their due date with a balance.
pageSizeintegerpage_sizeNewest first; pass the previous response's next_page_token.
pageTokenstringpage_tokenListInvoicesResponse
holygrail.invoices.v1.ListInvoicesResponse
invoicesInvoice[]nextPageTokenstringnext_page_tokenGetInvoiceRequest
holygrail.invoices.v1.GetInvoiceRequest
idstringCreateInvoiceRequest
holygrail.invoices.v1.CreateInvoiceRequest
idstringClient-chosen UUID, so a retried request creates one document.
kindInvoiceKinddraftInvoiceDraftIssueInvoiceRequest
holygrail.invoices.v1.IssueInvoiceRequest
idstringSendInvoiceRequest
holygrail.invoices.v1.SendInvoiceRequest
idstringemailstringDefaults to the customer's email.
RecordPaymentRequest
holygrail.invoices.v1.RecordPaymentRequest
idstringClient-chosen UUID, so a retried request records one payment.
invoiceIdstringinvoice_idcashAccountIdstringcash_account_idamountint64 stringpaidAtstringpaid_atRFC 3339; defaults to now.
referencestringVoidPaymentRequest
holygrail.invoices.v1.VoidPaymentRequest
invoiceIdstringinvoice_idpaymentIdstringpayment_idVoidInvoiceRequest
holygrail.invoices.v1.VoidInvoiceRequest
idstringreasonstringSetEstimateResponseRequest
holygrail.invoices.v1.SetEstimateResponseRequest
idstringacceptedbooleanConvertEstimateRequest
holygrail.invoices.v1.ConvertEstimateRequest
invoiceIdstringinvoice_idClient-chosen id for the new invoice.
estimateIdstringestimate_idGetPublicInvoiceRequest
holygrail.invoices.v1.GetPublicInvoiceRequest
tokenstringRespondToEstimateRequest
holygrail.invoices.v1.RespondToEstimateRequest
tokenstringacceptedbooleanInvoice
holygrail.invoices.v1.Invoice
Amounts are integer minor units in the organization's currency.
idstringkindInvoiceKindnumberstring"INV-0001" or "EST-0001", assigned on creation.
statusInvoiceStatuscustomerIdstringcustomer_idcustomerNamestringcustomer_namecustomerEmailstringcustomer_emaillocationIdstringlocation_idissueDatestringissue_dateYYYY-MM-DD.
dueDatestringdue_datePayment due date for an invoice, valid-until date for an estimate.
notestringlinesInvoiceLine[]orderDiscountint64 stringorder_discounttotalsTotalsamountPaidint64 stringamount_paidbalanceint64 stringpaymentsInvoicePayment[]publicUrlstringpublic_urlThe customer's link.
estimateIdstringestimate_idFor an invoice made from an estimate, and for the estimate, the invoice.
invoiceIdstringinvoice_idissuedAtstringissued_atrespondedAtstringresponded_atvoidedAtstringvoided_atvoidReasonstringvoid_reasoncreatedAtstringcreated_atInvoiceDraft
holygrail.invoices.v1.InvoiceDraft
What a draft contains; used to create and to update.
customerIdstringcustomer_idlocationIdstringlocation_idissueDatestringissue_datedueDatestringdue_datenotestringlinesInvoiceLine[]orderDiscountint64 stringorder_discountPublicInvoice
holygrail.invoices.v1.PublicInvoice
What the customer sees.
businessNamestringbusiness_namecurrencyCodestringcurrency_codekindInvoiceKindnumberstringstatusInvoiceStatuscustomerNamestringcustomer_nameissueDatestringissue_datedueDatestringdue_datenotestringlinesInvoiceLine[]totalsTotalsamountPaidint64 stringamount_paidbalanceint64 stringInvoiceLine
holygrail.invoices.v1.InvoiceLine
idstringvariantIdstringvariant_idThe catalog variant it was picked from, if any.
descriptionstringquantityintegerunitPriceint64 stringunit_pricediscountint64 stringDiscount on this line (all units).
taxRateIdsstring[]tax_rate_idsTax rates to apply. In responses, taxes holds the rates as they were.
taxesLineTax[]grossint64 stringComputed: quantity × unit price, then less discounts, and the tax on it.
netint64 stringtaxint64 stringTotals
holygrail.orders.v1.Totals
subtotalint64 stringSum of (unit price + modifiers) × quantity.
discountint64 stringLine and order discounts.
taxint64 stringAll tax, inclusive and exclusive.
inclusiveTaxint64 stringinclusive_taxTax already inside prices (part of subtotal).
totalint64 stringWhat the customer owes before tips: subtotal - discount + exclusive tax.
InvoicePayment
holygrail.invoices.v1.InvoicePayment
idstringcashAccountIdstringcash_account_idamountint64 stringpaidAtstringpaid_atreferencestringvoidedbooleanLineTax
holygrail.orders.v1.LineTax
taxRateIdstringtax_rate_idnamestringrateBpintegerrate_bpinclusivebooleanInvoiceKind enum
holygrail.invoices.v1.InvoiceKind
INVOICE_KIND_UNSPECIFIEDINVOICE_KIND_ESTIMATEINVOICE_KIND_INVOICEInvoiceStatus enum
holygrail.invoices.v1.InvoiceStatus
INVOICE_STATUS_UNSPECIFIEDINVOICE_STATUS_DRAFTINVOICE_STATUS_ISSUEDInvoice: posted and waiting for payment. Estimate: waiting for an answer.
INVOICE_STATUS_ACCEPTEDINVOICE_STATUS_DECLINEDINVOICE_STATUS_PAIDINVOICE_STATUS_VOIDBase URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.