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

# Create product

> Creates a new product. Custom field values use `cf_*` keys — see the [Custom fields](/api-v2/custom-fields) guide.



## OpenAPI

````yaml /openapi.v2.json post /products
openapi: 3.1.1
info:
  title: Heffl API v2 (Beta)
  version: 2.0.0
  description: >-
    Heffl REST API v2 (beta) — resource-oriented endpoints with consistent
    response envelopes. Endpoints, schemas, and behavior may change until GA.
    See Agent workflows and ID prefixes guides for automation.
  contact:
    name: Heffl Support
    url: https://heffl.com/support
    email: support@heffl.com
servers:
  - url: https://api.heffl.com/api/v2
    description: Production API Server
security:
  - ApiKeyAuth: []
paths:
  /products:
    post:
      tags:
        - Reference Data
      summary: Create product
      description: >-
        Creates a new product. Custom field values use `cf_*` keys — see the
        [Custom fields](/api-v2/custom-fields) guide.
      operationId: reference.products.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '400':
          description: Validation error or bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '403':
          description: Insufficient permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
components:
  schemas:
    ProductInput:
      type: object
      properties:
        name:
          type: string
          description: Product name
        type:
          type: string
          enum:
            - PRODUCT
            - SERVICE
          description: Product type
        price:
          type: number
          description: Product price
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Product description
        sku:
          anyOf:
            - type: string
            - type: 'null'
          description: SKU code
        buyPrice:
          anyOf:
            - type: number
            - type: 'null'
          description: Cost/buy price
        isActive:
          type: boolean
          description: Whether the product is active
      required:
        - name
      additionalProperties:
        description: Custom field values using cf_* keys (for example cf_brand).
    Product:
      type: object
      properties:
        id:
          type: string
          description: Product ID
        name:
          type: string
          description: Product name
        price:
          type: number
          description: Product price
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Product description
        sku:
          anyOf:
            - type: string
            - type: 'null'
          description: SKU code
        type:
          type: string
          description: Product type (PRODUCT or SERVICE)
        isActive:
          type: boolean
          description: Whether the product is active
      required:
        - id
        - name
        - price
        - type
        - isActive
    V2ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        app.heffl.com/settings/developers

````