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

# Link Supplier To Stock



## OpenAPI

````yaml post /inventory/stocks/link-supplier
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/link-supplier:
    post:
      tags:
        - provider
        - inventory
      summary: Link Supplier To Stock
      operationId: link_supplier_to_stock_inventory_stocks_link_supplier_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:
                anyOf:
                  - $ref: '#/components/schemas/SupplierToStockCreate'
                  - $ref: '#/components/schemas/SupplierToStockUpdate'
              type: array
              title: Supplier Links
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/SupplierToStock-Output'
                type: array
                title: >-
                  Response Link Supplier To Stock Inventory Stocks Link Supplier
                  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SupplierToStockCreate:
      properties:
        supplierId:
          type: string
          title: Supplierid
          description: ID of the supplier
        stockId:
          type: string
          title: Stockid
          description: ID of the stock
        uoms:
          items:
            $ref: '#/components/schemas/SupplierToStockUomCreate'
          type: array
          minItems: 1
          title: Uoms
          description: UOM entries for this supplier-stock link
      type: object
      required:
        - supplierId
        - stockId
        - uoms
      title: SupplierToStockCreate
      description: Schema for creating a new supplier-to-stock link with UOM entries.
    SupplierToStockUpdate:
      properties:
        id:
          type: string
          title: Id
          description: ID of the supplier-to-stock relationship to update
        uomsToAdd:
          anyOf:
            - items:
                $ref: '#/components/schemas/SupplierToStockUomCreate'
              type: array
            - type: 'null'
          title: Uomstoadd
          description: New UOM entries to add
        uomsToUpdate:
          anyOf:
            - items:
                $ref: '#/components/schemas/SupplierToStockUomUpdate'
              type: array
            - type: 'null'
          title: Uomstoupdate
          description: Existing UOM entries to update
        uomsToDelete:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Uomstodelete
          description: IDs of UOM entries to delete
        migratePurchaseOrders:
          type: boolean
          title: Migratepurchaseorders
          description: >-
            If true, update pending/partial PO line items to use the new UoM
            configurations
          default: false
      type: object
      required:
        - id
      title: SupplierToStockUpdate
      description: Schema for updating an existing supplier-to-stock link and its UOMs.
    SupplierToStock-Output:
      properties:
        supplierId:
          type: string
          title: Supplierid
          description: ID of the supplier
        stockId:
          type: string
          title: Stockid
          description: ID of the stock
        id:
          type: string
          title: Id
          description: Unique identifier for the supplier-to-stock relationship
        uoms:
          anyOf:
            - items:
                $ref: '#/components/schemas/SupplierToStockUom'
              type: array
            - type: 'null'
          title: Uoms
          description: UOM variants for this supplier-stock link
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
          description: Date the link was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date the link was last updated
        isArchived:
          type: boolean
          title: Isarchived
          description: Whether the link is archived
          default: false
      type: object
      required:
        - supplierId
        - stockId
        - id
      title: SupplierToStock
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SupplierToStockUomCreate:
      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)
      type: object
      required:
        - supplierPartNumber
        - uom
      title: SupplierToStockUomCreate
      description: Schema for creating a new SupplierToStockUom entry.
    SupplierToStockUomUpdate:
      properties:
        id:
          type: string
          title: Id
          description: ID of the UOM entry to update
        supplierPartNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierpartnumber
        uom:
          anyOf:
            - $ref: '#/components/schemas/Unit'
            - type: 'null'
        conversionFactor:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Conversionfactor
        isDefault:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isdefault
        displayLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Displaylabel
        price:
          anyOf:
            - type: integer
            - type: 'null'
          title: Price
        leadTime:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Leadtime
      type: object
      required:
        - id
      title: SupplierToStockUomUpdate
      description: Schema for updating an existing SupplierToStockUom entry.
    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
    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
    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

````