API reference

Payment destinations

Where vendors are paid: versioned bank accounts and addresses, kept encrypted, verified by a person before money goes there.

Guides: Record payments and apply them

List payment destinations

GET/v1/payment_destinations

client.paymentDestinations.list()

Where vendors are paid, the newest first, superseded versions included.

Parameters

NameTypeDescription
party_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

200DestinationPage

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

Add where a vendor is paid

POST/v1/payment_destinations· Idempotent

client.paymentDestinations.create()

Add where a vendor is paid: a new version, unverified, that supersedes the one before. Nothing can be sent there until a person who may approve money verifies it.

Request body

DestinationCreate

Response

201DestinationOut

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

Get a payment destination

GET/v1/payment_destinations/{destination_id}

client.paymentDestinations.get()

One destination, as much of it as may be shown.

Parameters

NameTypeDescription
destination_idPath · Requiredstring

An id that starts with dest_.

Response

200DestinationOut

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

Block a payment destination

POST/v1/payment_destinations/{destination_id}/block· Idempotent

client.paymentDestinations.block()

Never send anything here again. Needs money.approve.

Parameters

NameTypeDescription
destination_idPath · Requiredstring

An id that starts with dest_.

Response

200DestinationOut

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/payment_destinations/{destination_id}/block" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Verify a payment destination

POST/v1/payment_destinations/{destination_id}/verify· Idempotent

client.paymentDestinations.verify()

Say the details were confirmed with the vendor, and how. Needs money.approve.

Parameters

NameTypeDescription
destination_idPath · Requiredstring

An id that starts with dest_.

Request body

DestinationVerify

Response

200DestinationOut

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

Objects

The objects these operations take and return.

DestinationPage

NameTypeDescription
dataRequiredarray of DestinationOut
has_moreRequiredboolean
next_cursorRequiredstring or null

DestinationCreate

NameTypeDescription
detailsRequiredmap of string

For ach and wire: account_number and routing_number. For check: name, line1, city, region and postal_code. Kept encrypted; never returned.

party_idRequiredstring

The vendor paid there: a counterparty of these books.

railRequiredstring

ach, wire or check.

DestinationOut

NameTypeDescription
created_atRequiredstring (date-time)
idRequiredstring

An id that starts with dest_.

maskedRequiredstring

What may be shown of the details: the last four digits, or the city.

party_idRequiredstring

An id that starts with party_.

railRequiredstring
statusRequiredstring

unverified, verified, blocked or superseded.

verification_noteRequiredstring or null
verified_atRequiredstring (date-time) or null
versionRequiredinteger

Each change of details is a new version; the one before is superseded.

DestinationVerify

NameTypeDescription
noteRequiredstring

How the details were confirmed with the vendor.