> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# creditsLedger

> Get the credit ledger for a customer



**query** `creditsLedger(input: CreditLedgerInput!): CreditLedgerConnection!`

## Arguments

**`input`**: `CreditLedgerInput!` (required)

## Returns

`CreditLedgerConnection!`

**`edges`**: `[CreditLedgerEdge!]!`

Edges in the current page

---

**`pageInfo`**: `PageInfo!`

Pagination information

---

**`totalCount`**: `Int!`

Total number of items matching the filter

## Examples

```graphql Query
query CreditsLedger($input: CreditLedgerInput!) {
  creditsLedger(input: $input) {
    edges {
      cursor
      node {
        amount
        creditCurrencyId
        creditGrantId
        customerId
        eventId
        eventType
      }
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
```

```json Variables
{
  "input": {
    "customerId": "string"
  }
}
```

```json Response
{
  "data": {
    "creditsLedger": {
      "edges": [
        {
          "cursor": "string",
          "node": {
            "amount": 1.5,
            "creditCurrencyId": "string",
            "creditGrantId": "string",
            "customerId": "string",
            "eventId": "string",
            "eventType": "CREDITS_CONSUMED"
          }
        }
      ],
      "pageInfo": {
        "endCursor": "value",
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "value"
      },
      "totalCount": 1
    }
  }
}
```


## Related topics

- [Go SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/go.md)
- [CreditLedgerEvent](https://docs.stigg.io/graphql-reference/types/CreditLedgerEvent.md)
- [CreditLedgerInput](https://docs.stigg.io/graphql-reference/types/CreditLedgerInput.md)
- [CreditLedgerConnection](https://docs.stigg.io/graphql-reference/types/CreditLedgerConnection.md)
- [CreditLedgerEdge](https://docs.stigg.io/graphql-reference/types/CreditLedgerEdge.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.