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

# Get transaction details

> Returns the transaction details for a given transaction ID or transactions associated with an order



## OpenAPI

````yaml get /transaction
openapi: 3.0.1
info:
  title: Mavapay API
  description: API documentation for Mavapay
  license:
    name: MIT
  version: 1.0.0
  contact:
    name: Mavapay
    url: https://mavapay.co
    email: info@mavapay.co
servers:
  - url: https://staging.api.mavapay.co/api/v1
    description: Staging server
  - url: https://api.mavapay.co/api/v1
    description: Live server
security:
  - ApiKeyAuth: []
    bearerAuth: []
tags:
  - name: Price
    description: Price related endpoints
  - name: Payment Link
    description: Payment Link endpoints for creating and managing hosted payment pages
paths:
  /transaction:
    get:
      tags:
        - Transaction
      summary: Get transaction details
      description: >-
        Returns the transaction details for a given transaction ID or
        transactions associated with an order
      operationId: getTransaction
      parameters:
        - name: id
          in: query
          description: The transaction ID to get the details for
          schema:
            type: string
            format: string
          required: false
        - name: orderId
          in: query
          description: The order ID to get the transactions for
          schema:
            type: string
            format: string
          required: false
        - name: hash
          in: query
          description: The payment hash of the transaction to get the details for
          schema:
            type: string
            format: string
          required: false
      responses:
        '200':
          description: Transaction response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    format: string
                    example: ok
                  data:
                    $ref: '#/components/schemas/TransactionResponse'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    TransactionResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 10cda92f-db32-4f69-ae30-af32a0055caf
        ref:
          type: string
          example: 142a39e0bb85c45b06a9657f56156
        hash:
          type: string
          example: 89d7fd6571c8bdf4242091953553c26228dd5b7679729d20aaf2cc84f000d1bc
        amount:
          type: number
          example: 10000
        fees:
          type: number
          example: 0
        currency:
          type: string
          enum:
            - NGN
            - KES
            - BTC
            - ZAR
        type:
          type: string
          enum:
            - WITHDRAWAL
            - DEPOSIT
        status:
          type: string
          enum:
            - SUCCESS
            - PENDING
            - FAILED
        autopayout:
          type: boolean
          example: true
        createdAt:
          type: string
          format: date-time
          example: '2025-01-23T10:46:01.050Z'
        updatedAt:
          type: string
          format: date-time
          example: '2025-01-23T10:46:04.590Z'
        metadata:
          type: object
          properties:
            id:
              type: string
              format: uuid
              example: f2bf7bf8-9fe9-4afd-9ebb-cf3abae8cb19
            merchantId:
              type: string
              format: uuid
              example: f77986d6-75df-4979-85a9-8acedcfca392
            merchantName:
              type: string
              example: Ricki Allardice
            bankName:
              type: string
              example: CAPITEC BANK
            bankAccountNumber:
              type: string
              example: '1352906218'
            reference:
              type: string
              example: 2bNkqVDLER7n65O7RrcV
            customerInternalFee:
              type: number
              example: 0
            order:
              type: object
              properties:
                id:
                  type: string
                  example: 22723-5636
                settledQuoteId:
                  type: string
                  format: uuid
                  example: e3d3cb1c-3206-40bb-81a9-8dfd9d69a853
                amount:
                  type: number
                  example: 10000
                currency:
                  type: string
                  enum:
                    - NGN
                    - KES
                    - ZAR
                paymentMethod:
                  type: string
                  enum:
                    - LIGHTNING
                status:
                  type: string
                  enum:
                    - PAID
                    - PENDING
                    - EXPIRED
                    - FAILED
                quote:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    exchangeRate:
                      type: number
                      example: 1874805.7499999998
                    usdToTargetCurrencyRate:
                      type: number
                      example: 18.4977
                    paymentBtcDetail:
                      type: string
                    paymentMethod:
                      type: string
                      enum:
                        - LIGHTNING
                    totalAmount:
                      type: number
                      example: 6474
                    equivalentAmount:
                      type: number
                      example: 10000
                    expiry:
                      type: string
                      format: date-time
                    sourceCurrency:
                      type: string
                      enum:
                        - BTCSAT
                    targetCurrency:
                      type: string
                      enum:
                        - NGNKOBO
                        - KESCENT
                        - ZARCENT
                    paymentCurrency:
                      type: string
                      enum:
                        - NGNKOBO
                        - KESCENT
                        - ZARCENT
                    customerInternalFee:
                      type: number
                      example: 0
    Error:
      required:
        - error
        - message
      type: object
      properties:
        status:
          type: string
          format: string
          example: error
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    bearerAuth:
      type: http
      scheme: bearer

````