API reference
Cardholder contacts
The email addresses the books keep for cardholders a card program names without one.
- GET
/v1/cardholder_contactsList cardholders' addresses - POST
/v1/cardholder_contactsGive a cardholder's address - GET
/v1/cardholder_contacts/{contact_id}Get a cardholder's address - PATCH
/v1/cardholder_contacts/{contact_id}Change a cardholder's address - DELETE
/v1/cardholder_contacts/{contact_id}Forget a cardholder's address
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
| Name | Type | Description |
|---|---|---|
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/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
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/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
| Name | Type | Description |
|---|---|---|
contact_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/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
| Name | Type | Description |
|---|---|---|
contact_idPath · Required | string | An id that starts with |
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 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
| Name | Type | Description |
|---|---|---|
contact_idPath · Required | string | An id that starts with |
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 -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
| Name | Type | Description |
|---|---|---|
dataRequired | array of CardholderContactOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
CardholderContactCreate
| Name | Type | Description |
|---|---|---|
emailRequired | string | Their address. |
nameRequired | string | The cardholder, as the card program names them. |
CardholderContactOut
| Name | Type | Description |
|---|---|---|
created_atRequired | string (date-time) | |
created_byRequired | string or null | An id that starts with |
emailRequired | string | Where their receipt requests go. |
idRequired | string | An id that starts with |
nameRequired | string | The cardholder as the card program names them. |
CardholderContactUpdate
| Name | Type | Description |
|---|---|---|
email | string or null | |
name | string or null |