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

# Get payment history

> Returns a page of receipts sent or received by the user. pending=true matches Processing and Confirmed receipts; pending=false excludes both. Do not combine pending with status. For a continuation request, set next_or_previous and pass the receipt ID at the current page edge as cursor: the last receipt for the next page or the first receipt for the previous page.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/payment/onchain/receipts/{user_id}/{sort_by_latest}/{from_start}
openapi: 3.0.3
info:
  title: UniFi Public API
  version: 1.0.0
  description: >-
    Production API operations organized around the UniFi payment lifecycle.
    Internal administration, worker, dashboard, support, scheduling, and Falcon
    orchestration routes are intentionally excluded.
servers:
  - url: https://api.payunifi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Check API process availability and dependency health.
  - name: Deposit
    description: Resolve deposit addresses for a UniFi wallet.
  - name: Wallet
    description: Read stablecoin balances across wallets and chains.
  - name: Preflight
    description: >-
      Check balances, allowances, and estimated fees before submitting a
      payment.
  - name: Pay
    description: Create managed-wallet, merchant, and self-custodial payments.
  - name: History
    description: Track payment sessions, receipts, finality, and history.
paths:
  /v1/payment/onchain/receipts/{user_id}/{sort_by_latest}/{from_start}:
    get:
      tags:
        - History
      summary: Get payment history
      description: >-
        Returns a page of receipts sent or received by the user. pending=true
        matches Processing and Confirmed receipts; pending=false excludes both.
        Do not combine pending with status. For a continuation request, set
        next_or_previous and pass the receipt ID at the current page edge as
        cursor: the last receipt for the next page or the first receipt for the
        previous page.
      operationId: getPaymentReceipts
      parameters:
        - $ref: '#/components/parameters/UserId'
        - $ref: '#/components/parameters/SortByLatest'
        - $ref: '#/components/parameters/FromStart'
        - name: chain
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/Chain'
          description: Filter by chain.
        - name: coin
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/Stablecoin'
          description: Filter by stablecoin.
        - name: status
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/ReceiptStatus'
          description: Filter by receipt state.
        - name: pending
          in: query
          required: false
          schema:
            type: boolean
          description: >-
            true matches Processing and Confirmed; false excludes both. Cannot
            be combined with status.
        - name: direction
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/PaymentDirection'
          description: Filter by payments sent or received by the user.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
          description: Maximum number of receipts to return.
        - name: next_or_previous
          in: query
          required: false
          schema:
            type: boolean
          description: true requests the next page; false requests the previous page.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: >-
            Receipt ID at the current page edge. Required for stateless
            continuation requests; use the last receipt ID for next and the
            first receipt ID for previous.
      responses:
        '200':
          description: A page of payment receipts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoryResponse'
              example:
                status: 200 OK
                data:
                  has_prev: false
                  receipts: []
                  has_next: false
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    UserId:
      name: user_id
      in: path
      required: true
      schema:
        type: string
      description: >-
        UniFi user identifier, such as a verified email address or wallet
        address.
    SortByLatest:
      name: sort_by_latest
      in: path
      required: true
      schema:
        type: boolean
      description: Sort newest receipts first when true.
    FromStart:
      name: from_start
      in: path
      required: true
      schema:
        type: boolean
      description: Start a fresh history traversal when true.
  schemas:
    Chain:
      type: string
      enum:
        - Ethereum
        - Polygon
        - Sepolia
      description: >-
        Production-supported mainnets and public testnets exposed by the public
        reference.
    Stablecoin:
      type: string
      enum:
        - USDT
        - USDC
        - DAI
    ReceiptStatus:
      type: string
      enum:
        - Processing
        - Failed
        - Confirmed
        - Finalized
        - Reorged
    PaymentDirection:
      type: string
      enum:
        - Sent
        - Received
    HistoryResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
        data:
          $ref: '#/components/schemas/History'
    History:
      type: object
      required:
        - has_prev
        - receipts
        - has_next
      properties:
        has_prev:
          type: boolean
        receipts:
          type: array
          items:
            $ref: '#/components/schemas/Receipt'
        has_next:
          type: boolean
    Receipt:
      type: object
      required:
        - id
        - entity
        - user_id
        - is_fee_incl
        - chain
        - coin
        - to_address
        - amount
        - memo
        - est_fee
        - act_fee
        - tx_hash
        - block_num
        - status
        - start_ts_us
        - end_ts_us
      properties:
        id:
          type: string
        bulk_pay_id:
          type: string
          description: >-
            Identifier shared by receipts from the same bulk-payment submission.
            Omitted for legacy and single-payment receipts.
        entity:
          type: string
        user_id:
          type: string
        is_fee_incl:
          type: boolean
        chain:
          $ref: '#/components/schemas/Chain'
        coin:
          $ref: '#/components/schemas/Stablecoin'
        to_address:
          type: string
        amount:
          type: string
        memo:
          $ref: '#/components/schemas/Memo'
        fee_coin:
          $ref: '#/components/schemas/Stablecoin'
          description: >-
            Coin in which est_fee and act_fee are denominated. When omitted for
            legacy or single-payment receipts, coin is the fee coin.
        est_fee:
          type: string
        act_fee:
          type: string
        tx_hash:
          type: string
        block_num:
          type: integer
          format: int64
        status:
          $ref: '#/components/schemas/ReceiptStatus'
        start_ts_us:
          type: integer
          format: int64
          description: Payment start time in microseconds.
        end_ts_us:
          type: integer
          format: int64
          description: Confirmation time in microseconds, or zero before confirmation.
    Memo:
      description: >-
        Payment purpose. Unit variants serialize as strings; data-carrying
        variants serialize as objects.
      oneOf:
        - type: string
          enum:
            - General
            - FliqPay
            - FliqPayMerchant
            - BulkPay
        - type: object
          required:
            - Custom
          properties:
            Custom:
              type: string
              maxLength: 48
          additionalProperties: false
        - type: object
          required:
            - SubscribeApi
          properties:
            SubscribeApi:
              type: array
              minItems: 2
              maxItems: 2
              items:
                type: string
              example:
                - Starter
                - Month
          additionalProperties: false
  responses:
    BadRequest:
      description: The request is invalid or cannot be completed in the current state.
      content:
        text/plain:
          schema:
            type: string
    Unauthorized:
      description: >-
        The bearer credential is missing, invalid, or not authorized for this
        user.
      content:
        text/plain:
          schema:
            type: string
    NotFound:
      description: The requested resource does not exist.
      content:
        text/plain:
          schema:
            type: string
    Conflict:
      description: The operation conflicts with the resource's current state.
      content:
        text/plain:
          schema:
            type: string
    RateLimited:
      description: The credential has exceeded its current request allowance.
      content:
        text/plain:
          schema:
            type: string
    ServerError:
      description: The API could not complete the request.
      content:
        text/plain:
          schema:
            type: string
    Unavailable:
      description: A required dependency is temporarily unavailable.
      content:
        text/plain:
          schema:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Use a UniFi API key generated from the web app and stored server-side.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.