API reference
Receipt searches
One transaction's receipt, looked for in every connected mailbox, and how far the search got.
- GET
/v1/receipt_searches/{transaction_id}Get how the mailbox search for a transaction's receipt is going - POST
/v1/receipt_searches/{transaction_id}Search connected mailboxes for a transaction's receipt
Guides: Find receipts in your mailbox
Get how the mailbox search for a transaction's receipt is going
GET/v1/receipt_searches/{transaction_id}
client.receiptSearches.get()
The mailboxes a transaction's receipt can be looked for in, and how the search a person asked for is going in each.
Parameters
| Name | Type | Description |
|---|---|---|
transaction_idPath · Required | string | An id that starts with |
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_searches/{transaction_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Search connected mailboxes for a transaction's receipt
POST/v1/receipt_searches/{transaction_id}· Idempotent
client.receiptSearches.start()
Look for one transaction's receipt in every connected mailbox now, in
the background, whether or not the books are missing it. A receipt found
is attached to the transaction. Read the search back until searching
is false. Asking again while it runs changes nothing.
Parameters
| Name | Type | Description |
|---|---|---|
transaction_idPath · Required | string | An id that starts with |
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_searches/{transaction_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"Objects
The objects these operations take and return.
ReceiptSearchOut
A transaction's receipt, looked for in the books' connected mailboxes.
| Name | Type | Description |
|---|---|---|
mailboxesRequired | array of ReceiptSearchMailboxOut | Each mailbox that can be searched. Empty: no mailbox is connected, or each is paused or disconnected. |
searchingRequired | boolean | Whether a search is running in any mailbox. Read again until it is false; a receipt found is then among the transaction's documents. |
transaction_idRequired | string | An id that starts with |
ReceiptSearchMailboxOut
One mailbox, and what its searches for a transaction's receipt came to.
| Name | Type | Description |
|---|---|---|
addressRequired | string or null | The mailbox's address, when the provider told it. |
connection_idRequired | string | An id that starts with |
foundRequired | boolean | Whether a search found the receipt in it. |
providerRequired | MailProvider | |
searched_atRequired | string (date-time) or null | When it was last searched for this transaction's receipt; null if never. |
searchingRequired | boolean | Whether a search a person asked for is running in it now. |
MailProvider
A mailbox provider (app/integrations/mail/__init__.py).
No fields.