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

# Retrieve Payment Link

> Fetch one payment link by its link_id: where it stands, how it was paid, when it expires, and who it is for.

## Overview

Returns one payment link: its `status`, the payments made through it, its `expiry_date`, buyer, product, invoice and settlement. Use it to confirm a link's outcome — for an active link it checks for a payment before answering, so it can be ahead of [List Payment Links](/api-reference/v3/payment-link/list).

## Path Parameters

* `link_id`: The link's ID from [Create Payment Link](/api-reference/v3/payment-link/create), e.g. `PR4829301756`. The `payment_id` it returned is the same value.

From a payment webhook, pass its `link_id`: the webhook's `payment_id` names the payment, not the link.

A link that is not yours — or, for a PSP, not one of your sub-merchants' — reads as not found:

```json theme={null}
{
  "success": false,
  "error": {
    "code": "ERR_PAYMENT_005",
    "message": "Payment not found",
    "details": {
      "payment_id": "Payment not found"
    }
  }
}
```

PSPs do not need `X-Merchant-ID` here: a sub-merchant's link is found without it.

## Link status

| `status`  | Meaning                                                                                   |
| --------- | ----------------------------------------------------------------------------------------- |
| `active`  | Open for payment.                                                                         |
| `paid`    | Paid. This outranks expiry: a paid link reads `paid` even after its `expiry_date` passes. |
| `expired` | Past its `expiry_date`, or deactivated — a deactivated link reads `expired`.              |
| `failed`  | Could not be created, or closed without being paid.                                       |

## How the link was paid

A buyer may try more than once before a payment goes through. Two fields show the payments made through the link:

* `paid_payment_id`: The `payment_id` of the payment that paid the link, or `null` until it is paid. Refund and reconcile by this ID — see [Tracking a payment link](/api-reference/v3/payment-link/create#tracking-a-payment-link).
* `payments`: The payments made through the link, newest first — at most the 50 newest. Each entry carries:

| Field                  | Description                                                                                                                                                                      |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payment_id`           | The payment's ID. Its payment webhooks carry it, next to the link's `link_id`                                                                                                    |
| `status`               | `pending` while it is under way, `captured` once it went through, `failed` — or, rarely, `invalid` — if it did not                                                               |
| `mop_type`             | The method it was made with, in lowercase (`upi`, `credit_card`), or `null` when none is recorded                                                                                |
| `amount`               | Its amount, in the format [Create Payment Link](/api-reference/v3/payment-link/create) returns: a decimal string, `"1500"` for whole rupees and `"1500.50"` when there are paise |
| `created_at`           | When it was made                                                                                                                                                                 |
| `payment_completed_at` | When it completed, or `null` until it has — usually `null` for a payment that failed                                                                                             |

On some accounts a link and its payment share one ID. There `payments` holds a single entry whose `payment_id` is `link_id`, from the moment the link is created, and `paid_payment_id` becomes that same ID once the buyer pays. Elsewhere each try is a payment of its own, and `payments` stays empty until the buyer first tries to pay.

A link the buyer paid on their second try, with the rest of the response left out:

```json theme={null}
{
  "link_id": "PR6120458839",
  "status": "paid",
  "paid_payment_id": "PR7730215564",
  "payments": [
    {
      "payment_id": "PR7730215564",
      "status": "captured",
      "mop_type": "upi",
      "amount": "1500",
      "created_at": "2026-09-14T10:02:44.519302Z",
      "payment_completed_at": "2026-09-14T10:03:21.087716Z"
    },
    {
      "payment_id": "PR7730209921",
      "status": "failed",
      "mop_type": "credit_card",
      "amount": "1500",
      "created_at": "2026-09-14T09:48:10.332907Z",
      "payment_completed_at": null
    }
  ]
}
```

## Response Fields

<Note>
  **The response carries no amount for the link.** Keep the `amount` from [Create Payment Link](/api-reference/v3/payment-link/create), or read `amount` from [List Payment Links](/api-reference/v3/payment-link/list).
</Note>

* `link_id`: The link's ID. `payment_id` is the same value, kept for compatibility.
* `expiry_date`: When the link stops accepting payment. For a deactivated link, the moment it was deactivated.
* `mop_type`: The method the buyer paid with, in uppercase (`UPI`, `CREDIT_CARD`) — List gives the same value in lowercase. It is `null` until the link is paid, and can stay `null` after. `payments` gives the method of each payment.
* `buyer`, `product`, `invoice`: As sent on create.
  * `buyer.pan_number` and `buyer.dob` are `null` unless they were collected from the buyer.
  * `product.hs_code` and `product.hs_code_description` are `null`: the link does not store them.
  * `invoice.date` and `invoice.file` are `null` unless they were added to the order later.
* `settlement`: The settlement state recorded against the link. `settlement_details` stays `null` until the payment is part of a settlement; its `settlement_id` is what [Get Settlement](/api-reference/v3/settlement/get) takes. When `paid_payment_id` differs from `link_id`, the money moved on that payment rather than on the link, and `settlement` does not follow it: reconcile by `paid_payment_id`.
* `status_message`: Why the link failed or closed, when there is a reason to give; otherwise `null`.
* `created_at` and the other timestamps are UTC with microseconds, e.g. `2026-09-14T09:30:15.123456Z`.


## OpenAPI

````yaml openapi/v3-payment-links.json GET /pg/payment-links/{link_id}/
openapi: 3.0.0
info:
  title: EximPe Payment Gateway API — v3 Payment Links
  description: >-
    Create, list, retrieve and deactivate payment links on the v3 API. v1 and v2
    use the same paths; this spec carries the v3 contract.
  version: 3.0.0
servers:
  - url: https://api-pacb-uat.eximpe.com
    description: Payment Gateway Sandbox URL
security: []
paths:
  /pg/payment-links/{link_id}/:
    get:
      tags:
        - Payment Links
      summary: Retrieve Payment Link
      description: >-
        Fetch one payment link by its link_id: its status, the payments made
        through it, its expiry, buyer, product, invoice and settlement.
      operationId: v3_retrievePaymentLink
      parameters:
        - name: link_id
          in: path
          required: true
          description: >-
            The link's `link_id`, as returned by Create Payment Link (`PR`
            followed by 10 digits). The `payment_id` Create Payment Link returns
            is the same value.
          schema:
            type: string
            example: PR4829301756
      responses:
        '200':
          description: The payment link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_PaymentLinkDetailsResponse'
              examples:
                Active link:
                  summary: Active link
                  value:
                    success: true
                    message: Payment link details fetched successfully
                    data:
                      payment_id: PR4829301756
                      link_id: PR4829301756
                      reference_id: ORD-2026-000123
                      currency: INR
                      payment_link: https://api-pacb-uat.eximpe.com/p/Xk3nQ7bT2mWp9vLc4R/
                      expiry_date: '2026-12-31T18:29:59.000000Z'
                      mop_type: null
                      settlement:
                        status: not_applicable
                        message: null
                        settlement_details: null
                      buyer:
                        name: Rahul Sharma
                        email: rahul.sharma@example.com
                        phone: '+919876543210'
                        address:
                          line_1: 221B MG Road
                          line_2: Indiranagar
                          city: Bengaluru
                          state: Karnataka
                          postal_code: '560038'
                        pan_number: null
                        dob: null
                      product:
                        name: Annual subscription
                        description: 12-month premium plan
                        hs_code: null
                        hs_code_description: null
                        type_of_goods: service
                      invoice:
                        number: INV2026000123
                        date: null
                        file: null
                      air_waybills: []
                      status: active
                      status_message: null
                      created_at: '2026-09-14T09:30:15.123456Z'
                      paid_payment_id: null
                      payments: []
                Paid on the second try:
                  summary: Paid on the second try
                  description: >-
                    The buyer's first try failed and the second went through.
                    Each try is a payment with its own payment_id;
                    paid_payment_id names the one that paid the link.
                  value:
                    success: true
                    message: Payment link details fetched successfully
                    data:
                      payment_id: PR6120458839
                      link_id: PR6120458839
                      reference_id: ORD-2026-000125
                      currency: INR
                      payment_link: https://api-pacb-uat.eximpe.com/p/Rb6yLq3Wd8Nf2Kt5Hc/
                      expiry_date: '2026-10-14T18:29:59.000000Z'
                      mop_type: null
                      settlement:
                        status: not_applicable
                        message: null
                        settlement_details: null
                      buyer:
                        name: Kavya Iyer
                        email: kavya.iyer@example.com
                        phone: '+919845012345'
                        address:
                          line_1: 7 Cathedral Road
                          line_2: null
                          city: Chennai
                          state: Tamil Nadu
                          postal_code: '600086'
                        pan_number: null
                        dob: null
                      product:
                        name: Online course
                        description: Six-week data analysis course
                        hs_code: null
                        hs_code_description: null
                        type_of_goods: service
                      invoice:
                        number: INV2026000125
                        date: null
                        file: null
                      air_waybills: []
                      status: paid
                      status_message: null
                      created_at: '2026-09-14T09:40:02.118734Z'
                      paid_payment_id: PR7730215564
                      payments:
                        - payment_id: PR7730215564
                          status: captured
                          mop_type: upi
                          amount: '1500'
                          created_at: '2026-09-14T10:02:44.519302Z'
                          payment_completed_at: '2026-09-14T10:03:21.087716Z'
                        - payment_id: PR7730209921
                          status: failed
                          mop_type: credit_card
                          amount: '1500'
                          created_at: '2026-09-14T09:48:10.332907Z'
                          payment_completed_at: null
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              examples:
                Invalid credentials:
                  summary: Invalid credentials
                  value:
                    success: false
                    error:
                      code: ERR_AUTH_001
                      message: Invalid credentials
                      details:
                        authentication: Invalid credentials.
        '403':
          description: Payment links are not enabled on the account
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/v3_PermissionDeniedResponse'
                  - $ref: '#/components/schemas/v3_ErrorResponse'
              examples:
                Payment links not enabled:
                  summary: Payment links not enabled
                  description: >-
                    Payment links are not enabled on the account. This body does
                    not use the standard error envelope.
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: No link with this link_id belongs to you
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              examples:
                Not found:
                  summary: Not found
                  value:
                    success: false
                    error:
                      code: ERR_PAYMENT_005
                      message: Payment not found
                      details:
                        payment_id: Payment not found
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v3_ErrorResponse'
              examples:
                Unexpected error:
                  summary: Unexpected error
                  value:
                    success: false
                    error:
                      code: ERR_SERVICE_ERROR_000
                      message: Payment gateway error
                      details:
                        error: An unexpected error occurred. Please try again later
      security:
        - clientAuth: []
          clientSecretAuth: []
          apiVersionHeader: []
components:
  schemas:
    v3_PaymentLinkDetailsResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
        message:
          type: string
          description: Response message
        data:
          $ref: '#/components/schemas/v3_PaymentLinkDetails'
    v3_ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
          description: >-
            Indicates if the request was successful. Always false for error
            responses.
        error:
          $ref: '#/components/schemas/v3_ErrorDetails'
    v3_PermissionDeniedResponse:
      type: object
      required:
        - detail
      description: >-
        Returned when payment links are not enabled on the account. It does not
        use the standard error envelope.
      properties:
        detail:
          type: string
          description: Why the request was refused
    v3_PaymentLinkDetails:
      type: object
      description: >-
        The link, and the payments made through it. The link's amount is not
        included: keep the one from the create response, or read it from List
        Payment Links.
      properties:
        payment_id:
          type: string
          description: The same value as link_id, kept for compatibility
        link_id:
          type: string
          description: The link's ID
        reference_id:
          type: string
          description: Your reference_id from Create Payment Link
        currency:
          type: string
          description: Always INR
        payment_link:
          type: string
          format: uri
          nullable: true
          description: The URL sent to the buyer. Null when the link could not be created.
        expiry_date:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the link stops accepting payment; the moment of deactivation
            for a deactivated link. UTC, ISO 8601 with microseconds (e.g.
            `2026-09-14T09:30:15.123456Z`).
        mop_type:
          type: string
          nullable: true
          description: >-
            The method the buyer paid with, in uppercase (e.g. UPI, CREDIT_CARD,
            NET_BANKING). Can be null even after the link is paid.
        settlement:
          $ref: '#/components/schemas/v3_PaymentLinkSettlement'
        buyer:
          type: object
          nullable: true
          properties:
            name:
              type: string
              description: Buyer's full name
            email:
              type: string
              description: Buyer's email address
            phone:
              type: string
              nullable: true
              description: Buyer's phone number, E.164 (e.g. +919876543210)
            address:
              type: object
              nullable: true
              properties:
                line_1:
                  type: string
                  description: Address line 1
                line_2:
                  type: string
                  nullable: true
                  description: Address line 2
                city:
                  type: string
                  description: City name
                state:
                  type: string
                  description: State name
                postal_code:
                  type: string
                  description: PIN code
            pan_number:
              type: string
              nullable: true
              description: Buyer's PAN, when one has been collected
            dob:
              type: string
              format: date
              nullable: true
              description: Buyer's date of birth (YYYY-MM-DD), when one has been collected
        product:
          type: object
          nullable: true
          properties:
            name:
              type: string
              description: Product or service name
            description:
              type: string
              nullable: true
              description: Product or service description
            hs_code:
              type: string
              nullable: true
              description: HS code, when one is stored on the order
            hs_code_description:
              type: string
              nullable: true
              description: HS code description, when one is stored on the order
            type_of_goods:
              type: string
              description: 'Type of goods: physical_goods, digital_goods or service'
        invoice:
          type: object
          nullable: true
          properties:
            number:
              type: string
              description: Invoice number
            date:
              type: string
              format: date
              nullable: true
              description: Invoice date (YYYY-MM-DD), when one is recorded
            file:
              type: string
              format: uri
              nullable: true
              description: >-
                Time-limited download URL for the invoice file, when one has
                been uploaded
        air_waybills:
          type: array
          description: Air waybills recorded against the link's order; usually empty
          items:
            type: object
            properties:
              number:
                type: string
                description: Air waybill number
              file:
                type: string
                format: uri
                nullable: true
                description: Time-limited download URL for the air waybill file
        status:
          type: string
          enum:
            - active
            - paid
            - expired
            - failed
          description: >-
            Where the link stands. `active`: open for payment. `paid`: paid;
            this outranks an expiry that has since passed. `expired`: past its
            expiry_date, or deactivated. `failed`: could not be created, or
            closed without being paid.
        status_message:
          type: string
          nullable: true
          description: >-
            Why the link failed or closed, when there is a reason to give;
            otherwise null
        created_at:
          type: string
          format: date-time
          description: >-
            When the link was created. UTC, ISO 8601 with microseconds (e.g.
            `2026-09-14T09:30:15.123456Z`).
        paid_payment_id:
          type: string
          nullable: true
          description: >-
            The payment_id of the payment that paid the link, or null until it
            is paid. Refund and reconcile by this ID, not by link_id. On some
            accounts a link and its payment share one ID, and this equals
            link_id.
        payments:
          type: array
          description: >-
            The payments made through the link, newest first; at most the 50
            newest. A buyer may try more than once: where each try is a payment
            of its own, every try is listed, and this is empty until the buyer
            first tries to pay. On some accounts a link and its payment share
            one ID: this then holds one entry whose payment_id is link_id, from
            the moment the link is created.
          items:
            $ref: '#/components/schemas/v3_PaymentLinkPayment'
    v3_ErrorDetails:
      type: object
      required:
        - code
        - message
      properties:
        code:
          description: >-
            Error code (e.g., ERR_ORDER_002). The list endpoint's own failure
            sends a number (40350).
          oneOf:
            - type: string
            - type: integer
        message:
          type: string
          description: Error message
        details:
          description: >-
            What failed. Usually an object keyed by the offending field and
            nested the way the request is (e.g. buyer.address.postal_code), with
            one message per field. A purpose_code refusal sends a single string
            instead.
          oneOf:
            - type: object
              additionalProperties: true
            - type: string
    v3_PaymentLinkSettlement:
      type: object
      description: >-
        Settlement state recorded against the link. When paid_payment_id differs
        from link_id, the money moved on that payment rather than on the link,
        and this does not follow it: reconcile by paid_payment_id.
      properties:
        status:
          type: string
          description: Settlement status
          enum:
            - not_applicable
            - payment_pending
            - payment_failed
            - info_pending
            - ready_for_settlement
            - settled
            - settlement_error
            - under_review
            - action_required
            - verified
            - on_hold
            - expired
            - rejected
        message:
          type: string
          nullable: true
          description: Detail on the settlement status, when there is any
        settlement_details:
          allOf:
            - $ref: '#/components/schemas/v3_PaymentLinkSettlementDetails'
          nullable: true
          description: Null until the payment is part of a settlement
    v3_PaymentLinkPayment:
      type: object
      description: A payment made through the link
      required:
        - payment_id
        - status
        - mop_type
        - amount
        - created_at
        - payment_completed_at
      properties:
        payment_id:
          type: string
          description: >-
            The payment's ID (PR followed by 10 digits). Refund and reconcile by
            it. Its payment webhooks carry it with the link's link_id.
        status:
          type: string
          enum:
            - pending
            - captured
            - failed
            - invalid
          description: >-
            Where the payment stands. `pending`: under way. `captured`: it went
            through. `failed`, or rarely `invalid`: it did not.
        mop_type:
          type: string
          nullable: true
          description: >-
            The method the payment was made with, in lowercase (e.g. upi,
            credit_card, net_banking), or null when none is recorded.
        amount:
          type: string
          description: >-
            The payment's amount, in the format Create Payment Link returns: a
            decimal string, "1500" for whole rupees and "1500.50" when there are
            paise. Parse it as a decimal, never as a float.
        created_at:
          type: string
          format: date-time
          description: >-
            When the payment was made. UTC, ISO 8601 with microseconds (e.g.
            `2026-09-14T09:30:15.123456Z`).
        payment_completed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the payment completed, in the same format; null until it has,
            and usually null for a payment that failed.
    v3_PaymentLinkSettlementDetails:
      type: object
      description: Amounts are decimal strings with two decimals, or null.
      properties:
        settlement_id:
          type: string
          description: Settlement ID (ST…). Pass it to Get Settlement.
        settlement_completed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the settlement completed. UTC, ISO 8601 with microseconds (e.g.
            `2026-09-14T09:30:15.123456Z`).
        settlement_currency:
          type: string
          nullable: true
          description: Currency the payment settled in
        transaction_amount:
          type: string
          nullable: true
          description: Transaction amount
        merchant_service_fee:
          type: string
          nullable: true
          description: Service fee charged
        merchant_service_tax:
          type: string
          nullable: true
          description: Tax on the service fee
        merchant_net_amount:
          type: string
          nullable: true
          description: Net amount settled to you
        sgst:
          type: string
          nullable: true
          description: SGST component
        cgst:
          type: string
          nullable: true
          description: CGST component
        igst:
          type: string
          nullable: true
          description: IGST component
        merchant_transaction_id:
          type: string
          nullable: true
          description: The payment network's reference for the transaction
        card_type:
          type: string
          nullable: true
          description: Card type, for a card payment
        offer_service_fee:
          type: string
          nullable: true
          description: Service fee on an offer
        offer_service_tax:
          type: string
          nullable: true
          description: Tax on the offer service fee
        forex_rate:
          type: string
          nullable: true
          description: Forex rate applied
        discount:
          type: string
          nullable: true
          description: Discount applied
        additional_tdr_fee:
          type: string
          nullable: true
          description: Additional TDR fee
        additional_tdr_tax:
          type: string
          nullable: true
          description: Tax on the additional TDR fee
        total_processing_fee:
          type: string
          nullable: true
          description: Total processing fee
        total_service_tax:
          type: string
          nullable: true
          description: Total service tax
        transaction_currency:
          type: string
          nullable: true
          description: Currency of the transaction
  securitySchemes:
    clientAuth:
      type: apiKey
      name: X-Client-ID
      in: header
      description: >-
        **Client Application ID** - Your unique application identifier used to
        authenticate API requests. You can find your Client ID in the Developer
        Settings section of the merchant dashboard.
      x-displayName: Client ID
      x-example: your-client-id
    clientSecretAuth:
      type: apiKey
      name: X-Client-Secret
      in: header
      description: >-
        **Client Secret Key** - Your secret key used alongside the Client ID for
        secure authentication. Keep this confidential and never expose it in
        client-side code. Available in the Developer Settings section of the
        merchant dashboard.
      x-displayName: Client Secret
      x-example: your-client-secret
    apiVersionHeader:
      type: apiKey
      name: X-API-Version
      in: header
      description: >-
        **API Version** - Specifies which version of the API to use (e.g.,
        '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which
        API version your integration uses. Default version information is
        available in the Developer Settings.
      x-displayName: API Version
      x-example: 3.0.0

````