API reference

Bill inbox

The address vendors send their bills to, and the emails sent there with what became of each.

Guides: Enter and approve vendor bills

Get the address vendors send bills to

GET/v1/bill_inbox

client.billInbox.get()

The address vendors send their bills to. Each PDF or photo attached to an email sent there, by anyone, becomes a vendor's invoice waiting to be entered as a bill.

Response

200BillInboxOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/bill_inbox" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

List the emails sent to the bills address

GET/v1/bill_inbox/emails

client.billInbox.listEmails()

Emails sent to the bills address, newest first, with what became of each: kept, with how many bills it brought, or refused because nothing attached was a PDF or a photo.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200ReceiptEmailPage

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/bill_inbox/emails" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Replace the bills address

POST/v1/bill_inbox/rotate· Idempotent

client.billInbox.rotate()

Replace the bills address with a new one. The old one reaches nothing from now on: for an address that draws mail it should not.

Response

200BillInboxOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/bill_inbox/rotate" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Objects

The objects these operations take and return.

BillInboxOut

NameTypeDescription
addressRequiredstring or null

Where vendors send their bills. Null where this deployment does not receive email.

ReceiptEmailPage

NameTypeDescription
dataRequiredarray of ReceiptEmailOut
has_moreRequiredboolean
next_cursorRequiredstring or null

ReceiptEmailOut

One email forwarded to the books' address, and what became of it.

NameTypeDescription
documents_keptRequiredinteger

Receipts kept from it, once taken.

idRequiredstring

An id that starts with rcpt_.

received_atRequiredstring (date-time)
refusalRequiredstring or null

Why nothing was kept: not_a_member (the sender may not attach receipts to these books) or nothing_attached (no PDF or photo in it).

senderRequiredstring

Who sent it, as the email says.

statusRequiredstring

pending until taken, then kept or refused.

subjectRequiredstring or null
taken_atRequiredstring (date-time) or null