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

# Retrieve Payment Intent

> Retrieve the authoritative status and receipt for a Payment Intent

Use this server-side endpoint to recover the latest payment state or receipt.
Send the secret key in `X-API-Key`. The response intentionally excludes
`client_secret`.


## OpenAPI

````yaml api-reference/ecom/openapi.json GET /payment-intents/{id}
openapi: 3.0.3
info:
  title: Ecom API
  description: >-
    REST API for creating and managing hosted payment links. Generate a
    shareable checkout URL and accept one-time or multi-use payments.


    **Entity scoping:** Every API key is scoped to an entity in the organization
    hierarchy (Partner → Merchant → Branch). Data access is automatically
    restricted to the key's level.


    **Amounts:** All monetary values are integers in the currency's smallest
    unit (for PHP, centavos). `150000` represents PHP 1,500.00.


    **Idempotency:** Create requires an `Idempotency-Key`; cancel accepts one
    optionally.
  version: 1.0.0
  contact:
    name: API Support
    email: support@moduluslabs.io
  license:
    name: Proprietary
    url: https://moduluslabs.io
servers:
  - url: https://api.sbx.moduluslabs.io/ecom/v1
    description: Sandbox
security:
  - ApiKeyAuth: []
tags:
  - name: Payment Links
    description: Create and manage hosted payment links
paths:
  /payment-intents/{id}:
    get:
      summary: Retrieve a Payment Intent
      description: >-
        Retrieve the authoritative status and receipt view from your server. The
        response never contains the client secret.
      operationId: retrievePaymentIntent
      parameters:
        - name: id
          in: path
          required: true
          description: Payment Intent identifier returned by the create operation.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Payment intent retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentRead'
        '401':
          description: Missing or invalid secret key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentError'
        '403':
          description: The key is not authorized to read payment intents.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentError'
        '404':
          description: Payment intent not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentError'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentIntentError'
      security:
        - SecretKeyAuth: []
components:
  schemas:
    PaymentIntentRead:
      type: object
      required:
        - id
        - amount
        - currency
        - status
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Unique Payment Intent identifier (UUID v7).
        amount:
          type: integer
          format: int64
          description: Payment amount in the currency's smallest unit (for PHP, centavos).
        currency:
          type: string
          description: ISO 4217 currency code.
        order_reference:
          type: string
          maxLength: 100
          description: >-
            Merchant-defined order reference supplied when the Payment Intent
            was created. Omitted when no order reference was supplied.
        status:
          type: string
          enum:
            - ACTIVE
            - EXPIRED
            - CONSUMED
            - CANCELLED
            - REQUIRES_ACTION
            - PROCESSING
            - SUCCEEDED
            - DECLINED
            - FAILED
          description: Authoritative intent or latest payment-attempt status.
        payment_attempt_id:
          type: string
          format: uuid
          description: >-
            Identifier of the latest payment attempt. Omitted until an attempt
            exists.
        user_message:
          type: string
          description: >-
            Customer-safe message for the latest outcome. Omitted when no
            message is available.
        failure_category:
          type: string
          description: >-
            Normalized failure category for a failed attempt.
            PROCESSOR_UNAVAILABLE means the processor or issuer network returned
            an authoritative unavailable response and no authorization was
            created. CARD_NOT_ELIGIBLE means the card was rejected by a
            card-eligibility rule before reaching the processor. Omitted for
            non-failure states.
          enum:
            - VERIFICATION_REJECTED
            - VERIFICATION_UNAVAILABLE
            - PAYMENT_REJECTED
            - PAYMENT_PROCESSING_ERROR
            - PROCESSOR_UNAVAILABLE
            - CARD_NOT_ELIGIBLE
        updated_at:
          type: string
          format: date-time
          description: UTC RFC 3339 timestamp when the returned state was last updated.
        receipt:
          allOf:
            - $ref: '#/components/schemas/PaymentIntentReceipt'
          description: >-
            Receipt details for a successful payment. Omitted when no successful
            payment exists.
    PaymentIntentError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          description: Error returned for an unsuccessful Payment Intent API request.
          required:
            - code
            - message
            - correlation_id
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: BAD_REQUEST
            message:
              type: string
              description: Human-readable message. Do not branch on its wording.
            correlation_id:
              type: string
              description: Correlation id for this request.
            details:
              allOf:
                - $ref: '#/components/schemas/ValidationErrorDetails'
              description: >-
                Optional structured details identifying the field and validation
                rule that failed.
    PaymentIntentReceipt:
      type: object
      properties:
        approval_code:
          type: string
          description: Issuer authorization approval code, when available.
        transaction_id:
          type: string
          description: Modulus transaction identifier for reconciliation and support.
        reconciliation_id:
          type: string
          description: Processor reconciliation identifier, when available.
        card_scheme:
          type: string
          description: >-
            Card network used for the payment, for example `VISA` or
            `MASTERCARD`.
        card_last_four:
          type: string
          description: Last four digits of the card. Full card data is never returned.
        completed_at:
          type: string
          format: date-time
          description: UTC RFC 3339 timestamp when the payment completed.
        invoice_number:
          type: string
          description: Invoice number assigned to the transaction, when available.
    ValidationErrorDetails:
      type: object
      description: Optional machine-readable validation context.
      properties:
        field:
          type: string
          description: >-
            Request field that failed validation, using its exact API field
            name.
          example: description
        rule:
          type: string
          description: Machine-readable validation rule that failed.
          example: non_blank
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key enabled for the requested payment-link operation and associated
        with an eligible partner, merchant, or branch account.
    SecretKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Server-side secret key (`sk_...`) supplied in `X-API-Key`. Never expose
        this key in a browser or mobile app.

````