> ## 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 or update product and assign EPC on an antenna



## OpenAPI

````yaml https://app.buylo.ai/api/documentation/swagger/openapi.yaml post /api/antennas/{antenna_uuid}/product-epc
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/antennas/{antenna_uuid}/product-epc:
    post:
      tags:
        - Product EPC
      summary: Create or update product and assign EPC on an antenna
      parameters:
        - in: path
          name: antenna_uuid
          required: true
          schema:
            type: string
        - in: query
          name: allowed_tags_on_antenna
          required: false
          schema:
            type: number
            default: 1
          description: Allowed number of RFID tags detected on the antenna. Defaults to 1.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Product'
      responses:
        '200':
          description: Created or updated product and assigned EPC
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      product_epc_hashes:
                        type: array
                        items:
                          type: string
                        description: List of unique EPC hashes assigned to the product
                        example:
                          - 8aaedfc3559d0ce545ca55bcea31aad2
                          - 2b1c7f8c2aab4e33a5e09a2d77f3b611
                    required:
                      - product_epc_hashes
                required:
                  - data
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '403':
          description: Invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '404':
          description: No EPC record found for this antenna.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '409':
          description: EPC is already assigned to product.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
        '412':
          description: Invalid number of tags detected on the antenna.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    Product:
      type: object
      properties:
        product_id:
          type: string
          description: Your Unique product identifier
          example: ABC123
        name:
          type: object
          nullable: true
          description: Product name with translations
          additionalProperties:
            type: string
          example:
            en: Brazil Santos Coffee
            cs: Brazilská káva Santos
        category:
          type: string
          nullable: true
          maxLength: 255
          description: Product category
          example: Coffee
        description:
          type: object
          nullable: true
          description: Product description with translations
          additionalProperties:
            type: string
          example:
            en: Roasted Arabica coffee beans from Brazil
            cs: Pražená arabica z Brazílie
        ean:
          type: string
          maxLength: 255
          nullable: true
          description: European Article Number
          example: '8591234567890'
        brand:
          type: string
          maxLength: 255
          nullable: true
          description: Brand name of the product
          example: CoffeeCo
        prices:
          type: array
          nullable: true
          description: Array of prices in different currencies
          items:
            type: object
            required:
              - currency
              - price
            properties:
              currency:
                type: string
                description: Currency code (CZK, EUR, USD, etc.)
                example: EUR
              price:
                type: number
                format: float
                minimum: 0
                description: Price amount
                example: 199.99
          example:
            - currency: EUR
              price: 199.99
            - currency: CZK
              price: 4999
        vat_rate:
          type: number
          format: float
          minimum: 0
          nullable: true
          description: VAT rate percentage
          example: 21
        unit:
          type: string
          maxLength: 50
          nullable: true
          description: Unit of measurement
          example: kg
        product_data:
          type: object
          nullable: true
          description: Free additional product data
          additionalProperties: true
          example:
            color: red
            size: L
      required:
        - product_id
    InvalidResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the issue
      required:
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````