API reference

Cardholder contacts

The email addresses the books keep for cardholders a card program names without one.

Guides: Get missing receipts from cardholders

List cardholders' addresses

GET/v1/cardholder_contacts

client.cardholderContacts.list()

The addresses the books were given for cardholders, the newest first.

Parameters

NameTypeDescription
limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200CardholderContactPage

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

Give a cardholder's address

POST/v1/cardholder_contacts· Idempotent

client.cardholderContacts.create()

Give the address of a cardholder the card program names without one. Their missing receipts are asked of them from then on. One per name: a name the books already have is refused (409).

Request body

CardholderContactCreate

Response

201CardholderContactOut

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

Get a cardholder's address

GET/v1/cardholder_contacts/{contact_id}

client.cardholderContacts.get()

One cardholder's address.

Parameters

NameTypeDescription
contact_idPath · Requiredstring

An id that starts with cardholder_.

Response

200CardholderContactOut

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

Change a cardholder's address

PATCH/v1/cardholder_contacts/{contact_id}

client.cardholderContacts.update()

Change a cardholder's name or address. Requests already sent keep the address they went to.

Parameters

NameTypeDescription
contact_idPath · Requiredstring

An id that starts with cardholder_.

Request body

CardholderContactUpdate

Response

200CardholderContactOut

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 PATCH "https://api.ledgerit.ai/v1/cardholder_contacts/{contact_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Forget a cardholder's address

DELETE/v1/cardholder_contacts/{contact_id}

client.cardholderContacts.delete()

Forget a cardholder's address. Their next missing receipt waits on the owner again.

Parameters

NameTypeDescription
contact_idPath · Requiredstring

An id that starts with cardholder_.

Response

204No content

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 DELETE "https://api.ledgerit.ai/v1/cardholder_contacts/{contact_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Objects

The objects these operations take and return.

CardholderContactPage

NameTypeDescription
dataRequiredarray of CardholderContactOut
has_moreRequiredboolean
next_cursorRequiredstring or null

CardholderContactCreate

NameTypeDescription
emailRequiredstring

Their address.

nameRequiredstring

The cardholder, as the card program names them.

CardholderContactOut

NameTypeDescription
created_atRequiredstring (date-time)
created_byRequiredstring or null

An id that starts with usr_.

emailRequiredstring

Where their receipt requests go.

idRequiredstring

An id that starts with cardholder_.

nameRequiredstring

The cardholder as the card program names them.

CardholderContactUpdate

NameTypeDescription
emailstring or null
namestring or null