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

# List Products

> Retrieve a paginated list of products with filtering and search capabilities

### Query Parameters

<ParamField query="limit" type="integer">
  Number of products to return (default: 20, max: 100)
</ParamField>

<ParamField query="offset" type="integer">
  Number of products to skip (for pagination)
</ParamField>

<ParamField query="cursor" type="string">
  Cursor for pagination (alternative to offset)
</ParamField>

<ParamField query="status" type="string">
  Filter by status: "active", "draft", or "archived"
</ParamField>

<ParamField query="category" type="string">
  Filter by product category
</ParamField>

<ParamField query="brand" type="string">
  Filter by brand name
</ParamField>

<ParamField query="search" type="string">
  Search products by name, SKU, or description
</ParamField>

<ParamField query="sku" type="string">
  Filter by exact SKU match
</ParamField>

<ParamField query="tags" type="string">
  Filter by tags (comma-separated)
</ParamField>

<ParamField query="price_min" type="integer">
  Minimum price filter (in cents)
</ParamField>

<ParamField query="price_max" type="integer">
  Maximum price filter (in cents)
</ParamField>

<ParamField query="in_stock" type="boolean">
  Filter products with available inventory
</ParamField>

<ParamField query="low_stock" type="boolean">
  Filter products below low stock threshold
</ParamField>

<ParamField query="created_after" type="string">
  Filter products created after this date (ISO 8601)
</ParamField>

<ParamField query="created_before" type="string">
  Filter products created before this date (ISO 8601)
</ParamField>

<ParamField query="updated_after" type="string">
  Filter products updated after this date (ISO 8601)
</ParamField>

<ParamField query="sort_by" type="string">
  Sort field: "created\_at", "updated\_at", "name", "price", "sku" (default: "created\_at")
</ParamField>

<ParamField query="sort_order" type="string">
  Sort order: "asc" or "desc" (default: "desc")
</ParamField>

<ParamField query="include_variants" type="boolean">
  Include variant details in response (default: false)
</ParamField>

<ParamField query="include_inventory" type="boolean">
  Include inventory summary (default: false)
</ParamField>

### Response

<ResponseField name="object" type="string">
  Always "list"
</ResponseField>

<ResponseField name="data" type="array">
  Array of product objects
</ResponseField>

<ResponseField name="has_more" type="boolean">
  Whether there are more products to retrieve
</ResponseField>

<ResponseField name="total_count" type="integer">
  Total number of products matching the filters
</ResponseField>

<ResponseField name="next_cursor" type="string">
  Cursor for retrieving the next page
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request GET 'https://api.stateset.com/v1/products?limit=10&status=active&category=Electronics' \
  --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```graphQL GraphQL theme={null}
  query ListProducts(
    $limit: Int
    $offset: Int
    $status: ProductStatus
    $category: String
    $search: String
  ) {
    products(
      limit: $limit
      offset: $offset
      status: $status
      category: $category
      search: $search
    ) {
      data {
        id
        name
        sku
        category
        brand
        status
        price {
          amount
          currency
        }
        inventory_summary {
          total_quantity
          available_quantity
        }
      }
      has_more
      total_count
    }
  }
  ```

  ```javascript Node.js theme={null}
  const products = await stateset.products.list({
    limit: 10,
    status: 'active',
    category: 'Electronics',
    in_stock: true,
    sort_by: 'price',
    sort_order: 'asc'
  });

  // Iterate through all products
  for await (const product of stateset.products.list()) {
    console.log(product.id, product.name);
  }
  ```

  ```python Python theme={null}
  products = stateset.products.list(
      limit=10,
      status='active',
      category='Electronics',
      in_stock=True,
      sort_by='price',
      sort_order='asc'
  )

  # Iterate through all products
  for product in stateset.products.list():
      print(product.id, product.name)
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "object": "list",
    "data": [
      {
        "id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
        "object": "product",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T14:22:00Z",
        "name": "Wireless Bluetooth Headphones",
        "sku": "WBH-001",
        "description": "Premium noise-cancelling wireless headphones with 30-hour battery life",
        "category": "Electronics",
        "brand": "AudioTech",
        "status": "active",
        "price": {
          "amount": 14999,
          "currency": "USD",
          "compare_at": 19999
        },
        "inventory_summary": {
          "total_quantity": 150,
          "available_quantity": 145,
          "reserved_quantity": 5
        },
        "tags": ["electronics", "audio", "wireless", "bluetooth"]
      },
      {
        "id": "prod_1234567890abcdef",
        "object": "product",
        "created_at": "2024-01-14T09:15:00Z",
        "updated_at": "2024-01-14T09:15:00Z",
        "name": "USB-C Charging Cable",
        "sku": "USB-C-001",
        "description": "Fast charging USB-C cable, 6ft length",
        "category": "Electronics",
        "brand": "TechConnect",
        "status": "active",
        "price": {
          "amount": 1299,
          "currency": "USD",
          "compare_at": null
        },
        "inventory_summary": {
          "total_quantity": 500,
          "available_quantity": 487,
          "reserved_quantity": 13
        },
        "tags": ["electronics", "cables", "charging"]
      }
    ],
    "has_more": true,
    "total_count": 42,
    "next_cursor": "eyJpZCI6InByb2RfMTIzNDU2Nzg5MGFiY2RlZiJ9"
  }
  ```
</ResponseExample>
