> ## 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.

# Scan Barcode

> Resolve a scanned barcode to its associated stock item, with cost-gated fields redacted per the caller's permissions.



## OpenAPI

````yaml get /inventory/barcodes/scan
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /inventory/barcodes/scan:
    get:
      tags:
        - Stock
      summary: Scan Barcode
      description: >-
        Resolve a scanned barcode to its associated stock item, with cost-gated
        fields redacted per the caller's permissions.
      operationId: scan_barcode_inventory_barcodes_scan_get
      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: raw_value
          in: query
          required: true
          schema:
            type: string
            description: Raw barcode string from scanner
            title: Raw Value
          description: Raw barcode string from scanner
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BarcodeScanResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BarcodeScanResult:
      properties:
        barcode:
          anyOf:
            - $ref: '#/components/schemas/Barcode'
            - type: 'null'
          description: Matched barcode record
        stock:
          anyOf:
            - $ref: '#/components/schemas/StockTiny'
            - type: 'null'
          description: Associated stock
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/LinkedItem'
              type: array
            - type: 'null'
          title: Items
          description: Linked items via ItemStock
        supplierToStockUom:
          anyOf:
            - $ref: '#/components/schemas/SupplierToStockUom'
            - type: 'null'
          description: Linked UoM if present
        gs1Data:
          anyOf:
            - $ref: '#/components/schemas/GS1ParseResult'
            - type: 'null'
          description: Parsed GS1 fields if applicable
      type: object
      title: BarcodeScanResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    StockTiny:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the stock
        name:
          type: string
          title: Name
          description: Name of the stock
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the stock
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Notes about the stock
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Category name (references category.name)
        unit:
          $ref: '#/components/schemas/Unit'
          description: Unit of measurement
        minStockLevel:
          anyOf:
            - type: number
            - type: 'null'
          title: Minstocklevel
          description: Minimum stock level before alerting
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the stock is archived
          default: false
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: Optional identifier from an external system (importer/legacy SKU)
      type: object
      required:
        - name
        - unit
      title: StockTiny
    LinkedItem:
      properties:
        stockId:
          type: string
          title: Stockid
          description: Unique identifier for the stock
        itemId:
          type: string
          title: Itemid
          description: Identifier of the linked item
        quantityUsed:
          type: number
          title: Quantityused
          description: Quantity of the linked item used
        multiplyByDose:
          type: boolean
          title: Multiplybydose
          description: >-
            If true, dose-administration drawdowns multiply by
            DoseComponent.amount in addition to quantity_used.
          default: false
        item:
          $ref: '#/components/schemas/Item'
          description: Details of the linked item
      type: object
      required:
        - stockId
        - itemId
        - quantityUsed
        - item
      title: LinkedItem
    SupplierToStockUom:
      properties:
        supplierPartNumber:
          type: string
          title: Supplierpartnumber
          description: Supplier part number for this stock
        uom:
          $ref: '#/components/schemas/Unit'
          description: Unit of measure
        conversionFactor:
          type: number
          exclusiveMinimum: 0
          title: Conversionfactor
          description: Base units per 1 UoM
          default: 1
        isDefault:
          type: boolean
          title: Isdefault
          description: Default UoM for this part number
          default: false
        displayLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Displaylabel
          description: Display label (e.g., 'Case of 200')
        price:
          anyOf:
            - type: integer
            - type: 'null'
          title: Price
          description: Price in cents per UoM
        leadTime:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Leadtime
          description: Lead time in days (must be > 0)
        id:
          type: string
          title: Id
          description: Unique identifier for the supplier-to-stock UOM
        supplierToStockId:
          type: string
          title: Suppliertostockid
          description: ID of the parent supplier-to-stock relationship
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: Date the UOM was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date the UOM was last updated
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the UOM is archived
          default: false
      type: object
      required:
        - supplierPartNumber
        - uom
        - id
        - supplierToStockId
      title: SupplierToStockUom
    GS1ParseResult:
      properties:
        gtin:
          anyOf:
            - type: string
            - type: 'null'
          title: Gtin
          description: GTIN extracted from AI (01)
        lotNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Lotnumber
          description: Lot/batch number from AI (10)
        expiryDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Expirydate
          description: Expiry date from AI (17)
        packagingDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Packagingdate
          description: Packaging date from AI (13)
        serialNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Serialnumber
          description: Serial number from AI (21)
      type: object
      title: GS1ParseResult
    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
    BarcodeType:
      type: string
      enum:
        - UPC_A
        - EAN_13
        - GS1_DATAMATRIX
        - GS1_128
        - ITF_14
        - CODE_128
        - QR_CODE
        - INTERNAL
      title: BarcodeType
    Unit:
      type: string
      enum:
        - AMPOULES
        - APPLICATORS
        - BOTTLES
        - BOXES
        - CAPSULES
        - CUPS
        - DOSES
        - G_PER_ML
        - GRAMS
        - IU
        - IU_PER_ML
        - OUNCES
        - FLUID_OUNCES
        - KG
        - KITS
        - LITERS
        - MCG
        - MG
        - MG_PER_ML
        - ML
        - MMOL
        - MICROGRAM_PER_ML
        - PACKS
        - PAIRS
        - PATCHES
        - PERCENTAGE
        - PIECES
        - POUCHES
        - ROLLS
        - SACHETS
        - SHEETS
        - SPRAYS
        - STRIPS
        - SYRINGES
        - TABLETS
        - TABLETS_PER_DAY
        - TESTS
        - TROCHES
        - TUBES
        - UNITS
        - VIALS
        - TREATMENTS
        - SESSIONS
        - PULSES
        - JOULES
        - CENTIMETERS
        - THREAD_COUNT
        - INJECTIONS
        - WRINKLE_UNITS
        - POUNDS
        - FEET
        - INCHES
      title: Unit
    Item:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the item
        name:
          type: string
          title: Name
          description: Name of the item
        brandName:
          anyOf:
            - type: string
            - type: 'null'
          title: Brandname
          description: Optional brand name of the item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the item
        price:
          type: integer
          title: Price
          description: Price of the item in cents
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
          description: Category name (references category.name)
        unit:
          anyOf:
            - $ref: '#/components/schemas/Unit'
            - type: 'null'
          description: Unit of measurement for the item
        isPhysical:
          type: boolean
          title: Isphysical
          description: Whether the item is physical
          default: true
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the item is archived
          default: false
        internalNotes:
          anyOf:
            - type: string
            - type: 'null'
          title: Internalnotes
          description: Optional internal notes for the item
        sortOrder:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sortorder
          description: Optional sort order for the item
        allowCustomPricing:
          type: boolean
          title: Allowcustompricing
          description: Whether custom pricing is allowed for this item
          default: false
        showInCheckOut:
          type: boolean
          title: Showincheckout
          description: Whether this item appears in checkout
          default: true
        type:
          $ref: '#/components/schemas/ItemType'
          description: Type of item (PRODUCT, MEDICATION, etc.)
          default: PRODUCT
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: Optional external ID for the item
        exemptedTaxIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Exemptedtaxids
          description: >-
            List of tax IDs that this item is exempted from (excludes from
            scope-based taxes)
        cost:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cost
          description: Cost of the item in cents
        cashPrice:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cashprice
          description: Cash price of the item in cents (for dual pricing)
        commissionable:
          type: boolean
          title: Commissionable
          description: Whether this item is eligible for commissions
          default: true
        tags:
          items:
            $ref: '#/components/schemas/ItemTagSummary'
          type: array
          title: Tags
          description: Tags assigned to this item
        hiddenInPatientPortal:
          type: boolean
          title: Hiddeninpatientportal
          description: Whether this item is hidden from the patient portal
          default: false
        hiddenInOnlineShop:
          type: boolean
          title: Hiddeninonlineshop
          description: Whether this item is hidden from the online shop
          default: true
        loyaltyPointsEarned:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Loyaltypointsearned
          description: Points earned when this item is purchased
        defaultCptCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Defaultcptcode
          description: Default CPT / HCPCS code for Super Bill autofill
        defaultModifiers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Defaultmodifiers
          description: Default procedure modifiers for Super Bill autofill
        defaultIcd10Codes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Defaulticd10Codes
          description: Default ICD-10 codes for Super Bill autofill
        defaultPlaceOfService:
          anyOf:
            - type: string
            - type: 'null'
          title: Defaultplaceofservice
          description: Default CMS Place of Service code for Super Bill autofill
        stocks:
          anyOf:
            - items:
                $ref: '#/components/schemas/ItemStock'
              type: array
            - type: 'null'
          title: Stocks
          description: Optional linked stocks for the item
      type: object
      required:
        - name
        - price
      title: Item
    ItemType:
      type: string
      enum:
        - ITEM
        - SERVICE
        - PRODUCT
        - PACKAGE
        - MEMBERSHIP
        - MEDICATION
        - SERVICE_FEE
        - GIFT_CARD
      title: ItemType
    ItemTagSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
      type: object
      required:
        - id
        - name
      title: ItemTagSummary
    ItemStock:
      properties:
        itemId:
          type: string
          title: Itemid
          description: ID of the item
        stockId:
          type: string
          title: Stockid
          description: ID of the stock
        quantityUsed:
          type: number
          title: Quantityused
          description: Quantity of the item
        multiplyByDose:
          type: boolean
          title: Multiplybydose
          description: >-
            If true, dose-administration drawdowns multiply quantity_used by
            DoseComponent.amount (unit-converted to the stock's unit). Used for
            vial-style medications.
          default: false
      type: object
      required:
        - itemId
        - stockId
        - quantityUsed
      title: ItemStock

````