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

# Get a payment by transaction ID

> Retrieve a payment using the YuvexPay transaction ID (`txId`) instead of the UUID.



## OpenAPI

````yaml GET /v1/payments/txid/{txId}
openapi: 3.1.0
info:
  title: YuvexPay API
  description: >-
    The YuvexPay API allows you to accept payments, process withdrawals, manage
    products and customers programmatically. All API access is over HTTPS and
    uses JSON request/response bodies.
  version: 1.0.0
  contact:
    name: YuvexPay Support
    email: support@yuvexpay.com
    url: https://docs.yuvexpay.com
servers:
  - url: https://api.yuvexpay.com
    description: >-
      Same base URL serves both sandbox and production. Send a `ypk_test_*` key
      for sandbox or a `ypk_live_*` key for production.
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Inspect the API key in use
  - name: Payments
    description: Create and manage payments
  - name: Withdrawals
    description: Create and manage withdrawals
  - name: Products
    description: Manage product catalog
  - name: Customers
    description: Manage customer records
  - name: Documents
    description: Generate receipts and statements
  - name: Balance
    description: Inspect the current account balance
paths:
  /v1/payments/txid/{txId}:
    get:
      tags:
        - Payments
      summary: Get payment by transaction ID
      description: >-
        Retrieve a payment using the YuvexPay transaction ID (`txId`) instead of
        the UUID.
      operationId: getPaymentByTxId
      parameters:
        - name: txId
          in: path
          required: true
          schema:
            type: string
          description: The YuvexPay transaction ID.
      responses:
        '200':
          description: Payment found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  payment:
                    $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Payment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        txId:
          type: string
          description: YuvexPay transaction ID.
        amount:
          type: number
          description: >-
            Merchant-requested base amount, in BRL. This is the seller's
            intended receivable.
        feeAmount:
          type: number
          description: >-
            YuvexPay platform fee, in BRL. When `feePassedToPayer` is true, this
            equals `payerFeeAmount` and is charged on top of `amount`. When
            false, this is deducted from `amount` to produce `netAmount`.
        netAmount:
          type: number
          description: >-
            Merchant's net receivable, in BRL. Equals `amount` when
            `feePassedToPayer` is true; equals `amount - feeAmount` otherwise.
        feePassedToPayer:
          type: boolean
          description: >-
            Resolved decision (after applying the per-payment override, company
            default, and sub-R$1 forced passthrough) on whether the fee was
            added on top for the payer.
        payerFeeAmount:
          type: number
          nullable: true
          description: >-
            Fee amount added to the payer's total charge. Null when
            `feePassedToPayer` is false. When true, payer-charged total =
            `amount + payerFeeAmount`.
        status:
          $ref: '#/components/schemas/PaymentStatus'
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethod'
        currency:
          $ref: '#/components/schemas/Currency'
        description:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        expiresAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        methodData:
          type: object
          description: >-
            Payment method-specific data (QR code for PIX, barcode for boleto,
            etc.).
          properties:
            type:
              $ref: '#/components/schemas/PaymentMethod'
          additionalProperties: true
        paidAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the payment was confirmed paid. Null until paid.
        payer:
          type: object
          nullable: true
          description: >-
            Payer (debtor) identity captured from the PIX network once the
            charge is paid. Provider-agnostic. Null for historical records or
            open-payer charges where no payer data was captured.
          properties:
            name:
              type: string
              nullable: true
              description: Payer full name.
            document:
              type: string
              nullable: true
              description: >-
                Payer CPF/CNPJ, returned unredacted when the full value is on
                file. May be masked (e.g. "75******20") for open-payer charges
                where only a masked value was provided by the payer's bank.
            documentType:
              type: string
              nullable: true
              enum:
                - CPF
                - CNPJ
              description: Payer document type.
            institutionName:
              type: string
              nullable: true
              description: Payer bank/institution name.
            institutionIspb:
              type: string
              nullable: true
              description: Payer bank ISPB (Banco Central participant identifier).
    PaymentStatus:
      type: string
      enum:
        - NEW
        - PENDING_METHOD_SELECTION
        - PROCESSING
        - CONFIRMED
        - PAID
        - CANCELLED
        - EXPIRED
        - REFUNDED
        - PARTIAL_REFUND
        - CHARGEBACK
        - MED_FROZEN
      description: Possible payment statuses.
    PaymentMethod:
      type: string
      enum:
        - PIX
        - CARD
        - BOLETO
      description: Available public payment methods.
    Currency:
      type: string
      enum:
        - BRL
      description: Supported currencies.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable error message.
            details:
              type: object
              description: Additional error context.
  responses:
    Unauthorized:
      description: Missing or invalid authentication token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_KEY
              message: Invalid or revoked API key
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: NOT_FOUND
              message: Resource not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        YuvexPay API key. Include as `Authorization: Bearer
        ypk_<env>_<kid>_<secret>` where `<env>` is `test` (sandbox) or `live`
        (production). Create and manage keys in the dashboard under **Settings >
        API Keys**.

````