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

# List products

> List products with pagination, filtering, and sorting. Results are automatically filtered by the authenticated merchant unless a different merchantId is provided in the filter.



## OpenAPI

````yaml /api-reference/link-product-openapi.json post /products/list
openapi: 3.0.0
info:
  title: Link Product API
  description: RESTful API for managing payment links, customers, and invoices
  version: 1.0.0
servers:
  - url: https://api.sandbox.cheqpay.mx/lps
    description: Sandbox environment
  - url: https://prod.cheqpay.mx/lps
    description: Production environment
security: []
tags:
  - name: Payment Links
    description: Operations related to payment links
  - name: Invoices
    description: Invoice creation and retrieval
  - name: Products
    description: Product management operations
paths:
  /products/list:
    post:
      tags:
        - Products
      summary: List products
      description: >-
        List products with pagination, filtering, and sorting. Results are
        automatically filtered by the authenticated merchant unless a different
        merchantId is provided in the filter.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListProductsRequest'
            example:
              page: 1
              limit: 10
              filter:
                search: Premium
              sort:
                field: createdAt
                order: desc
      responses:
        '200':
          description: Products retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListProductsResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ListProductsRequest:
      type: object
      description: Request to list products with pagination and filters
      properties:
        page:
          type: integer
          minimum: 1
          default: 1
          description: Page number (1-indexed)
        limit:
          type: integer
          minimum: 1
          maximum: 100
          default: 10
          description: Number of items per page
        filter:
          type: object
          description: Filter criteria
          properties:
            search:
              type: string
              description: Search term to filter by product name (case-insensitive)
            status:
              type: string
              enum:
                - active
                - inactive
              description: Product status
            merchantId:
              type: string
              pattern: ^[a-f\d]{24}$
              description: >-
                Merchant ID to filter by (defaults to authenticated merchant if
                not provided)
        sort:
          type: object
          description: Sort criteria
          properties:
            field:
              type: string
              enum:
                - createdAt
                - name
                - price
                - status
                - updatedAt
              default: createdAt
              description: Field to sort by
            order:
              type: string
              enum:
                - asc
                - desc
              default: desc
              description: Sort order
    ListProductsResponse:
      type: object
      description: Paginated response containing products
      required:
        - data
        - currentPage
        - totalPages
        - totalCount
        - limit
      properties:
        data:
          type: array
          description: Array of products
          items:
            $ref: '#/components/schemas/Product'
        currentPage:
          type: integer
          description: Current page number
          example: 1
        totalPages:
          type: integer
          description: Total number of pages
          example: 5
        totalCount:
          type: integer
          description: Total number of products matching the filter
          example: 47
        limit:
          type: integer
          description: Number of items per page
          example: 10
    ValidationError:
      type: object
      description: Validation error response
      properties:
        message:
          type: string
          description: Error message
          example: Validation failed
    UnauthorizedError:
      type: object
      description: Unauthorized error response
      properties:
        message:
          type: string
          description: Error message
          example: Unauthorized
    InternalError:
      type: object
      description: Internal server error response
      properties:
        message:
          type: string
          description: Error message
          example: Internal server error
    Product:
      type: object
      description: Product entity
      required:
        - _id
        - merchantId
        - name
        - price
      properties:
        _id:
          type: string
          description: MongoDB ObjectId
          pattern: ^[a-f\d]{24}$
        id:
          type: string
          description: Custom product identifier
        merchantId:
          type: string
          pattern: ^[a-f\d]{24}$
          description: Merchant identifier
        name:
          type: string
          description: Product name
        description:
          type: string
          description: Product description
        price:
          type: number
          minimum: 0
          description: Product price
        status:
          type: string
          enum:
            - active
            - inactive
          default: active
          description: Product status
        imageUrl:
          type: string
          description: Product image URL
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
        deletedAt:
          type: string
          format: date-time
          nullable: true
          description: Soft deletion timestamp (null if not deleted)
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for merchant authentication

````