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

# Get Payment

> Retrieve payment details



## OpenAPI

````yaml /api-reference/openapi.en.json get /v1/payments/{id}
openapi: 3.1.0
info:
  title: ZAFA PAY API
  description: Payment API platform integrating multiple PSPs
  version: 1.0.0
servers:
  - url: https://api.sandbox.zafapay.com
    description: Sandbox environment
  - url: https://api.zafapay.com
    description: Production environment
security:
  - bearerAuth: []
paths:
  /v1/payments/{id}:
    get:
      tags:
        - Payments
      summary: Get Payment
      description: Retrieve payment details
      operationId: getPayment
      parameters:
        - name: id
          in: path
          required: true
          description: Transaction ID
          schema:
            type: string
            example: tx_abc123
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentDetailResponse'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Transaction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    PaymentDetailResponse:
      type: object
      properties:
        id:
          type: string
          description: Transaction ID
          example: tx_abc123
        request_id:
          type: string
          description: Payment request ID
          example: req_xyz789
        status:
          type: string
          enum:
            - pending
            - requires_action
            - authorized
            - completed
            - failed
            - canceled
            - partially_refunded
            - refunded
          description: Status
          example: completed
        amount:
          type: string
          description: Payment amount (string format)
          example: '17.62'
        currency:
          type: string
          description: Currency code
          example: usd
        capture_method:
          type: string
          description: Capture method
          example: automatic
        external_id:
          type: string
          description: Merchant's order ID
          example: order_12345
        payment_method:
          type: string
          description: Payment method
          example: card
        amount_refunded:
          type: string
          description: Refunded amount (string format)
          example: '0'
        original_amount:
          type: number
          nullable: true
          description: Original amount before currency exchange
          example: null
        original_currency:
          type: string
          nullable: true
          description: Original currency before exchange
          example: null
        applied_rate:
          type: number
          nullable: true
          description: Exchange rate applied
          example: null
        card_brand:
          type: string
          nullable: true
          description: Card brand
          example: visa
        card_last4:
          type: string
          nullable: true
          description: Last 4 digits of card number
          example: '4242'
        cardholder_name:
          type: string
          nullable: true
          description: Cardholder name
          example: John Doe
        card_exp_month:
          type: integer
          nullable: true
          description: Card expiration month (1-12)
          example: 12
        card_exp_year:
          type: integer
          nullable: true
          description: Card expiration year
          example: 2028
        card_country:
          type: string
          nullable: true
          description: Card issuing country (ISO 3166-1 alpha-2)
          example: US
        card_funding:
          type: string
          nullable: true
          description: Card funding type (credit, debit, prepaid)
          example: credit
        payment_method_id:
          type: string
          nullable: true
          description: Saved card ID (pmi_xxx format)
          example: null
        is_recurring:
          type: boolean
          description: True for recurring payments
          example: false
        customer_id:
          type: string
          nullable: true
          description: Customer ID
          example: null
        email:
          type: string
          nullable: true
          description: Customer email address
          example: customer@example.com
        tel:
          type: string
          nullable: true
          description: Customer phone number
          example: null
        product_name:
          type: string
          nullable: true
          description: Product name
          example: null
        error_code:
          type: string
          nullable: true
          description: >-
            Unified error code for failed payments (e.g., card_declined,
            insufficient_funds, expired_card)
          example: null
        refunds:
          type: array
          description: Refund history
          items:
            $ref: '#/components/schemas/Refund'
        metadata:
          type: object
          description: Metadata
          additionalProperties: true
        created_at:
          type: string
          format: date-time
          description: Created at
          example: '2024-01-15T10:30:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: Updated at
          example: '2024-01-15T10:31:00.000Z'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: Error type
              enum:
                - authentication_error
                - authorization_error
                - invalid_request_error
                - payment_error
                - rate_limit_error
                - api_error
              example: invalid_request_error
            code:
              type: string
              description: Error code
              example: validation_error
            message:
              type: string
              description: Error message
              example: Invalid request parameters
            param:
              type: string
              description: Parameter that caused the error
              example: amount
            details:
              type: array
              description: Validation error details
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                  message:
                    type: string
            request_id:
              type: string
              description: Request ID
              example: req_abc123xyz789
    Refund:
      type: object
      description: Refund history (used in GET /v1/payments/{id} response)
      properties:
        id:
          type: string
          description: Refund ID
          example: orf_xyz789
        amount:
          type: string
          description: Refund amount (string format)
          example: '5.50'
        status:
          type: string
          description: Refund status
          example: succeeded
        reason:
          type: string
          description: Refund reason
          example: Customer request
        created_at:
          type: string
          format: date-time
          description: Refund date
          example: '2024-01-15T10:35:00Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication using access token

````