# List single-use payment links

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /payment-links:
    get:
      summary: List single-use payment links
      deprecated: false
      description: >
        Returns the authenticated merchant's non-reusable payment links, ordered
        by creation (newest first).


        Supported filters:

        - status: ACTIVE, INACTIVE, or EXPIRED (invalid values are ignored).

        - externalReference: exact match on the merchant's external id.
      tags:
        - PaymentLinks
        - PaymentLinks
      parameters:
        - name: page
          in: query
          description: ''
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: pageSize
          in: query
          description: ''
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: status
          in: query
          description: Filter by link status. Invalid values are ignored.
          required: false
          schema: &ref_1
            $ref: '#/components/schemas/PaymentLinkStatus'
        - name: externalReference
          in: query
          description: Merchant's external reference (exact match).
          required: false
          schema:
            type: string
      responses:
        '200':
          description: List returned successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  paymentLinks:
                    type: array
                    items:
                      $ref: '#/components/schemas/PaymentLinkSummary'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                required:
                  - success
                  - paymentLinks
                  - pagination
                x-apidog-orders:
                  - success
                  - paymentLinks
                  - pagination
                x-apidog-ignore-properties: []
              example:
                success: true
                paymentLinks:
                  - id: pl_123
                    externalReference: 1b4db7eb-4057-5ddf-91e0-36dec72071f5
                    title: Payment Title
                    description: Payment Description
                    amount: 129.9
                    currency: USD
                    status: ACTIVE
                    isMultiUse: false
                    isActive: true
                    isExpired: false
                    expiresAt: '2025-01-31T23:59:59.000Z'
                    url: >-
                      https://app.sxdigitalpay.com/quote/[merchantShortName]/[paymentLinkId]
                    shortUrl: https://sxpay.me/[paymentLinkShortId]
                    metadata: null
                    callbackUrl: https://merchant.com/checkout/success
                    createdAt: '2024-12-05T18:20:00.000Z'
                pagination:
                  page: 1
                  pageSize: 20
                  total: 1
                  totalPages: 1
          headers:
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            X-RateLimit-Reset:
              schema:
                type: string
          x-apidog-name: ''
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/Error'
              examples:
                '4':
                  summary: missing
                  value:
                    error: API Key not found
                '5':
                  summary: invalid
                  value:
                    error: Invalid API Key
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: Merchant is not active.
          content:
            application/json:
              schema: *ref_0
              example:
                error: Inactive Merchant
          headers: {}
          x-apidog-name: Forbidden
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema: *ref_0
              example:
                error: Too many requests. Try again in 60 seconds.
          headers:
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            X-RateLimit-Reset:
              schema:
                type: string
            Retry-After:
              schema:
                type: string
          x-apidog-name: TooManyRequests
      security:
        - ApiKeyAuth: []
          x-apidog:
            schemeGroups:
              - id: Fa631OHGYK7enm8xkuS97
                schemeIds:
                  - ApiKeyAuth
            required: true
            use:
              id: Fa631OHGYK7enm8xkuS97
            scopes:
              Fa631OHGYK7enm8xkuS97:
                ApiKeyAuth: []
      x-apidog-folder: PaymentLinks
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1147027/apis/api-25254363-run
components:
  schemas:
    PaymentLinkStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
        - EXPIRED
      x-apidog-folder: ''
    Pagination:
      type: object
      properties:
        page:
          type: integer
        pageSize:
          type: integer
        total:
          type: integer
        totalPages:
          type: integer
      required:
        - page
        - pageSize
        - total
        - totalPages
      x-apidog-orders:
        - page
        - pageSize
        - total
        - totalPages
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    PaymentLinkSummary:
      allOf:
        - $ref: '#/components/schemas/PaymentLinkBase'
      x-apidog-folder: ''
    PaymentLinkBase:
      type: object
      properties:
        id:
          type: string
        externalReference:
          type: string
          nullable: true
        title:
          type: string
        description:
          type: string
          nullable: true
        amount:
          type: number
          format: double
          description: Amount in the merchant's currency.
        currency:
          type: string
          description: Merchant currency (e.g., USD, EUR, GBP).
        status: *ref_1
        isMultiUse:
          type: boolean
          description: Always false for this API.
        isActive:
          type: boolean
          description: True only if status is ACTIVE and expiresAt has not passed.
        isExpired:
          type: boolean
        expiresAt:
          type: string
          format: date-time
          nullable: true
        url:
          type: string
          format: uri
          description: >-
            The complete URL of the quotation page to which the user should be
            directed to proceed with the payment.
        shortUrl:
          type: string
          format: uri
          description: Short URL for the `url` field.
        metadata:
          description: JSON object stored with the link.
          type: object
          additionalProperties: true
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
          nullable: true
        callbackUrl:
          type: string
          format: uri
          description: Optional redirect URL after a successful payment.
          nullable: true
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - title
        - amount
        - currency
        - status
        - isMultiUse
        - isActive
        - isExpired
        - url
        - shortUrl
      x-apidog-orders:
        - id
        - externalReference
        - title
        - description
        - amount
        - currency
        - status
        - isMultiUse
        - isActive
        - isExpired
        - expiresAt
        - url
        - shortUrl
        - metadata
        - callbackUrl
        - createdAt
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      x-apidog-orders:
        - error
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: >-
        API key provisioned per merchant. Authorization: Bearer <api-key> is
        also accepted.
    WebhookSignature:
      type: apikey
      in: header
      name: x-sxpay-signature
      description: >
        HMAC-SHA256 signature calculated over "{timestamp}.{rawBody}" using the
        link's webhookSecret. Includes header x-sxpay-timestamp (epoch ms) for
        replay protection. These headers are only sent when a webhookSecret is
        configured for the link.
servers:
  - url: https://sandbox.sxdigitalpay.com/api/v1
    description: Sandbox
  - url: https://app.sxdigitalpay.com/api/v1
    description: Prod
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: aSabarTaLKMkoazJDLTtw
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: aSabarTaLKMkoazJDLTtw
      scopes:
        aSabarTaLKMkoazJDLTtw:
          ApiKeyAuth: []

```
