API reference

Receipt inbox

The address to forward receipts to, and the emails forwarded there with what became of each.

Guides: Find receipts and invoices

Get the address to forward receipts to

GET/v1/receipt_inbox

client.receiptInbox.get()

The address to forward receipts to. Each PDF or photo attached to an email sent there by a member who may attach receipts becomes a document, read and matched like an upload; email from anyone else is refused.

Response

200ReceiptInboxOut

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/receipt_inbox" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

List the emails forwarded to the books

GET/v1/receipt_inbox/emails

client.receiptInbox.listEmails()

Emails forwarded to the books' address, newest first, with what became of each.

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/receipt_inbox/emails" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Replace the receipt forwarding address

POST/v1/receipt_inbox/rotate· Idempotent

client.receiptInbox.rotate()

Replace the address with a new one. The old one reaches nothing from now on: for an address that has been shared where it should not be.

Response

200ReceiptInboxOut

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/receipt_inbox/rotate" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Objects

The objects these operations take and return.

ReceiptInboxOut

NameTypeDescription
addressRequiredstring or null

Forward receipts here. 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