> ## Documentation Index
> Fetch the complete documentation index at: https://gnosispay-feat-v2-auth-module.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Card PIN

> Sets the card PIN. The caller encrypts the new PIN (in PIN Block 2 format)
with an AES session key, then RSA-OAEP encrypts the session key with the PCI
public key. The EIP-712 signature over a prior `change-pin` challenge is
passed via the `x-eip712-signature` / `x-eip712-nonce` headers. Proxied to
partner-api over HTTP.



## OpenAPI

````yaml https://core.prod.gnosispay.com/user-api/openapi.json post /pci/cards/{cardId}/pin
openapi: 3.1.0
info:
  title: User Service
  version: 0.0.0
servers: []
security: []
tags:
  - name: Health
  - name: Auth
  - name: User
  - name: Cards
  - name: Phone
  - name: PCI
  - name: Terms
  - name: Source of Funds
paths:
  /pci/cards/{cardId}/pin:
    post:
      tags:
        - PCI
      summary: Set Card PIN
      description: >-
        Sets the card PIN. The caller encrypts the new PIN (in PIN Block 2
        format)

        with an AES session key, then RSA-OAEP encrypts the session key with the
        PCI

        public key. The EIP-712 signature over a prior `change-pin` challenge is

        passed via the `x-eip712-signature` / `x-eip712-nonce` headers. Proxied
        to

        partner-api over HTTP.
      operationId: PCI_setCardPin
      parameters:
        - name: cardId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
        - name: x-eip712-signature
          in: header
          required: true
          description: EIP-712 signature over the `change-pin` challenge.
          schema:
            type: string
        - name: x-eip712-nonce
          in: header
          required: true
          description: Nonce of the challenge that was signed.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PciSetEncryptedPinRequest'
      responses:
        '204':
          description: >-
            There is no content to send for this request, but the headers may be
            useful. 
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    uuid:
      type: string
      format: uuid
    PciSetEncryptedPinRequest:
      type: object
      required:
        - encryptedKey
        - encryptedPin
        - iv
      properties:
        encryptedKey:
          type: string
          description: Base64-encoded RSA-OAEP encrypted AES-256 session key.
        encryptedPin:
          type: string
          description: AES-GCM encrypted PIN in PIN Block 2 format, Base64-encoded.
        iv:
          type: string
          description: Base64-encoded AES-GCM initialization vector.
    Unauthorized:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    NotFound:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````