API reference
Detected sources
The accounts the books' own transactions name and the books do not read yet, such as a Stripe payout or a Gusto debit, with the lines that named them.
- GET
/v1/detected_sourcesList the sources the books' lines name - POST
/v1/detected_sources/scanRead the books' lines again for sources - GET
/v1/detected_sources/{source_id}Get a source the books' lines name - PATCH
/v1/detected_sources/{source_id}Dismiss or restore a suggested source
Guides: Connect your banks, cards, payroll and revenue
List the sources the books' lines name
GET/v1/detected_sources
client.detectedSources.list()
The sources the books' own lines name — a Stripe payout, a Gusto
debit — each with how often, what moved through it and its newest lines,
newest first. An open one is a suggestion to connect.
Parameters
| Name | Type | Description |
|---|---|---|
statusQuery | string or null | Only sources in this state: |
kindQuery | string or null | Only sources of this kind. |
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/detected_sources" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Read the books' lines again for sources
POST/v1/detected_sources/scan
client.detectedSources.scan()
Read the last year of lines again for the sources they name. Every sync and upload already does this for what it brings in, and a daily sweep does it for every set of books; this is for now. Safe to repeat: a line is evidence of a source once.
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/detected_sources/scan" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Get a source the books' lines name
GET/v1/detected_sources/{source_id}
client.detectedSources.get()
One source the lines name, with its newest lines.
Parameters
| Name | Type | Description |
|---|---|---|
source_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/detected_sources/{source_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Dismiss or restore a suggested source
PATCH/v1/detected_sources/{source_id}
client.detectedSources.update()
Dismiss a suggestion (status: dismissed): the books do not use the
source, or do not want it read, and it is not suggested again. open
takes that back; a dismissed source whose provider is connected comes
back as connected. Setting connected by hand is refused (422): connect
the provider instead.
Parameters
| Name | Type | Description |
|---|---|---|
source_idPath · Required | string | An id that starts with |
Request body
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 PATCH "https://api.ledgerit.ai/v1/detected_sources/{source_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status":"…"}'Objects
The objects these operations take and return.
DetectedSourcePage
| Name | Type | Description |
|---|---|---|
dataRequired | array of DetectedSourceOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
DetectedSourceScanOut
What reading the lines again found.
| Name | Type | Description |
|---|---|---|
examinedRequired | integer | Lines read. |
sightingsRequired | integer | Lines that named a source for the first time. |
sourcesRequired | array of string | The keys of the sources the lines named. |
DetectedSourceOut
| Name | Type | Description |
|---|---|---|
connection_idRequired | string or null | An id that starts with |
created_atRequired | string (date-time) | |
dismissed_atRequired | string (date-time) or null | |
dismissed_byRequired | string or null | An id that starts with |
first_seen_onRequired | string (date) | The earliest line that named it. |
idRequired | string | An id that starts with |
inflowRequired | Money | What came in from it, in the books' currency. |
keyRequired | string | The source, by the catalog's key for it: |
kindRequired | string | What connecting it would bring: |
last_seen_onRequired | string (date) | The latest line that named it. |
nameRequired | string | The source's name: Stripe, PayPal, ADP. |
outflowRequired | Money | What went out to it, in the books' currency. |
providerRequired | string or null | The provider that connects it ( |
samplesRequired | array of DetectedSourceSampleOut | Its newest lines, at most five: the evidence. |
sightingsRequired | integer | How many lines named it. |
statusRequired | string |
|
updated_atRequired | string (date-time) |
DetectedSourceUpdate
| Name | Type | Description |
|---|---|---|
statusRequired | string |
|
Money
An amount and its currency. amount is a base-10 string with two to
four decimal places — two unless the currency counts finer, as a dinar
does — and an optional leading minus sign. Parse it with a decimal type,
not a float.
| Name | Type | Description |
|---|---|---|
amountRequired | string | |
currencyRequired | string | ISO 4217 code. |
DetectedSourceSampleOut
One of the lines that named the source.
| Name | Type | Description |
|---|---|---|
amountRequired | Money | Signed: positive came in, negative went out. |
dateRequired | string (date) | The line's date, in its source's reckoning. |
descriptionRequired | string | The line, as its source wrote it. |
matched_textRequired | string | The words in the line that named the source: |
transaction_idRequired | string or null | An id that starts with |