API reference

Receipt searches

One transaction's receipt, looked for in every connected mailbox, and how far the search got.

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

NameTypeDescription
transaction_idPath · Requiredstring

An id that starts with txn_.

Response

200ReceiptSearchOut

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_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

NameTypeDescription
transaction_idPath · Requiredstring

An id that starts with txn_.

Response

200ReceiptSearchOut

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_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.

NameTypeDescription
mailboxesRequiredarray of ReceiptSearchMailboxOut

Each mailbox that can be searched. Empty: no mailbox is connected, or each is paused or disconnected.

searchingRequiredboolean

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_idRequiredstring

An id that starts with txn_.

ReceiptSearchMailboxOut

One mailbox, and what its searches for a transaction's receipt came to.

NameTypeDescription
addressRequiredstring or null

The mailbox's address, when the provider told it.

connection_idRequiredstring

An id that starts with conn_.

foundRequiredboolean

Whether a search found the receipt in it.

providerRequiredMailProvider
searched_atRequiredstring (date-time) or null

When it was last searched for this transaction's receipt; null if never.

searchingRequiredboolean

Whether a search a person asked for is running in it now.

MailProvider

A mailbox provider (app/integrations/mail/__init__.py).

No fields.