API reference

Bill requests

Bills asked of vendors by email from the close, each with the month, the usual amount it named and where it went.

Guides: Close the month

List the bills asked of vendors

GET/v1/bill_requests

client.billRequests.list()

The bills asked of vendors, the newest first.

Parameters

NameTypeDescription
counterparty_idQuerystring or null

An id that starts with party_.

periodQuerystring or null

Only requests for this month, as YYYY-MM.

limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200BillRequestPage

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

Ask a vendor for its bill for a month

POST/v1/bill_requests· Idempotent

client.billRequests.create()

Ask a vendor for its bill for a month. One email, in the company's name, naming the month and the vendor's usual bill when the close found it missing, with its reply going to the books' bills address: the invoice that comes back is read like any other, and the close's item about the month answers itself. Recorded only once the mail service took the email; a vendor is asked about a month at most once a day. A week on, while the month still waits on the bill, LedgerIt reminds the vendor once. In demo books the ask is recorded and no email goes.

Request body

BillRequestCreate

Response

201BillRequestOut

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/bill_requests" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"counterparty_id":"…","period":"…"}'

Get a bill asked of a vendor

GET/v1/bill_requests/{request_id}

client.billRequests.get()

One bill asked of a vendor.

Parameters

NameTypeDescription
request_idPath · Requiredstring

An id that starts with bill_req_.

Response

200BillRequestOut

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/bill_requests/{request_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

BillRequestPage

NameTypeDescription
dataRequiredarray of BillRequestOut
has_moreRequiredboolean
next_cursorRequiredstring or null

BillRequestCreate

NameTypeDescription
counterparty_idRequiredstring

The vendor to ask.

emailstring or null

Where to send it. Left out, the vendor's own email, else the address its last emailed bill came from.

periodRequiredstring

The month whose bill to ask for, as YYYY-MM.

BillRequestOut

One email asking a vendor for a month's bill.

NameTypeDescription
counterparty_idRequiredstring

The vendor it was asked of.

currencyRequiredstring

The books' currency.

idRequiredstring

An id that starts with bill_req_.

periodRequiredstring

The month the bill is for, as YYYY-MM.

remindsRequiredstring or null

An id that starts with bill_req_.

requested_byRequiredstring or null

An id that starts with usr_.

sent_atRequiredstring (date-time)

When the mail service took the email.

sent_toRequiredstring

The address the email went to.

usualRequiredstring or null

The vendor's usual bill the email named, in currency; null when the vendor was not missing from the month by the rhythm it keeps, so no amount was named.