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

# Vytvořit produkt

> Vytvoření nového produktu v katalogu

## Poznámky k použití

* `schema_id` vybírá opakovaně použitelné Product Schema produktu.
* Klíče v `attributes` musí odpovídat aktivním Attributes v tomto schématu nebo v `attribute_extension_ids`.
* `attribute_extension_ids` připojí existující firemní Attributes pouze k tomuto produktu. Nepřidá je do opakovaně použitelného Product Schema.
* Hodnoty Relation i Attribute se ověří před vytvořením produktu. Při chybě validace se nevytvoří nic.

Nové produkty vytvořené přes API používají výchozí zdroj a stav životního cyklu handleru. Místo předpokladu zkontrolujte vrácené `source` a `status`.

## Příklady

```bash cURL theme={null}
curl --request POST \
  --url https://app.productlasso.com/api/v1/catalog \
  --header "Authorization: Bearer $LASSO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "schema_id": "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
    "attributes": {"sku": "A-100", "product_name": "Alpine bottle", "price": 24.9},
    "attribute_extension_ids": ["e683267d-2450-4ea8-a977-462d46a8f610"]
  }'
```

```typescript TypeScript theme={null}
const response = await fetch("https://app.productlasso.com/api/v1/catalog", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LASSO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    schema_id: "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
    attributes: { sku: "A-100", product_name: "Alpine bottle", price: 24.9 },
    attribute_extension_ids: ["e683267d-2450-4ea8-a977-462d46a8f610"],
  }),
});

if (!response.ok) throw new Error(await response.text());
const product = await response.json();
```

```python Python theme={null}
import os
import requests

response = requests.post(
    "https://app.productlasso.com/api/v1/catalog",
    headers={"Authorization": f"Bearer {os.environ['LASSO_API_KEY']}"},
    json={
        "schema_id": "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
        "attributes": {"sku": "A-100", "product_name": "Alpine bottle", "price": 24.9},
        "attribute_extension_ids": ["e683267d-2450-4ea8-a977-462d46a8f610"],
    },
    timeout=30,
)
response.raise_for_status()
product = response.json()
```

```json Example response theme={null}
{
  "id": "13adf145-d9a0-4c28-9235-3f7e17af4cf1",
  "company_id": "81e2b625-e6e8-4dd5-a50f-22803806cc10",
  "schema_id": "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
  "source": "manual",
  "external_id": null,
  "status": "draft",
  "attributes": {"sku": "A-100", "product_name": "Alpine bottle", "price": 24.9},
  "attribute_extensions": [
    {"attribute_id": "e683267d-2450-4ea8-a977-462d46a8f610", "key": "supplier_note"}
  ],
  "created_at": "2026-08-31T09:30:00.000Z",
  "updated_at": "2026-08-31T09:30:00.000Z",
  "deleted_at": null
}
```


## OpenAPI

````yaml openapi.yaml POST /catalog
openapi: 3.1.0
info:
  title: Lasso API
  description: AI-powered product data extraction and enhancement API
  version: 1.0.0
  contact:
    name: Lasso Support
    url: https://lasso.ai
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://app.productlasso.com/api/v1
    description: Production
security:
  - BearerAuth: []
paths:
  /catalog:
    post:
      tags:
        - Catalog
      summary: Create a Catalog product
      description: >-
        Product-only Shared Attributes are attached by stable ID without
        widening the selected Product Schema.
      operationId: createCatalogProduct
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CatalogProductCreateInput'
      responses:
        '201':
          description: Catalog product created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogProduct'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl --request POST \
              --url https://app.productlasso.com/api/v1/catalog \
              --header "Authorization: Bearer $LASSO_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
                "schema_id": "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
                "attributes": {"sku": "A-100", "product_name": "Alpine bottle", "price": 24.9},
                "attribute_extension_ids": ["e683267d-2450-4ea8-a977-462d46a8f610"]
              }'
        - lang: typescript
          label: TypeScript
          source: >
            const response = await
            fetch("https://app.productlasso.com/api/v1/catalog", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.LASSO_API_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                schema_id: "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
                attributes: { sku: "A-100", product_name: "Alpine bottle", price: 24.9 },
                attribute_extension_ids: ["e683267d-2450-4ea8-a977-462d46a8f610"],
              }),
            });


            if (!response.ok) throw new Error(await response.text());

            const product = await response.json();
        - lang: python
          label: Python
          source: |
            import os
            import requests

            response = requests.post(
                "https://app.productlasso.com/api/v1/catalog",
                headers={"Authorization": f"Bearer {os.environ['LASSO_API_KEY']}"},
                json={
                    "schema_id": "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
                    "attributes": {"sku": "A-100", "product_name": "Alpine bottle", "price": 24.9},
                    "attribute_extension_ids": ["e683267d-2450-4ea8-a977-462d46a8f610"],
                },
                timeout=30,
            )
            response.raise_for_status()
            product = response.json()
components:
  schemas:
    CatalogProductCreateInput:
      type: object
      additionalProperties: false
      required:
        - schema_id
        - attributes
      properties:
        schema_id:
          type: string
          format: uuid
        attributes:
          type: object
          additionalProperties: true
        attribute_extension_ids:
          type: array
          maxItems: 2000
          uniqueItems: true
          description: >-
            Active Shared Attribute UUIDs to attach only to this product.
            Attributes already owned by the base schema remain schema fields and
            are not duplicated here.
          items:
            type: string
            format: uuid
      example:
        schema_id: 9e1c77dd-8f10-41ca-bfe8-e672b89692d1
        attributes:
          sku: A-100
          product_name: Alpine bottle
          price: 24.9
        attribute_extension_ids:
          - e683267d-2450-4ea8-a977-462d46a8f610
    CatalogProduct:
      type: object
      additionalProperties: false
      required:
        - id
        - company_id
        - schema_id
        - source
        - external_id
        - status
        - attributes
        - attribute_extensions
        - created_at
        - updated_at
        - deleted_at
      properties:
        id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        schema_id:
          type: string
          format: uuid
        source:
          type: string
          enum:
            - manual
            - product_extraction
            - shopify
        external_id:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - draft
            - active
            - archived
        attributes:
          type: object
          additionalProperties: true
          description: >-
            Values backed by active Shared Attributes from the base schema or
            attribute_extensions.
        attribute_extensions:
          type: array
          maxItems: 2000
          items:
            $ref: '#/components/schemas/CatalogAttributeExtension'
        relations:
          type: object
          additionalProperties: true
          description: >-
            Hydrated relation values. Present on the single-product GET
            response.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
      examples:
        - id: 13adf145-d9a0-4c28-9235-3f7e17af4cf1
          company_id: 81e2b625-e6e8-4dd5-a50f-22803806cc10
          schema_id: 9e1c77dd-8f10-41ca-bfe8-e672b89692d1
          source: manual
          external_id: null
          status: draft
          attributes:
            sku: A-100
            product_name: Alpine bottle
            price: 24.9
          attribute_extensions:
            - attribute_id: e683267d-2450-4ea8-a977-462d46a8f610
              key: supplier_note
          created_at: '2026-08-31T09:30:00.000Z'
          updated_at: '2026-08-31T09:30:00.000Z'
          deleted_at: null
    CatalogAttributeExtension:
      type: object
      additionalProperties: false
      required:
        - attribute_id
        - key
      description: >-
        An active Shared Attribute attached only to this Catalog product,
        without changing its Product Schema.
      properties:
        attribute_id:
          type: string
          format: uuid
        key:
          type: string
          description: Current canonical Attribute key.
    Error:
      type: object
      required:
        - status_code
        - error_type
        - message
        - request_id
      properties:
        status_code:
          type: integer
        error_type:
          type: string
          enum:
            - invalid_request
            - unauthenticated
            - forbidden
            - not_found
            - conflict
            - validation_error
            - rate_limited
            - service_unavailable
            - internal_error
        message:
          type: string
        request_id:
          type: string
        code:
          type: string
          description: >-
            Stable machine-readable detail code for validation, conflict, and
            retryable availability errors.
        retryable:
          type: boolean
          description: Whether the request can be retried without changing its payload.
        attribute_id:
          type: string
          format: uuid
          description: Stable Attribute identity when the error is scoped to one Attribute.
        attribute_key:
          type: string
          description: Attribute key when the error is scoped to one Attribute.
        details:
          type: object
          additionalProperties: true
        current_updated_at:
          type: string
          format: date-time
          description: >-
            Current resource revision supplied for client-directed refetch after
            a stale write.
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Request validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.