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

# Bulk insert to inventory

> Bulk insert to inventory



## OpenAPI

````yaml oms_v1 post /api-inventory/inventory/bulk-insert
openapi: 3.0.0
info:
  description: Order Management System
  version: 1.0.0
  title: Orders v1 (OMS v1)
  contact:
    email: oms-team@fabric.inc
  license:
    name: fabric API license
    url: https://fabric.inc/api-license
servers:
  - url: https://prod01-apigw.{customer_name}.fabric.zone
    description: Production
    variables:
      customer_name:
        default: yourcompany
        description: Customer name, provided by support team
security: []
tags:
  - name: Cart
    description: >-
      Cart APIs<br /><br />**Note:** These are the legacy Cart APIs. To view
      fabric's new Cart APIs, navigate to *Cart API > Cart* from the left side
      navigation pane.
  - name: Bill To
    description: Bill To APIs [Deprecated]
  - name: Ship To
    description: >-
      Ship To APIs<br /><br />**Note:** These are the legacy Ship To APIs. To
      view fabric's new Shipping APIs, navigate to *Cart API > Shipping* from
      the left side navigation pane.
  - name: Wishlist
    description: Wishlist APIs
  - name: Cart Decoupled
    description: Cart Decoupled APIs
  - name: Warehouse
    description: Warehouse APIs
  - name: Inventory
    description: Inventory APIs
  - name: Attributes
    description: >-
      Attributes APIs<br /><br />**Note:** These are the legacy Attribute APIs.
      To view fabric's new Attribute APIs, navigate to *Cart API > Attribute*
      from the left side navigation pane.
  - name: List
    description: List APIs
  - name: Tax/Address Validate
    description: Tax/Address Validate APIs
  - name: Shipping
    description: Shipping APIs
  - name: Payments
    description: Payments APIs
  - name: Order
    description: Order APIs
paths:
  /api-inventory/inventory/bulk-insert:
    post:
      tags:
        - Inventory
      summary: Bulk insert to inventory
      description: Bulk insert to inventory
      operationId: inventoryBulkInsert
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: header
          name: x-api-key
          schema:
            type: string
            example: 0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k
      requestBody:
        content:
          application/json:
            example:
              - sku: '1597422'
                itemId: 1597422
                totalQuantity: 25
                reservedQuantity: 0
                locationId: 175
                type: Stock
                channelId: 12
                transitRef: wo-2002
                transitOrderDate: '2019-12-14'
                transitStockDate: '2019-12-14'
            schema:
              type: array
              minItems: 1
              items:
                type: object
                anyOf:
                  - required:
                      - totalQuantity
                      - reservedQuantity
                      - locationId
                      - type
                      - sku
                  - required:
                      - totalQuantity
                      - reservedQuantity
                      - locationId
                      - type
                      - itemId
                properties:
                  sku:
                    type: string
                    minLength: 1
                    example: '1597422'
                  itemId:
                    type: number
                    minimum: 1
                    example: 1597422
                  totalQuantity:
                    type: number
                    minimum: 0
                    example: 25
                  reservedQuantity:
                    type: number
                    minimum: 0
                    example: 0
                  locationId:
                    type: number
                    minimum: 0
                    example: 175
                  type:
                    type: string
                    enum:
                      - Stock
                      - Transit
                    example: Stock
                  channelId:
                    type: number
                    enum:
                      - 12
                      - 13
                    example: 12
                  transitRef:
                    type: string
                    example: wo-2002
                  transitOrderDate:
                    type: string
                    example: '2019-12-14'
                  transitStockDate:
                    type: string
                    example: '2019-12-14'
      responses:
        '200':
          description: Inventory bulk insert
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      messages:
                        type: array
                        items:
                          type: string
                          example: >-
                            Import Inventory job started: Mon Nov 02 2020
                            22:26:10 GMT+0000 (Coordinated Universal Time)
                      keyId:
                        type: string
                        example: api-1604355970096
                      type:
                        type: string
                        example: api
                      status:
                        type: string
                        example: FINISHED
                      totalItems:
                        type: integer
                        example: 1
                      totalItemsUploaded:
                        type: integer
                        example: 1
                      totalRows:
                        type: integer
                        example: 2
                      totalRowsErrors:
                        type: integer
                        example: 2
                      __v:
                        type: number
                        example: 0
                  - type: object
                    properties:
                      _id:
                        type: string
                        example: 5fee9d59f2f08a1b3cbdea08
                      createdAt:
                        type: string
                        example: '2020-12-31T02:09:53.914Z'
                      updatedAt:
                        type: string
                        example: '2020-12-31T02:09:53.914Z'
        '400':
          description: Inventory insert failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    description: The error code
                    example: INVENTORY_INSERT_FAILED
                    type: string
                  message:
                    description: The error message
                    example: >-
                      Inventory insert failed: Row 1: Cannot find "Location Id"
                      999.
        '403':
          $ref: '#/components/responses/MissingXApiKeyHeader'
        '500':
          $ref: '#/components/responses/GenericServerError'
components:
  parameters:
    xSiteContent:
      name: x-site-context
      in: header
      description: >-
        The `x-site-context` header is a JSON object that contains information
        about the source you wish to pull from. The mandatory `account` is the
        24 character identifier found in Copilot. The `channel` (Sales channel
        ID), `stage` (environment name), and `date` attributes can be used to
        further narrow the scope of your data source.
      required: true
      schema:
        type: string
        example: >-
          {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
          "1234abcd5678efgh9ijklmno","stage":"production"}
  responses:
    MissingXApiKeyHeader:
      description: Missing x-api-key in header
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                description: The error message
                example: Forbidden
                type: string
    GenericServerError:
      description: A generic server error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string

````