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

# Create product from EAN registry

> Creates a new product by looking up product information in the EAN registry
and creates a product record in the tenant database. Optionally accepts
`epc_ids` to attach EPC tags to the newly created product in the same transaction.




## OpenAPI

````yaml https://app.buylo.ai/api/documentation/swagger/openapi.yaml post /api/products/create-from-ean-registry
openapi: 3.1.1
info:
  title: Buylo - company external API
  version: 1.0.0
  description: >-
    API endpoints for managing products and EPCs in the Buylo system. Use
    company token for authentication.
servers:
  - url: https://app.buylo.ai/
security:
  - bearerAuth: []
paths:
  /api/products/create-from-ean-registry:
    post:
      tags:
        - Products
      summary: Create product from EAN registry
      description: >
        Creates a new product by looking up product information in the EAN
        registry

        and creates a product record in the tenant database. Optionally accepts

        `epc_ids` to attach EPC tags to the newly created product in the same
        transaction.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductFromEanRequest'
      responses:
        '200':
          description: Product successfully created from EAN registry
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ProductResponse'
                required:
                  - data
        '400':
          description: Validation error - invalid EAN format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '403':
          description: Invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '404':
          description: EAN not found in registry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '409':
          description: One or more supplied EPC IDs already exist in this tenant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateProductFromEanRequest:
      type: object
      properties:
        ean:
          type: string
          pattern: ^\d+$
          description: European Article Number. Digits only; any length.
          example: '8594001524129'
        epc_ids:
          type: array
          nullable: true
          description: >-
            Optional. If provided, these EPC IDs are attached to the newly
            created product in the same transaction.
          items:
            type: string
          example:
            - E2004001020304
            - E2004001020305
      required:
        - ean
    ProductResponse:
      type: object
      properties:
        id:
          type: integer
          description: Internal product ID
          example: 123
        product_id:
          type: string
          description: Your Unique product identifier
          example: ABC123
        name:
          type: string
          nullable: true
          maxLength: 255
          description: Name of the product
          example: Brazil Santos Coffee
        category:
          type: string
          nullable: true
          maxLength: 255
          description: Product category
          example: Coffee
        description:
          type: string
          nullable: true
          description: Detailed description of the product
          example: Roasted Arabica coffee beans from Brazil
        ean:
          type: string
          nullable: true
          description: European Article Number (13 digits)
          example: '8594001524129'
        ean_registry_id:
          type: integer
          nullable: true
          description: >
            ID of the central `ean_registry` row this product was created from.

            Populated only for products created via

            `POST /api/products/create-from-ean-registry` (or endpoints that

            internally use the same flow, e.g. `/bulk-pack`). `null` for
            products

            created manually or by other flows.
          example: 42
        brand:
          type: string
          nullable: true
          description: Brand name of the product
          example: CoffeeCo
        sale_price:
          type: number
          format: float
          nullable: true
          description: Sale price of the product
          example: 199.99
        sale_price_currency:
          type: object
          nullable: true
          description: Currency information
        vat_rate:
          type: number
          format: float
          nullable: true
          description: VAT rate percentage
          example: 21
        unit:
          type: string
          nullable: true
          description: Unit of measurement
          example: kg
        product_data:
          type: object
          nullable: true
          description: Free additional product data
        epc_hashes:
          type: array
          items:
            type: string
          description: List of EPC hashes assigned to this product
          example: []
        warehouse_nodes:
          type: array
          items:
            type: object
          description: List of warehouse nodes where this product is located
          example: []
        created_at:
          type: string
          format: date-time
          nullable: true
          example: '2025-08-06T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          nullable: true
          example: '2025-08-06T12:30:00Z'
    InvalidResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the issue
      required:
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````