API reference

Refund requests

Refunds asked by email of vendors that charged after you cancelled them, each with what it asked back and where it went.

Guides: Close the month, Work the inbox

List the refunds asked of vendors

GET/v1/refund_requests

client.refundRequests.list()

The refunds asked of vendors, the newest first: each person's ask, and LedgerIt's one reminder of it two weeks on when nothing came back.

Parameters

NameTypeDescription
counterparty_idQuerystring or null

An id that starts with party_.

limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200RefundRequestPage

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

Ask a vendor that charged after it stopped for a refund

POST/v1/refund_requests· Idempotent

client.refundRequests.create()

Ask a vendor that charged after it stopped billing for the money back. One email, in the company's name, naming the month the vendor was to stop billing from and what it has charged since and not refunded, with its reply going to the company's email (else the caller's). The refund, when it lands on the bank or card, closes the Inbox items about the charges itself. Recorded only once the mail service took the email; a vendor is asked at most once a day. In demo books the ask is recorded and no email goes.

Request body

RefundRequestCreate

Response

201RefundRequestOut

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

Get a refund asked of a vendor

GET/v1/refund_requests/{request_id}

client.refundRequests.get()

One refund asked of a vendor.

Parameters

NameTypeDescription
request_idPath · Requiredstring

An id that starts with refund_req_.

Response

200RefundRequestOut

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

Objects

The objects these operations take and return.

RefundRequestPage

NameTypeDescription
dataRequiredarray of RefundRequestOut
has_moreRequiredboolean
next_cursorRequiredstring or null

RefundRequestCreate

NameTypeDescription
counterparty_idRequiredstring

The vendor to ask: one a person said stopped billing (stopped_billing_in), that has charged since and not refunded all of it.

emailstring or null

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

RefundRequestOut

One email asking a vendor that charged after it stopped billing for the money back.

NameTypeDescription
amountRequiredstring

What the email asked back, in currency: everything charged since the vendor stopped, less what it had refunded of it by then.

chargesRequiredinteger

How many charges since the vendor stopped the email counted.

counterparty_idRequiredstring

The vendor it was asked of.

currencyRequiredstring

The books' currency.

idRequiredstring

An id that starts with refund_req_.

remindsRequiredstring or null

An id that starts with refund_req_.

reply_toRequiredstring

Where the vendor's reply goes: the company's email, else the address of the person who asked.

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.

stopped_billing_inRequiredstring (date)

The first day of the month the vendor was said to stop billing from, as it stood when asked: the charges since then are what the email asked back.