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

# Relay - Retrieve

> Retrieves a relay details.



## OpenAPI

````yaml get /relay/{relay_id}
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:
  /relay/{relay_id}:
    get:
      tags:
        - Relay
      summary: Relay - Retrieve
      description: Retrieves a relay details.
      operationId: Retrieve a Relay details
      parameters:
        - name: relay_id
          in: path
          description: The unique identifier for the Relay
          required: true
          schema:
            type: string
        - name: X-Profile-Id
          in: header
          description: Profile ID for authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Relay Retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelayResponse'
        '404':
          description: Relay details was not found
      security:
        - api_key: []
        - ephemeral_key: []
components:
  schemas:
    RelayResponse:
      type: object
      required:
        - id
        - status
        - connector_resource_id
        - connector_id
        - profile_id
        - type
      properties:
        id:
          type: string
          description: The unique identifier for the Relay
          example: relay_mbabizu24mvu3mela5njyhpit4
        status:
          $ref: '#/components/schemas/RelayStatus'
        connector_resource_id:
          type: string
          description: >-
            The identifier that is associated to a resource at the connector
            reference to which the relay request is being made
          example: pi_3MKEivSFNglxLpam0ZaL98q9
        error:
          allOf:
            - $ref: '#/components/schemas/RelayError'
          nullable: true
        connector_reference_id:
          type: string
          description: >-
            The identifier that is associated to a resource at the connector to
            which the relay request is being made
          example: re_3QY4TnEOqOywnAIx1Mm1p7GQ
          nullable: true
        connector_id:
          type: string
          description: >-
            Identifier of the connector ( merchant connector account ) which was
            chosen to make the payment
          example: mca_5apGeP94tMts6rg3U3kR
        profile_id:
          type: string
          description: The business profile that is associated with this relay request.
          example: pro_abcdefghijklmnopqrstuvwxyz
        type:
          $ref: '#/components/schemas/RelayType'
        data:
          allOf:
            - $ref: '#/components/schemas/RelayData'
          nullable: true
    RelayStatus:
      type: string
      enum:
        - created
        - pending
        - success
        - failure
    RelayError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: The error code
        message:
          type: string
          description: The error message
    RelayType:
      type: string
      enum:
        - refund
        - capture
        - incremental_authorization
        - void
    RelayData:
      oneOf:
        - type: object
          required:
            - refund
          properties:
            refund:
              $ref: '#/components/schemas/RelayRefundRequestData'
        - type: object
          required:
            - capture
          properties:
            capture:
              $ref: '#/components/schemas/RelayCaptureRequestData'
        - type: object
          required:
            - incremental_authorization
          properties:
            incremental_authorization:
              $ref: '#/components/schemas/RelayIncrementalAuthorizationRequestData'
        - type: object
          required:
            - void
          properties:
            void:
              $ref: '#/components/schemas/RelayVoidRequestData'
    RelayRefundRequestData:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          format: int64
          description: The amount that is being refunded
          example: 6540
        currency:
          $ref: '#/components/schemas/Currency'
        reason:
          type: string
          description: The reason for the refund
          example: Customer returned the product
          nullable: true
          maxLength: 255
    RelayCaptureRequestData:
      type: object
      required:
        - authorized_amount
        - amount_to_capture
        - currency
      properties:
        authorized_amount:
          type: integer
          format: int64
          description: The amount that is authorized for capture
          example: 6540
        amount_to_capture:
          type: integer
          format: int64
          description: The amount that is being captured
          example: 6540
        currency:
          $ref: '#/components/schemas/Currency'
        capture_method:
          allOf:
            - $ref: '#/components/schemas/CaptureMethod'
          nullable: true
    RelayIncrementalAuthorizationRequestData:
      type: object
      required:
        - total_amount
        - additional_amount
        - currency
      properties:
        total_amount:
          type: integer
          format: int64
          description: Original amount + additional amount of the transaction
          example: 6540
        additional_amount:
          type: integer
          format: int64
          description: The amount by which the payment needs is incremented
          example: 6540
        currency:
          $ref: '#/components/schemas/Currency'
    RelayVoidRequestData:
      type: object
      required:
        - amount
      properties:
        amount:
          type: integer
          format: int64
          description: The amount of the transaction that is being voided
          example: 6540
        currency:
          allOf:
            - $ref: '#/components/schemas/Currency'
          nullable: true
        cancellation_reason:
          type: string
          description: The cancellation reason for voiding the transaction
          example: Requested by merchant
          nullable: true
    Currency:
      type: string
      description: >-
        The three-letter ISO 4217 currency code (e.g., "USD", "EUR") for the
        payment amount. This field is mandatory for creating a payment.
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLF
        - CLP
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STD
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
        - ZWL
    CaptureMethod:
      type: string
      description: >-
        Specifies how the payment is captured.

        - `automatic`: Funds are captured immediately after successful
        authorization. This is the default behavior if the field is omitted.

        - `manual`: Funds are authorized but not captured. A separate request to
        the `/payments/{payment_id}/capture` endpoint is required to capture the
        funds.
      enum:
        - automatic
        - manual
        - manual_multiple
        - scheduled
        - sequential_automatic
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api-key
      description: >-
        Use the API key created under your merchant account from the HyperSwitch
        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.
    ephemeral_key:
      type: apiKey
      in: header
      name: api-key
      description: >-
        Ephemeral keys provide temporary access to singular data, such as access
        to a single customer object for a short period of time.

````