> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.afternoon.co/llms.txt.
> For full documentation content, see https://docs.afternoon.co/llms-full.txt.

# List customer balances

GET https://api.afternoon.co/v1/customers/{id}/balances

Returns all wallet balances for a customer.

Reference: https://docs.afternoon.co/api-reference/afternoon-events-api/customers/list-balances

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Afternoon Events API
  version: 1.0.0
paths:
  /v1/customers/{id}/balances:
    get:
      operationId: list-balances
      summary: List customer balances
      description: Returns all wallet balances for a customer.
      tags:
        - subpackage_customers
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: cuid
        - name: Authorization
          in: header
          description: API key obtained from the Afternoon dashboard
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Customer balances
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerBalancesResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
servers:
  - url: https://api.afternoon.co
  - url: http://localhost:8787
components:
  schemas:
    WalletBalanceAccountType:
      type: string
      enum:
        - pricing_unit
        - currency
      description: Type of wallet account
      title: WalletBalanceAccountType
    WalletBalance:
      type: object
      properties:
        balance:
          type: string
          description: Current wallet balance
        account_type:
          $ref: '#/components/schemas/WalletBalanceAccountType'
          description: Type of wallet account
        pricing_unit_code:
          type: string
          description: Pricing unit code (if account type is pricing_unit)
        currency_code:
          type: string
          description: Currency code (if account type is currency)
      required:
        - balance
        - account_type
      title: WalletBalance
    CustomerBalancesResponse:
      type: object
      properties:
        success:
          type: boolean
        balances:
          type: array
          items:
            $ref: '#/components/schemas/WalletBalance'
        request_id:
          type: string
      required:
        - success
        - balances
        - request_id
      title: CustomerBalancesResponse
    ErrorResponseError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          oneOf:
            - description: Any type
            - type: 'null'
      required:
        - code
        - message
      title: ErrorResponseError
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        error:
          $ref: '#/components/schemas/ErrorResponseError'
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - success
        - error
      title: ErrorResponse
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the Afternoon dashboard

```

## SDK Code Examples

```typescript
import { AfternoonClient } from "afternoon-sdk";

async function main() {
    const client = new AfternoonClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.customers.listBalances("cm5x9z8nv0000h85r7l9p2k1m");
}
main();

```

```python
import requests

url = "https://api.afternoon.co/v1/customers/cm5x9z8nv0000h85r7l9p2k1m/balances"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.afternoon.co/v1/customers/cm5x9z8nv0000h85r7l9p2k1m/balances"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.afternoon.co/v1/customers/cm5x9z8nv0000h85r7l9p2k1m/balances")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.afternoon.co/v1/customers/cm5x9z8nv0000h85r7l9p2k1m/balances")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.afternoon.co/v1/customers/cm5x9z8nv0000h85r7l9p2k1m/balances', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.afternoon.co/v1/customers/cm5x9z8nv0000h85r7l9p2k1m/balances");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.afternoon.co/v1/customers/cm5x9z8nv0000h85r7l9p2k1m/balances")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```