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

# Retrieve a payment link

> Same fields as create, plus `transactions`: every payment (inbound or outbound) recorded against this link, newest first, same row shape as a Transaction but without the computed `money` breakdown.



## OpenAPI

````yaml GET /gateway/payment-links/{id}
openapi: 3.1.0
info:
  title: AgentaOS Gateway API
  version: 1.0.0
  description: >-
    The AgentaOS REST API: payment links, checkouts, subscriptions, customers,
    invoices, and the unified transactions feed. This is the same API the
    TypeScript SDK (`@agentaos/pay`) and the `agenta` CLI call underneath.


    ## Money model


    - **Decimal currency units (`number`)**: a plain `amount` field (on a create
    body, a Payment Link, a Checkout's `amount_override`, or an Invoice's
    `amount`/`fiat_amount`/`tax_amount`) is in currency units. `49.99` means EUR
    49.99, never cents.

    - **Integer minor units (`number`)**: exactly one field breaks that rule:
    `unitAmountMinor` on a Subscription. It is an integer count of the smallest
    currency unit (`1999` means EUR 19.99), named with a `Minor` suffix
    specifically so it is never confused with a plain `amount`. The `money`
    object on Transactions and the `earnings` object on a retrieved Invoice are
    also integer minor units, computed server-side.

    - **String, on webhooks**: the `amount` inside a webhook payload's `data`
    object is a string (e.g. `"49.99"`), since JSON numbers silently drop
    trailing zeros and this value must round-trip exactly for accounting.


    ## Naming convention


    Most response fields mirror the underlying database column and are
    `snake_case` (`created_at`, `seller_mode`, `buyer_email`, ...). A small
    number of computed convenience fields are camelCase with no snake_case
    equivalent: `checkoutUrl` on Checkouts and Payment Links, `sellerMode` on
    Payment Links specifically, `money` on Transactions, and `earnings` on a
    single retrieved Invoice. Two resources (Subscriptions and Customers) are
    fully camelCase end to end.


    ## Pagination


    Every list endpoint takes `limit` and `offset` and returns `{ items, total,
    hasMore }`. `hasMore` is computed server-side (`offset + items.length <
    total`); never derive it client-side.
  contact:
    name: AgentaOS
    url: https://agentaos.ai
  license:
    name: Proprietary
    url: https://agentaos.ai
servers:
  - url: https://api.agentaos.ai/api/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Payment Links
    description: >-
      Reusable, shareable payment products: a fixed amount and description
      behind one URL.
  - name: Checkouts
    description: >-
      One attempt to collect one payment, standalone or built from a payment
      link. Wire path is `/gateway/sessions`; the SDK and CLI call this resource
      "checkout".
  - name: Subscriptions
    description: >-
      Merchant-side read and management surface for recurring plans. Created
      automatically when a buyer pays a `type: subscription` payment link.
  - name: Customers
    description: 'Read-only surface: everyone who has paid you or been sent an invoice.'
  - name: Invoices
    description: >-
      Every checkout issues an invoice. List, retrieve, void, export, and
      download PDFs/receipts.
  - name: Transactions
    description: >-
      The unified activity feed: every inbound payment and outbound send, across
      every rail, in one list.
paths:
  /gateway/payment-links/{id}:
    get:
      tags:
        - Payment Links
      summary: Retrieve a payment link
      description: >-
        Same fields as create, plus `transactions`: every payment (inbound or
        outbound) recorded against this link, newest first, same row shape as a
        Transaction but without the computed `money` breakdown.
      operationId: getPaymentLink
      parameters:
        - $ref: '#/components/parameters/PaymentLinkId'
      responses:
        '200':
          description: The payment link, with its transaction history.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLinkDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    PaymentLinkId:
      name: id
      in: path
      required: true
      description: Payment link UUID.
      schema:
        type: string
        format: uuid
  schemas:
    PaymentLinkDetail:
      allOf:
        - $ref: '#/components/schemas/PaymentLink'
        - type: object
          properties:
            transactions:
              type: array
              items:
                $ref: '#/components/schemas/LinkTransactionRow'
              description: >-
                Every payment (inbound or outbound) recorded against this link,
                newest first.
          required:
            - transactions
    PaymentLink:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          format: uuid
          description: Payment link UUID.
        org_id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        secure_link_id:
          type: string
          description: Public ID used in the checkout URL.
        amount:
          type: number
          description: Currency units.
        currency:
          type: string
          description: Settlement currency or token.
        description:
          type:
            - string
            - 'null'
        metadata:
          type: object
          description: Your custom data.
        checkout_fields:
          type: array
          items:
            $ref: '#/components/schemas/CheckoutField'
        webhook_url:
          type:
            - string
            - 'null'
        success_url:
          type:
            - string
            - 'null'
        cancel_url:
          type:
            - string
            - 'null'
        tax_rate_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          type: string
          enum:
            - active
            - cancelled
        payment_count:
          type: integer
          description: Successful payments against this link so far.
        supported_networks:
          type: array
          items:
            type: string
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        name:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        max_uses:
          type:
            - integer
            - 'null'
          description: null means unlimited.
        seller_mode:
          type: string
          enum:
            - mor
            - crypto
          description: >-
            mor (card + bank) or crypto (on-chain). The snake_case column
            equivalent of the computed `sellerMode`.
        type:
          type: string
          enum:
            - one_time
            - subscription
        billing_interval:
          type:
            - string
            - 'null'
          enum:
            - month
            - year
            - null
        environment:
          type: string
          enum:
            - test
            - live
        checkoutUrl:
          type: string
          description: >-
            Full URL to share with buyers. Computed, camelCase, no snake_case
            equivalent.
        sellerMode:
          type: string
          enum:
            - mor
            - crypto
      required:
        - id
        - org_id
        - user_id
        - secure_link_id
        - amount
        - currency
        - description
        - metadata
        - checkout_fields
        - webhook_url
        - success_url
        - cancel_url
        - tax_rate_id
        - status
        - payment_count
        - supported_networks
        - expires_at
        - created_at
        - updated_at
        - name
        - image_url
        - max_uses
        - seller_mode
        - type
        - billing_interval
        - environment
        - checkoutUrl
        - sellerMode
    LinkTransactionRow:
      type: object
      description: >-
        A raw transaction row as nested under a Payment Link or Checkout detail
        response: same shape as a Transaction, but without the computed `money`
        breakdown.
      additionalProperties: true
      properties:
        id:
          type: string
          format: uuid
        direction:
          type: string
          enum:
            - inbound
            - outbound
        status:
          type: string
        amount:
          type: number
        payment_method:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
      required:
        - id
        - direction
        - status
        - amount
        - created_at
    Error:
      type: object
      description: >-
        Every non-2xx response is JSON in this shape. Every response (success or
        error) also carries an `x-request-id` response header; send that header
        on your request to have your own id echoed back, otherwise the server
        mints one. On errors the same id is repeated in the `requestId` body
        field.
      properties:
        statusCode:
          type: integer
          description: Same as the HTTP status code.
        message:
          description: >-
            Human-readable. A validation failure (400) returns an array of
            per-field messages instead of one string.
          anyOf:
            - type: string
            - type: array
              items:
                type: string
        errors:
          type: array
          description: >-
            Present on 400 validation failures: one entry per invalid field. The
            flat human-readable strings stay in `message` for back-compat; this
            is the machine-readable, per-field view.
          items:
            type: object
            properties:
              field:
                type: string
                description: >-
                  Name of the invalid field, dot-notated for nested properties
                  (e.g. `checkoutFields.0.type`).
              message:
                type: string
                description: Validation messages for that field, joined with `, `.
            required:
              - field
              - message
        requestId:
          type: string
          description: >-
            Correlation id, identical to the `x-request-id` response header.
            Include it when contacting support. On success it is available on
            the header only, not the body.
        timestamp:
          type: string
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    CheckoutField:
      type: object
      description: An extra field collected at checkout.
      properties:
        key:
          type: string
          maxLength: 64
        label:
          type: string
          maxLength: 128
        type:
          type: string
          enum:
            - text
            - email
            - tel
            - select
        required:
          type: boolean
        placeholder:
          type: string
          maxLength: 256
        options:
          type: array
          items:
            type: string
          description: 'For `type: select` only.'
      required:
        - key
        - label
        - type
        - required
  responses:
    Unauthorized:
      description: Missing or invalid `x-api-key`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Invalid API key
            timestamp: '2026-08-06T12:00:00.000Z'
    Forbidden:
      description: The key is valid but the resource belongs to a different organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            message: Payment link belongs to another organization
            timestamp: '2026-08-06T12:00:00.000Z'
    NotFound:
      description: >-
        Resource not found (or not visible to your key; the two are not
        distinguished).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            message: Payment link not found
            timestamp: '2026-08-06T12:00:00.000Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your secret key, from app.agentaos.ai -> Settings -> Developers -> API
        Keys. The key's prefix is both its identity and its environment:
        `sk_test_...` (sandbox, free, no verification) or `sk_live_...` (real
        money, requires business verification). A missing or invalid key returns
        401.

````