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

# Refunds - List

> Lists all the refunds associated with the merchant, or for a specific payment if payment_id is provided



## OpenAPI

````yaml post /refunds/list
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:
  /refunds/list:
    post:
      tags:
        - Refunds
      summary: Refunds - List
      description: >-
        Lists all the refunds associated with the merchant, or for a specific
        payment if payment_id is provided
      operationId: List all Refunds
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundListRequest'
        required: true
      responses:
        '200':
          description: List of refunds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundListResponse'
      security:
        - api_key: []
components:
  schemas:
    RefundListRequest:
      allOf:
        - allOf:
            - $ref: '#/components/schemas/TimeRange'
          nullable: true
        - type: object
          properties:
            payment_id:
              type: string
              description: The identifier for the payment
              nullable: true
            refund_id:
              type: string
              description: The identifier for the refund
              nullable: true
            profile_id:
              type: string
              description: The identifier for business profile
              nullable: true
            limit:
              type: integer
              format: int64
              description: Limit on the number of objects to return
              nullable: true
            offset:
              type: integer
              format: int64
              description: The starting point within a list of objects
              nullable: true
            amount_filter:
              allOf:
                - $ref: '#/components/schemas/AmountFilter'
              nullable: true
            connector:
              type: array
              items:
                type: string
              description: The list of connectors to filter refunds list
              nullable: true
            merchant_connector_id:
              type: array
              items:
                type: string
              description: >-
                The list of merchant connector ids to filter the refunds list
                for selected label
              nullable: true
            currency:
              type: array
              items:
                $ref: '#/components/schemas/Currency'
              description: The list of currencies to filter refunds list
              nullable: true
            refund_status:
              type: array
              items:
                $ref: '#/components/schemas/RefundStatus'
              description: The list of refund statuses to filter refunds list
              nullable: true
    RefundListResponse:
      type: object
      required:
        - count
        - total_count
        - data
      properties:
        count:
          type: integer
          description: The number of refunds included in the list
          minimum: 0
        total_count:
          type: integer
          format: int64
          description: The total number of refunds in the list
        data:
          type: array
          items:
            $ref: '#/components/schemas/RefundResponse'
          description: The List of refund response object
    TimeRange:
      type: object
      description: >-
        A type representing a range of time for filtering, including a mandatory
        start time and an optional end time.
      required:
        - start_time
      properties:
        start_time:
          type: string
          format: date-time
          description: >-
            The start time to filter payments list or to get list of filters. To
            get list of filters start time is needed to be passed
        end_time:
          type: string
          format: date-time
          description: >-
            The end time to filter payments list or to get list of filters. If
            not passed the default time is now
          nullable: true
    AmountFilter:
      type: object
      properties:
        start_amount:
          type: integer
          format: int64
          description: >-
            The start amount to filter list of transactions which are greater
            than or equal to the start amount
          nullable: true
        end_amount:
          type: integer
          format: int64
          description: >-
            The end amount to filter list of transactions which are less than or
            equal to the end amount
          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
    RefundStatus:
      type: string
      description: The status for refunds
      enum:
        - succeeded
        - failed
        - pending
        - review
    RefundResponse:
      type: object
      required:
        - refund_id
        - payment_id
        - amount
        - currency
        - status
        - connector
      properties:
        refund_id:
          type: string
          description: Unique Identifier for the refund
        payment_id:
          type: string
          description: The payment id against which refund is initiated
        amount:
          type: integer
          format: int64
          description: >-
            The refund amount, which should be less than or equal to the total
            payment amount. Amount for the payment in lowest denomination of the
            currency. (i.e) in cents for USD denomination, in paisa for INR
            denomination etc
          example: 6540
          minimum: 100
        currency:
          type: string
          description: The three-letter ISO currency code
        status:
          $ref: '#/components/schemas/RefundStatus'
        reason:
          type: string
          description: >-
            An arbitrary string attached to the object. Often useful for
            displaying to users and your customer support executive
          nullable: true
        metadata:
          type: object
          description: >-
            You can specify up to 50 keys, with key names up to 40 characters
            long and values up to 500 characters long. Metadata is useful for
            storing additional, structured information on an object
          nullable: true
        error_message:
          type: string
          description: The error message
          nullable: true
        error_code:
          type: string
          description: The code for the error
          nullable: true
        unified_code:
          type: string
          description: >-
            Error code unified across the connectors is received here if there
            was an error while calling connector
          nullable: true
        unified_message:
          type: string
          description: >-
            Error message unified across the connectors is received here if
            there was an error while calling connector
          nullable: true
        created_at:
          type: string
          format: date-time
          description: The timestamp at which refund is created
          nullable: true
        updated_at:
          type: string
          format: date-time
          description: The timestamp at which refund is updated
          nullable: true
        connector:
          type: string
          description: The connector used for the refund and the corresponding payment
          example: stripe
        profile_id:
          type: string
          description: The id of business profile for this refund
          nullable: true
        merchant_connector_id:
          type: string
          description: >-
            The merchant_connector_id of the processor through which this
            payment went through
          nullable: true
        split_refunds:
          allOf:
            - $ref: '#/components/schemas/SplitRefund'
          nullable: true
        issuer_error_code:
          type: string
          description: Error code received from the issuer in case of failed refunds
          nullable: true
        issuer_error_message:
          type: string
          description: Error message received from the issuer in case of failed refunds
          nullable: true
        raw_connector_response:
          type: string
          description: Contains whole connector response
          nullable: true
        connector_refund_id:
          type: string
          description: A unique identifier for a payment provided by the connector
          nullable: true
    SplitRefund:
      oneOf:
        - type: object
          required:
            - stripe_split_refund
          properties:
            stripe_split_refund:
              $ref: '#/components/schemas/StripeSplitRefundRequest'
        - type: object
          required:
            - adyen_split_refund
          properties:
            adyen_split_refund:
              $ref: '#/components/schemas/AdyenSplitData'
        - type: object
          required:
            - xendit_split_refund
          properties:
            xendit_split_refund:
              $ref: '#/components/schemas/XenditSplitSubMerchantData'
      description: >-
        Charge specific fields for controlling the revert of funds from either
        platform or connected account. Check sub-fields for more details.
    StripeSplitRefundRequest:
      type: object
      description: >-
        Charge specific fields for controlling the revert of funds from either
        platform or connected account for Stripe. Check sub-fields for more
        details.
      properties:
        revert_platform_fee:
          type: boolean
          description: >-
            Toggle for reverting the application fee that was collected for the
            payment.

            If set to false, the funds are pulled from the destination account.
          nullable: true
        revert_transfer:
          type: boolean
          description: >-
            Toggle for reverting the transfer that was made during the charge.

            If set to false, the funds are pulled from the main platform's
            account.
          nullable: true
      additionalProperties: false
    AdyenSplitData:
      type: object
      description: >-
        Fee information for Split Payments to be charged on the payment being
        collected for Adyen
      required:
        - split_items
      properties:
        store:
          type: string
          description: The store identifier
          nullable: true
        split_items:
          type: array
          items:
            $ref: '#/components/schemas/AdyenSplitItem'
          description: Data for the split items
      additionalProperties: false
    XenditSplitSubMerchantData:
      type: object
      description: >-
        Fee information to be charged on the payment being collected for
        sub-merchant via xendit
      required:
        - for_user_id
      properties:
        for_user_id:
          type: string
          description: The sub-account user-id that you want to make this transaction for.
      additionalProperties: false
    AdyenSplitItem:
      type: object
      description: Data for the split items
      required:
        - amount
        - split_type
        - reference
      properties:
        amount:
          type: integer
          format: int64
          description: The amount of the split item
          example: 6540
        split_type:
          $ref: '#/components/schemas/AdyenSplitType'
        account:
          type: string
          description: >-
            The unique identifier of the account to which the split amount is
            allocated.
          nullable: true
        reference:
          type: string
          description: Unique Identifier for the split item
        description:
          type: string
          description: >-
            Description for the part of the payment that will be allocated to
            the specified account.
          nullable: true
      additionalProperties: false
    AdyenSplitType:
      type: string
      enum:
        - BalanceAccount
        - AcquiringFees
        - PaymentFee
        - AdyenFees
        - AdyenCommission
        - AdyenMarkup
        - Interchange
        - SchemeFee
        - Commission
        - TopUp
        - Vat
  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.

````