Freezes the user’s card, temporarily disabling it and preventing all transaction authorizations. This is a reversible action that allows users to quickly secure their card when they suspect suspicious activity or want to temporarily prevent spending.
Reversible ActionFrozen cards can be reactivated at any time using the POST /v1/card/unfreeze endpoint. No data is lost, and the same card details remain valid.
async function reportSuspiciousActivity() { try { await freezeCard(); console.log('Card frozen successfully'); console.log('Contact support to investigate suspicious activity'); notifyUser({ title: 'Card Frozen', message: 'Your card has been frozen for security. Contact support for assistance.' }); } catch (error) { console.error('Failed to freeze card:', error); }}
async function enableSpendingLock() { const card = await getCardStatus(); if (card.status === 'ACTIVE') { await freezeCard(); console.log('Spending locked until you unfreeze your card'); notifyUser({ title: 'Spending Locked', message: 'Your card is now frozen. Unfreeze it anytime to resume spending.' }); }}
async function handleLostCard(confirmedLost: boolean) { if (confirmedLost) { await freezeCard(); console.log('Card frozen. Report as lost/stolen to get a replacement.'); showDialog({ title: 'Card Frozen', message: 'Do you want to report this card as lost or stolen?', actions: [ { label: 'Report Lost/Stolen', action: () => reportCardLost() }, { label: 'I Found It', action: () => unfreezeCard() } ] }); } else { await freezeCard(); console.log('Card frozen temporarily. You can unfreeze it when found.'); }}
Already Frozen CardsCalling this endpoint on an already frozen card will return a 400 Bad Request error with the message “Card is already frozen”. Check card status first if you’re unsure of the current state.
Copy
async function freezeCardSafely() { try { const card = await getCardStatus(); if (card.status === 'FROZEN') { console.log('Card is already frozen'); return { success: true, alreadyFrozen: true }; } if (card.status === 'BLOCKED') { throw new Error('Card is blocked and cannot be frozen'); } await freezeCard(); return { success: true, alreadyFrozen: false }; } catch (error) { console.error('Failed to freeze card:', error); throw error; }}
Cannot Freeze BLOCKED CardsCards with BLOCKED status cannot be frozen or unfrozen. Blocked cards are permanently disabled and require replacement via POST /v1/card/order.
Subscription PaymentsFreezing a card will cause recurring subscription payments to fail. Inform users that they should unfreeze their card before scheduled subscription renewals or update payment methods for critical services.
Real-Time EffectCard freezing takes effect immediately. There may be a brief delay (typically <1 second) for the status change to propagate to payment processors.
async function freezeAndVerify() { await freezeCard(); await new Promise(resolve => setTimeout(resolve, 500)); const card = await getCardStatus(); if (card.status !== 'FROZEN') { console.warn('Card status is not FROZEN after freeze operation'); throw new Error('Card freeze verification failed'); } return card;}