openapi: 3.0.1
info:
  title: Common Entities - Inventory
  description: Inventory common domain entities
  termsOfService: https://fabric.inc/privacy-policy
  contact:
    name: Fabric Support Team
    email: support@fabric.inc
  license:
    name: Fabric Privacy Policy
    url: https://fabric.inc/privacy-policy
  version: 3.0.0
  x-audience: external-public
servers:
  - url: https://api.fabric.inc/v3
    description: Production
paths: {}
components:
  schemas:
    inventory:
      type: object
      properties:
        inventoryId:
          type: string
          description: >-
            System-generated inventory ID. This ID is generated during inventory
            creation.
          example: 723910d81723
        sku:
          type: string
          description: >-
            Product SKU (Stock Keeping Unit) identifier. It serves as the
            primary reference key for the inventory and provides uniqueness to
            the item.
          example: SKU1
        itemId:
          type: integer
          description: >-
            Merchant-defined item ID whose inventory is created or updated. If
            omitted, fabric Inventory service generates the `itemId`. If you
            choose to use the `itemId` in your environment, you must include it
            in all inventory *Write* requests.
          format: int32
          example: 12345
        locationNumber:
          type: integer
          description: >-
            Represents the warehouse or store location where the inventory is
            stored. It's recommended to link `locationNumber` to the
            corresponding value in the fabric Locations service.
          format: int32
          example: 12345
        region:
          type: string
          description: Region where inventory is managed
          example: North America
        channelId:
          type: string
          description: Sales channel ID; identifies business operations location.
          example: channel_xyz
        vendorId:
          type: string
          description: ID of the vendor who will replenish the inventory for the retailer
          example: vendor1
        createdAt:
          type: string
          description: Time of inventory creation
          format: date-time
          example: 2022-08-01T18:03:28.483Z
        updatedAt:
          type: string
          description: Time when inventory was last updated
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        leadTime:
          type: string
          description: >-
            Time between when an order is placed to replenish inventory and when
            the order is received at warehouse
          example: 5 days
        type:
          type: string
          description: >-
            Inventory type - a classifier attribute that provides flexibility to
            define inventory types
          example: primary
        hasInfiniteInventory:
          type: boolean
          description: >-
            Infinite inventory flag.<br />true: Inventory can be used any number
            of times and doesn't have any consumption limit.<br />false:
            Inventory can't be used infinitely, and has a consumption limit.
          example: false
          default: false
        backorderShipmentAt:
          type: string
          description: Time when backorder is shipped
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        preorderShipmentAt:
          type: string
          description: Time when preorder is shipped
          format: date-time
          example: 2022-08-01T20:03:28.483Z
        backorderLimit:
          type: integer
          description: Maximum restock inventory quantity
          format: int32
          example: 50
        preorderLimit:
          type: integer
          description: Maximum first-shipping inventory quantity
          format: int32
          example: 40
        safetyStock:
          type: integer
          description: Reserved inventory quantity at the location
          format: int32
          example: 10
        lowStock:
          type: integer
          description: >-
            Inventory quantity below which consumer service wants to be alerted
            as low stock at the location
          format: int32
          example: 10
        networkCode:
          type: string
          description: Code of the network to which the inventory belongs
          example: ShipToHome
        counters:
          type: object
          additionalProperties:
            type: integer
            description: >-
              Merchant-defined inventory counter (also known as inventory
              position)
            format: int32
          description: >-
            Merchant-defined inventory counter (also known as inventory
            position)
          example:
            onHand: 100
            allocated: 10
            shipped: 20
        customAttributes:
          type: object
          additionalProperties:
            type: string
            description: Placeholder for additional info
            example: '{"isBopis":true}'
          description: Placeholder for additional info
          example:
            isBopis: true
        networkCounters:
          type: object
          additionalProperties:
            type: integer
            description: Indicates inventory positions at network
            format: int32
          description: Indicates inventory positions at network
          example:
            softReserve: 10
        virtualCounters:
          type: object
          additionalProperties:
            type: integer
            format: int32
            description: Virtual counters are calculated at run time from counters
          description: Virtual counters are calculated at run time from counters
          example:
            availableToPurchase: 60
      description: Inventory response sample
