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

# List consumption attempts for a payment link

> Returns every attempt to pay this link, newest first. One record is written
each time a customer opens the link's `hostedUrl` and a checkout session is
created for them, so this is the audit trail behind the link's `paidCount`
and `failedCount`.

This endpoint is not paginated — all attempts are returned.



## OpenAPI

````yaml /openapi/payment-acceptance.json get /payment-links/{link_id}/consumptions
openapi: 3.1.0
info:
  title: lite - Payment Acceptance
  version: 1.0.0
servers:
  - url: https://api.lite.sa/api/v1
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: 3DS Authentication
    description: Standalone payer authentication via the 3DS standard
  - name: Hosted Checkout
    description: Create, manage and deploy hosted checkout pages
  - name: Payment Links
    description: Create, manage and audit shareable payment links
  - name: Server-to-Server Payments
    description: Direct payment API for server-side integrations
paths:
  /payment-links/{link_id}/consumptions:
    get:
      tags:
        - Payment Links
      summary: List consumption attempts for a payment link
      description: >-
        Returns every attempt to pay this link, newest first. One record is
        written

        each time a customer opens the link's `hostedUrl` and a checkout session
        is

        created for them, so this is the audit trail behind the link's
        `paidCount`

        and `failedCount`.


        This endpoint is not paginated — all attempts are returned.
      operationId: lite.paymentLinks.listPaymentLinkConsumptions
      parameters:
        - $ref: '#/components/parameters/x-correlation-id'
        - $ref: '#/components/parameters/link_id'
      responses:
        '200':
          $ref: '#/components/responses/PaymentLinkConsumptionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    x-correlation-id:
      name: x-correlation-id
      in: header
      required: false
      description: >-
        Unique identifier for request tracing. Generated by the client or server
        if not provided.
      schema:
        type: string
        format: uuid
        example: 550e8400-e29b-41d4-a716-446655440000
    link_id:
      name: link_id
      in: path
      required: true
      description: Unique identifier of the payment link
      schema:
        type: string
        format: uuid
        example: 550e8400-e29b-41d4-a716-446655440000
  responses:
    PaymentLinkConsumptionListResponse:
      description: Consumption attempts retrieved successfully.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentLinkConsumptionList'
    Unauthorized:
      description: |
        Authentication failed — missing or invalid token.

        Returned when:
        - The JWT bearer token is missing, expired, or has an invalid signature
        - The API key is missing or invalid
        - The authenticated session token is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >
        Request blocked by security policy.


        Returned when:

        - A security threat is detected (SQL injection, XSS, NoSQL injection,
        LDAP injection, path traversal)

        - Header injection or suspicious headers are detected

        - The request payload exceeds the maximum allowed size

        - Geo-region validation fails (user country does not match client
        region)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: |
        The requested resource was not found.

        Returned when:
        - The specified resource ID does not exist
        - The path does not match any known endpoint
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: >
        An unexpected error occurred on the server.


        Returned when an unhandled exception or infrastructure failure prevents
        the request from being processed. Retry the request with exponential
        backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    PaymentLinkConsumptionList:
      type: object
      description: >-
        All consumption attempts for a payment link, newest first. This endpoint
        is

        not paginated — `total` always equals the length of `items`.
      required:
        - items
        - total
      properties:
        items:
          type: array
          description: Consumption attempts, ordered by consumption time descending
          items:
            $ref: '#/components/schemas/PaymentLinkConsumption'
        total:
          type: integer
          description: Number of returned attempts
          example: 3
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - timestamp
          properties:
            code:
              type: string
              description: Error code identifying the type of error
              example: PAYMENT_DETAILS_MISMATCH
            message:
              type: string
              description: Human-readable error description
              example: The request was invalid or malformed
            details:
              type: object
              description: Additional error details
            correlationId:
              type: string
              format: uuid
              description: Correlation ID for tracking the request
              example: 550e8400-e29b-41d4-a716-446655440000
            timestamp:
              type: string
              format: date-time
              description: Timestamp when the error occurred
              example: '2024-12-16T10:30:00.000Z'
    PaymentLinkConsumption:
      type: object
      description: >-
        A single attempt to pay a link. One consumption record is written each
        time a

        customer opens `hostedUrl` and a checkout session is successfully
        created.


        > **Casing note:** camelCase response, as with `PaymentLink`.
      required:
        - id
        - linkId
        - sessionId
        - status
        - consumedAt
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique consumption identifier
          example: 9b2e4c71-8a3f-4d05-91e6-7c0b5a2f8d14
        linkId:
          type: string
          format: uuid
          description: Payment link this attempt belongs to
          example: 550e8400-e29b-41d4-a716-446655440000
        sessionId:
          type: string
          format: uuid
          description: Checkout session spawned for this attempt
          example: 1c7d3e90-4b62-4f18-a5d3-6e9f0a2b8c47
        hostedUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Hosted checkout URL the customer was redirected to for this attempt
          example: https://checkout.lite.sa/ses_a1b2c3d4e5f6
        status:
          type: string
          description: |-
            Outcome of the attempt.

            - `PENDING` — session created, no terminal payment status yet.
            - `PAID` — the payment succeeded.
            - `FAILED` — the payment reached a failed terminal status.
            - `EXPIRED` — the session expired before the customer completed it.
          enum:
            - PENDING
            - PAID
            - FAILED
            - EXPIRED
          example: PAID
        consumedAt:
          type: string
          format: date-time
          description: When the customer opened the link and the slot was reserved
          example: '2026-06-04T09:11:02.000Z'
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the attempt reached a terminal status, or `null` while still
            `PENDING`
          example: '2026-06-04T09:12:44.000Z'
        createdAt:
          type: string
          format: date-time
          example: '2026-06-04T09:11:02.000Z'
        updatedAt:
          type: string
          format: date-time
          example: '2026-06-04T09:12:44.000Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for service-to-service or merchant authentication.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token obtained from user authentication. Passed as
        Authorization: Bearer <token>.

````