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

# Get wallet

> Get wallet balances and active credits for a customer

<RequestExample>
  ```ts theme={null}
  const { result, error } = await unprice.wallet.balance({
    customerId: "cus_1234567890"
  });

  if (error) {
    console.error(error.message);
    return;
  }

  console.log(result);
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "currency": "USD",
    "available": {
      "ledger_amount": 100000000,
      "amount": "1.00000000",
      "currency": "USD",
      "display_amount": "$1.00000000"
    },
    "held": {
      "ledger_amount": 25000000,
      "amount": "0.25000000",
      "currency": "USD",
      "display_amount": "$0.25000000"
    },
    "credits": [
      {
        "id": "wcr_123",
        "source": "credit_line",
        "issued": {
          "ledger_amount": 100000000,
          "amount": "1.00000000",
          "currency": "USD",
          "display_amount": "$1.00000000"
        },
        "available": {
          "ledger_amount": 75000000,
          "amount": "0.75000000",
          "currency": "USD",
          "display_amount": "$0.75000000"
        },
        "expires_at": "2026-06-07T00:00:00.000Z",
        "created_at": "2026-05-07T12:28:35.906Z"
      }
    ]
  }
  ```
</ResponseExample>

`available` is the amount the customer can still spend. `held` is already reserved for accepted usage that is still settling.

To inspect one credit from the `credits` array:

```ts theme={null}
const { result, error } = await unprice.walletCredits.balance({
  customerId: "cus_1234567890",
  walletId: "wcr_123"
});
```

## Request

<ParamField query="customerId" type="string" required>
  The customer ID to load wallet state for.
</ParamField>

<ParamField query="projectId" type="string">
  Optional project ID. Only main-project keys can request another project.
</ParamField>
