API reference
Receipt inbox
The address to forward receipts to, and the emails forwarded there with what became of each.
- GET
/v1/receipt_inboxGet the address to forward receipts to - GET
/v1/receipt_inbox/emailsList the emails forwarded to the books - POST
/v1/receipt_inbox/rotateReplace the receipt forwarding address
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
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 "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
| Name | Type | Description |
|---|---|---|
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
Response
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 "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
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 -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
| Name | Type | Description |
|---|---|---|
addressRequired | string or null | Forward receipts here. Null where this deployment does not receive email. |
ReceiptEmailPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of ReceiptEmailOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
ReceiptEmailOut
One email forwarded to the books' address, and what became of it.
| Name | Type | Description |
|---|---|---|
documents_keptRequired | integer | Receipts kept from it, once taken. |
idRequired | string | An id that starts with |
received_atRequired | string (date-time) | |
refusalRequired | string or null | Why nothing was kept: |
senderRequired | string | Who sent it, as the email says. |
statusRequired | string |
|
subjectRequired | string or null | |
taken_atRequired | string (date-time) or null |