---
search:
  tags:
    - Customers
    - GET
seo:
  description: >-
    Any signed in user. Returns ledger entries for one customer,… Reference for
    the GET /api/v1/customers/{customerId}/ledger endpoint in the PharmaFlow
    API.
sidebar:
  label: Get a customer ledger
  badge: GET
title: Get a customer ledger
type: openapi-operation
---
Any signed in user. Returns ledger entries for one customer, newest first, with the balance. An unknown customer answers 404 before the read, and each row carries the staff name.

`GET /api/v1/customers/{customerId}/ledger`

**Responses**

- `200` — A page of ledger entries
- `401` — Not authenticated
- `404` — Customer not found

Response example, 200:

```json
{
  "total": -9007199254740991,
  "page": -9007199254740991,
  "page_size": -9007199254740991,
  "items": [
    {
      "id": "string",
      "customer_id": "string",
      "transaction_type": "string",
      "amount": "string",
      "balance_after": "string",
      "reference_id": "string",
      "notes": "string",
      "created_by": "string",
      "created_at": "string",
      "created_by_name": "string"
    }
  ]
}
```
