Invoices
Drafts, issuing, sending, PDFs and public links.
Paths are relative to https://evenbooks.org/api/v1. How keys, errors, paging and versions work is in the guide; the whole reference is also an OpenAPI 3.1 document.
Administrator key marks endpoints that need a key with the admin role, Write access those a read-only key can’t call, and Idempotent those that accept an idempotency key.
List invoices
/invoicesNewest issue date first unless sort and dir say otherwise. outstanding keeps issued invoices that are not fully paid; overdue keeps those past their due date; q searches the number, memo and customer name. List items leave lines empty and omit allocations: get one invoice for those.
Parameters
limitintegerquerycursorstring · PageCursorquerysortstringqueryOne of:
issueDatedueDatenumbercustomertotalbalanceDuedirstring · SortDirectionqueryOne of:
ascdescstatusstring · DocumentStatusqueryOne of:
draftissuedpaidvoidcontactIdstring · Uuidqueryfromstring · PlainDateStringquerytostring · PlainDateStringqueryoverdueboolean · QueryBooleanqueryoutstandingboolean · QueryBooleanqueryqstringquery
Response 200
A page of InvoiceDto ({ items, nextCursor, total }, see paging).
Errors 400 · 401 · 403 · 404 · 409 · 429
Create a draft invoice
/invoicesA draft has no number and is not in the books yet; issue it with POST /invoices/{id}/issue. The customer’s name, email and address are copied onto the invoice. dueDate defaults to issueDate plus termsDays (the company’s default terms when omitted), and memo and footer default to the invoice branding defaults.
Request body
CreateInvoiceInput
contactIdstring · UuidrequiredissueDatestring · PlainDateStringrequireddueDatestring · PlainDateStringtermsDaysintegerlinesarray of DocumentLineInputrequiredShow 7 fields of each item
itemIdstring · Uuid or nulldescriptionstringrequiredquantitystring · NonNegativeDecimalStringunitPricestring · DecimalStringrequireddiscountDiscountInput or nullincomeAccountIdstring · UuidrequiredtaxRateIdsarray of string · Uuid
documentDiscountDiscountInput or nullShow 2 fields
typestringrequiredOne of:
percentfixedvaluestring · NonNegativeDecimalStringrequired
memostring or nullfooterstring or nullpaymentUrlstring or nullonlinePaymentsDisabledboolean
Response 200
InvoiceDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Get an invoice
/invoices/{id}Includes its lines and its allocations (payments and credits applied to it).
Parameters
idstring (uuid)path · required
Response 200
InvoiceDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Change an invoice
/invoices/{id}Send version from your last read (409 version_conflict if it changed). On a draft, any field of the create body can change, and lines, when sent, replace all lines. On an issued, paid or void invoice only paymentUrl and onlinePaymentsDisabled change; other fields are ignored.
Parameters
idstring (uuid)path · required
Request body
UpdateInvoiceInput
contactIdstring · UuidissueDatestring · PlainDateStringdueDatestring · PlainDateStringtermsDaysintegerlinesarray of DocumentLineInputShow 7 fields of each item
itemIdstring · Uuid or nulldescriptionstringrequiredquantitystring · NonNegativeDecimalStringunitPricestring · DecimalStringrequireddiscountDiscountInput or nullincomeAccountIdstring · UuidrequiredtaxRateIdsarray of string · Uuid
documentDiscountDiscountInput or nullShow 2 fields
typestringrequiredOne of:
percentfixedvaluestring · NonNegativeDecimalStringrequired
memostring or nullfooterstring or nullpaymentUrlstring or nullonlinePaymentsDisabledbooleanversionintegerrequired
Response 200
InvoiceDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Delete a draft invoice
/invoices/{id}Only drafts can be deleted (409 immutable otherwise). Void an issued invoice instead.
Parameters
idstring (uuid)path · required
Response 204
Done; no body
No body.
Errors 400 · 401 · 403 · 404 · 409 · 429
List emails of an invoice
/invoices/{id}/emailsEvery email queued for this invoice, newest first, with its delivery status.
Parameters
idstring (uuid)path · required
Response 200
array of EmailMessageDto
Errors 400 · 401 · 403 · 404 · 409 · 429
Issue an invoice
/invoices/{id}/issueTurns a draft into a final invoice: gives it the next invoice number, posts it to the books (money the customer owes, against income and sales tax), creates its public link and queues its PDF. Send version from your last read (409 version_conflict); the total must be above zero, and a date in a locked period is refused (409 period_locked). issueDate replaces the draft’s date and recalculates the due date from the terms.
Parameters
idstring (uuid)path · required
Request body
IssueInvoiceInput
versionintegerrequiredissueDatestring · PlainDateStringidempotencyKeystring · IdempotencyKey
Response 200
InvoiceDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
List PDF versions of an invoice
/invoices/{id}/pdfEvery PDF made for this invoice, newest first. Download one with GET /attachments/{attachmentId}/download.
Parameters
idstring (uuid)path · required
Response 200
array of InvoicePdfVersionDto
Errors 400 · 401 · 403 · 404 · 409 · 429
Get or remake the invoice PDF
/invoices/{id}/pdfReturns the current PDF, making one first if the invoice has none. regenerate: true makes a new version with the design saved when the invoice was issued; applyCurrentDesign: true makes one with the current invoice branding and keeps that design for later PDFs. Drafts have no PDF (409 invalid_state). Download it with GET /attachments/{attachmentId}/download.
Parameters
idstring (uuid)path · required
Request body
PostInvoicesIdPdfBody
regeneratebooleanapplyCurrentDesignboolean
Response 200
InvoicePdfDto
attachmentIdstringdownloadPathstringPath of the download:
/api/v1/attachments/{attachmentId}/downloadfor API keys (the app gets its own/api/...path).
Errors 400 · 401 · 403 · 404 · 409 · 429
Get, replace or turn off the public link
/invoices/{id}/public-linkThe public link lets the customer view, download and pay the invoice without signing in. get returns the current link, rotate replaces it (the old link stops working) and revoke turns it off; while it is off, url and path are null until you rotate. get and rotate need an issued or paid invoice (409 invalid_state); voiding an invoice turns its link off.
Parameters
idstring (uuid)path · required
Request body
PostInvoicesIdPublicLinkBody
actionstringOne of:
getrotaterevoke
Response 200
PublicLinkStateDto
urlstring or nullpathstring or null
Errors 400 · 401 · 403 · 404 · 409 · 429
Email an invoice
/invoices/{id}/sendQueues an email to to with the invoice PDF attached; the server sends it shortly after. Only issued or paid invoices (409 invalid_state). subject and message replace the template’s; usePlatformSender sends from the Evenbooks address instead of the company’s own domain. Counts toward the company’s hourly and daily email limits (429 rate_limited). An address on the suppression list is recorded with status suppressed and not sent. Follow delivery with GET /invoices/{id}/emails.
Parameters
idstring (uuid)path · required
Request body
SendInvoiceEmailInput
tostring (email)requiredmessagestring or nullsubjectstringusePlatformSenderbooleanidempotencyKeystring · IdempotencyKey
Response 200
EmailMessageDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Void an invoice
/invoices/{id}/voidCancels an issued invoice by posting a reversing entry on date (default: the issue date) and turns off its public link. Refused while payments or credits are applied to it (409 invalid_state): reverse those allocations first, or give a credit note instead. Needs version from your last read; refused in a locked period (409 period_locked). Delete a draft instead of voiding it.
Parameters
idstring (uuid)path · required
Request body
VoidInvoiceInput (fields under Schemas)
Response 200
InvoiceDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Issue or email many invoices
/invoices/bulkUp to 100 invoices, each with its own version and idempotencyKey: one failure (a stale version, a locked period, a missing email address) does not stop the others, and a retry with the same keys repeats only what did not go through. issue issues drafts; send emails issued invoices to the address on the invoice, or else the contact’s, and skips invoices with neither. The response has one result per invoice and the counts.
Request body
BulkInvoiceInput
One of these shapes:
action: "issue"
actionstringrequiredAlways
"issue"itemsarray of objectrequiredShow 3 fields of each item
idstring · UuidrequiredversionintegerrequiredidempotencyKeystring · IdempotencyKeyrequired
action: "send"
actionstringrequiredAlways
"send"itemsarray of objectrequiredShow 3 fields of each item
idstring · UuidrequiredversionintegerrequiredidempotencyKeystring · IdempotencyKeyrequired
messagestring or null
Response 200
BulkInvoiceResultDto
actionstringOne of:
issuesendresultsarray of BulkInvoiceItemResultsucceededintegerfailedintegerskippedinteger
Errors 400 · 401 · 403 · 404 · 409 · 429
Calculate invoice totals
/invoices/previewWorks out each line’s discount, sales tax and total, and the document totals, without saving anything. Credit notes use the same calculation.
Request body
PostInvoicesPreviewBody
linesarray of DocumentLineInputrequiredShow 7 fields of each item
itemIdstring · Uuid or nulldescriptionstringrequiredquantitystring · NonNegativeDecimalStringunitPricestring · DecimalStringrequireddiscountDiscountInput or nullincomeAccountIdstring · UuidrequiredtaxRateIdsarray of string · Uuid
documentDiscountDiscountInput or nullShow 2 fields
typestringrequiredOne of:
percentfixedvaluestring · NonNegativeDecimalStringrequired
Response 200
DocumentPreviewDto
linesarray of objectShow 13 fields of each item
descriptionstringquantitystringunitPricestringdiscountDiscount or nullincomeAccountIdstringtaxRateIdsarray of stringtaxesarray of LineTaxDtogrossstring · DecimalStringlineDiscountstring · DecimalStringdocumentDiscountSharestring · DecimalStringnetstring · DecimalStringtaxTotalstring · DecimalStringtotalstring · DecimalString
subtotalstring · DecimalStringdiscountTotalstring · DecimalStringnetTotalstring · DecimalStringtaxTotalstring · DecimalStringtotalstring · DecimalStringtaxSummaryarray of TaxSummaryDto
Errors 400 · 401 · 403 · 404 · 409 · 429
Schemas
The types these endpoints take or return, by name. Type names above link here.
Address
line1stringoptionalline2stringoptionalcitystringoptionalregionstringoptionalpostalCodestringoptionalcountrystringoptional
AllocationDto
idstringsourceTypestringOne of:
paymentcredit_notepaymentIdstring or nullcreditNoteIdstring or nullinvoiceIdstringinvoiceNumberstring or nulloptionalamountstring · DecimalStringdatestring · PlainDateStringstatusstringOne of:
activereversedjournalEntryIdstring or nullreversalJournalEntryIdstring or nullsourceLabelstringoptional
BulkInvoiceItemResult
idstringnumberstring or nullokbooleanskippedbooleanoptionalinvoiceInvoiceDtooptionalemailEmailMessageDtooptionalerrorobjectoptionalShow 2 fields
codestringmessagestring
CustomerSnapshotDto
namestringemailstring or nulloptionalphonestring or nulloptionaladdressAddressoptional
DecimalString
decimal string
string
Discount
typestringOne of:
percentfixedvaluestring · NonNegativeDecimalString
DiscountInput
typestringrequiredOne of:
percentfixedvaluestring · NonNegativeDecimalStringrequired
DocumentLineDto
idstringlineNointegeritemIdstring or nulldescriptionstringquantitystringunitPricestringdiscountDiscount or nullincomeAccountIdstringincomeAccountNamestringoptionaltaxRateIdsarray of stringtaxesarray of LineTaxDtogrossstring · DecimalStringlineDiscountstring · DecimalStringdocumentDiscountSharestring · DecimalStringnetstring · DecimalStringtaxTotalstring · DecimalStringtotalstring · DecimalString
DocumentLineInput
itemIdstring · Uuid or nulldescriptionstringrequiredquantitystring · NonNegativeDecimalStringunitPricestring · DecimalStringrequireddiscountDiscountInput or nullincomeAccountIdstring · UuidrequiredtaxRateIdsarray of string · Uuid
DocumentStatus
string
One of: draft issued paid void
EmailMessageDto
idstringkindstringinvoiceIdstring or nulltoEmailstringfromEmailstring or nulloptionalreplyTostring or nulloptionaltemplateVersionnumber or nulloptionalsubjectstringstatusstring · EmailStatusOne of:
queuedsendingsentdeliveredbouncedcomplainedfaileduncertainsuppressedproviderMessageIdstring or nullattemptsintegerlastErrorstring or nullisResendbooleanrequestedBystringqueuedAtstringsentAtstring or nulldeliveredAtstring or nullfailedAtstring or null
EmailStatus
string
One of: queued sending sent delivered bounced complained failed uncertain suppressed
IdempotencyKey
string
InvoiceDto
idstringnumberstring or nullstatusstring · DocumentStatusOne of:
draftissuedpaidvoidisOverduebooleancontactIdstringcontactNamestringoptionalcustomerSnapshotCustomerSnapshotDtoissueDatestring · PlainDateStringdueDatestring · PlainDateStringtermsDaysintegermemostring or nullfooterstring or nullpaymentUrlstring or nullonlinePaymentsDisabledbooleandocumentDiscountDiscount or nullcurrencystringsubtotalstring · DecimalStringdiscountTotalstring · DecimalStringnetTotalstring · DecimalStringtaxTotalstring · DecimalStringtotalstring · DecimalStringtaxSummaryarray of TaxSummaryDtoamountSettledstring · DecimalStringbalanceDuestring · DecimalStringjournalEntryIdstring or nullvoidJournalEntryIdstring or nullvoidReasonstring or nullrecurringScheduleIdstring or nullrecurringOccurrenceIndexinteger or nullhasPublicLinkbooleancurrentPdfAttachmentIdstring or nullissuedAtstring or nulllastSentAtstring or nulllinesarray of DocumentLineDtoallocationsarray of AllocationDtooptionalversionintegercreatedAtstring
InvoicePdfVersionDto
versionintegerattachmentIdstringreasonstringWhy it was made:
on_demand,manual,design_updatedoremail_snapshot.createdAtstringsha256string or null
LineTaxDto
taxRateIdstringnamestringratestringamountstring · DecimalString
NonNegativeDecimalString
string
PageCursor
string
PlainDateString
string
QueryBoolean
boolean
SortDirection
string
One of: asc desc
TaxSummaryDto
taxRateIdstringnamestringratestringtaxablestring · DecimalStringamountstring · DecimalStringliabilityAccountIdstring
Uuid
string (uuid)
VoidInvoiceInput
versionintegerrequiredreasonstringrequireddatestring · PlainDateStringidempotencyKeystring · IdempotencyKey