Expenses
Money spent (purchases, bills paid, vendor refunds).
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 expenses
/purchasesMoney spent, and vendor refunds received. Newest first unless sort and dir say otherwise; accountId keeps expenses with a line in that category or paid from that account; q searches the memo and reference. List items omit attachments: get one expense for those.
Parameters
limitintegerquerycursorstring · PageCursorquerysortstringqueryOne of:
datetotalvendorreferencedirstring · SortDirectionqueryOne of:
ascdescfromstring · PlainDateStringquerytostring · PlainDateStringquerycontactIdstring · UuidqueryaccountIdstring · UuidquerystatusstringqueryOne of:
postedvoidqstringquery
Response 200
A page of PurchaseDto ({ items, nextCursor, total }, see paging).
Errors 400 · 401 · 403 · 404 · 409 · 429
Record an expense
/purchasesRecords money already paid from paidFromAccountId (a bank account or card) and posts it to the books on date, split over the categories in lines; direction: inflow records a refund from a vendor. attachmentIds attaches uploaded receipts (see POST /attachments). Refused in a locked period (409 period_locked).
Request body
CreatePurchaseInput
datestring · PlainDateStringrequiredcontactIdstring · Uuid or nullpaidFromAccountIdstring · UuidrequireddirectionstringOne of:
outflowinflowreferencestring or nullmemostring or nulllinesarray of PurchaseLineInputrequiredShow 3 fields of each item
accountIdstring · Uuidrequireddescriptionstringamountstring · PositiveDecimalStringrequired
attachmentIdsarray of string · UuidbankTransactionIdstring · Uuid or nullidempotencyKeystring · IdempotencyKey
Response 200
PurchaseDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Get an expense
/purchases/{id}Includes its lines and attachments.
Parameters
idstring (uuid)path · required
Response 200
PurchaseDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Void an expense
/purchases/{id}/voidCancels an expense by posting a reversing entry on date (default: the expense date); a matched bank line goes back to unreviewed. Send version from your last read (409 version_conflict); refused in a locked period (409 period_locked).
Parameters
idstring (uuid)path · required
Request body
VoidPurchaseInput
versionintegerrequiredreasonstringrequireddatestring · PlainDateStringidempotencyKeystring · IdempotencyKey
Response 200
PurchaseDto (fields under Schemas)
Errors 400 · 401 · 403 · 404 · 409 · 429
Schemas
The types these endpoints take or return, by name. Type names above link here.
DecimalString
decimal string
string
IdempotencyKey
string
NonNegativeDecimalString
string
PageCursor
string
PlainDateString
string
PositiveDecimalString
string
PurchaseDto
idstringdatestring · PlainDateStringcontactIdstring or nullcontactNamestring or nulloptionaldirectionstringOne of:
outflowinflowpaidFromAccountIdstringpaidFromAccountNamestringoptionalreferencestring or nullmemostring or nulltotalstring · DecimalStringcurrencystringstatusstringOne of:
postedvoidjournalEntryIdstringvoidJournalEntryIdstring or nullbankTransactionIdstring or nullvoidReasonstring or nulllinesarray of PurchaseLineDtoattachmentsarray of objectoptionalShow 4 fields of each item
idstringfileNamestringcontentTypestringsizeBytesnumber
versionintegercreatedAtstring
PurchaseLineDto
idstringlineNointegeraccountIdstringaccountNamestringoptionalaccountCodestringoptionaldescriptionstringamountstring · DecimalString
PurchaseLineInput
accountIdstring · Uuidrequireddescriptionstringamountstring · PositiveDecimalStringrequired
SortDirection
string
One of: asc desc
Uuid
string (uuid)