> ## Documentation Index
> Fetch the complete documentation index at: https://api-reference.hyperswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Data from Locker

> Retrieve sensitive data from the locker



## OpenAPI

````yaml rust_locker_open_api_spec post /data/retrieve
openapi: 3.0.2
info:
  title: Tartarus - OpenAPI 3.0
  description: >-
    This is the OpenAPI 3.0 specification for the card locker.

    This is used by the [hyperswitch](https://github.com/juspay/hyperswitch) for
    storing card information securely.
  version: '1.0'
servers: []
security: []
tags:
  - name: Key Custodian
    description: API used to initialize the locker after deployment.
  - name: Data
    description: CRUD APIs for working with data to be stored in the locker
  - name: Cards
    description: >-
      CRUD APIs for working with cards data to be stored in the locker
      (deprecated)
paths:
  /data/retrieve:
    post:
      tags:
        - Cards
        - Data
      summary: Retrieve Data from Locker
      description: Retrieve sensitive data from the locker
      parameters:
        - in: header
          name: x-tenant-id
          schema:
            type: string
      requestBody:
        description: The request body might be JWE + JWS encrypted when using middleware
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/RetrieveDataReq'
                - $ref: '#/components/schemas/JWEReq'
        required: true
      responses:
        '200':
          description: Retrieve Data Response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/RetrieveDataRes'
                  - $ref: '#/components/schemas/JWERes'
components:
  schemas:
    RetrieveDataReq:
      title: RetrieveDataReq
      type: object
      properties:
        merchant_id:
          type: string
          example: m0100
        merchant_customer_id:
          type: string
          example: HsCustomer1
        card_reference:
          type: string
          example: 3ffdf1e5-7f38-4f26-936f-c66a6f4296fa
    JWEReq:
      title: JWEReq
      type: object
      properties:
        header:
          type: string
        iv:
          type: string
        encrypted_payload:
          type: string
        tag:
          type: string
        encrypted_key:
          type: string
    RetrieveDataRes:
      title: RetrieveDataRes
      type: object
      description: >-
        Response received with the sensitive data, associated to the card
        reference
      properties:
        status:
          type: string
          enum:
            - Ok
        payload:
          $ref: '#/components/schemas/RetrieveRes'
    JWERes:
      title: JWERes
      type: object
      description: JWE encrypted response equivalent
      properties:
        header:
          type: string
        iv:
          type: string
        encrypted_payload:
          type: string
        tag:
          type: string
        encrypted_key:
          type: string
    RetrieveRes:
      title: RetrieveRes
      oneOf:
        - type: object
          properties:
            card:
              $ref: '#/components/schemas/Card'
        - type: object
          properties:
            enc_card_data:
              type: string
    Card:
      title: Card
      type: object
      required:
        - card_number
      properties:
        card_number:
          type: string
        name_on_card:
          type: string
        card_exp_month:
          type: string
        card_exp_year:
          type: string
        card_brand:
          type: string
        card_isin:
          type: string
        nick_name:
          type: string

````