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.
- GET
/v1/bill_requestsList the bills asked of vendors - POST
/v1/bill_requestsAsk a vendor for its bill for a month - GET
/v1/bill_requests/{request_id}Get a bill asked of a vendor
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
| Name | Type | Description |
|---|---|---|
counterparty_idQuery | string or null | An id that starts with |
periodQuery | string or null | Only requests for this month, as |
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/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
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/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
| Name | Type | Description |
|---|---|---|
request_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/bill_requests/{request_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Objects
The objects these operations take and return.
BillRequestPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of BillRequestOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
BillRequestCreate
| Name | Type | Description |
|---|---|---|
counterparty_idRequired | string | The vendor to ask. |
email | string or null | Where to send it. Left out, the vendor's own email, else the address its last emailed bill came from. |
periodRequired | string | The month whose bill to ask for, as |
BillRequestOut
One email asking a vendor for a month's bill.
| Name | Type | Description |
|---|---|---|
counterparty_idRequired | string | The vendor it was asked of. |
currencyRequired | string | The books' currency. |
idRequired | string | An id that starts with |
periodRequired | string | The month the bill is for, as |
remindsRequired | string or null | An id that starts with |
requested_byRequired | string or null | An id that starts with |
sent_atRequired | string (date-time) | When the mail service took the email. |
sent_toRequired | string | The address the email went to. |
usualRequired | string or null | The vendor's usual bill the email named, in |