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

# Get Transactions by User ID

> Retrieve all transactions associated with a specific user ID.

## Endpoint

`GET /transaction/:userId`

Retrieve all transactions associated with a specific user ID.

* Returns an array of transaction objects related to the specified user.


## OpenAPI

````yaml /en/api-reference/openapi.json GET /transaction/{userId}
openapi: 3.1.0
info:
  title: Fapshi Payment API
  description: >-
    API for generating payment links, direct payments, transaction monitoring,
    payouts, and more.
  version: 1.0.0
servers:
  - url: https://sandbox.fapshi.com
security:
  - apiAuth: []
    apiKey: []
paths:
  /transaction/{userId}:
    get:
      summary: Get Transactions by User ID
      description: Retrieve all transactions associated with a specific user ID.
      parameters:
        - name: userId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9\-_]{1,100}$
          description: User ID to retrieve transactions for.
      responses:
        '200':
          description: List of transactions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Transaction'
        4XX:
          description: Invalid user ID or error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Transaction:
      type: object
      properties:
        transId:
          type: string
          description: Transaction ID of the payment.
        status:
          type: string
          enum:
            - CREATED
            - PENDING
            - SUCCESSFUL
            - FAILED
            - EXPIRED
          description: Transaction status
        medium:
          type: string
          enum:
            - mobile money
            - orange money
            - fapshi
          description: Payment method
        serviceName:
          type: string
          description: Name of the service in use
        transType:
          type: string
          enum:
            - Collection
            - Payout
          description: Type of transaction
        amount:
          type: integer
          description: Transaction amount
        revenue:
          type: integer
          description: Amount received when Fapshi fees have been deducted
        payerName:
          type: string
          description: Client name
        email:
          type: string
          format: email
          description: Client email
        redirectUrl:
          type: string
          format: uri
          description: URL to redirect after payment
        externalId:
          type: string
          description: The transaction ID on your application
        userId:
          type: string
          description: ID of the client on your application
        webhook:
          type: string
          format: uri
          description: The webhook you defined for your service
        reason:
          type: string
          description: Typically appears when a payout via fapshi fails
        financialTransId:
          type: string
          description: Transaction ID with the payment operator
        dateInitiated:
          type: string
          format: date
          description: Date when the payment was initiated
        dateConfirmed:
          type: string
          format: date
          description: Date when the payment was made
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message.
  securitySchemes:
    apiAuth:
      type: apiKey
      in: header
      name: apiuser
    apiKey:
      type: apiKey
      in: header
      name: apikey

````