Locking is reversible and canceling is not: a
locked card can return to active, but a canceled card can never be reactivated.
Lock a card
Set a cardβs status tolocked to temporarily block all new authorizations. Locking is the right move for a misplaced card, a suspected but unconfirmed compromise, or a cardholder who wants to pause spend. Set the status back to active to unlock.
A lock is fully reversible and keeps the card, its number, and its digital-wallet tokens intact. Prefer locking over canceling whenever the card might return to use.
Rain automatically locks a card after too many incorrect PIN attempts, with statusChangeReason: pin_limit_exceeded on the card.updated webhook. Build a cardholder-facing unlock path so users are never stranded.
Manage PINs
Set and retrieve PINs through the PIN endpoints, and always encrypt the PIN with a client session key before you transmit it. Never send or store a PIN in plaintext. Enforce PIN quality before you submit:- Length between 4 and 12 digits.
- No simple sequences, such as
1234or0000. - No repeated digits, such as
1111.
Handle lost or stolen cards
For a confirmed lost or stolen card, set its status tocanceled. Cancellation is permanent. A canceled card cannot be reactivated.
To get the cardholder spending again, create a new card for the user.
Lock when in doubt, cancel when confirmed. Locking preserves recovery; canceling forces a reissue.
Apply spend controls
Prevent misuse before it happens rather than reacting to it:- Spending limits: Set an
amountandfrequency(per24HourPeriod,per7DayPeriod,per30DayPeriod,perYearPeriod,allTime, orperAuthorization) on a card to cap exposure. - Scoped cards: For one-off, agent, or purpose-specific spend, issue a scoped virtual card with a hard amount cap, an optional
expiresAt, and an optionalallowedMccsmerchant-category allow-list to limit blast radius. - Blocked MCCs and merchants: Rain declines high-risk merchant categories and a maintained merchant blocklist by default, and can block a specific merchant for your program on request.
Handle encrypted card details
Full card number and CVC are encrypted and require a session-ID handshake to retrieve. The last four digits and expiry are always available without it. Request full details only when strictly necessary, and never store the decrypted values.Stay in sync with webhooks
Subscribe to thecard.updated webhook and treat it as your source of truth for card status. It fires on every lock, unlock, and cancel, on PIN-limit auto-locks, on digital-wallet provisioning, and on changes Rain initiates internally (statusChangeReason: rain_initiated).
Reconcile your local card state against this webhook rather than assuming your API call is the only thing that can change a card. That way a Rain-side or processor-side action never leaves your records out of sync.
Whatβs next
Issue a Card
Issue and manage cards for your users.
Managing a Card's PIN
Set and retrieve PINs securely.
Scoped Cards
Purpose-specific cards with hard spend caps.
Viewing Encrypted Card Details
Retrieve full card details securely.