Skip to main content

Endpoint

GET /v1/listCards
EnvironmentFull URL
Sandboxhttps://sandbox.api.prava.space/v1/listCards
Productionhttps://api.prava.space/v1/listCards

Authentication

Bearer token using your secret key:
Authorization: Bearer sk_test_xxx
Cards are scoped by merchant_id (derived from your secret key) and the customer_id query parameter.

Query Parameters

Required

customer_id
string
required
The customer ID to retrieve cards for (the user_id used when creating the session)

Optional

status
string
default:"active"
Filter by card status: active (default) or all (includes deleted cards)
include_card_art
string
default:"false"
Include card art URL in response: "true" or "false" (default: "false")

Response (200)

cards
array
Array of card objects
count
number
Total number of cards returned

Example

Swap the host for production: use https://api.prava.space instead of https://sandbox.api.prava.space.
curl "https://sandbox.api.prava.space/v1/listCards?customer_id=user_123&status=active" \
  -H "Authorization: Bearer sk_test_xxx"
curl "https://api.prava.space/v1/listCards?customer_id=user_123&status=active" \
  -H "Authorization: Bearer sk_live_xxx"
const BASE_URL = 'https://sandbox.api.prava.space'; // or https://api.prava.space

const result = await fetch(
  `${BASE_URL}/v1/listCards?customer_id=user_123&status=active`,
  {
    headers: {
      'Authorization': `Bearer ${SECRET_KEY}`,
    },
  }
).then(res => res.json());

console.log(result.cards);  // Array of card objects
console.log(result.count);  // Number of cards

Response

{
  "cards": [
    {
      "card_id": "enr_abc123",
      "card_last4": "4242",
      "card_brand": "visa",
      "card_exp_month": 12,
      "card_exp_year": 2027,
      "masked_card_number": "•••• •••• •••• 4242",
      "is_default": true,
      "status": "active",
      "card_art_url": null,
      "metadata": {
        "backgroundColor": "#1A1F71",
        "foregroundColor": "#FFFFFF",
        "labelColor": "#CCCCCC"
      },
      "created_at": "2026-03-15T10:30:00Z"
    }
  ],
  "count": 1
}

Error Responses

StatusCodeCause
400INVALID_REQUESTMissing customer_id query parameter
401AUTH_1001Invalid API key
401AUTH_1002Missing or invalid Authorization header
404CUSTOMER_NOT_FOUNDNo customer found for the given customer_id

Error Response Format

{
  "error": {
    "code": "AUTH_1001",
    "message": "Invalid API key"
  }
}

Notes

  • Only non-sensitive card metadata is returned — full PANs are never exposed.
  • Use status=all to include previously deleted cards for historical reference.
  • The card_id returned here is the same as the enrollmentId from the SDK’s collectPAN().