Cards

Get a PIN-entry URL

Changed on

Get a temporary URL for a secure PIN-entry iframe. The cardholder chooses a four-digit PIN inside the iframe, without the plaintext PIN crossing your servers or Grid's. Grid supports online PINs only.

Configure cardConfigs.pinTargetOrigin through PATCH /config before requesting a URL. It is the canonical HTTPS origin of the page that hosts the iframe. The iframe is restricted to that origin; this endpoint takes no request body or origin parameter.

Each call creates a fresh, temporary PIN-entry session. Request a URL immediately before displaying the form. Fetching the URL does not set or change the PIN. Set your iframe's src to the returned iframeUrl without modifying it. Follow the Card PIN guide to submit the form and confirm the result. Never store, cache, or log the URL or token. The session expires at expiresAt and permits one successful PIN submission. Responses include Cache-Control: no-store.

Use the iframe's submission result to confirm completion, and GET /cards/{id} to read pinStatus. OK alone cannot confirm a change to an already configured PIN.

If you operate your own PIN-entry UI, use POST /cards/{id}/set-pin with a client-encrypted payload instead.

Requires permission to manage cards. Every successful URL request is audit-logged with the requesting actor.

get/cards/{id}/pin-entry-url

Request

  • Base URL
    https://api.lightspark.com/grid/2025-10-13
  • URL
    https://api.lightspark.com/grid/2025-10-13/cards/{id}/pin-entry-url
  • Auth
    HTTP basic

Query parameters

stylesstring

JSON-encoded CSS declarations for the PIN input, with string values and optional nested declarations for supported pseudo-classes: :first-child, :last-child, :enabled, :read-write, :read-only, :placeholder-shown, :valid, :invalid, :disabled, :hover, :focus-within, :focus, :focus-visible, and :active. Use CSS property names such as font-size. URL-encode the JSON as one query parameter; do not base64-encode it. Grid includes the styles in the returned iframeUrl. Omit this parameter to use the default appearance. Each request applies only to its returned URL. Styles that load external resources, including external fonts and images, are not supported. The JSON string is limited to 3072 characters, and its compact UTF-8 representation must fit within 4096 characters after base64 encoding. Invalid JSON, an invalid structure, or oversized styles return 400 INVALID_INPUT.

Response

A fresh PIN-entry URL and its expiration.

iframeUrlstring uri required

Ready-to-use URL for the secure PIN-entry iframe. Set this as your iframe's src without modifying it. The cardholder enters their PIN inside the iframe, so the plaintext PIN never reaches your servers or Grid's. Use the message flow in the Card PIN guide to submit and confirm the result.

The URL contains a temporary credential. Never store, cache, or log it. It expires at expiresAt and permits one successful PIN submission.

sessionTokenstring required

Temporary credential authorizing one successful PIN submission. It is already included in iframeUrl; use that URL to load the form. Never store, cache, or log the token. Use the iframe's submission result to confirm a change; status OK alone cannot prove that an existing PIN was changed. Read GET /cards/{id} for its pinStatus.

expiresAtstring date-time required

When the URL stops working. Request a new URL rather than reusing an expired URL or token.

environment'SANDBOX' | 'PRODUCTION' required

Session environment. The iframeUrl already selects the matching environment.

Example response

{
  "iframeUrl": "https://embed.example.com/pin?session=eyJhbGciOiJIUzI1NiJ9...",
  "sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresAt": "2026-05-08T14:16:00Z",
  "environment": "SANDBOX"
}

Changes

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • warning

      added the new CORRIDOR_UNDER_MAINTENANCE enum value to the response property for the response status