API reference
Receipt requests
Missing receipts asked of the person who swiped the card, by email, with reminders.
- GET
/v1/receipt_request_settingsGet whether the books ask cardholders - PUT
/v1/receipt_request_settingsTurn asking cardholders on or off - GET
/v1/receipt_requestsList the receipts asked of cardholders - POST
/v1/receipt_requestsAsk a cardholder for a charge's receipt - GET
/v1/receipt_requests/{request_id}Get a receipt request - POST
/v1/receipt_requests/{request_id}/cancelCancel a receipt request - POST
/v1/receipt_requests/{request_id}/resendEmail a receipt request again
Guides: Get missing receipts from cardholders
Get whether the books ask cardholders
GET/v1/receipt_request_settings
client.receiptRequests.getSettings()
Whether the books ask cardholders for missing receipts on their own.
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_request_settings" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Turn asking cardholders on or off
PUT/v1/receipt_request_settings
client.receiptRequests.setSettings()
Turn asking cardholders on their own on or off. Requests already made carry on; turned off, a person asks from the Inbox.
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 PUT "https://api.ledgerit.ai/v1/receipt_request_settings" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"ask_automatically":false}'List the receipts asked of cardholders
GET/v1/receipt_requests
client.receiptRequests.list()
The receipts asked of cardholders, the newest first, with what each came to.
Parameters
| Name | Type | Description |
|---|---|---|
transaction_idQuery | string or null | An id that starts with |
statusQuery | string or null | Only open, completed, cancelled, expired |
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/receipt_requests" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Ask a cardholder for a charge's receipt
POST/v1/receipt_requests· Idempotent
client.receiptRequests.create()
Ask the cardholder for a charge's receipt. They are emailed a link to
a page that needs no account and works for 30 days, where they upload a
photo or a PDF; it is attached to the charge and read like any receipt.
Reminders follow on day 3 and day 7. The charge's missing_receipt item
waits on them meanwhile. Asking again cancels the open request, and its
link stops working. emailed says whether the email went; when it did
not, the request is open all the same and the books try again. A
cardholder who is a member of the books is not emailed: they upload the
receipt from their Inbox, and asking them without an email is refused
(409).
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/receipt_requests" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"transaction_id":"…"}'Get a receipt request
GET/v1/receipt_requests/{request_id}
client.receiptRequests.get()
One receipt request, and what it came to.
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/receipt_requests/{request_id}" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Cancel a receipt request
POST/v1/receipt_requests/{request_id}/cancel
client.receiptRequests.cancel()
Stop an open request's link working. The charge's missing_receipt
item goes back to the owner. Settled requests stay as they are.
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 -X POST "https://api.ledgerit.ai/v1/receipt_requests/{request_id}/cancel" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Email a receipt request again
POST/v1/receipt_requests/{request_id}/resend· Idempotent
client.receiptRequests.resend()
Email an open request's link again, now. Not twice within a day: a cardholder emailed less than a day ago is refused (409).
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 -X POST "https://api.ledgerit.ai/v1/receipt_requests/{request_id}/resend" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"Objects
The objects these operations take and return.
ReceiptRequestSettingsOut
| Name | Type | Description |
|---|---|---|
ask_automaticallyRequired | boolean | Whether a missing receipt is asked of its cardholder as soon as it is raised, when the books know their address. On by default. |
ReceiptRequestSettingsIn
| Name | Type | Description |
|---|---|---|
ask_automaticallyRequired | boolean | Ask cardholders on their own, or only when a person does. |
ReceiptRequestPage
| Name | Type | Description |
|---|---|---|
dataRequired | array of ReceiptRequestOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
ReceiptRequestCreate
| Name | Type | Description |
|---|---|---|
cardholder | string or null | Who to ask, when the card program does not say. Left out, the person it names. |
email | string or null | Where to send the link. Left out, the cardholder's address the books know: the one the card program gave, a member's of the same name, or one given before. Given for a cardholder the card program names, it is kept for that name. |
transaction_idRequired | string | The card charge. Asking again cancels its open request, and that link stops working. |
ReceiptRequestOut
| Name | Type | Description |
|---|---|---|
cancelled_atRequired | string (date-time) or null | |
cardholderRequired | string | Who it is asked of: the person who spent the charge. |
completed_atRequired | string (date-time) or null | |
created_atRequired | string (date-time) | |
document_idRequired | string or null | An id that starts with |
emailed | boolean or null | On a request just made or sent again: whether the email went. Null when read later. |
expiredRequired | boolean | Open, but past its day: the sweep is about to expire it. |
expired_atRequired | string (date-time) or null | |
expires_atRequired | string (date-time) | When its link stops working. |
idRequired | string | An id that starts with |
reminded_atRequired | string (date-time) or null | When it was last emailed again. |
reminders_sentRequired | integer | Reminders sent so far: on day 3 and day 7, at most two. |
requested_byRequired | string or null | An id that starts with |
sent_atRequired | string (date-time) or null | When the first email went; null while it waits to go. |
sent_toRequired | string | The address the link is emailed to. |
statusRequired | string |
open, completed, cancelled, expired |
transaction_idRequired | string | The card charge whose receipt is asked for. |