> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gnosispay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an encrypted card PIN

> Retrieves the encrypted PIN block for a fully provisioned card.

Generate a new AES-256 session key, wrap it with one of the RSA-OAEP keys
returned by `GET /pci/public-key`, and send the encrypted key with its
`key_id`. The PIN block is returned encrypted with AES-GCM.

This route is available only to approved PCI integrations. Never log,
cache, persist, or display a plaintext PIN.



## OpenAPI

````yaml https://core.sandbox.gnosispay.in/partner-api/openapi.json get /v1/pci/cards/{card_id}/pin
openapi: 3.1.0
info:
  title: Gnosis Pay Partner API
  version: 1.0.0
  description: >-
    Server-to-server API for onboarding users, creating accounts and cards,
    moving

    funds, and managing the card lifecycle. Call this API only from a trusted

    backend. Every request requires a partner access token, and every resource
    is

    scoped to the authenticated partner.
servers:
  - url: https://core.prod.gnosispay.com/partner-api
    description: Production
    variables: {}
  - url: https://core.sandbox.gnosispay.in/core
    description: Sandbox
    variables: {}
security:
  - BearerAuth: []
tags:
  - name: Accounts
  - name: Cards
  - name: Card transactions
  - name: KYC
  - name: Deposits
  - name: Withdrawals
  - name: PCI
  - name: 3DS
  - name: Webhooks
paths:
  /v1/pci/cards/{card_id}/pin:
    get:
      tags:
        - PCI
      summary: Get an encrypted card PIN
      description: >-
        Retrieves the encrypted PIN block for a fully provisioned card.


        Generate a new AES-256 session key, wrap it with one of the RSA-OAEP
        keys

        returned by `GET /pci/public-key`, and send the encrypted key with its

        `key_id`. The PIN block is returned encrypted with AES-GCM.


        This route is available only to approved PCI integrations. Never log,

        cache, persist, or display a plaintext PIN.
      operationId: pci.get_encrypted_pin.v1
      parameters:
        - name: card_id
          in: path
          required: true
          description: The card ID.
          schema:
            $ref: '#/components/schemas/uuid'
        - name: encrypted_key
          in: query
          required: true
          description: >-
            Base64-encoded RSA-OAEP encrypted AES-256 session key. URL-encode
            this query value.
          schema:
            type: string
          explode: false
        - name: key_id
          in: query
          required: true
          description: Id of the `encryption_keys` entry that wrapped `encrypted_key`.
          schema:
            type: string
          explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EncryptedPinData'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    uuid:
      type: string
      format: uuid
    EncryptedPinData:
      type: object
      required:
        - encrypted_pin
        - iv
      properties:
        encrypted_pin:
          type: string
          description: AES-GCM encrypted PIN in PIN Block 2 format (Base64-encoded).
        iv:
          type: string
          description: Base64-encoded initialization vector used for AES-GCM encryption.
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code.
        message:
          type: string
          description: Generic human-readable text for the status code. Do not parse it.
        reason:
          type: string
          description: >-
            Stable machine-readable code identifying the specific cause, present
            only

            for errors that expose one (e.g. `CREATE_CARD_LIMIT_EXCEEDED`).
            Branch on

            this rather than on `message`.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.