# arLedger

query · in the family [Reading your records](/reference/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 (charge/payment/credit_memo/writeoff, -ref'd to their orders/tenders/returns/notes). Requires authentication; the account is tenant-scoped server-side.

## What happens

Reads only.

## Who may call it

Capability area: **Reading your records** — Looking up and listing the records of your organization.

- Owner
- System Administrator
- Manager
- Associate Manager
- Sales Associate
- An API key whose scope allows `api:arLedger`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `orgCustomerId` | [ID](/types/#scalars) `ID!` | yes | No further notes. |
| `from` | [String](/types/#scalars) | no | No further notes. |
| `to` | [String](/types/#scalars) | no | No further notes. |
| `limit` | [Int](/types/#scalars) | no | How many records to answer at most; a page may hold fewer. |
| `nextToken` | [String](/types/#scalars) | no | The cursor from the previous page, passed back exactly as received. |

## Returns

[ArEntryPage](/types/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](/guides/paging-and-the-cursor-grammar/).

## Example request

```graphql
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:

```json
{
  "orgCustomerId": "01900000-0000-7000-8000-ba56ff800000",
  "from": "<from>"
}
```

## Example response

```json
{
  "data": {
    "arLedger": {
      "items": [
        {
          "id": "01900000-0000-7000-8000-37386ae00000",
          "parentId": "01900000-0000-7000-8000-065235280000",
          "entryType": "charge",
          "amountMinor": 1,
          "currency": "USD",
          "dueAt": "2027-01-31T00:00:00.000Z",
          "reason": "Correcting a miscount.",
          "orderId": "01900000-0000-7000-8000-f6d8263a0000",
          "tenderId": "01900000-0000-7000-8000-0ae1978a0000",
          "returnId": "01900000-0000-7000-8000-4d4c03d20000",
          "creditNoteId": "01900000-0000-7000-8000-0206baad0000",
          "debitNoteId": "01900000-0000-7000-8000-f2e485a00000",
          "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. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))

## Used in

- [Bill a business customer and collect on account](/use-cases/bill-a-business-customer/)
