> ## 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.

# Request a payment report

> Accepts the full payment-list filter set by composition, so a report and
the payments list can never diverge. Freezes the upper date bound to the
request time, dedupes identical requests on a canonical hash of merchant +
format + filters, then runs generation asynchronously. There is no
request-time row cap: an over-large request is accepted and later fails
as MAX_ROWS_EXCEEDED, visible on the report row.




## OpenAPI

````yaml /openapi/payment-acceptance.json post /payments/reports
openapi: 3.1.0
info:
  title: lite - Payment Acceptance
  version: 1.0.0
servers:
  - url: https://api.lite.sa
    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:
  /payments/reports:
    post:
      tags:
        - Server-to-Server Payments
      summary: Request a payment report
      description: >
        Accepts the full payment-list filter set by composition, so a report and

        the payments list can never diverge. Freezes the upper date bound to the

        request time, dedupes identical requests on a canonical hash of merchant
        +

        format + filters, then runs generation asynchronously. There is no

        request-time row cap: an over-large request is accepted and later fails

        as MAX_ROWS_EXCEEDED, visible on the report row.
      operationId: lite.server-to-server.createPaymentReport
      parameters:
        - $ref: '#/components/parameters/x-correlation-id'
      requestBody:
        $ref: '#/components/requestBodies/CreateReport'
      responses:
        '200':
          $ref: '#/components/responses/ReportDeduped'
        '202':
          $ref: '#/components/responses/ReportAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
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
  requestBodies:
    CreateReport:
      description: Request a payment report
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateReportRequest'
  responses:
    ReportDeduped:
      description: >-
        Deduped to an existing report matching the same merchant, format, and
        filters. Adds row_count / completed_at / expires_at when that report is
        already COMPLETED.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Report'
    ReportAccepted:
      description: New or restarted report, queued for generation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Report'
    BadRequest:
      description: >
        The request was invalid or malformed.


        Returned when:

        - Request validation fails (missing required fields, invalid field
        formats)

        - Payment details do not match the session (amount, currency, order
        reference mismatch)

        - The operation is not allowed given the current resource state
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    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'
  schemas:
    CreateReportRequest:
      type: object
      required:
        - format
        - recipient_email
      properties:
        format:
          type: string
          enum:
            - CSV
          description: Report file format. Only CSV is supported in v1.
          example: CSV
        filters:
          $ref: '#/components/schemas/ReportFilters'
        recipient_email:
          type: string
          format: email
          description: Email address notified once the report completes.
          example: finance@merchant.example
    Report:
      type: object
      required:
        - id
        - status
        - created_at
      properties:
        id:
          type: string
          format: uuid
          description: Report identifier
          example: 3f1c0b2a-0e5d-4a1b-9c2f-6a7b8c9d0e1f
        status:
          type: string
          enum:
            - QUEUED
            - RUNNING
            - COMPLETED
            - FAILED
          example: QUEUED
        created_at:
          type: string
          format: date-time
          example: '2026-09-06T12:00:00.000Z'
        row_count:
          type: integer
          description: Exact row count. Present when a deduped report is already COMPLETED.
          example: 1284
        completed_at:
          type: string
          format: date-time
          example: '2026-09-06T12:03:11.000Z'
        expires_at:
          type: string
          format: date-time
          example: '2026-12-05T12:03:11.000Z'
    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'
    ReportFilters:
      type: object
      description: >-
        Same filter set accepted by GET /payments. Omit entirely to include
        every payment for the merchant in the report (still bounded by the
        frozen upper date and the row ceiling).
      properties:
        status:
          type: array
          items:
            type: string
            enum:
              - CREATED
              - PENDING
              - AUTHORIZED
              - FAILED
              - EXPIRED
              - AUTHORIZATION_REVERSED
              - VOIDED
              - PARTIALLY_CAPTURED
              - CAPTURED
              - REFUNDED
              - DISPUTED
              - DISPUTE_CHALLENGED
              - ARBITRATION_INITIATED
              - ARBITRATION_LOST
              - CHARGEDBACK
              - REQUIRES_ACTION
          description: Filter by payment status
        payment_method:
          type: array
          items:
            type: string
            enum:
              - CARD
              - APPLE_PAY
              - GOOGLE_PAY
              - SAMSUNG_PAY
              - MDES
              - SCOF
              - VTS
              - VCOF
              - IBAN
          description: Filter by payment method
        card_brand:
          type: array
          items:
            type: string
            enum:
              - MADA
              - VISA
              - MASTERCARD
              - DISCOVER
              - JCB
              - UPI
              - AMEX
              - GCCNET
              - MAESTRO
              - UNKNOWN
          description: Filter by card brand
        channel_type:
          type: string
          description: Filter by channel type
        channel_id:
          type: string
          description: Filter by channel id
        from_date:
          type: string
          format: date-time
          description: Start date filter (ISO 8601)
        to_date:
          type: string
          format: date-time
          description: >-
            End date filter (ISO 8601). On the create-report request this is
            frozen to the request time when omitted, so an identical request
            replayed later still dedupes to the same row set.
        amount_min:
          type: integer
          minimum: 0
          description: Minimum amount, minor units
        amount_max:
          type: integer
          minimum: 0
          description: Maximum amount, minor units
        customer_id:
          type: string
          description: Filter by customer id
        decline_reason:
          type: string
          description: Filter by decline reason
        last_four:
          type: string
          pattern: ^\d{4}$
          description: Filter by the last 4 digits of the card
        rrn:
          type: string
          description: Filter by retrieval reference number
        approval_code:
          type: string
          description: Filter by approval code
  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>.

````