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



## OpenAPI

````yaml post /inventory/stocks/create
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/create:
    post:
      tags:
        - provider
        - inventory
      summary: Create Stock
      operationId: create_stock_inventory_stocks_create_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
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/StockDetail-Input'
              type: array
              title: Stocks
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Stock'
                type: array
                title: Response Create Stock Inventory Stocks Create Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StockDetail-Input:
      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
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the stock is archived
          default: false
        shipments:
          anyOf:
            - items:
                $ref: '#/components/schemas/Shipment-Input'
              type: array
            - type: 'null'
          title: Shipments
          description: Shipments in the stock
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/ItemStock'
              type: array
            - type: 'null'
          title: Items
          description: Items in the stock
        locationSummaries:
          anyOf:
            - items:
                $ref: '#/components/schemas/StockLocationSummary'
              type: array
            - type: 'null'
          title: Locationsummaries
          description: Stock quantities grouped by location
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Optional note for inventory log when updating stock
      type: object
      required:
        - name
        - unit
      title: StockDetail
    Stock:
      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
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the stock is archived
          default: false
        shipments:
          anyOf:
            - items:
                $ref: '#/components/schemas/Shipment-Output'
              type: array
            - type: 'null'
          title: Shipments
          description: Shipments in the stock
      type: object
      required:
        - name
        - unit
      title: Stock
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
        - TUBES
        - UNITS
        - VIALS
        - TREATMENTS
        - SESSIONS
        - PULSES
        - JOULES
        - CENTIMETERS
        - THREAD_COUNT
        - INJECTIONS
        - WRINKLE_UNITS
        - POUNDS
        - FEET
        - INCHES
      title: Unit
    Shipment-Input:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the shipment
        stockId:
          type: string
          title: Stockid
          description: ID of the stock
        supplierId:
          type: string
          title: Supplierid
          description: ID of the supplier
        locationId:
          type: string
          title: Locationid
          description: ID of the location where the shipment was delivered
        lotNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Lotnumber
          description: Optional lot number of the shipment
        expiryDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirydate
          description: Optional expiry date of the shipment
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
          description: Optional SKU (Stock Keeping Unit)
        quantity:
          type: number
          title: Quantity
          description: Total quantity
        remainingQuantity:
          type: number
          title: Remainingquantity
          description: Remaining quantity
        cost:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cost
          description: Cost of the shipment in cents
        supplier:
          anyOf:
            - $ref: '#/components/schemas/Supplier'
            - type: 'null'
          description: Optional supplier details
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: Date and time the shipment was created
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Optional note for inventory log when updating shipment
      type: object
      required:
        - stockId
        - supplierId
        - locationId
        - quantity
        - remainingQuantity
      title: Shipment
    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
      type: object
      required:
        - itemId
        - stockId
        - quantityUsed
      title: ItemStock
    StockLocationSummary:
      properties:
        locationId:
          type: string
          title: Locationid
          description: ID of the location
        locationName:
          type: string
          title: Locationname
          description: Name of the location
        totalQuantity:
          type: number
          title: Totalquantity
          description: Total quantity at this location
        remainingQuantity:
          type: number
          title: Remainingquantity
          description: Remaining quantity at this location
        percentage:
          type: number
          title: Percentage
          description: Percentage of stock remaining
      type: object
      required:
        - locationId
        - locationName
        - totalQuantity
        - remainingQuantity
        - percentage
      title: StockLocationSummary
    Shipment-Output:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the shipment
        stockId:
          type: string
          title: Stockid
          description: ID of the stock
        supplierId:
          type: string
          title: Supplierid
          description: ID of the supplier
        locationId:
          type: string
          title: Locationid
          description: ID of the location where the shipment was delivered
        lotNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Lotnumber
          description: Optional lot number of the shipment
        expiryDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expirydate
          description: Optional expiry date of the shipment
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
          description: Optional SKU (Stock Keeping Unit)
        quantity:
          type: number
          title: Quantity
          description: Total quantity
        remainingQuantity:
          type: number
          title: Remainingquantity
          description: Remaining quantity
        cost:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cost
          description: Cost of the shipment in cents
        supplier:
          anyOf:
            - $ref: '#/components/schemas/Supplier'
            - type: 'null'
          description: Optional supplier details
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: Date and time the shipment was created
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Optional note for inventory log when updating shipment
        locationName:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationname
          description: Get the location name from the related location object
          readOnly: true
      type: object
      required:
        - stockId
        - supplierId
        - locationId
        - quantity
        - remainingQuantity
        - locationName
      title: Shipment
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Supplier:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the supplier
        name:
          type: string
          title: Name
          description: Name of the supplier
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the supplier
        website:
          anyOf:
            - type: string
            - type: 'null'
          title: Website
          description: Optional website of the supplier
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Optional email of the supplier
        preferredContactMethod:
          anyOf:
            - type: string
            - type: 'null'
          title: Preferredcontactmethod
          description: Optional preferred contact method
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: Optional phone number of the supplier
        addressLineOne:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslineone
          description: Optional first line of address
        addressLineTwo:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslinetwo
          description: Optional second line of address
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: Optional city
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: Optional state or province
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: Optional ZIP or postal code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Optional country
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the supplier is archived
          default: false
      type: object
      required:
        - name
      title: Supplier

````