curl --request GET \
--url https://api.example.com/api/cards/:id{
"status": true,
"message": "<string>",
"data": [
{
"id": "<string>",
"object": "<string>",
"brand": "<string>",
"last4": "<string>",
"exp_month": 123,
"exp_year": 123,
"country": "<string>",
"fingerprint": "<string>",
"funding": "<string>",
"customer": "<string>"
}
]
}Retrieve all cards associated with a customer
curl --request GET \
--url https://api.example.com/api/cards/:id{
"status": true,
"message": "<string>",
"data": [
{
"id": "<string>",
"object": "<string>",
"brand": "<string>",
"last4": "<string>",
"exp_month": 123,
"exp_year": 123,
"country": "<string>",
"fingerprint": "<string>",
"funding": "<string>",
"customer": "<string>"
}
]
}Retrieves a list of all cards (payment sources) associated with a specific customer. This is useful for displaying saved payment methods to users.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/peLuis123/Stripe_Back/llms.txt
Use this file to discover all available pages before exploring further.
cus_.Example: "cus_QRs9eKZ4xUzN2TP9"true) or failed (false)."Tarjetas listadas correctamente"Show Card Object
card_.Example: "card_1QRs9eKZ4xUzN2TPabcdefgh""card"."Visa""4242"122026"US"credit, debit, prepaid, or unknown.Example: "credit"curl -X GET https://your-api.com/api/cards/cus_QRs9eKZ4xUzN2TP9 \
-H "Content-Type: application/json"
{
"status": true,
"message": "Tarjetas listadas correctamente",
"data": [
{
"id": "card_1QRs9eKZ4xUzN2TPabcdefgh",
"object": "card",
"brand": "Visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2026,
"country": "US",
"fingerprint": "Xt5EWLLDS7FJjR1c",
"funding": "credit",
"customer": "cus_QRs9eKZ4xUzN2TP9",
"cvc_check": "pass",
"address_zip_check": null
},
{
"id": "card_2ABc9eKZ4xUzN2TPxyzdefgh",
"object": "card",
"brand": "MasterCard",
"last4": "5555",
"exp_month": 6,
"exp_year": 2027,
"country": "US",
"fingerprint": "Yt6FXMMDS8GKkS2d",
"funding": "debit",
"customer": "cus_QRs9eKZ4xUzN2TP9",
"cvc_check": "pass",
"address_zip_check": "pass"
}
]
}
import { useState, useEffect } from 'react';
function PaymentMethods({ customerId }) {
const [cards, setCards] = useState([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
async function fetchCards() {
try {
const response = await fetch(`https://your-api.com/api/cards/${customerId}`);
const data = await response.json();
if (data.status) {
setCards(data.data);
}
} catch (error) {
console.error('Error fetching cards:', error);
} finally {
setLoading(false);
}
}
fetchCards();
}, [customerId]);
if (loading) return <div>Loading...</div>;
return (
<div>
<h2>Saved Payment Methods</h2>
{cards.length === 0 ? (
<p>No cards on file</p>
) : (
<ul>
{cards.map(card => (
<li key={card.id}>
{card.brand} ending in {card.last4}
<br />
Expires {card.exp_month}/{card.exp_year}
</li>
))}
</ul>
)}
</div>
);
}
cvc_check: Result of CVC verification (pass, fail, unavailable, or unchecked)address_zip_check: Result of ZIP code verification (pass, fail, unavailable, or unchecked)address_line1_check: Result of address verification