{"openapi":"3.0.3","info":{"title":"Vibed Cards API","version":"1.0.0","description":"Issue and load virtual Mastercard cards for your users. New card 20.1 USD; top-up = amount + 3.61% + 0.1 USD. Sign up at https://vibed.cards/developers."},"servers":[{"url":"https://vibed.cards"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"vbd_live_… API key"}}},"security":[{"bearer":[]}],"paths":{"/api/v1/cards":{"post":{"summary":"Issue a card","description":"Creates a virtual Mastercard (Apple Pay / Google Pay ready) for one of your customers. The card price is taken from your API balance. Most cards are active within a minute: status is 'issuing' until then (you also get a card.issued webhook). Send an Idempotency-Key header so a retry never creates a second card.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Cardholder email (optional; recommended)."},"name":{"type":"string","description":"Name on the card / label, up to 50 characters (optional)."},"client_ref":{"type":"string","description":"Your own customer id, to group cards and money per customer (optional)."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{\n  \"card\": { \"id\": \"card_8f2…\", \"status\": \"active\", \"client_ref\": \"user_42\", \"name\": \"Alice\", \"email\": \"alice@example.com\", \"created_at\": \"…\" },\n  \"charged_usd\": 20.1,\n  \"balance_usd\": 479.9\n}"}}}}},"get":{"summary":"List cards","description":"Your cards, newest first. Filter by your customer id with ?client_ref=.","parameters":[{"name":"client_ref","in":"query","required":false,"description":"Only this customer's cards (optional).","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"data\": [ { \"id\": \"card_8f2…\", \"status\": \"active\", \"client_ref\": \"user_42\", … } ] }"}}}}}},"/api/v1/cards/{id}/topup":{"post":{"summary":"Top up a card","description":"Loads exactly `amount` USD onto the card. The price (amount + fee) is taken from your API balance. Status 'completed' = on the card; 'processing' = being confirmed; you get a topup.completed webhook when it lands, or a topup.failed webhook and the full price back in your balance if it can't. Don't send the same top-up again while it is processing. Send an Idempotency-Key header.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","description":"USD to put on the card (minimum 5)."}},"required":["amount"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"card_id\": \"card_8f2…\", \"amount_usd\": 50, \"charged_usd\": 51.92, \"status\": \"completed\", \"balance_usd\": 427.98 }"}}}}}},"/api/v1/cards/{id}":{"get":{"summary":"Get a card","description":"Status, last 4 digits, expiry and live balance. Add ?reveal=true to also get the full number, CVV and billing address (show these only to the cardholder, never log them).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"reveal","in":"query","required":false,"description":"true to include number, cvv and billing_address.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"id\": \"card_8f2…\", \"status\": \"active\", \"last4\": \"4242\", \"expiry\": \"12/29\", \"balance_usd\": 50, \"frozen\": false, \"client_ref\": \"user_42\", … }"}}}}}},"/api/v1/cards/{id}/transactions":{"get":{"summary":"Card transactions","description":"Purchases, declines (with reason), refunds and top-ups on the card.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"data\": [ { \"id\": \"…\", \"description\": \"AMAZON\", \"amount_usd\": -12.5, \"status\": \"success\", \"decline_reason\": null, \"date\": \"…\" } ] }"}}}}}},"/api/v1/cards/{id}/codes":{"get":{"summary":"Verification codes","description":"One-time codes of the last 30 minutes: online payment checks (3-D Secure) and Apple Pay / Google Pay add codes. Show them to the cardholder.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"codes\": [ { \"code\": \"482913\", \"kind\": \"payment_3ds\", \"received_at\": \"…\" } ], \"wallet_code_status\": \"none\" }"}}}}}},"/api/v1/cards/{id}/wallet-code":{"post":{"summary":"Prepare Apple Pay / Google Pay","description":"Call this right before the cardholder adds the card to Apple Pay or Google Pay (choosing the email option). The next wallet code is matched to this card for 10 minutes; read it from /codes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"id\": \"card_8f2…\", \"status\": \"waiting\" }"}}}}}},"/api/v1/cards/{id}/freeze":{"post":{"summary":"Freeze a card","description":"Blocks new payments until unfrozen. /unfreeze turns it back on.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"id\": \"card_8f2…\", \"status\": \"frozen\" }"}}}}}},"/api/v1/cards/{id}/close":{"post":{"summary":"Close a card","description":"Closes the card for good. Its whole remaining balance goes back to your API balance, with no fee.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"id\": \"card_8f2…\", \"status\": \"closed\", \"returned_usd\": 42.5, \"balance_usd\": 470.48 }"}}}}}},"/api/v1/payments":{"post":{"summary":"Customer payment (earn your fee)","description":"Your customer pays for a new card or a top-up themselves, in USDC on Solana: you get a one-time address, the exact amount and a ready checkout page (checkout_url) to send them. The amount = API price + your fee (set 0–3% in your dashboard; it goes to your earnings). Once paid (usually seconds), the money lands in your API balance, the card is made / loaded from it automatically and you get a payment.completed webhook. No prepaid balance needed. Links are valid 24 hours.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"\"topup\" (needs card_id) or \"card\" (a new card). Default: topup when card_id is sent."},"card_id":{"type":"string","description":"The card to load (type topup)."},"amount_usd":{"type":"number","description":"What goes on the card, in USD (5–10,000)."},"client_ref":{"type":"string","description":"Your own customer id (optional; shown per customer in your dashboard)."},"email":{"type":"string","description":"Cardholder email for a new card (optional)."},"name":{"type":"string","description":"Name on a new card (optional)."}},"required":["amount_usd"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"id\": \"8c1e…\", \"object\": \"payment\", \"status\": \"waiting\", \"purpose\": \"topup\", \"card_id\": \"card_8f2…\", \"amount_usd\": 100, \"price_usd\": 103.72, \"fee_usd\": 2, \"pay_amount\": 105.72, \"pay_currency\": \"USDC\", \"pay_network\": \"solana\", \"pay_address\": \"7xKX…\", \"checkout_url\": \"https://vibed.cards/pay/8c1e…\", \"solana_pay_url\": \"solana:7xKX…?amount=105.72&spl-token=EPjF…\", \"expires_at\": \"…\" }"}}}}},"get":{"summary":"List payments","description":"Your customer payments, newest first.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–200 (default 50).","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"data\": [ { \"id\": \"8c1e…\", \"status\": \"completed\", \"amount_usd\": 100, \"fee_usd\": 2, … } ] }"}}}}}},"/api/v1/payments/{id}":{"get":{"summary":"Payment status","description":"Checks the payment on chain and returns it: waiting → paid → processing (card being made / loaded) → completed. failed = the card step was refused; the money stays in your API balance. expired = nothing paid in 24 h. underpaid = less than pay_amount arrived; it was added to your API balance without your fee. Poll every few seconds while your customer pays, or use the payment.* webhooks.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"id\": \"8c1e…\", \"status\": \"completed\", \"card_id\": \"card_8f2…\", \"received_usdc\": 105.72, … }"}}}}}},"/api/v1/balance":{"get":{"summary":"API balance","description":"Your prepaid balance in USD. Add funds on vibed.cards/developers.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"balance_usd\": 470.48 }"}}}}}},"/api/v1/ledger":{"get":{"summary":"Money flow","description":"Every deposit, card, top-up, return and refund on your balance, newest first.","parameters":[{"name":"limit","in":"query","required":false,"description":"1–500 (default 100).","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"data\": [ { \"id\": 812, \"type\": \"card_topup\", \"amount_usd\": -51.92, \"balance_after_usd\": 427.98, \"card_id\": \"card_8f2…\", \"client_ref\": \"user_42\", \"status\": \"done\", \"created_at\": \"…\" } ] }"}}}}}},"/api/v1/pricing":{"get":{"summary":"Prices","description":"Current prices (no API key needed).","security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"example":"{ \"card_issue_usd\": 20.1, \"topup_fee_percent\": 3.61, \"topup_fixed_fee_usd\": 0.1, … }"}}}}}},"/api/v1/cards/{id}/unfreeze":{"post":{"summary":"Unfreeze a card","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}}}}