GET /cards/{cardId}/secrets when your app needs to display the full card number or CVC. GET /cards/{cardId} only returns card metadata such as status, last4, expiry, type, and PIN state.
The secrets endpoint never returns plaintext PAN or CVC. It uses the same session setup as Managing a card’s PIN:
- Fetch your business RSA public key from
GET /business/pin-crypto-key. - Generate a 32-character hex sessionKey locally.
- Save
sessionKeyuntil you have decrypted the response (same key as for PIN flows). - Encrypt the session key with the public key and send it as the
SessionIdheader. - Decrypt
encryptedPanandencryptedCvclocally with the saved raw session key.
Request
GET /cards/CARD_ID/secrets
Response
Decrypt PAN and CVC
Use the samesessionKey you generated and saved for this request. Unlike PIN retrieval, PAN and CVC are decrypted as plain values and do not use PIN block formatting.
decrypt-card-secret.js