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

# List all categories

> Returns a list of your product categories. The categories are returned sorted by creation date, with the most recently created categories appearing first.



## OpenAPI

````yaml get /catalog/marketplace/categories
openapi: 3.1.0
info:
  version: '1.0'
  title: CE Storefront APIs
  summary: Customer-facing e-commerce API for building exceptional shopping experiences
  description: >-
    Public-facing API for Commerce Engine storefronts, enabling seamless
    shopping experiences with product browsing, cart management, checkout
    processing, user accounts, and order tracking. Perfect for building web,
    mobile, and headless commerce applications.
  contact:
    name: Support
    email: support@commercengine.io
    url: https://www.commercengine.io/contact-us
  license:
    url: https://www.commercengine.io/contact-us
    name: All Rights Reserved
servers:
  - url: https://staging.api.commercengine.io/api/v1/{store_id}/storefront
    description: Staging Server
    variables:
      store_id:
        description: Store ID
        default: store_id
    x-speakeasy-server-id: staging
  - url: https://prod.api.commercengine.io/api/v1/{store_id}/storefront
    description: Prod Server
    variables:
      store_id:
        description: Store ID
        default: store_id
    x-speakeasy-server-id: prod
security: []
tags:
  - name: Analytics
    description: Analytics
  - name: Auth
    description: auth
  - name: Campaigns
    description: Campaigns
  - name: Carts
    description: Carts
  - name: Catalog
    description: Catalog
  - name: Common
    description: Common
  - name: Coupons & promotions
    description: Coupons & promotions
  - name: Customers
    description: Customers
  - name: Juspay
    description: Juspay Payments
  - name: KYC
    description: KYC
  - name: Marketplace
    description: Marketplace
  - name: Orders
    description: Orders
  - name: Others
    description: Others
  - name: Payments
    description: Payments
  - name: PayU
    description: PayU Payments
  - name: POS
    description: POS
  - name: Shipping
    description: Shipping
  - name: Store
    description: Store
  - name: Subscriptions
    description: Subscriptions
externalDocs:
  url: https://llm-docs.commercengine.io
  description: Commerce Engine API Reference Documentation
paths:
  /catalog/marketplace/categories:
    get:
      tags:
        - Marketplace
      summary: List all categories
      description: >-
        Returns a list of your product categories. The categories are returned
        sorted by creation date, with the most recently created categories
        appearing first.
      operationId: list-marketplace-categories
      parameters:
        - $ref: '#/components/parameters/searchKeyword'
        - $ref: '#/components/parameters/sortingParam'
        - name: nested_level
          in: query
          description: return child categories up to nesting level
          schema:
            type: integer
            default: 0
            maximum: 4
            minimum: 0
        - name: parent_category_id
          in: query
          description: To return child categories using category id.
          schema:
            type: string
            example: 01JWZW41Y3FBKTZSP399SKANY7
            examples:
              - 01JWZW41Y3FBKTZSP399SKANY7
        - name: parent_category_slug
          in: query
          description: To return child categories using category slug
          schema:
            type: string
            example: vitals
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - success
                  - content
                properties:
                  message:
                    type: string
                    examples:
                      - all categories
                  success:
                    type: boolean
                  content:
                    properties:
                      categories:
                        type: array
                        items:
                          $ref: '#/components/schemas/ProductCategory'
                      pagination:
                        $ref: '#/components/schemas/Pagination'
                    required:
                      - categories
                      - pagination
                    type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - Authorization: []
      externalDocs:
        url: >-
          https://llm-docs.commercengine.io/storefront/operations/list-marketplace-categories
        description: API reference for the list-marketplace-categories operation
components:
  parameters:
    searchKeyword:
      name: search
      in: query
      description: search keyword
      required: false
      schema:
        type: string
    sortingParam:
      name: sort_by
      in: query
      description: 'JSON string format: {"field1":"asc", "field2":"desc"}'
      required: false
      schema:
        description: >-
          json string in format {'field_name':'asc', 'other_field_name':'desc',
          ...}
        type: string
        examples:
          - '{"country":"asc","city":"asc","population":"desc"}'
  schemas:
    ProductCategory:
      title: ProductCategory
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/ProductCategory
        description: API reference for the ProductCategory schema
      allOf:
        - $ref: '#/components/schemas/Category'
        - type: object
          properties:
            child_categories:
              type:
                - array
                - 'null'
              items:
                $ref: '#/components/schemas/Category'
          required:
            - child_categories
      examples: []
    Pagination:
      description: pagination metadata structure
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/Pagination
        description: API reference for the Pagination schema
      required:
        - total_records
        - total_pages
        - limit
        - next_page
      properties:
        total_records:
          type: integer
        total_pages:
          type: integer
        previous_page:
          type:
            - integer
            - 'null'
        limit:
          type: integer
        next_page:
          type:
            - integer
            - 'null'
      examples:
        - total_records: 100
          total_pages: 4
          previous_page: null
          next_page: 2
          limit: 25
    Category:
      title: Category
      type: object
      externalDocs:
        url: https://llm-docs.commercengine.io/storefront/schemas/Category
        description: API reference for the Category schema
      required:
        - id
        - name
        - slug
        - description
        - parent_category_id
        - product_count
        - active
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
          readOnly: true
        slug:
          type: string
          readOnly: true
        description:
          type:
            - string
            - 'null'
        parent_category_id:
          type:
            - string
            - 'null'
          readOnly: true
        product_count:
          type: integer
        active:
          type: boolean
      examples: []
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
              - code
            properties:
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              code:
                type: string
              error:
                type: object
    Unauthorized:
      description: Not authorized for given operation on the Resource
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
              - code
            properties:
              message:
                type: string
                examples:
                  - Not authorized for given operation on the Resource.
                x-speakeasy-error-message: true
              success:
                type: boolean
                default: false
              code:
                type: string
                examples:
                  - unauthorized
    NotFound:
      description: Requested resource not found
      content:
        application/json:
          schema:
            type: object
            required:
              - message
              - success
              - code
            properties:
              message:
                type: string
                x-speakeasy-error-message: true
              success:
                type: boolean
              code:
                type: string
  securitySchemes:
    Authorization:
      type: http
      description: Access token
      scheme: bearer

````