Skip to main content
POST
https://api-dev.weir.ai/
/
org
/
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"
}

Add Payment Card

Add a new payment card to your organization using a payment token.
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"
}

Request Body

token
string
required
Payment token from payment processor (e.g., Stripe token).

Usage Examples

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();
};