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

# Get payment



## OpenAPI

````yaml GET /api/v1/payments/{paymentId}
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: http://localhost:8080
    description: Generated server url
security:
  - BearerAuth: []
paths:
  /api/v1/payments/{paymentId}:
    get:
      tags:
        - payment-controller
      operationId: getPayment
      parameters:
        - name: paymentId
          in: path
          required: true
          schema:
            type: string
            maxLength: 32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponse'
        '400':
          description: Bad Request - Invalid paymentId format
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: INVALID_PAYMENT_ID
                  message:
                    type: string
                    example: The paymentId format is invalid
                  details:
                    type: array
                    items:
                      type: string
                    example:
                      - paymentId must be a valid string
                      - paymentId cannot be empty
                  timestamp:
                    type: string
                    format: date-time
                    example: '2024-01-15T10:30:00Z'
        '401':
          description: Unauthorized - Invalid or missing authorization
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: UNAUTHORIZED
                  message:
                    type: string
                    example: Invalid or missing authorization token
                  details:
                    type: array
                    items:
                      type: string
                    example:
                      - Authorization header is required
                      - Token has expired
                      - Invalid token format
                  timestamp:
                    type: string
                    format: date-time
                    example: '2024-01-15T10:30:00Z'
        '404':
          description: Not Found - Payment not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: PAYMENT_NOT_FOUND
                  message:
                    type: string
                    example: Payment not found
                  details:
                    type: array
                    items:
                      type: string
                    example:
                      - No payment found with the specified paymentId
                  timestamp:
                    type: string
                    format: date-time
                    example: '2024-01-15T10:30:00Z'
        '500':
          description: Internal Server Error - Unexpected server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: INTERNAL_ERROR
                  message:
                    type: string
                    example: An unexpected server error occurred
                  details:
                    type: array
                    items:
                      type: string
                    example:
                      - Please try again later
                      - Contact support if the issue persists
                  timestamp:
                    type: string
                    format: date-time
                    example: '2024-01-15T10:30:00Z'
        '503':
          description: Service Unavailable - Payment provider outage
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: PROVIDER_UNAVAILABLE
                  message:
                    type: string
                    example: Payment data is temporarily unavailable
                  details:
                    type: array
                    items:
                      type: string
                    example:
                      - Payment provider is experiencing issues
                      - Please retry in a few minutes
                  timestamp:
                    type: string
                    format: date-time
                    example: '2024-01-15T10:30:00Z'
components:
  schemas:
    PaymentResponse:
      type: object
      properties:
        paymentId:
          type: string
          maxLength: 32
          description: Unique identifier for the payment generated by the system.
          example: pay_1234567890abcdef
        merchantReference:
          type: string
          description: Reference passed in by the merchant for correlation.
          example: ORDER-12345
        amount:
          type: integer
          description: Amount processed in the smallest currency unit.
          example: 12997
        currency:
          type: string
          description: ISO 4217 currency code used in the payment.
          example: USD
        status:
          type: string
          enum:
            - PENDING
            - AUTHORIZED
            - CAPTURED
            - REFUNDED
            - VOIDED
            - FAILED
          description: Current state of the payment.
          example: CAPTURED
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethodResponse'
          description: >-
            The chosen payment method details (e.g., card). Sensitive fields are
            masked in responses.
        captureNow:
          type: boolean
          description: >-
            Determines how the payment is processed. Default: false →
            Authorization only (funds reserved, must capture later). If true →
            Sale (authorize and capture in one step).
          example: true
        descriptor:
          type: string
          description: >-
            Text shown on the customer's bank statement (e.g., merchant or
            product name).
          example: MyStore Online
        goodsType:
          type: string
          enum:
            - PHYSICAL
            - DIGITAL
            - MIXED
          description: >-
            Type of goods being purchased: PHYSICAL = tangible items, DIGITAL =
            non-physical items, MIXED = combination of both.
          example: MIXED
        productItems:
          type: array
          description: List of product or service items included in this payment.
          items:
            $ref: '#/components/schemas/ProductItem'
          example:
            - id: PROD-001
              name: Wireless Keyboard
              quantity: 2
              unitPrice: 4999
              goodsType: PHYSICAL
            - id: PROD-002
              name: E-Book Subscription
              quantity: 1
              unitPrice: 2999
              goodsType: DIGITAL
        consumer:
          $ref: '#/components/schemas/Consumer'
          description: Consumer details such as name, email, phone.
        billing:
          $ref: '#/components/schemas/Billing'
          description: Billing address information.
        shipping:
          $ref: '#/components/schemas/Shipping'
          description: Shipping address and recipient details.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the payment was created.
          example: '2024-01-15T10:30:00Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the payment was last updated.
          example: '2024-01-15T11:00:00Z'
        transactions:
          type: array
          description: Array of transaction attempts made for this payment.
          items:
            $ref: '#/components/schemas/Transaction'
          example:
            - id: SALE_eUfZ9n3BCPJo
              type: SALE
              amount: 100
              result: FAILED
              failure:
                failureCode: INSUFFICIENT_FUNDS
                providerFailureCode: '51'
              createdAt: '2025-12-15T10:22:10Z'
            - id: SALE_pU2HnmS8AcpI
              type: SALE
              amount: 100
              result: SUCCEEDED
              createdAt: '2025-12-16T10:00:00Z'
            - id: REFN_KmOODVdcacz5
              type: REFUND
              amount: 100
              result: SUCCEEDED
              createdAt: '2025-12-17T14:14:14Z'
        source:
          $ref: '#/components/schemas/Source'
          description: Details related to where the payment originated.
    PaymentMethodResponse:
      type: object
      properties:
        type:
          type: string
          description: >-
            Payment method type. Currently, only CARD is supported. In future
            versions, additional types such as PAYPAL, APPLE_PAY, or
            BANK_TRANSFER may be introduced.
          example: CARD
        card:
          $ref: '#/components/schemas/CardResponse'
          description: >-
            Card details (required if type=CARD). Sensitive fields are masked in
            responses.
      required:
        - type
    ProductItem:
      type: object
      description: Represents a single product or service item within a payment.
      properties:
        id:
          type: string
          description: >-
            Unique identifier of the product or service in the merchant's
            catalog.
          example: PROD-001
        name:
          type: string
          description: Name or description of the item.
          example: Wireless Keyboard
        quantity:
          type: integer
          minimum: 1
          description: Quantity of this item being purchased.
          example: 2
        unitPrice:
          type: integer
          minimum: 1
          description: Unit price in the smallest currency unit (e.g., cents).
          example: 1999
        goodsType:
          type: string
          enum:
            - PHYSICAL
            - DIGITAL
          description: Type of item — physical or digital goods.
          example: PHYSICAL
      required:
        - id
        - name
        - quantity
        - unitPrice
        - goodsType
    Consumer:
      type: object
      properties:
        firstName:
          type: string
          description: Consumer's first name.
          example: John
        lastName:
          type: string
          description: Consumer's last name.
          example: Doe
        email:
          type: string
          description: Consumer's email address.
          example: john.doe@example.com
        phone:
          type: string
          description: Consumer's phone number (E.164 format recommended).
          example: '+1234567890'
        ip:
          type: string
          description: Consumer's IP address at the time of purchase.
          example: 192.168.1.1
      required:
        - firstName
        - email
    Billing:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: Billing address details.
      required:
        - address
    Shipping:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
          description: Shipping address details.
        firstName:
          type: string
          description: Recipient's first name.
          example: Jane
        lastName:
          type: string
          description: Recipient's last name.
          example: Smith
    Transaction:
      type: object
      description: Details about a transaction attempt made for a payment.
      properties:
        id:
          type: string
          maxLength: 32
          description: Unique identifier for the transaction generated by the system.
          example: AUTH_eUfZ9n3BCPJo
        type:
          type: string
          enum:
            - SALE
            - AUTH
            - CAPTURE
            - REFUND
            - VOID
          description: The type of transaction that has been processed.
          example: AUTH
        amount:
          type: integer
          description: Amount processed in the smallest currency unit.
          example: 10000
        result:
          type: string
          enum:
            - SUCCEEDED
            - FAILED
          description: Result of the transaction attempt.
          example: FAILED
        failure:
          $ref: '#/components/schemas/Failure'
          description: >-
            Details about the cause of a failed transaction. Only present if
            result is FAILED.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the transaction was created.
          example: '2025-12-15T10:22:10Z'
    Source:
      type: object
      description: Details related to where a payment originated.
      properties:
        initiatedBy:
          type: string
          enum:
            - CONSUMER
            - MERCHANT
          description: Indicates who is initiating the payment, the CONSUMER or MERCHANT.
          example: MERCHANT
        storeId:
          type: string
          description: >-
            A Paymend-defined identifier for the merchant's store (e.g.,
            website).
          example: store_abc123
      required:
        - storeId
    CardResponse:
      type: object
      properties:
        bin:
          type: string
          description: >-
            Bank Identification Number (BIN) - first 8 digits for
            Visa/Mastercard, first 6 digits for Amex.
          example: '41111111'
        last4:
          type: string
          description: Last 4 digits of the card number.
          example: '1111'
        holderName:
          type: string
          description: Name printed on the card.
          example: John Doe
        cvvPresentDuringAttempt:
          type: boolean
          description: Indicates whether CVV was provided during the payment attempt.
          example: true
        expiryMonth:
          type: string
          pattern: ^(0[1-9]|1[0-2])$
          description: Expiry month of the card, in MM format (01–12).
          example: '12'
        expiryYear:
          type: string
          pattern: ^[0-9]{4}$
          description: Expiry year of the card, in YYYY format.
          example: '2030'
        brand:
          type: string
          description: Card brand (e.g., VISA, MASTERCARD).
          example: VISA
      required:
        - holderName
        - expiryMonth
        - expiryYear
        - bin
    Address:
      type: object
      properties:
        street:
          type: string
          description: Street address line.
          example: 123 Main Street
        city:
          type: string
          description: City or locality.
          example: San Francisco
        country:
          type: string
          description: Two-letter ISO 3166 country code (e.g., US, DE).
          example: US
        state:
          type: string
          description: State, province, or region.
          example: CA
        zip:
          type: string
          description: ZIP or postal code.
          example: '94105'
    Failure:
      type: object
      description: Details about the cause of a failed payment.
      properties:
        failureCode:
          type: string
          description: Paymend-defined code indicating the reason for failure.
          example: INSUFFICIENT_FUNDS
        providerFailureCode:
          type: string
          description: Provider-defined code indicating the reason for failure.
          example: '51'
      required:
        - failureCode
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your API token

````