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

# Crear producto

> Crea un producto simple, servicio, combo o kit, o un producto con hasta tres opciones y 250 variantes. En la creación con variantes, cada variante define su combinación, SKU, precios y stock inicial.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/products
openapi: 3.1.0
info:
  title: La Pyme API
  description: >-
    Resources and workflows for purchases, sales, inventory, contacts, products,
    reports, and settings.
  version: 1.0.0
  contact:
    name: La Pyme Support
    email: hola@lapyme.com.ar
  license:
    name: Proprietary
    url: https://lapyme.com.ar/terminos
servers:
  - url: https://api.lapyme.com.ar
    description: Servidor de producción
security:
  - bearerAuth: []
tags:
  - name: API
    description: Public API operations for La Pyme integrations.
paths:
  /api/v1/products:
    post:
      tags:
        - API
      summary: Crear producto
      description: >-
        Crea un producto simple, servicio, combo o kit, o un producto con hasta
        tres opciones y 250 variantes. En la creación con variantes, cada
        variante define su combinación, SKU, precios y stock inicial.
      operationId: createApiProduct
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Clave única para evitar duplicados al reintentar la misma creación
            de producto.
          required: true
          schema:
            type: string
        - name: X-Request-Id
          in: header
          description: >-
            ID opcional de la solicitud para trazabilidad. Si se omite, el
            servidor genera uno.
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiProductMutationRequest'
      responses:
        '200':
          description: Producto creado exitosamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiProductCreateResponse'
        '400':
          description: Solicitud inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_product_create_1
                    error:
                      code: INVALID_REQUEST
                      message: Invalid request for creating products
                      retryable: false
                      type: invalid_request_error
                      details: []
        '401':
          description: API key faltante o inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: AUTHENTICATION_REQUIRED
                  value:
                    request_id: req_product_create_1
                    error:
                      code: AUTHENTICATION_REQUIRED
                      message: API key is required in the Authorization header
                      retryable: false
                      type: invalid_request_error
                      details: []
        '403':
          description: Scopes insuficientes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: FORBIDDEN
                  value:
                    request_id: req_product_create_1
                    error:
                      code: FORBIDDEN
                      message: Your API key does not have permission for this operation
                      retryable: false
                      type: invalid_request_error
                      details: []
        '404':
          description: Recurso relacionado inexistente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: NOT_FOUND
                  value:
                    request_id: req_product_create_1
                    error:
                      code: NOT_FOUND
                      message: Category not found
                      retryable: false
                      type: invalid_request_error
                      details: []
        '409':
          description: Conflicto de negocio o idempotencia
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: CONFLICT
                  value:
                    request_id: req_product_create_1
                    error:
                      code: CONFLICT
                      message: A product with this SKU already exists
                      retryable: false
                      type: invalid_request_error
                      details: []
        '429':
          description: Límite de solicitudes excedido para la organización
          headers:
            Retry-After:
              description: Segundos a esperar antes de volver a intentar la solicitud.
              schema:
                type: string
                example: '30'
            X-RateLimit-Limit:
              description: Límite de la ventana activa.
              schema:
                type: string
                example: '5000'
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa.
              schema:
                type: string
                example: '0'
            X-RateLimit-Reset:
              description: Segundos restantes hasta el reset de la ventana activa.
              schema:
                type: string
                example: '30'
            RateLimit-Limit:
              description: Límite de la ventana activa en formato estándar.
              schema:
                type: string
                example: '5000'
            RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa en formato estándar.
              schema:
                type: string
                example: '0'
            RateLimit-Reset:
              description: >-
                Segundos hasta el reset de la ventana activa en formato
                estándar.
              schema:
                type: string
                example: '30'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: RATE_LIMITED
                  value:
                    request_id: req_rate_limit_1
                    error:
                      type: rate_limit_error
                      code: RATE_LIMITED
                      message: >-
                        The organization request limit was reached. Try again
                        later.
                      retryable: true
                      details: []
        '500':
          description: Error interno del servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INTERNAL_ERROR
                  value:
                    request_id: req_product_create_1
                    error:
                      code: INTERNAL_ERROR
                      message: Could not process the product
                      retryable: false
                      type: invalid_request_error
                      details: []
      x-codeSamples:
        - lang: typescript
          label: La Pyme SDK
          source: |
            import { Lapyme } from "lapyme";

            const lapyme = new Lapyme({
              bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
            });

            const product = await lapyme.products.create({
              idempotencyKey: crypto.randomUUID(),
              body: {
                name: "Remera basica",
                sku: "REM-BASICA-M",
                productType: "product",
                price: 1250000,
                cost: 700000,
                currency: "PES",
              },
            });
components:
  schemas:
    ApiProductMutationRequest:
      anyOf:
        - type: object
          properties:
            name:
              type: string
            description:
              anyOf:
                - type: string
                - type: 'null'
            category_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            visibility:
              $ref: '#/components/schemas/ApiSharedEnum6ecba1a4ce'
            image_url:
              anyOf:
                - type: string
                - type: 'null'
              description: >-
                External product image URL reference. La Pyme displays it best
                effort and does not copy, ingest, or host the image.
            product_type:
              default: product
              type: string
              enum:
                - product
                - service
                - combo
                - kit
            sku:
              type: string
            barcode:
              anyOf:
                - type: string
                - type: 'null'
            unit_of_measure:
              $ref: '#/components/schemas/ApiSharedEnum5f0db377e3'
            currency:
              $ref: '#/components/schemas/ApiSharedEnum70385a22ba'
            cost:
              default: 0
              type: integer
              minimum: 0
            price:
              description: >-
                Manual sale price in cents. Mutually exclusive with
                markup_percentage; send price for manual pricing or
                markup_percentage for markup pricing.
              type: integer
              minimum: 0
            promotional_price:
              anyOf:
                - type: integer
                  minimum: 0
                - type: 'null'
            markup_percentage:
              description: >-
                Markup percentage used to calculate the sale price from cost,
                tax, and organization rounding rules. Mutually exclusive with
                price; send null to switch back to manual pricing.
              anyOf:
                - type: number
                  minimum: 0
                  maximum: 10000
                - type: 'null'
            tax_rate_id:
              default: 5
              type: integer
            is_exempt:
              default: false
              type: boolean
            default_supplier_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            default_sales_account_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            default_purchase_account_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            warehouse_stocks:
              default: []
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObject6dbe49c4ef'
            is_active:
              default: true
              type: boolean
            metafields:
              description: >-
                Group-level custom field values addressed by canonical key.
                Available when custom fields are enabled for the organization.
              minItems: 1
              maxItems: 100
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObject0347948139'
          required:
            - name
            - sku
          additionalProperties: false
        - type: object
          properties:
            name:
              type: string
            description:
              anyOf:
                - type: string
                - type: 'null'
            category_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            visibility:
              $ref: '#/components/schemas/ApiSharedEnum6ecba1a4ce'
            image_url:
              anyOf:
                - type: string
                - type: 'null'
              description: >-
                External product image URL reference. La Pyme displays it best
                effort and does not copy, ingest, or host the image.
            default_supplier_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            default_sales_account_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            default_purchase_account_id:
              anyOf:
                - type: string
                  format: uuid
                - type: 'null'
            is_active:
              default: true
              type: boolean
            metafields:
              description: >-
                Group-level custom field values addressed by canonical key.
                Available when custom fields are enabled for the organization.
              minItems: 1
              maxItems: 100
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObject0347948139'
            product_type:
              default: product
              type: string
              const: product
            options:
              minItems: 1
              maxItems: 3
              type: array
              items:
                type: string
              description: >-
                Nombres ordenados de las opciones de variantes, por ejemplo
                Material, Color y Talle.
            variants:
              minItems: 1
              maxItems: 250
              type: array
              items:
                type: object
                properties:
                  image_url:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      External product image URL reference. La Pyme displays it
                      best effort and does not copy, ingest, or host the image.
                  sku:
                    type: string
                  barcode:
                    anyOf:
                      - type: string
                      - type: 'null'
                  unit_of_measure:
                    $ref: '#/components/schemas/ApiSharedEnum5f0db377e3'
                  currency:
                    $ref: '#/components/schemas/ApiSharedEnum70385a22ba'
                  cost:
                    default: 0
                    type: integer
                    minimum: 0
                  price:
                    description: >-
                      Manual sale price in cents. Mutually exclusive with
                      markup_percentage; send price for manual pricing or
                      markup_percentage for markup pricing.
                    type: integer
                    minimum: 0
                  promotional_price:
                    anyOf:
                      - type: integer
                        minimum: 0
                      - type: 'null'
                  markup_percentage:
                    description: >-
                      Markup percentage used to calculate the sale price from
                      cost, tax, and organization rounding rules. Mutually
                      exclusive with price; send null to switch back to manual
                      pricing.
                    anyOf:
                      - type: number
                        minimum: 0
                        maximum: 10000
                      - type: 'null'
                  tax_rate_id:
                    default: 5
                    type: integer
                  is_exempt:
                    default: false
                    type: boolean
                  warehouse_stocks:
                    default: []
                    type: array
                    items:
                      $ref: '#/components/schemas/ApiSharedObject6dbe49c4ef'
                  option_values:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                    description: >-
                      Mapa con exactamente un valor por cada nombre declarado en
                      options.
                required:
                  - sku
                  - option_values
                additionalProperties: false
              description: Variantes vendibles que se crearán dentro del producto.
          required:
            - name
            - options
            - variants
          additionalProperties: false
    ApiProductCreateResponse:
      type: object
      properties:
        request_id:
          type: string
        data:
          type: object
          properties:
            product:
              $ref: '#/components/schemas/ApiSharedObject36dfdd5b32'
            idempotent_replay:
              type: boolean
          required:
            - product
            - idempotent_replay
          additionalProperties: false
        warnings:
          type: array
          items: {}
      required:
        - request_id
        - data
        - warnings
      additionalProperties: false
    ApiErrorEnvelope:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - authorization_error
                - business_error
                - external_dependency_error
                - idempotency_error
                - invalid_request_error
                - rate_limit_error
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObjectc671832641'
          required:
            - type
            - code
            - message
            - retryable
            - details
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
    ApiSharedEnum6ecba1a4ce:
      default: both
      type: string
      enum:
        - both
        - sales
        - purchases
    ApiSharedEnum5f0db377e3:
      default: '07'
      type: string
      enum:
        - '10'
        - '11'
        - '12'
        - '13'
        - '14'
        - '15'
        - '16'
        - '17'
        - '18'
        - '19'
        - '20'
        - '21'
        - '22'
        - '23'
        - '24'
        - '25'
        - '26'
        - '27'
        - '28'
        - '29'
        - '30'
        - '31'
        - '32'
        - '33'
        - '34'
        - '35'
        - '36'
        - '37'
        - '41'
        - '47'
        - '48'
        - '49'
        - '50'
        - '51'
        - '52'
        - '53'
        - '54'
        - '55'
        - '61'
        - '62'
        - '63'
        - '97'
        - '98'
        - '99'
        - '00'
        - '01'
        - '02'
        - '03'
        - '04'
        - '05'
        - '06'
        - '07'
        - '08'
        - '09'
    ApiSharedEnum70385a22ba:
      type: string
      enum:
        - PES
        - DOL
      default: PES
    ApiSharedObject6dbe49c4ef:
      type: object
      properties:
        warehouse_id:
          type: string
          format: uuid
        quantity:
          type: number
          minimum: 0
      required:
        - warehouse_id
        - quantity
      additionalProperties: false
    ApiSharedObject0347948139:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
      additionalProperties: false
    ApiSharedObject36dfdd5b32:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        category:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedObject8aeeceaf0f'
            - type: 'null'
        sku:
          type: string
        barcode:
          anyOf:
            - type: string
            - type: 'null'
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            External product image URL reference. La Pyme displays it best
            effort and does not copy, ingest, or host the image.
        currency:
          type: string
        cost:
          type: number
        price:
          type: number
        tax_rate:
          $ref: '#/components/schemas/ApiSharedObjectee5eae48b0'
        default_supplier:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedObject8aeeceaf0f'
            - type: 'null'
        product_type:
          $ref: '#/components/schemas/ApiSharedEnumff49232140'
        is_active:
          type: boolean
        organization_slug:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        effective_price:
          type: number
        price_source:
          $ref: '#/components/schemas/ApiSharedEnumfe93f70a59'
        applied_price_list:
          $ref: '#/components/schemas/ApiSharedObjectfc277c542a'
        object:
          type: string
          const: product
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiSharedObject8a94344083'
        variant_group_id:
          type: string
          format: uuid
        variant_options:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties:
                type: string
            - type: 'null'
        is_exempt:
          type: boolean
        metafields:
          type: array
          items:
            $ref: '#/components/schemas/ApiSharedObject0347948139'
        stock_summary:
          $ref: '#/components/schemas/ApiSharedObjecta9f7340006'
      required:
        - id
        - name
        - description
        - category
        - sku
        - barcode
        - image_url
        - currency
        - cost
        - price
        - tax_rate
        - default_supplier
        - product_type
        - is_active
        - organization_slug
        - created_at
        - updated_at
        - object
        - tags
        - variant_group_id
        - variant_options
        - is_exempt
        - metafields
        - stock_summary
      additionalProperties: false
    ApiSharedObjectc671832641:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - code
        - message
      additionalProperties: false
    ApiSharedObject8aeeceaf0f:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
      required:
        - id
        - name
      additionalProperties: false
    ApiSharedObjectee5eae48b0:
      type: object
      properties:
        id:
          type: number
        value:
          type: number
      required:
        - id
        - value
      additionalProperties: false
    ApiSharedEnumff49232140:
      type: string
      enum:
        - product
        - service
        - combo
        - kit
    ApiSharedEnumfe93f70a59:
      type: string
      enum:
        - automatic
        - manual_override
        - manual_fallback
        - base
    ApiSharedObjectfc277c542a:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        is_automatic:
          type: boolean
        automatic_pricing_mode:
          $ref: '#/components/schemas/ApiSharedEnum3c5633618c'
        adjustment_percentage:
          anyOf:
            - type: number
            - type: 'null'
        tax_inclusive:
          type: boolean
      required:
        - id
        - name
        - is_automatic
        - automatic_pricing_mode
        - adjustment_percentage
        - tax_inclusive
      additionalProperties: false
    ApiSharedObject8a94344083:
      type: object
      properties:
        object:
          type: string
          const: tag
        id:
          type: string
          format: uuid
        scope:
          $ref: '#/components/schemas/ApiSharedEnum09f8155a9a'
        name:
          type: string
        slug:
          type: string
        color:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedEnum599647cb76'
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - scope
        - name
        - slug
        - color
        - description
        - archived_at
        - created_at
        - updated_at
      additionalProperties: false
    ApiSharedObjecta9f7340006:
      type: object
      properties:
        total_quantity:
          type: number
        warehouse_count:
          type: integer
          minimum: 0
        by_warehouse:
          type: array
          items:
            $ref: '#/components/schemas/ApiSharedObjectf20bf16616'
      required:
        - total_quantity
        - warehouse_count
        - by_warehouse
      additionalProperties: false
    ApiSharedEnum3c5633618c:
      type: string
      enum:
        - base_price_adjustment
        - cost_markup
    ApiSharedEnum09f8155a9a:
      type: string
      enum:
        - customer
        - supplier
        - product
        - sale
        - purchase
        - purchase_order
        - transfer
    ApiSharedEnum599647cb76:
      type: string
      enum:
        - slate
        - red
        - orange
        - amber
        - yellow
        - lime
        - green
        - teal
        - cyan
        - blue
        - indigo
        - violet
        - pink
    ApiSharedObjectf20bf16616:
      type: object
      properties:
        warehouse_id:
          type: string
          format: uuid
        warehouse_name:
          type: string
        quantity:
          type: number
        on_hand:
          type: number
        reserved_quantity:
          type: number
        incoming_quantity:
          type: number
      required:
        - warehouse_id
        - warehouse_name
        - quantity
        - on_hand
        - reserved_quantity
        - incoming_quantity
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````