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

# Create a Product

> Create a product.

[The Products Data Model](https://docs.rootfi.dev/api-reference/customers/overview) is designed to streamline the management and retrieval of products-related information across various accounting platforms.


## OpenAPI

````yaml POST /ecommerce/products
openapi: 3.0.1
info:
  title: rootfi
  version: v3
servers:
  - url: https://api.rootfi.dev/v3
    description: global
  - url: https://api.sa.rootfi.dev/v3
    description: saudi
security: []
paths:
  /ecommerce/products:
    post:
      tags:
        - EcommerceProducts
      summary: Create a Product
      description: Create a product.
      operationId: ecommerce_products_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ecommerceCreateProductRequest'
            examples:
              Example1:
                value:
                  company_id: 123
                  data:
                    - name: John Doe
                      description: John Doe
                      status: ACTIVE
                      created_at: '2024-01-22T05:07:31.465Z'
                      updated_at: '2024-01-22T05:07:31.000Z'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ecommerceCreateProductResponse'
              examples:
                Example1:
                  value:
                    data:
                      rootfi_id: 157
                      rootfi_deleted_at: null
                      rootfi_created_at: '2024-01-22T05:07:31.465Z'
                      rootfi_updated_at: '2024-01-22T05:07:31.000Z'
                      rootfi_company_id: 1089
                      platform_id: '123456_1'
                      platform_unique_id: '123456'
                      name: John Doe
                      description: John Doe
                      status: ACTIVE
                      created_at: '2024-01-22T05:07:31.465Z'
                      updated_at: '2024-01-22T05:07:31.000Z'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RootFiAPIResponseType'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ecommerceCreateProductRequest:
      title: ecommerceCreateProductRequest
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ecommerceProductsFields'
          description: The data of the products endpoint
      required:
        - data
      allOf:
        - $ref: '#/components/schemas/CompanyIDRequestField'
    ecommerceCreateProductResponse:
      title: ecommerceCreateProductResponse
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ecommerceProductObject'
          nullable: true
          description: The data of the products endpoint
        sync_id:
          type: string
          nullable: true
          description: The sync id of the request
    RootFiAPIResponseType:
      title: RootFiAPIResponseType
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RootFiAPIResponseErrorType'
          description: The error message
      required:
        - error
    ecommerceProductsFields:
      title: ecommerceProductsFields
      type: object
      properties:
        name:
          type: string
          nullable: true
          description: The name of the product
        description:
          type: string
          nullable: true
          description: The description of the product
        status:
          $ref: '#/components/schemas/BaseStatus'
          nullable: true
          description: The status of the product
        sku:
          type: string
          nullable: true
          description: The SKU (Stock Keeping Unit) of the product
        created_at:
          type: string
          nullable: true
          description: The date the product was created
        updated_at:
          type: string
          nullable: true
          description: The date the product was updated
    CompanyIDRequestField:
      title: CompanyIDRequestField
      type: object
      properties:
        company_id:
          type: integer
          description: The ID of the company in the accounting platform
        run_async:
          type: boolean
          nullable: true
          description: Run the request asynchronously
      required:
        - company_id
    ecommerceProductObject:
      title: ecommerceProductObject
      type: object
      properties: {}
      allOf:
        - $ref: '#/components/schemas/AccountingRootFiBaseFields'
        - $ref: '#/components/schemas/ecommerceProductsFields'
    RootFiAPIResponseErrorType:
      title: RootFiAPIResponseErrorType
      type: object
      properties:
        message:
          type: string
          description: The error message
        code:
          type: string
          description: The error code
        field:
          type: string
          description: The status of the error
      required:
        - message
        - code
        - field
    BaseStatus:
      title: BaseStatus
      type: string
      enum:
        - ACTIVE
        - ARCHIVED
        - UNKNOWN
    AccountingRootFiBaseFields:
      title: AccountingRootFiBaseFields
      type: object
      properties:
        rootfi_id:
          type: number
          format: double
          description: The unique ID we assign for that data's information
          example: 157
        rootfi_deleted_at:
          type: string
          format: date-time
          nullable: true
          description: The date at which the data was deleted in the accounting platform
        rootfi_created_at:
          type: string
          format: date-time
          description: The date at which RootFi first synced this data
          example: '2024-01-22T05:07:31.465Z'
        rootfi_updated_at:
          type: string
          format: date-time
          description: The latest date at which RootFi updated this data
          example: '2024-01-22T05:07:31.000Z'
        rootfi_company_id:
          type: number
          format: double
          description: The ID of the company in the accounting platform
          example: 1089
        platform_id:
          type: string
          description: An unique custom RootFi ID made from platform's unique_id.
          example: '123456'
        platform_unique_id:
          type: string
          nullable: true
          description: The ID of the data in the accounting platform.
        raw_data:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            A JSON containing fields that you can directly get from the
            accounting platform.
        data_hash:
          type: string
          nullable: true
          description: The hash of the data
      required:
        - rootfi_id
        - rootfi_created_at
        - rootfi_updated_at
        - rootfi_company_id
        - platform_id
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key

````