Skip to main content
Card PINs are set — and changed — through Yativo’s hosted secure page, powered by the card network’s Partner Secure Elements (PSE) service. The cardholder types their PIN directly inside a sandboxed iframe. Your backend never receives or processes the PIN value.
First-time PIN setup and PIN changes use different response shapes.
  • First-time setup (pin_set: false): any call to view-token returns 422 PIN_NOT_SET. The response body includes data.pin_setup_url — open that URL for PIN setup. You do not need to pass enabled_views: ["pin"]; the API auto-selects the PIN-setup view.
  • PIN change (pin_set: true): call view-token with enabled_views: ["pin"]. You get 200 with data.secure_view_url — open that for PIN change.
pin_set is informational, not a hard gate. Yativo tracks pin_set from the physical.card.pin.changed webhook — the card network does not expose this value via a direct lookup. The flag may lag behind reality if the webhook was missed or the cardholder set their PIN through another path. Use it as a UI hint (e.g. show a “Set PIN” prompt) rather than blocking access server-side.

How it works

First-time PIN setup (pin_set: false)

1

Call view-token (any enabled_views)

Call POST /v1/yativo-card/{yativoCardId}/cards/{cardId}/view-token. You do not need to pass enabled_views: ["pin"] — the API detects that the PIN is not set and overrides the view automatically.
2

You receive 422 PIN_NOT_SET with pin_setup_url

The API returns HTTP 422 with error_code: "PIN_NOT_SET". The response body includes data.pin_setup_url — a short-lived URL pre-configured for PIN setup.
3

Open pin_setup_url in an iframe or WebView

Pass data.pin_setup_url to your frontend. The cardholder enters and confirms their 4-digit PIN directly in the hosted page. The PIN never leaves the iframe.
4

Card network fires a webhook

Once saved, the card network sends a physical.card.pin.changed event. Yativo updates pin_set: true on the card record automatically.

PIN change (pin_set: true)

1

Call view-token with enabled_views: ["pin"]

Call POST /v1/yativo-card/{yativoCardId}/cards/{cardId}/view-token with enabled_views: ["pin"].
2

You receive 200 with secure_view_url

The API returns HTTP 200 with data.secure_view_url — open that in an iframe or WebView for the PIN change form.

Step 1 — Request a PIN view token

yativoCardId
string
required
The Yativo Card account ID (yativo_card_id).
cardId
string
required
The card ID to set the PIN for.
enabled_views
array
required
Pass ["pin"] to open the PIN-setting form. Pass ["data", "pin"] to show both card details and PIN (only works after PIN is already set).
theme
object
Optional brand customization — accent_color, logo_url, background_color, etc. See Secure Card Display for all options.

Step 2 — Embed the hosted PIN page

Pass secure_view_url as the src of an iframe. No SDK or client-side JavaScript required.
Recommended dimensions for PIN-only view: 420 × 520px. For combined card details + PIN view: 420 × 740px.

Theme customization

Pass a theme object in the view-token request to brand the hosted PIN page. All theme fields are optional.
Theme fields: accent_color, background_color, panel_color, text_color, muted_color, border_radius, font_family, logo_url. See Secure Card Display for the full reference.

Checking pin_set status

After the PIN is set, the card network’s physical.card.pin.changed webhook fires and Yativo updates pin_set: true on the card record. You can read this via:
  • Card issuersGET /v1/card-issuer/customers/{customerId}data.cards[n].pin_set
  • End usersGET /v1/yativo-card/my-accountdata.account.cards[n].pin_set
  • View-token responsedata.pin_set is returned on every POST .../view-token call
The next_action field on the issuer customer record will read:
"Card is active — customer must set card PIN before in-store (PSE) payments will work"
until pin_set becomes true.
pin_set reflects the last known state from the webhook. The card network does not expose this flag via a direct API lookup, so if the webhook was missed or the PIN was set through another path, the value may be stale. Treat it as a UI hint — not an authoritative server-side gate.

Notes