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

# Get a Payment Link

> Retrieve a payment link with its current status and the number of successful payments it has taken.

`GET /payment-link/{id}` returns one of your payment links. Poll it to see whether a link has been paid: `status` is `active`, `used`, `expired`, or `cancelled`, and `usesCount` is the number of successful payments taken through it.

A link that belongs to another merchant, or to the other environment, returns `404`.

## Example

<RequestExample>
  ```bash cURL theme={"dark"}
  curl "https://api.therius.io/v1/payment-link/5b1f0a52-3c0e-4a52-9d57-0c1d7e9f2a10?merchantCode=MERCHANT_001" \
    -H "Authorization: Bearer prv_production_your_key_here"
  ```
</RequestExample>

<Note>
  Payments made through a link are ordinary payments: they send the usual payment webhooks, and the link's `reference` is their `orderCode`.
</Note>


## OpenAPI

````yaml GET /payment-link/{id}
openapi: 3.1.0
info:
  title: Therius API
  description: REST API for payments, subscriptions, and billing plans.
  version: 1.0.0
servers:
  - url: https://api.therius.io/v1
    description: Production
  - url: https://api-sandbox.therius.io/v1
    description: Sandbox
security:
  - bearerAuth: []
paths:
  /payment-link/{id}:
    get:
      tags:
        - Payment Links
      summary: Get a payment link
      operationId: getPaymentLink
      parameters:
        - name: id
          in: path
          required: true
          description: The payment link `id`.
          schema:
            type: string
            format: uuid
        - name: merchantCode
          in: query
          description: >-
            Your merchant account identifier. Required if the key maps to more
            than one merchant account.
          schema:
            type: string
      responses:
        '200':
          description: The payment link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLink'
        '401':
          description: Missing or invalid API key
        '404':
          description: Payment link not found
components:
  schemas:
    PaymentLink:
      type: object
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
          description: The hosted checkout URL to share with the payer.
        type:
          type: string
          enum:
            - one-time
            - subscription
        status:
          type: string
          enum:
            - active
            - used
            - expired
            - cancelled
          description: >-
            `used` once a single-use link takes its first successful payment, or
            a reusable link reaches `maxUses`.
        amountMode:
          type: string
          enum:
            - fixed
            - customer_entered
        amount:
          allOf:
            - $ref: '#/components/schemas/Amount'
          description: >-
            Absent on subscription links. For `customer_entered` links only
            `currency` and `exponent` are set.
        amountMin:
          type: integer
          format: int64
          description: Minimum payer-entered amount, minor units.
        amountMax:
          type: integer
          format: int64
          description: Maximum payer-entered amount, minor units.
        subscriptionPlanId:
          type: integer
          format: int64
        checkoutConfigId:
          type: string
          format: uuid
        title:
          type: string
        description:
          type: string
        reference:
          type: string
        customerEmail:
          type: string
        customerName:
          type: string
        returnUrl:
          type: string
          format: uri
        saveCardEnabled:
          type: boolean
        reusable:
          type: boolean
        maxUses:
          type: integer
        usesCount:
          type: integer
          description: Number of successful payments taken through this link.
        environment:
          type: string
          enum:
            - production
            - sandbox
        expiresAt:
          type: string
          format: date-time
        usedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
    Amount:
      type: object
      required:
        - currency
        - value
        - exponent
      properties:
        currency:
          type: string
          description: >-
            ISO 4217 currency code. On capture, refund and cancel it must match
            the currency of the original payment.
          example: USD
        value:
          type: integer
          description: >-
            Amount in minor units (cents, pence, etc.). `4999` = $49.99 for USD
            (exponent 2); `5000` = ¥5000 for JPY (exponent 0). On capture it
            must not exceed the authorized value; on refund the cumulative total
            across refunds must not exceed the captured amount.
          example: 4999
        exponent:
          type: integer
          description: >-
            Number of decimal places for the currency — `2` for USD/EUR, `0` for
            JPY. Determines where the decimal point sits in `value`.
          example: 2
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret API key: `Bearer prv_production_xxx` (production) or `Bearer
        prv_sandbox_xxx` (sandbox).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.