> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.paywithatoa.co.uk/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**

<ParamField path="customerId" type="string" required>
  The customer UUID whose cards to retrieve.
</ParamField>

**Response**

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

<ResponseField name="id" type="string">
  Card identifier. **Use this as `paymentMethodId` when processing payments.**
</ResponseField>

<ResponseField name="name" type="string">
  Cardholder name.
</ResponseField>

<ResponseField name="type" type="string">
  Card type (e.g., `credit`, `debit`).
</ResponseField>

<ResponseField name="lastFourDigits" type="string">
  Last 4 digits of the card number.
</ResponseField>

<ResponseField name="category" type="string">
  Card category (e.g., `consumer`, `commercial`).
</ResponseField>

<ResponseField name="cardType" type="string">
  Card type (e.g., `DEBIT`, `CREDIT`, `PREPAID`).
</ResponseField>

<ResponseField name="brand" type="string">
  Card network brand (e.g., `VISA`, `MASTERCARD`).
</ResponseField>

<ResponseField name="country" type="string">
  Card issuing country code (e.g., `GB`).
</ResponseField>

<ResponseField name="recurrenceType" type="string">
  Recurrence type (`unscheduled`, `recurring`, `installment`). Default: `unscheduled`.
</ResponseField>

<ResponseField name="expiryDate" type="string">
  Card expiry date in `MM/YYYY` format.
</ResponseField>

<RequestExample>
  ```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();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "id": "card_abc123def456",
      "name": "John Doe",
      "type": "credit",
      "lastFourDigits": "4242",
      "category": "consumer",
      "cardType": "DEBIT",
      "brand": "VISA",
      "country": "GB",
      "recurrenceType": "unscheduled",
      "expiryDate": "12/2027"
    }
  ]
  ```

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