Skip to main content
Cardholders must set their PIN before card details or PIN reveal can be viewed.If pin_set is false and you request ["data"] or ["pin-view"], the API returns a 422 PIN_NOT_SET error with a ready-to-use pin_setup_url. Open that URL so the cardholder can set their PIN, then retry the view-token request.To set the PIN, call with enabled_views: ["pin-set"] — this always returns 200 OK and secure_view_url, regardless of pin_set status. See Setting a Card PIN.
Card details (PAN, CVV, expiry) and the card PIN each use separate view tokens. You must request the correct enabled_views for each use case. Never reuse a token between sessions.

How it works

Sensitive card data is never returned in plain API responses. Instead, Yativo hosts a secure card view page and provides you with a short-lived URL to embed in your application:
  1. Your backend calls POST /yativo-card/{yativoCardId}/cards/{cardId}/view-token
  2. If you request ["data"] or ["pin-view"] and pin_set is false, the API returns PIN_NOT_SET and a pin_setup_url — direct the cardholder there to set their PIN first. If you request ["pin-set"], you always receive a secure_view_url regardless of pin_set status.
  3. Yativo returns a secure_view_url — a hosted, tokenized page
  4. Your frontend embeds that URL in an <iframe>
  5. The hosted page renders the sensitive data directly — your application never touches the raw values
View tokens expire quickly. Always request a fresh token immediately before rendering and never cache or log secure_view_url.

Step 1 — Request a view token

Call this from your backend. The token is scoped to the views you request.
string
required
The Yativo Card account ID (yativo_card_id) returned during onboarding.
string
required
The card ID from card creation.
array
Which views to enable on the hosted page. Accepted values:The legacy value "pin" is accepted as an alias for "pin-set".Combine freely, e.g. ["data", "pin-view", "pin-set"]. The page renders one tab per value. If pin_set is false and "pin-set" is not in the request, the API returns 422 PIN_NOT_SET. Including "pin-set" in any request bypasses that gate — the token is issued so the cardholder can set their PIN.
string
Optional extra PIN or unlock code the user must enter before the card details are revealed. Adds an additional layer of protection for high-security flows.
object
Optional per-request theme tokens for the hosted page wrapper. For full CSS control — including card data text colors and fonts — set persistent customization via PUT /api/card-issuer/pse-customization (see Custom CSS below). All theme fields are optional.
string
Primary brand color (hex). Default: #813AE3
string
Page background color (hex).
string
Card panel background color (hex). When this value (or background_color) is a dark color, the page automatically applies color-scheme: dark to the card data frame, rendering card digits in white.
string
Primary text color (hex).
string
Secondary/muted text color (hex).
number
Border radius in pixels.
string
CSS font-family string (e.g. "Inter, sans-serif").
string
URL of your logo to display on the hosted page.

Step 2 — Embed the iframe

Pass the secure_view_url directly as the src of an iframe. No SDK or additional JavaScript is required.
The hosted page is fully responsive. Recommended dimensions: 420 × 740px for card details, 420 × 520px for PIN-only views.

Step 3 — Backend proxy (required)

Your frontend must never call the Yativo API directly with your credentials. Always proxy the token request through your backend:

View options reference

Pass an array with any combination:
  • ["data"] — card details only
  • ["pin-set"] — PIN setup only (e.g. initial onboarding)
  • ["data", "pin-view"] — card details + reveal PIN
  • ["data", "pin-set"] — card details + change PIN
  • ["data", "pin-view", "pin-set"] — all three tabs
pin_set reflects the last known state from card activity webhooks. If pin_set is false and you request ["data"] or ["pin-view"], the API returns a PIN_NOT_SET error with a pin_setup_url — direct the cardholder there to set their PIN, then retry once the webhook confirms.Requesting ["pin-set"] always returns a secure_view_url (HTTP 200) regardless of pin_set — use this to present the PIN setup screen without checking pin_set first.

Access code flow

When you pass access_code in the token request, requires_access_code: true is returned. The hosted page will prompt the user to enter that code before revealing any card details. Use this for:
  • Confirming user intent before showing the full card number
  • Adding a secondary verification step in high-value contexts

Customization

The secure view page supports two levels of customization: per-request theme tokens and persistent CSS overrides.

Theme tokens (per request)

Pass a theme object in the view-token request to apply brand colors, fonts, and a logo. These take effect immediately on every URL you generate. All fields are optional. Unset fields fall back to the defaults above.

Custom CSS (persistent, issuer-level)

For fine-grained control over colors, typography, and spacing, you can supply raw CSS that is stored against your issuer account and applied to every secure view URL you generate. The page has two layers — your CSS affects them differently: Layer 1 — Page shell (injected directly into the page <style> block) The Yativo-rendered wrapper: background, header, tabs, status bar, frame container. All standard CSS applies normally. Layer 2 — Card data area (forwarded to the secure card SDK) The card number, expiry, and CVV are rendered inside a cross-origin secure iframe. Yativo extracts a specific set of selectors from your stylesheet and forwards them to the secure card SDK, which applies them to the card data elements. Background colors, borders, label fonts, and copy-button styles apply reliably. Card digit text color (color on .pse-card-value) is controlled by the card network’s own stylesheet — it does not update through this API alone. To enable custom digit text colors (e.g. white digits on a dark background), contact Yativo to activate program-level card data theming for your account.
For security, the following patterns are stripped before storage: @import, external url() references, expression(), and behavior:. Inline data URIs for images (data:image/png;base64,...) are allowed.

Supported selectors

Page shell Card data area

Manage your customization

Example: brand colours + Inter font

Dark theme

Passing a dark color in theme.panel_color or theme.background_color is all that is needed to enable dark mode. The page wrapper measures the luminance of those colors and automatically sets color-scheme: dark on the card data frame — the card SDK responds by rendering digits in white. No extra flag or request parameter is required.
If card digits still appear dark after passing dark colors, the card program may not have dark-mode digit support configured at the card network level. Contact Yativo to verify your program’s configuration.

Known limitations

Copy button icon color cannot be changed. The clipboard SVG inside .pse-copy-button has a hardcoded fill. Setting color on .pse-copy-button affects the button border and background only — not the icon itself.
View PIN and Change PIN are always light-mode. These tabs are rendered entirely by the card network’s secure iframe and cannot be themed via custom CSS.

Testing

Use the test script in the backend repo to verify the full flow against your running server:
The script will print the secure_view_url and a ready-to-paste iframe snippet.

Virtual Cards

Create and manage virtual cards.

API Reference — View Token

Full parameter reference for the view-token endpoint.