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

# List user credentials

> Retrieves the user's stored credentials matching the requested `type` values.
Requests that do not supply any `type` values return an empty list.




## OpenAPI

````yaml /openapi.yaml get /user/{id}/credential/list
openapi: 3.0.1
info:
  title: Push API
  version: 0.0.1
servers:
  - url: https://api.pushcash.com
    description: Production API
  - url: https://sandbox.pushcash.com
    description: Sandbox API used for developing an integration with Push
security:
  - bearer: []
tags:
  - name: user
  - name: tokenization
  - name: authorization
  - name: intent
  - name: dispute
  - name: refund
  - name: ledger
    description: >-
      Accounts, transactions, and transfers — the records that make up the Push
      ledger.
  - name: simulation
paths:
  /user/{id}/credential/list:
    get:
      tags:
        - user
      summary: List user credentials
      description: >
        Retrieves the user's stored credentials matching the requested `type`
        values.

        Requests that do not supply any `type` values return an empty list.
      operationId: listCredentials
      parameters:
        - name: id
          in: path
          description: The push identifier for the user
          required: true
          schema:
            type: string
            example: user_28CJjV7P4Go5PNJvfzghiD
        - in: query
          name: type
          description: >
            The credential types to return. Repeat the parameter to pass
            multiple values

            (e.g. `?type=secure_debit&type=apple_pay_debit`). Requests that do
            not supply

            any `type` values return an empty list.


            To display credentials eligible for deposits, pass `secure_debit`,

            `card_only_credit`, and `card_only_debit`. To display credentials
            eligible

            for withdrawals, pass `secure_debit` and `apple_pay_debit`.
          required: false
          explode: true
          schema:
            type: array
            items:
              type: string
              example: apple_pay_debit
              enum:
                - secure_debit
                - card_only_credit
                - card_only_debit
                - apple_pay_debit
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserCredential'
                required:
                  - data
              example:
                data:
                  - id: cred_7YlA9IiSl8UZvNwNSbFajV
                    created_at: '2023-05-24T20:15:18.158Z'
                    card_last4: '4444'
                    authenticated: true
                    type: secure_debit
                    account_last4: '0685'
                    bank_name: Chase Bank
                  - id: cred_8ZlB0JjTm9VZaOxOTcGbkW
                    created_at: '2023-05-25T10:20:30.123Z'
                    card_last4: '1234'
                    authenticated: true
                    type: card_only_credit
                    account_last4: null
                    bank_name: null
                  - id: cred_9AmC1KkUn0WabPyPUdHclX
                    created_at: '2023-05-26T14:35:45.456Z'
                    card_last4: '5678'
                    authenticated: true
                    type: card_only_debit
                    account_last4: null
                    bank_name: null
                  - id: cred_0BnD2LlVo1XbcQzQVeIdmY
                    created_at: '2023-05-27T09:45:12.789Z'
                    card_last4: '9010'
                    authenticated: true
                    type: apple_pay_debit
                    account_last4: null
                    bank_name: null
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl --request GET \
              --url 'https://api.pushcash.com/user/{id}/credential/list?type=secure_debit&type=apple_pay_debit' \
              --header 'Authorization: Bearer <token>'
        - lang: python
          label: Python
          source: |
            import requests

            url = "https://api.pushcash.com/user/{id}/credential/list"
            params = {"type": ["secure_debit", "apple_pay_debit"]}
            headers = {"Authorization": "Bearer <token>"}

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

            print(response.json())
        - lang: javascript
          label: JavaScript
          source: |
            const params = new URLSearchParams();
            params.append('type', 'secure_debit');
            params.append('type', 'apple_pay_debit');

            const response = await fetch(
              `https://api.pushcash.com/user/{id}/credential/list?${params}`,
              { headers: { Authorization: 'Bearer <token>' } }
            );

            const data = await response.json();
        - lang: php
          label: PHP
          source: |
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://api.pushcash.com/user/{id}/credential/list?type=secure_debit&type=apple_pay_debit",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_HTTPHEADER => ["Authorization: Bearer <token>"],
            ]);

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

            echo $response;
        - lang: go
          label: Go
          source: |
            package main

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

            func main() {
              url := "https://api.pushcash.com/user/{id}/credential/list?type=secure_debit&type=apple_pay_debit"

              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(string(body))
            }
        - lang: java
          label: Java
          source: >
            HttpResponse<String> response =
            Unirest.get("https://api.pushcash.com/user/{id}/credential/list?type=secure_debit&type=apple_pay_debit")
              .header("Authorization", "Bearer <token>")
              .asString();
        - lang: ruby
          label: Ruby
          source: >
            require 'uri'

            require 'net/http'


            url =
            URI("https://api.pushcash.com/user/{id}/credential/list?type=secure_debit&type=apple_pay_debit")


            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
components:
  schemas:
    UserCredential:
      type: object
      example:
        id: cred_7YlA9IiSl8UZvNwNSbFajV
        created_at: '2023-05-24T20:15:18.158Z'
        card_last4: '4444'
        authenticated: true
        type: secure_debit
        account_last4: '0685'
        bank_name: Chase Bank
      properties:
        id:
          type: string
          description: The unique identifier assigned by Push
        created_at:
          type: string
          format: date-time
          description: When the payment credential was created (ISO 8061 date string)
        card_last4:
          type: string
          description: The last 4 digits of the card number
        authenticated:
          type: boolean
          description: >-
            For `secure_debit` credentials, whether the user has authenticated
            with the bank.
        type:
          description: >
            The type of payment credential:

            - `secure_debit`: A debit card which can be used for withdrawals and
            deposits

            - `card_only_credit`: A credit card which can be used for deposits
            alone

            - `card_only_debit`: A debit card which can be used for deposits
            alone

            - `apple_pay_debit`: A debit card stored via Apple Pay which can be
            used for withdrawals alone
          type: string
          enum:
            - secure_debit
            - card_only_credit
            - card_only_debit
            - apple_pay_debit
        account_last4:
          type: string
          description: >-
            For authenticated `secure_debit` credentials, the last 4 digits of
            the bank account number for the user's account. This field is `null`
            otherwise.
          nullable: true
        bank_name:
          type: string
          description: >-
            For `secure_debit` credentials, the name of the user's bank. This
            field is `null` otherwise.
          nullable: true
      required:
        - id
        - created_at
        - card_last4
        - authenticated
        - type
        - account_last4
        - bank_name
    error:
      description: Description of the error encountered from the API request
      type: object
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````