Returns a saved credit card by its ID
JavaScript
import { createClient } from '@spree/sdk' const client = createClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const card = await client.customer.creditCards.get('card_abc123', { bearerToken: '<token>', })
{ "id": "card_UkLWZg9DAJ", "brand": "visa", "last4": "1111", "month": 12, "year": 2027, "name": "Spree Commerce", "default": false, "gateway_payment_profile_id": null }
Publishable API key for store access
JWT token for authenticated customers
Comma-separated list of fields to include (e.g., name,slug,price). id is always included.
credit card found
Was this page helpful?