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

# Get Transaction by ID

> The "Get Transaction by ID" API allows to retrieve information for a specific transaction using its unique identifier. Use this endpoint to fetch details for a single transaction based on the provided transaction ID.



## OpenAPI

````yaml /api-reference/payments/openapi.json get /payments/transactions/{transactionId}
openapi: 3.0.0
info:
  title: Payments API
  description: Documentation for payments API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Payments
    description: Documentation for payments API
  - name: Integrations
    description: Documentation for payments API
  - name: Orders
    description: Documentation for payments API
  - name: Order fulfillments
    description: Documentation for payments API
  - name: Order Notes
    description: Documentation for payments API
  - name: Transactions
    description: Documentation for payments API
  - name: Subscriptions
    description: Documentation for payments API
  - name: Coupons
    description: Documentation for payments API
  - name: Custom Provider
    description: Documentation for payments API
paths:
  /payments/transactions/{transactionId}:
    get:
      tags:
        - Transactions
      summary: Get Transaction by ID
      description: >-
        The "Get Transaction by ID" API allows to retrieve information for a
        specific transaction using its unique identifier. Use this endpoint to
        fetch details for a single transaction based on the provided transaction
        ID.
      operationId: get-transaction-by-id
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
        - name: transactionId
          required: true
          in: path
          description: ID of the transaction that needs to be returned
          schema:
            example: 61dd0feac077f72010f78804
            type: string
        - name: locationId
          required: false
          in: query
          description: LocationId is the id of the sub-account.
          schema:
            example: 3SwdhCu3svxI8AKsPJt6
            type: string
        - name: altId
          required: true
          in: query
          description: 'AltId is the unique identifier e.g: location id.'
          schema:
            example: 3SwdhCu3svxI8AKsPJt6
            type: string
        - name: altType
          required: true
          in: query
          description: AltType is the type of identifier.
          schema:
            example: location
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTxnResponseSchema'
        '400':
          description: Transaction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - Location-Access:
            - payments/transactions.readonly
components:
  schemas:
    GetTxnResponseSchema:
      type: object
      properties:
        _id:
          type: string
          description: The unique identifier for the transaction.
          example: 61dd0feac077f72010f78804
        altType:
          type: string
          example: location
          description: AltType is the type of identifier.
        altId:
          type: string
          description: 'AltId is the unique identifier eg: location id.'
          example: 3SwdhCu3svxI8AKsPJt6
        contactId:
          type: string
          example: XPLSw2SVagl12LMDeTmQ
          description: Contact id corresponding to the transaction.
        contactSnapshot:
          type: object
          description: Contact details of the transaction.
          example: >-
            { last_name: "Mcclain", type: "lead", first_name_lower_case:
            "rogan", email: "anish+11@hoopai.com", last_name_lower_case:
            "mcclain", location_id: "o6241QsiRwUIJHyjuhos", company_name:
            "Jordan and Cox Trading"}
        currency:
          type: string
          example: USD
          description: Currency in which transaction was made.
        amount:
          type: number
          example: '100'
          description: Transaction value.
        status:
          type: object
          example: succeeded
          description: Transaction status.
        liveMode:
          type: boolean
          example: 'false'
          description: Transaction is in live / test mode.
        createdAt:
          format: date-time
          type: string
          description: The creation timestamp of the transaction.
          example: '2023-11-20T10:23:36.515Z'
        updatedAt:
          format: date-time
          type: string
          description: The last update timestamp of the transaction.
          example: '2024-01-23T09:57:04.846Z'
        entityType:
          type: string
          example: order
          description: 'Entity type of transaction (eg: order).'
        entityId:
          type: string
          example: 61dd0fe9c077f73e67f78803
          description: 'Entity id for the transaction. e.g: order id'
        entitySource:
          $ref: '#/components/schemas/OrderSource'
          example: >-
            { type: "funnel", id: "BDBMEghdIUaqMPEsK349", subType:
            "two_step_order_form", name: "new funnel" }
        chargeId:
          type: string
          example: in_1KGcXDCScnf89tZohCsmImwE
          description: Charge id for transaction.
        chargeSnapshot:
          type: object
          description: Charge snapshot of transaction.
          example: >-
            { id: "in_1KGcXDCScnf89tZohCsmImwE", object: "invoice",
            account_country: "US",  account_name:  "HoopAI-Testing" }
        invoiceId:
          type: string
          example: in_1KGcXDCScnf89tZohCsmImwE
          description: Invoice id for the transaction.
        subscriptionId:
          type: string
          example: sub_1KGcXDCScnf89tZoVkoEMCEL
          description: Subscription id for transaction.
        paymentProvider:
          type: object
          description: Payment provider details of the transaction.
          example: >-
            { type: "stripe", connectedAccount: { _id:
            "612ca676b484b241fef9d962", accountId: "acct_1Ihw53CScnf89tZo" } }
        ipAddress:
          type: string
          example: 107.178.194.224
          description: Ip address from where transaction was initiated.
        meta:
          type: object
          description: Meta details of the transaction.
          example: >-
            { stepId: "af7c731e-e36f-4152-bd1a-3f69a31d6d6d", pageId:
            "A8ltotc2jZxurJba4e3Y", pageUrl: "/v2/preview/A8ltotc2jZxurJba4e3Y"
            }
        markAsTest:
          type: boolean
          description: Is test transaction.
          example: 'false'
        isParent:
          type: boolean
          description: Is parent transaction.
          example: 'false'
        amountRefunded:
          type: number
          example: '10'
          description: Transaction amount refunded.
        receiptId:
          type: string
          example: 6492fbea489bc07892c6defb
          description: Receipt id for transaction.
        qboSynced:
          type: boolean
          description: Is transaction qbo synced.
          example: 'false'
        qboResponse:
          type: object
          description: Qbo details of the transaction.
          example: >-
            { domain: "QBO", sparse: false, Id: "180", SyncToken: "0", TotalAmt:
            25 }
        traceId:
          type: string
          description: Trace id of the transaction.
          example: d3b16a92-a8ed-4e6b-8467-844750f78ed5
        mergedFromContactId:
          type: string
          example: XPLSw2SVagl12LMDeTmQ
          description: ID of the contact that was merged from.
        createdBy:
          type: string
          example: user123
          description: User ID who created the transaction.
      required:
        - _id
        - altType
        - altId
        - createdAt
        - updatedAt
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    OrderSource:
      type: object
      properties:
        type:
          type: string
          enum:
            - funnel
            - website
            - invoice
            - calendar
            - text2Pay
            - document_contracts
            - membership
            - mobile_app
            - communities
            - point_of_sale
            - manual
            - form
            - survey
            - payment_link
            - external
        subType:
          type: string
          enum:
            - one_step_order_form
            - two_step_order_form
            - upsell
            - tap_to_pay
            - card_payment
            - store
            - contact_view
            - email_campaign
            - payments_dashboard
            - shopify
            - subscription_view
            - store_upsell
            - woocommerce
            - service
            - meeting
            - imported_csv
            - qr_code
            - saas_one_time
            - saas_subscription
        id:
          type: string
        name:
          type: string
        meta:
          type: object
      required:
        - type
        - id

````