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

# List Payment Methods

> List payment methods via the Atoa Payment Methods API, request parameters, response schema and code samples in cURL, Python, JavaScript, PHP, Go and Java.

List all saved payment methods for a customer. Use the `id` field as `paymentMethodId` when charging a saved card.

### Authorization

Bearer `<accessSecret>`

**Path Parameters**

**customerId** `string` *required*

The customer UUID whose cards to retrieve.

**Query Parameters**

**metadata** `object`

Filter to cards whose metadata contains an exact key/value match. Use bracket syntax: `?metadata[internalId]=42`.

**Response**

Returns an array of saved card objects. Returns an empty array `[]` if no cards are saved.

**id** `string`

Card identifier. **Use this as `paymentMethodId` when processing payments.**

**name** `string`

Cardholder name.

**type** `string`

Card type (e.g., `credit`, `debit`).

**lastFourDigits** `string`

Last 4 digits of the card number.

**category** `string`

Card category (e.g., `consumer`, `commercial`).

**cardType** `string`

Card type (e.g., `DEBIT`, `CREDIT`, `PREPAID`).

**brand** `string`

Card network brand (e.g., `VISA`, `MASTERCARD`).

**country** `string`

Card issuing country code (e.g., `GB`).

**expiryDate** `string`

Card expiry date in `MM/YYYY` format.

**metadata** `object`

The key/value string pairs attached to the card when it was saved.

**createdAt** `string`

ISO 8601 timestamp of when the card was saved.

```bash curl theme={null}
curl --request GET \
  --url https://api.atoa.me/api/customers/{customerId}/cards \
  --header 'Authorization: Bearer <token>'
```

```python Python theme={null}
import requests

url = "https://api.atoa.me/api/customers/{customerId}/cards"
headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)
print(response.json())
```

```javascript JavaScript theme={null}
const response = await fetch(
  "https://api.atoa.me/api/customers/{customerId}/cards",
  {
    headers: { Authorization: "Bearer <token>" },
  }
);

const data = await response.json();
console.log(data);
```

```php PHP theme={null}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.atoa.me/api/customers/{customerId}/cards",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

```go Go theme={null}
package main

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

func main() {
  url := "https://api.atoa.me/api/customers/{customerId}/cards"

  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <token>")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

```java Java theme={null}
HttpResponse<String> response = Unirest.get("https://api.atoa.me/api/customers/{customerId}/cards")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```json 200 theme={null}
[
  {
    "id": "card_abc123def456",
    "name": "John Doe",
    "type": "credit",
    "lastFourDigits": "4242",
    "category": "consumer",
    "cardType": "DEBIT",
    "brand": "VISA",
    "country": "GB",
    "expiryDate": "12/2027",
    "metadata": { "internalId": "42" },
    "createdAt": "2025-06-15T10:30:00.000Z"
  }
]
```

```json 404 theme={null}
{
  "name": "NOT_FOUND",
  "message": "Customer not found",
  "status": 404,
  "errors": []
}
```


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