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

# Query Refund Payment

> **The payment gateway requests a query refund payment status**



## OpenAPI

````yaml /openapi.json get /api/services/app/PaymentGateway/QueryRefund
openapi: 3.0.1
info:
  title: CommercePay API
  version: v1
  description: >
    ---

    **Credentials Accounts**


    Every account is provided with separate keys for testing and for running
    live transactions. Once the merchant application has been approved,
    developers can begin the process of integrating the CommercePay API. The
    following details will be provided to get started with the integration. 


    <a href="https://docs.commercepay.asia/docs/api/d19b0f3289ae0-get-started"
    target="_blank">Get Started</a>
  contact: {}
servers:
  - description: Staging
    url: https://staging-payments.commerce.asia
  - url: https://payments.commerce.asia
    description: Production
security: []
paths:
  /api/services/app/PaymentGateway/QueryRefund:
    get:
      tags:
        - PaymentGateway
      summary: Query Refund Payment
      description: '**The payment gateway requests a query refund payment status**'
      operationId: ApiServicesAppPaymentgatewayQueryrefundGet
      parameters:
        - name: TransactionNumber
          in: query
          schema:
            type: string
            maxLength: 24
          description: Unique CAP Transaction Number
          required: true
        - name: Timestamp
          in: query
          schema:
            type: integer
            format: int64
            example: 1621851652617
          description: new Date().getTime()
          required: true
        - $ref: '#/components/parameters/AbpTenantId'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/CapSignature'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                x-examples:
                  Example 1:
                    tenantId: 0
                    transactionNumber: string
                    paymentSessionNumber: string
                    refundTransactionNumber: string
                    referenceCode: string
                    amount: 0
                    currencyCode: string
                    refundStatus: 0
                    refundPaymentList:
                      - transactionNumber: string
                        amount: 0
                        currencyCode: string
                        refundReason: string
                        refundStatus: 0
                    responseMessage: string
                properties:
                  tenantId:
                    type: integer
                  transactionNumber:
                    type: string
                  paymentSessionNumber:
                    type: string
                  refundTransactionNumber:
                    type: string
                  referenceCode:
                    type: string
                  amount:
                    type: integer
                  currencyCode:
                    type: string
                  refundStatus:
                    type: integer
                  refundPaymentList:
                    type: array
                    items:
                      type: object
                      properties:
                        transactionNumber:
                          type: string
                        amount:
                          type: integer
                        currencyCode:
                          type: string
                        refundReason:
                          type: string
                        refundStatus:
                          type: integer
                  responseMessage:
                    type: string
              examples:
                Example 1:
                  value:
                    tenantId: 0
                    transactionNumber: string
                    paymentSessionNumber: string
                    refundTransactionNumber: string
                    referenceCode: string
                    amount: 0
                    currencyCode: string
                    refundStatus: 0
                    refundPaymentList:
                      - transactionNumber: string
                        amount: 0
                        currencyCode: string
                        refundReason: string
                        refundStatus: 0
                    responseMessage: string
            text/json:
              schema:
                $ref: '#/components/schemas/RequestRefundOutputDto'
            text/plain:
              schema:
                $ref: '#/components/schemas/RequestRefundOutputDto'
components:
  parameters:
    AbpTenantId:
      schema:
        type: string
      in: header
      name: Abp-TenantId
      required: true
      description: Your unique Merchant ID assigned by CommercePay.
    Authorization:
      schema:
        type: string
      in: header
      name: Authorization
      required: true
      description: Your API credentials used for authentication (typically a Bearer token).
    CapSignature:
      schema:
        type: string
      in: header
      name: cap-signature
      required: true
      description: >-
        A unique security hash used to verify the integrity of the request body.
        See [Generate Signature](/docs/generate-signature) for how to generate
        this.
  schemas:
    RequestRefundOutputDto:
      type: object
      additionalProperties: false
      x-internal: false
      properties:
        tenantId:
          type: integer
          format: int64
        transactionNumber:
          type: string
          description: Unique CAP transaction number
          maxLength: 24
          nullable: true
        refundTransactionNumber:
          type: string
          nullable: true
        referenceCode:
          type: string
          description: Merchant Reference Code
          nullable: true
        amount:
          type: number
          format: double
          description: "Please take note: The Amount parameter only accepts integer units. For example, 1000 is equivalent to 10.00 for the backend.\r\n\r\nInvalid Format: 1,000.00"
          example: 100
        currencyCode:
          type: string
          description: Currency code with a 3-letter ISO 4217 standard code
          example: MYR
          maxLength: 3
          nullable: true
        refundStatus:
          $ref: '#/components/schemas/PaymentStatus'
        responseMessage:
          type: string
          nullable: true
        paymentSessionNumber:
          type: string
          description: Unique CAP Session Number
          maxLength: 24
          nullable: true
        refundPaymentList:
          $ref: '#/components/schemas/RefundPaymentListDto'
      x-examples:
        Example 1:
          tenantId: 0
          transactionNumber: string
          paymentSessionNumber: string
          refundTransactionNumber: string
          referenceCode: string
          amount: 0
          currencyCode: string
          refundStatus: 0
          refundPaymentList:
            - transactionNumber: string
              amount: 0
              currencyCode: string
              refundReason: string
              refundStatus: 0
          responseMessage: string
    PaymentStatus:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
      type: integer
      format: int32
      x-enumNames:
        - Pending
        - Success
        - Failed
        - Cancelled
        - TransactionLimitExceeded
        - MinTransactionAmountNotMeet
        - InsufficientFunds
        - InvalidTransaction
      description: 'Payment Status: Refer on Appendix 3.1 Payment Status Code Table'
    RefundPaymentListDto:
      title: RefundPaymentListDto
      type: object
      properties:
        transactionNumber:
          type: string
          description: Unique CAP Transaction Number
          maxLength: 24
          nullable: true
        amount:
          type: integer
          format: int64
          description: Refund Amount.
          example: 100
        currencyCode:
          type: string
          description: Currency code with a 3-letter ISO 4217 standard code
          example: MYR
          maxLength: 3
          nullable: true
        refundReason:
          type: string
          description: A description for refund.
          nullable: true
        refundStatus:
          $ref: '#/components/schemas/PaymentStatus'

````