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

# Create Barcode

> Create a new barcode for a stock item.



## OpenAPI

````yaml post /inventory/stocks/{stock_id}/barcodes
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /inventory/stocks/{stock_id}/barcodes:
    post:
      tags:
        - Stock
      summary: Create Barcode
      description: Create a new barcode for a stock item.
      operationId: create_barcode_inventory_stocks__stock_id__barcodes_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: stock_id
          in: path
          required: true
          schema:
            type: string
            title: Stock Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BarcodeCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Barcode'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BarcodeCreate:
      properties:
        barcodeType:
          $ref: '#/components/schemas/BarcodeType'
          description: Type of barcode
        barcodeValue:
          type: string
          title: Barcodevalue
          description: The actual barcode string
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Human label for the barcode
        supplierToStockUomId:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliertostockuomid
          description: Optional packaging-level link
      type: object
      required:
        - barcodeType
        - barcodeValue
      title: BarcodeCreate
    Barcode:
      properties:
        barcodeType:
          $ref: '#/components/schemas/BarcodeType'
          description: Type of barcode
        barcodeValue:
          type: string
          title: Barcodevalue
          description: The actual barcode string
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Human label for the barcode
        supplierToStockUomId:
          anyOf:
            - type: string
            - type: 'null'
          title: Suppliertostockuomid
          description: Optional packaging-level link
        id:
          type: string
          title: Id
          description: Unique identifier
        stockId:
          type: string
          title: Stockid
          description: ID of the stock this barcode identifies
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
        isArchived:
          type: boolean
          title: Isarchived
          default: false
      type: object
      required:
        - barcodeType
        - barcodeValue
        - id
        - stockId
      title: Barcode
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BarcodeType:
      type: string
      enum:
        - UPC_A
        - EAN_13
        - GS1_DATAMATRIX
        - GS1_128
        - ITF_14
        - CODE_128
        - QR_CODE
        - INTERNAL
      title: BarcodeType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````