arLedger
query · in the family Reading your records
What it does
A customer’s house-account ledger — every charge and payment, in order.
The AREntry ledger of ONE OrgCustomer house account, newest-first + born-paginated. from/to are the half-open period bounds over createdAt (UTC ISO-8601). 'nextToken' = the prior page's cursor. With the OrgCustomer GET (cached arBalanceMinor — stamped in the same transaction as every post) this IS the debt story.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Sales Associate
- An API key whose scope allows
api:arLedger
What happens
Reads only.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
orgCustomerId | ID ID! | yes | |
from | String | no | |
to | String | no | |
limit | Int | no | How many records to answer at most; a page may hold fewer. |
nextToken | String | no | The cursor from the previous page, passed back exactly as received. |
Returns
ArEntryPage ArEntryPage! — One arLedger page.
This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. See paging.
Example request
query ExampleArLedger($orgCustomerId: ID!, $from: String) {
arLedger(orgCustomerId: $orgCustomerId, from: $from) {
items {
id
parentId
entryType
amountMinor
currency
dueAt
reason
orderId
tenderId
returnId
creditNoteId
debitNoteId
caption
createdAt
}
nextToken
}
}Variables:
{
"orgCustomerId": "01900000-0000-7000-8000-7c3b96a50000",
"from": "<from>"
}Example response
{
"data": {
"arLedger": {
"items": [
{
"id": "01900000-0000-7000-8000-37386ae00000",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"entryType": "charge",
"amountMinor": 1250,
"currency": "USD",
"dueAt": "2027-01-31T00:00:00.000Z",
"reason": "Correcting a miscount.",
"orderId": "01900000-0000-7000-8000-18e782370000",
"tenderId": "01900000-0000-7000-8000-337e28070000",
"returnId": "01900000-0000-7000-8000-cc01b1df0000",
"creditNoteId": "01900000-0000-7000-8000-474463b00000",
"debitNoteId": "01900000-0000-7000-8000-a74545850000",
"caption": "Blue jeans",
"createdAt": "2027-01-31T00:00:00.000Z"
}
],
"nextToken": "<the cursor from the previous page>"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)