curl -X POST 'https://api.weir.ai/org/card' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'x-source: console' \
-d '{
"token": "tok_1N3T00LkdIwHu7ixt44h1F8k"
}'
{
"data": {
"cardId": "card_123456789",
"last4": "4242",
"brand": "Visa",
"expiryMonth": 12,
"expiryYear": 2025
},
"message": "Card added successfully",
"status": "success"
}
Add a new payment card
curl -X POST 'https://api.weir.ai/org/card' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'x-source: console' \
-d '{
"token": "tok_1N3T00LkdIwHu7ixt44h1F8k"
}'
{
"data": {
"cardId": "card_123456789",
"last4": "4242",
"brand": "Visa",
"expiryMonth": 12,
"expiryYear": 2025
},
"message": "Card added successfully",
"status": "success"
}
curl -X POST 'https://api.weir.ai/org/card' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'x-source: console' \
-d '{
"token": "tok_1N3T00LkdIwHu7ixt44h1F8k"
}'
{
"data": {
"cardId": "card_123456789",
"last4": "4242",
"brand": "Visa",
"expiryMonth": 12,
"expiryYear": 2025
},
"message": "Card added successfully",
"status": "success"
}
const addCard = async (token, accessToken) => {
const response = await fetch('https://api.weir.ai/org/card', {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'x-source': 'console'
},
body: JSON.stringify({ token })
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
return await response.json();
};
Was this page helpful?