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

# Fetch Refund History

> The merchant uses this endpoint to fetch refund transaction history for card transactions. The data output can be filtered using a date range and/or status..



## OpenAPI

````yaml /openapi.json get /refund-chargeback/refund/merchant/api/refund_history?from={from}&to={to}&currency={currency}&page={page}&size={size}&refund_status={refund_status}&refund_reference={refund_reference}
openapi: 3.0.1
info:
  title: Payaza Documentation
  version: 2.0.0
  description: >-
    API reference for processing payments using Card, Bank Transfer, USSD, and
    QR Code methods.
servers:
  - url: https://api.payaza.africa/live
security:
  - ApiKeyAuth: []
  - TenantID: []
  - ProductID: []
tags:
  - name: Transfers
    description: >-
      Transfers are transactions made from your Payaza account to beneficiaries.
      Merchants can instantly transfer funds from their available balance. For
      every transfer, you need to specify the amount and the beneficiary’s
      details. You become eligible to make transfers after you have been
      verified. (you sign up, finish account activation and KYC verification).
  - name: Payaza Account
    description: >-
      This is our internal account that can be used to make payouts to other
      bank accounts, in single or in bulk. The Payaza account can also be used
      to receive settlements. It can also be used to track the transfer status
      of your transactions and check your balance instantly
  - name: Sub Accounts
    description: >-
      This enables you to establish Sub Payaza accounts for your customers. Each
      sub-account comes with an assigned static virtual account, facilitating
      direct funding for individual accounts. Furthermore, the Main Payaza
      account can directly initiate funding for each sub-account. These
      sub-accounts serve the purpose of managing unique account positions or
      balances and facilitating disbursements from these positions to specified
      beneficiaries.
  - name: EUR Accounts
    description: >-
      This endpoints enable you to create EUR subaccounts which can be used to
      make transfers as required .
  - name: Apple Pay and Google Pay
    description: >-
      Apple Pay and Google Pay give your customers a fast, familiar, and secure
      way to complete payments. Our APIs provide a gateway to provide these
      services to your users for a smooth payment experience.
  - name: Virtual Accounts
    description: >-
      Virtual Accounts are bank accounts that are created for a specific purpose
      and last for specified durations. Virtual accounts are issued by Payaza’s
      partner banks. Our virtual account APIs can be used to create virtual
      accounts and perform other tasks relevant to virtual accounts. Virtual
      accounts are created to foster easy payment collections for your business
      and platform. 

      Static/Reserved Account: This virtual account is created by the merchant
      and remains valid indefinitely. It can be used multiple times and does not
      expire. 

      Dynamic Account: This virtual account is generated for a specific
      transaction or purpose. Please note that dynamic virtual account remains
      valid for a temporary period of time or until a payment of the specified
      amount is received. Upon expiry, a merchant can generate another one for a
      different purpose.
  - name: Card Collection
    description: >-
      The Card Collection APIs can be used to make card transactions, refund
      transactions that have been performed, check the status of a transaction
      and so much more.
  - name: Card Tokenisation
    description: >-
      The Card Tokenisation APIs are used to create card tokens, charge cards
      using tokens, retrieve all tokens created by a merchant account and
      deleting any card token as desired.
  - name: Refunds And Chargebacks
    description: >-
      The Refunds and Chargeback APIs are used to initiate refunds, view your
      refund and chargeback history and so much more.
  - name: Branches
    description: >-
      The Refunds and Chargeback APIs are used to initiate refunds, view your
      refund and chargeback history and so much more.
  - name: Auth-Capture-Void
    description: >-
      The Auth-Capture-Void APIs provide a two-phase payment process where
      transactions are first authorized, then captured or voided. This allows
      merchants to hold funds and complete the transaction in the future.
  - name: Momo and ZAR Collections
    description: APIs for MoMo, ZAR and XOF collections.
  - name: Check Transaction Status(Merchant Reference)
    description: >-
      This endpoint is used to check the transaction status of a transaction
      using the Merchant Reference..
paths:
  /refund-chargeback/refund/merchant/api/refund_history?from={from}&to={to}&currency={currency}&page={page}&size={size}&refund_status={refund_status}&refund_reference={refund_reference}:
    get:
      tags:
        - Refunds And Chargebacks
      summary: Fetch Refund History
      description: >-
        The merchant uses this endpoint to fetch refund transaction history for
        card transactions. The data output can be filtered using a date range
        and/or status..
      parameters:
        - name: from
          in: path
          required: false
          schema:
            type: string
          description: The start date range to filter data in YYYY-MM-DD format
        - name: to
          in: path
          required: false
          schema:
            type: string
          description: The end date range to filter data in YYYY-MM-DD format
        - name: currency
          in: path
          required: false
          schema:
            type: string
          description: The <b>ISO 4217 alpha-3</b> currency code. e.g. NGN, USD
        - name: page
          in: path
          required: true
          schema:
            type: integer
          description: The page number
        - name: size
          in: path
          required: true
          schema:
            type: integer
          description: The total number of transactions per page.
        - name: refund_status
          in: path
          required: true
          schema:
            type: string
          description: “Success” or “Initialized”
        - name: refund_reference
          in: path
          required: false
          schema:
            type: string
          description: 'The refund reference '
      responses:
        '200':
          description: Fetch Refund History Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/fetchRefundHistoryResponse'
              examples:
                success:
                  summary: Fetch Refund History
                  value:
                    status: success
                    message: Refund History Success.
                    data:
                      content:
                        - id: 28824
                          refund_amount: 0.05
                          transaction_amount: 0.05
                          transaction_fee: 0
                          transaction_reference: RF20230228-PS56JY26JYJ0USD
                          mpgs_refund_type: REFUNDED
                          mpgs_refund_status: SUCCESS
                          refund_order_id: QA-PL-1KBPSCJCRD947
                          refund_transaction_id: RF20230228-LDUUSD
                          start_at: '2024-08-06 12:44:48.652847'
                          end_at: '2024-08-06 12:44:50.408276'
                          transaction:
                            id: 20149381
                            description: Test for Headers
                            ended_at: '2024-08-05 12:03:13.777000'
                            fee_amount: 0
                            rrn: '000812310925'
                            collection_channel: Card
                            started_at: '2024-08-05 12:03:13.777000'
                            status_reason: Payment Approved
                            transaction_amount: 0.05
                            transaction_reference: QA-PL-1KBPSCJCRD947
                            transaction_status: Completed
                            customer:
                              id: 29425269
                              email_address: johndoe@gmail.com
                              first_name: John
                              last_name: Doe
                              mobile_number: '08123456789'
                            currency:
                              id: 2
                              name: US Dollar
                              code: USD
                              html_code: '&#36;'
                              iso_code: USA
                              unicode: $
                              active: true
                          status_reason: Refund processed successfully
                          merchant_name: Integration
                      total: 1
                      last: false
                      first: true
                      pageable:
                        page: 1
                        size: 10
        '400':
          description: Invalid transaction reference format
      security:
        - ApiKeyAuth: []
components:
  schemas:
    fetchRefundHistoryResponse:
      title: Fetch Refund History Response
      type: object
      properties:
        status:
          type: string
          description: API status (e.g., success).
          example: success
        message:
          type: string
          description: Status message.
          example: Refund History Success.
        data:
          type: object
          properties:
            content:
              type: array
              description: List of refund records.
              items:
                type: object
                properties:
                  id:
                    type: integer
                    description: Unique refund ID.
                    example: 28824
                  refund_amount:
                    type: number
                    format: double
                    description: Amount refunded.
                    example: 0.05
                  transaction_amount:
                    type: number
                    format: double
                    description: Original transaction amount.
                    example: 0.05
                  transaction_fee:
                    type: number
                    format: double
                    description: Fee charged for the transaction.
                    example: 0
                  transaction_reference:
                    type: string
                    description: Reference for the refund transaction.
                    example: RF20230228-PS56JY26JYJ0USD
                  mpgs_refund_type:
                    type: string
                    description: Type of refund processed.
                    example: REFUNDED
                  mpgs_refund_status:
                    type: string
                    description: Status of the refund.
                    example: SUCCESS
                  refund_order_id:
                    type: string
                    description: Order ID associated with the refund.
                    example: QA-PL-1KBPSCJCRD947
                  refund_transaction_id:
                    type: string
                    description: ID of the refund transaction.
                    example: RF20230228-LDUUSD
                  start_at:
                    type: string
                    format: date-time
                    description: Timestamp when refund started.
                    example: '2024-08-06 12:44:48.652847'
                  end_at:
                    type: string
                    format: date-time
                    description: Timestamp when refund ended.
                    example: '2024-08-06 12:44:50.408276'
                  transaction:
                    type: object
                    description: Details of the original transaction.
                    properties:
                      id:
                        type: integer
                      description:
                        type: string
                      transaction_status:
                        type: string
                      transaction_reference:
                        type: string
                      rrn:
                        type: string
                      customer:
                        type: object
                        properties:
                          id:
                            type: integer
                          email_address:
                            type: string
                          first_name:
                            type: string
                          last_name:
                            type: string
                      currency:
                        type: object
                        properties:
                          code:
                            type: string
                          name:
                            type: string
                          unicode:
                            type: string
                  status_reason:
                    type: string
                    description: Reason for the refund status.
                    example: Refund processed successfully
                  merchant_name:
                    type: string
                    description: Name of the merchant.
                    example: Integration
            total:
              type: integer
              description: Total number of records found.
              example: 1
            pageable:
              type: object
              description: Pagination details.
              properties:
                page:
                  type: integer
                size:
                  type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Payaza {{Public API Key in Base 64}}
    TenantID:
      type: apiKey
      in: header
      name: X-TenantID
      description: live or test
    ProductID:
      type: apiKey
      in: header
      name: X-ProductID
      description: 'default value is ‟app” '

````