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

# Auth

> Authorise a terminal to perform different action.



## OpenAPI

````yaml post /terminals/auth
openapi: 3.0.3
info:
  title: Paycode - API Documentation
  description: >

    ## Get started


    Paycode provides a collection of APIs that enable you to process and manage
    payments.

    Our APIs accept and return JSON in the HTTP body, and return standard HTTP
    response codes.


    You can consume the APIs directly using your favorite HTTP/REST library.


    We have a testing environment referred to "sandbox", which you can setup to
    test API calls without

    affecting production data.

    Currently, our sandbox environment is live while our production environment
    is under development

    and will be available soon.

    You can sign up on our Dashboard to get API keys to access Paycode API.


    ### Environment


    Use the following base URLs when making requests to the APIs:


    | Environment   |  Base URL                          |

    |---------------|------------------------------------|

    | Sandbox       | <https://api.staging.paycodefintech.net>   |

    | Production    | <https://api.production.paycodefintech.net>       |


    ## Authentication


    When you sign up on our [dashboard](https://app.staging.paycodefintech.net)
    and create a merchant

    account, you are given a secret key (also referred as api-key) and a
    publishable key.

    You may authenticate all API requests with Paycode server by providing the
    appropriate key in

    the request Authorization header.


    | Key             | 
    Description                                                                                 
    |

    |-----------------|-----------------------------------------------------------------------------------------------|

    | api-key         | Private key. Used to authenticate all API requests from
    your merchant server                  |

    | publishable key | Unique identifier for your account. Used to authenticate
    API requests from your app's client  |


    Never share your secret api keys. Keep them guarded and secure.
  contact:
    name: Paycode Support
    url: https://paycodefintech.net
    email: Paycode@juspay.in
  license:
    name: Apache-2.0
  version: 0.1.0
servers:
  - url: https://api.staging.paycodefintech.net
    description: Sandbox Environment
security: []
tags:
  - name: Merchant Account
    description: Create and manage merchant accounts
  - name: Profile
    description: Create and manage profiles
  - name: Merchant Connector Account
    description: Create and manage merchant connector accounts
  - name: Payments
    description: Create and manage one-time payments, recurring payments and mandates
  - name: Refunds
    description: Create and manage refunds for successful payments
  - name: Mandates
    description: Manage mandates
  - name: Customers
    description: Create and manage customers
  - name: Payment Methods
    description: Create and manage payment methods of customers
  - name: Disputes
    description: Manage disputes
  - name: API Key
    description: Create and manage API Keys
  - name: Payouts
    description: Create and manage payouts
  - name: payment link
    description: Create payment link
  - name: Routing
    description: Create and manage routing configurations
  - name: Event
    description: Manage events
  - name: POS
    description: Point of Sale operations including balance enquiry
paths:
  /terminals/auth:
    post:
      tags:
        - Terminal
      summary: Auth
      description: Authorise a terminal to perform different action.
      operationId: Auth Handshake
      requestBody:
        description: Request body for terminal auth handshake
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerminalAuthRequest'
            examples:
              Sample Request:
                value:
                  current_versions:
                    acquirer_param_version: v3.2.0
                    aid_version: v1.3.0
                    biometric_key_version: v1.2.0
                    capk_version: v2.6.0
                    cvm_version: v1.0.9
                    emv_key_version: v2.7.0
                    file_key_version: v3.4.0
                    firmware_version: v2.4.2
                    fx_rates_version: v1.3.0
                    hot_cards_version: v1.1.0
                    pure_tags_version: v3.2.0
                    tac_version: v1.1.2
                    tms_param_version: v4.0.5
                  device_health:
                    batterylevel: 85
                    signalstrength: strong
                    tamperdetected: false
                    temperature: 36.5
                  geolocation:
                    latitude: -1.2921
                    longitude: 36.8219
                  terminal_id: term_tPYmyt3FEfKl83JiHpb2
        required: true
      responses:
        '200':
          description: Terminal authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalAuthResponse'
              examples:
                Sample Response:
                  value:
                    expires_in_seconds: 3600
                    network_token: TI5vXQgbZZPHXP7TOCo0
                    sync_required: true
                    update_hints:
                      AID_version: v2.1.6
                      CAPK_version: v3.0.1
        '404':
          description: Terminal not found
      security:
        - api_key: []
components:
  schemas:
    TerminalAuthRequest:
      type: object
      description: Request payload for POS login handshake
      required:
        - terminal_id
        - current_versions
      properties:
        terminal_id:
          type: string
          description: Terminal ID (required)
        geolocation:
          allOf:
            - $ref: '#/components/schemas/GeoLocation'
          nullable: true
        device_health:
          allOf:
            - $ref: '#/components/schemas/DeviceHealth'
          nullable: true
        current_versions:
          $ref: '#/components/schemas/TerminalParameterVersions'
        network_token:
          type: string
          description: token for session if available
          nullable: true
    TerminalAuthResponse:
      type: object
      description: Response for parameter download request
      required:
        - network_token
        - expires_in_seconds
        - sync_required
      properties:
        network_token:
          type: string
          description: Network token for authentication
        expires_in_seconds:
          type: integer
          format: int32
          description: Token expiration time in seconds
          minimum: 0
        update_hints:
          type: object
          description: Update hints for newer versions available
          additionalProperties:
            type: string
          nullable: true
        sync_required:
          type: boolean
          description: Whether synchronization is required
    GeoLocation:
      type: object
      required:
        - latitude
        - longitude
      properties:
        latitude:
          type: number
          format: double
        longitude:
          type: number
          format: double
      additionalProperties: false
    DeviceHealth:
      type: object
      required:
        - temperature
      properties:
        temperature:
          type: number
          format: double
        batterylevel:
          type: integer
          format: int32
          nullable: true
        tamperdetected:
          type: boolean
          nullable: true
        signalstrength:
          type: string
          nullable: true
      additionalProperties: false
    TerminalParameterVersions:
      type: object
      description: Terminal parameter versions (MOSOLO specification)
      properties:
        firmware_version:
          type: string
          description: Firmware version
          nullable: true
        acquirer_param_version:
          type: string
          description: Acquirer parameter version
          nullable: true
        tms_param_version:
          type: string
          description: TMS parameter version
          nullable: true
        aid_version:
          type: string
          description: EMV AID profiles version
          nullable: true
        capk_version:
          type: string
          description: EMV CAPK version
          nullable: true
        tac_version:
          type: string
          description: Terminal Action Codes version
          nullable: true
        cvm_version:
          type: string
          description: CVM configuration version
          nullable: true
        pure_tags_version:
          type: string
          description: PURE tag profiles version
          nullable: true
        hot_cards_version:
          type: string
          description: Hot cards list version
          nullable: true
        fx_rates_version:
          type: string
          description: Currency exchange rates version
          nullable: true
        file_key_version:
          type: string
          description: File encryption key version
          nullable: true
        emv_key_version:
          type: string
          description: EMV key version
          nullable: true
        biometric_key_version:
          type: string
          description: Biometric key version
          nullable: true
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api-key
      description: >-
        Use the API key created under your merchant account from the Paycode
        dashboard. API key is used to authenticate API requests from your
        merchant server only. Don't expose this key on a website or embed it in
        a mobile application.

````