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

# Create Product

> Create Product



## OpenAPI

````yaml post /v1/products
openapi: 3.0.0
info:
  description: Open API's for WizCommerce API's
  title: WizCommerce Open API's
  termsOfService: https://wizcommerce.com/terms/
  contact:
    name: Tech Support
    url: https://help.wizcommerce.com/
    email: tech@wizcommerce.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '1.0'
servers:
  - url: https://api.wizcommerce.com
    description: Production BaseURL
  - url: https://api-staging.sourcerer.tech
    description: Staging BaseURL
security: []
paths:
  /v1/products:
    post:
      tags:
        - Product
      summary: Create Product
      description: Create Product
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dtos.ProductCreateRequest'
        description: Product Create Request
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/dtos.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/dtos.ProductListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    dtos.ProductCreateRequest:
      type: object
      required:
        - group_code
        - variants
      properties:
        group_code:
          description: If no grouping is available, the group code will be the sku_id
          type: string
          x-order: '1'
          example: PRD1
        grouping_attributes:
          description: >-
            Ordered list of attribute names used to distinguish and group
            variants under the same product (e.g., size, then shape).
          type: array
          items:
            type: string
          x-order: '2'
        variants:
          type: array
          items:
            $ref: '#/components/schemas/dtos.VariantCreateRequest'
          x-order: '3'
    dtos.SuccessResponse:
      type: object
      properties:
        data:
          x-order: '1'
    dtos.ProductListResponse:
      type: object
      properties:
        reference_id:
          type: string
          x-order: '1'
          example: SKU123
        id:
          description: UUID
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        parent_id:
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        sku:
          type: string
          x-order: '2'
          example: SKU123
        name:
          type: string
          x-order: '3'
          example: Product Name
        group_code:
          type: string
          x-order: '4'
          example: PRD1
        medias:
          type: array
          items:
            $ref: '#/components/schemas/dtos.ProductMediaResponse'
          x-order: '5'
        is_primary:
          type: boolean
          x-order: '6'
          example: true
        status:
          type: string
          enum:
            - active
            - inactive
          x-order: '7'
          example: active
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/dtos.AttributeResponse'
          x-order: '8'
        created_at:
          type: string
          x-order: '9'
        updated_at:
          type: string
          x-order: '10'
    errors.HttpError:
      type: object
      properties:
        code:
          type: string
          x-order: '1'
        message:
          type: string
          x-order: '2'
        details:
          type: array
          items:
            $ref: '#/components/schemas/errors.HttpErrorDetails'
          x-order: '3'
    dtos.VariantCreateRequest:
      type: object
      required:
        - name
        - product_prices
        - reference_id
        - sku_id
      properties:
        sku_id:
          type: string
          x-order: '1'
          example: 66112458-fda7-4a96-8121-9c1d57a8651d
        reference_id:
          description: >-
            Reference ID for the variant, if no reference id is available, the
            sku_id should be used
          type: string
          x-order: '2'
          example: PRD1
        name:
          type: string
          maxLength: 255
          x-order: '3'
          example: 8'X10'
        categories:
          description: >-
            One or more category names for this variant, in case sub categories
            are available, the sub categories should be separated by :: eg:
            "category1::sub_category1::sub_sub_category1" then the category
            "sub_sub_category1" will be mapped to the product
          type: array
          items:
            type: string
          x-order: '4'
        collections:
          description: One or more collection IDs for this variant
          type: array
          items:
            type: string
          x-order: '5'
        medias:
          description: Media assets associated with this variant
          type: array
          items:
            $ref: '#/components/schemas/dtos.ProductMediaRequest'
          x-order: '6'
        attributes:
          description: Key-value pair attributes like size, shape, material, etc.
          type: array
          items:
            $ref: '#/components/schemas/dtos.AttributeRequest'
          x-order: '7'
        product_prices:
          description: Prices mapped to price lists
          type: array
          items:
            $ref: >-
              #/components/schemas/openapi_internal_dtos_product.ProductPriceRequest
          x-order: '8'
        is_primary:
          description: Indicates if this is the primary variant
          type: boolean
          default: false
          x-order: '9'
          example: true
        priority:
          description: Sets the Priority for the product listing sort order.
          type: integer
          x-order: '10'
    dtos.ProductMediaResponse:
      type: object
      properties:
        is_default:
          type: boolean
          example: true
        type:
          type: string
          example: image
        url:
          type: string
          example: https://example.com/image1.jpg
    dtos.AttributeResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: '1234567890'
        name:
          type: string
          x-order: '2'
          example: color
        value:
          type: string
          x-order: '3'
          example: red
    errors.HttpErrorDetails:
      type: object
      properties:
        field:
          type: string
          x-order: '1'
        reason:
          type: string
          x-order: '2'
    dtos.ProductMediaRequest:
      type: object
      required:
        - order
        - type
        - url
      properties:
        url:
          description: Media URL, should be a valid URL with public access
          type: string
          x-order: '1'
          example: https://example.com/image1.jpg
        order:
          description: Display order
          type: integer
          x-order: '2'
          example: 1
        is_default:
          description: Whether this is the default media
          type: boolean
          default: false
          x-order: '3'
          example: true
        type:
          type: string
          enum:
            - image
          x-order: '4'
          example: image
    dtos.AttributeRequest:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          maxLength: 255
          x-order: '1'
          example: '1234567890'
        value:
          type: string
          x-order: '2'
          example: red
    openapi_internal_dtos_product.ProductPriceRequest:
      type: object
      required:
        - price_list_id
      properties:
        price_list_id:
          type: string
          x-order: '1'
          example: PRC123
        price:
          description: Price for this variant under the given price list
          type: number
          minimum: 0
          x-order: '2'
          example: 100
        min_order_quantity:
          description: Minimum quantity allowed per order
          type: integer
          default: 1
          minimum: 1
          x-order: '3'
          example: 1
        max_order_quantity:
          description: Maximum quantity allowed per order
          type: integer
          default: 9999
          minimum: 1
          x-order: '4'
          example: 100
        step_increment:
          description: Step increment for ordering (e.g., in multiples of 1, 5, etc.)
          type: integer
          default: 1
          minimum: 1
          x-order: '5'
          example: 1
  securitySchemes:
    ApiKeyAuth:
      description: API Key for authentication
      type: apiKey
      name: X-API-Key
      in: header

````