> ## 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.

# Payments - External 3DS Authentication

> External 3DS Authentication is performed and returns the AuthenticationResponse



## OpenAPI

````yaml post /payments/{payment_id}/3ds/authentication
openapi: 3.0.3
info:
  title: Hyperswitch - API Documentation
  description: >

    ## Get started


    Hyperswitch 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 Hyperswitch API.


    ### Environment


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


    | Environment   |  Base URL                          |

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

    | Sandbox       | <https://sandbox.hyperswitch.io>   |

    | Production    | <https://api.hyperswitch.io>       |


    ## Authentication


    When you sign up on our [dashboard](https://app.hyperswitch.io) 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 Hyperswitch 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: Hyperswitch Support
    url: https://hyperswitch.io
    email: support.global@juspay.io
  license:
    name: Apache-2.0
  version: 0.1.0
servers:
  - url: https://sandbox.hyperswitch.io
    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: Authentication
    description: Create and manage authentication
  - name: Subscriptions
    description: Subscription management and billing endpoints
  - name: Card Issuer
    description: Create and manage card issuers
paths:
  /payments/{payment_id}/3ds/authentication:
    post:
      tags:
        - Payments
      summary: Payments - External 3DS Authentication
      description: >-
        External 3DS Authentication is performed and returns the
        AuthenticationResponse
      operationId: Initiate external authentication for a Payment
      parameters:
        - name: payment_id
          in: path
          description: The identifier for payment
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentsExternalAuthenticationRequest'
        required: true
      responses:
        '200':
          description: Authentication created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentsExternalAuthenticationResponse'
        '400':
          description: Missing mandatory fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericErrorResponseOpenApi'
      security:
        - publishable_key: []
components:
  schemas:
    PaymentsExternalAuthenticationRequest:
      type: object
      required:
        - device_channel
        - threeds_method_comp_ind
      properties:
        client_secret:
          type: string
          description: Client Secret
          nullable: true
        sdk_information:
          allOf:
            - $ref: '#/components/schemas/SdkInformation'
          nullable: true
        device_channel:
          $ref: '#/components/schemas/DeviceChannel'
        threeds_method_comp_ind:
          $ref: '#/components/schemas/ThreeDsCompletionIndicator'
    PaymentsExternalAuthenticationResponse:
      type: object
      required:
        - trans_status
        - three_ds_requestor_url
      properties:
        trans_status:
          $ref: '#/components/schemas/TransactionStatus'
        acs_url:
          type: string
          description: Access Server URL to be used for challenge submission
          nullable: true
        challenge_request:
          type: string
          description: Challenge request which should be sent to acs_url
          nullable: true
        challenge_request_key:
          type: string
          description: >-
            Challenge request key which should be set as form field name for
            creq
          nullable: true
        acs_reference_number:
          type: string
          description: >-
            Unique identifier assigned by the EMVCo(Europay, Mastercard and
            Visa)
          nullable: true
        acs_trans_id:
          type: string
          description: >-
            Unique identifier assigned by the ACS to identify a single
            transaction
          nullable: true
        three_dsserver_trans_id:
          type: string
          description: >-
            Unique identifier assigned by the 3DS Server to identify a single
            transaction
          nullable: true
        acs_signed_content:
          type: string
          description: >-
            Contains the JWS object created by the ACS for the
            ARes(Authentication Response) message
          nullable: true
        three_ds_requestor_url:
          type: string
          description: Three DS Requestor URL
        three_ds_requestor_app_url:
          type: string
          description: >-
            Merchant app declaring their URL within the CReq message so that the
            Authentication app can call the Merchant app after OOB
            authentication has occurred
          nullable: true
        error_message:
          type: string
          description: Error message if any
          nullable: true
    GenericErrorResponseOpenApi:
      type: object
      required:
        - error_type
        - message
        - code
      properties:
        error_type:
          type: string
          example: invalid_request
        message:
          type: string
          example: 'Missing required param: {param}'
        code:
          type: string
          example: IR_04
    SdkInformation:
      type: object
      description: SDK Information if request is from SDK
      required:
        - sdk_app_id
        - sdk_enc_data
        - sdk_ephem_pub_key
        - sdk_trans_id
        - sdk_reference_number
        - sdk_max_timeout
      properties:
        sdk_app_id:
          type: string
          description: >-
            Unique ID created on installations of the 3DS Requestor App on a
            Consumer Device
        sdk_enc_data:
          type: string
          description: >-
            JWE Object containing data encrypted by the SDK for the DS to
            decrypt
        sdk_ephem_pub_key:
          type: object
          description: >-
            Public key component of the ephemeral key pair generated by the 3DS
            SDK
          additionalProperties:
            type: string
        sdk_trans_id:
          type: string
          description: Unique transaction identifier assigned by the 3DS SDK
        sdk_reference_number:
          type: string
          description: >-
            Identifies the vendor and version for the 3DS SDK that is integrated
            in a 3DS Requestor App
        sdk_max_timeout:
          type: integer
          format: int32
          description: Indicates maximum amount of time in minutes
          minimum: 0
        sdk_type:
          allOf:
            - $ref: '#/components/schemas/SdkType'
          nullable: true
        device_details:
          allOf:
            - $ref: '#/components/schemas/DeviceDetails'
          nullable: true
    DeviceChannel:
      type: string
      description: Device Channel indicating whether request is coming from App or Browser
      enum:
        - APP
        - BRW
    ThreeDsCompletionIndicator:
      type: string
      description: Indicates if 3DS method data was successfully completed or not
      enum:
        - 'Y'
        - 'N'
        - U
    TransactionStatus:
      type: string
      description: Indicates the transaction status
      enum:
        - 'Y'
        - 'N'
        - U
        - A
        - R
        - C
        - D
        - I
    SdkType:
      type: string
      description: Enum representing the type of 3DS SDK.
      enum:
        - '01'
        - '02'
        - '03'
        - '04'
        - '05'
    DeviceDetails:
      type: object
      description: Device details for collecting Device information
      properties:
        device_type:
          type: string
          description: Device type
          nullable: true
        device_brand:
          type: string
          description: Device brand
          nullable: true
        device_os:
          type: string
          description: Device OS
          nullable: true
        device_display:
          type: string
          description: Device display
          nullable: true
  securitySchemes:
    publishable_key:
      type: apiKey
      in: header
      name: api-key
      description: >-
        Publishable keys are a type of keys that can be public and have limited
        scope of usage.

````