Skip to main content
GET /v1/cards and GET /v1/cards/{id} never return full PAN or CVV. They only include safe fields such as lastFour, status, and expiry label. To show the full number, expiry, and CVV you use one of the two reveal methods below. Pick based on whether sensitive data may touch your servers.

Which method should I use?

If you only need to display card details in a web or mobile WebView UI, use Method 1. Use Method 2 only when your backend must process PAN/CVV and you have PCI DSS Level 1 attestation.
API Reference endpoints for both methods live under Cards — reveal PAN/CVV.
Your servers receive a short-lived revealToken only. The browser loads Apocor Widget.js; PAN/CVV render inside PCI iframes and never pass through your backend.

Steps

  1. Authenticate → Bearer token (Authentication).
  2. Call GET /v1/cards/{id}/secure-details.
  3. Load the Apocor Widget SDK (sandbox vs live must match the token environment).
  4. Call widget.bootstrap({ clientAccessToken: revealToken, ... }).
  5. Ask Apocor to allowlist your page origin (the domain of your app, not api.apocor.ai).

Get a reveal token

cURL

Widget SDK URLs

Optional CDN (same paths): https://static.apocor.ai/sdk/card/... Reference (API Reference → Cards — reveal PAN/CVV): GET …/secure-details · Widget.js sandbox · Widget.js live.

Frontend example

A revealToken expires in about 5 minutes and is single-purpose. Never log it. Match Sandbox SDK with TEST tokens and Live SDK with LIVE tokens.

Method 2 — Server-side encrypted reveal (PCI DSS Level 1)

Apocor never returns plaintext PAN/CVV over HTTP. You send an RSA public key; we return a hybrid encrypted envelope. Decrypt only inside a PCI-scoped environment (HSM/KMS for the private key). Requires: pciRevealEnabled = true on your organization (ask Apocor after PCI attestation). Algorithm: RSA_OAEP_SHA256_AES_256_GCM

Steps

  1. Generate an RSA-2048+ key pair; keep the private key in HSM/KMS.
  2. POST /v1/cards/{id}/payment-details with encryption.public_key_pem.
  3. Unwrap encryptedKey with RSA-OAEP (SHA-256).
  4. Decrypt ciphertext with AES-256-GCM using iv + authTag.
Reference: POST …/payment-details.

Request

cURL

Response envelope

Decrypted payload

Node.js decrypt example

Call payment-details only from a PCI-scoped service. Never log PAN/CVV or the private key. Never send the private key to Apocor. If you are not PCI Level 1, use Method 1 instead (403 if pciRevealEnabled is false).