---
swagger: "2.0"
info:
  description: Shipwire's Stock API.
  version: "3.0"
  title: Shipwire Inventory API
host: api.shipwire.com
basePath: /
schemes:
- https
consumes:
- application/json
produces:
- application/json
security:
- basicAuth: []
paths:
  /api/v3/stock:
    get:
      tags:
      - Stock
      summary: Get inventory levels for your products at different stages of fulfillment.
      operationId: ApiV3StockGet
      produces:
      - application/json
      parameters:
      - name: parentId
        in: query
        description: Product ID or external ID
        required: false
        type: string
      - name: sku
        in: query
        description: Filters by SKU, comma-separated list can be specified
        required: false
        type: string
      - name: productId
        in: query
        description: Filters by product ID (Shipwire platform), comma-separated list can be specified
        required: false
        type: string
      - name: productExternalId
        in: query
        description: Filters by product ID (Client platform), comma-separated list can be specified
        required: false
        type: string
      - name: warehouseId
        in: query
        description: Filters by warehouse ID (Shipwire platform), comma-separated list can be specified
        required: false
        type: string
      - name: warehouseExternalId
        in: query
        description: Filters by warehouse ID (Client platform), comma-separated list can be specified
        required: false
        type: string
      - name: warehouseRegion
        in: query
        description: Filters by warehouse Region, comma-separated list can be specified
        required: false
        type: string
      - name: warehouseArea
        in: query
        description: Filters by warehouse Area (continents and countries), comma-separated list can be specified
        required: false
        type: string
      - name: channelName
        in: query
        description: Sets channelName for the request
        required: false
        type: string
      - name: includeEmpty
        in: query
        description: If set to '1' then empty resources will be displayed as well
        required: false
        type: boolean
      - name: vendorId
        in: query
        description: Vendor ID list (comma-separated)
        required: false
        type: string
      - name: vendorExternalId
        in: query
        description: Vendor external ID list (comma-separated)
        required: false
        type: string
      - name: disableAutoBreakLots
        in: query
        description: If set to 1, disable Auto Break Lots feature in the response (i.e show actual eaches in the warehouse, not including the eaches found in the unbroken innercase and/or mastercase cartons)
        required: false
        type: boolean
      - name: mode
        in: query
        description: 'This defines whether we return eaches SKUs with the eaches quantities contained within mastercases and innercases included in the eaches SKU quantity ("IncludingHigherLevelQuantities" vs "NotIncludingHigherLevelQuantities") as well as whether we include lot SKUs (mastercases and innercases) in the response ("WithLots" vs "WithoutLots"). If you do not set this parameter, and your Shipping Preferences have "Enable Automated Lot Breaks" enabled, we default to "IncludingHigherLevelQuantitiesWithLots". If you have this preference disabled, we default to "NotIncludingHigherLevelQuantitiesWithLots". Valid values: IncludingHigherLevelQuantitiesWithLots, IncludingHigherLevelQuantitiesWithoutLots, NotIncludingHigherLevelQuantitiesWithLots, NotIncludingHigherLevelQuantitiesWithoutLots'
        required: false
        type: string
      - name: includeEmptyShipwireAnywhere
        in: query
        description: If set to 1, empty stock resources at Shipwire Anywhere warehouses will be displayed as well
        required: false
        type: boolean
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/GetStockAvailabilityResponse'
  /api/v3/stock/adjust:
    post:
      tags:
      - Stock
      summary: Adjust inventory at Fulfillment Anywhere warehouses.
      operationId: ApiV3StockAdjustPost
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        required: true
        schema:
          $ref: '#/definitions/AdjustInventoryRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/AdjustInventoryResponse'
securityDefinitions:
  basicAuth:
    type: basic
definitions:
  StockServerResponse:
    type: object
    properties:
      status:
        type: integer
        example: 200
        description: This is the HTTP status code.
      message:
        type: string
        example: Successful
        description: This is the HTTP status message.
      resourceLocation:
        type: string
        example: null
        description: A URL that gives more information about the linked resource. A null value would mean that no further information is available for that resource. Use this resource to get detailed information about the stock available.
    title: Stock Server Response
    description: These are codes in the response header that indicate the general status of the response. For example, if the request is successful, the status code is 200; if the request has some errors, it could be a 400 series code.
  StockServerPaginationResponse:
    type: object
    properties:
      offset:
        type: integer
        example: 0
        description: This is an integer that matches the offset given in the request and dictates the number of items to skip while fetching results. For example, there is a preset limit of 20 results per page. If there are 30 total results and offset is set to 20, then the response will show the second "page" of results, with items 21 to 30.
      total:
        type: integer
        example: 1
        description: Total number of available items in the API response.
      previous:
        type: string
        example: null
        description: A link used to fetch the previous set or page of items in the API response.
      next:
        type: string
        example: null
        description: A link used to fetch the next set or page of items in the API response.
    title: Stock Server Pagination Response
    description: Stock Server Pagination Response
  GetStockAvailabilityResponse:
    allOf:
    - $ref: '#/definitions/StockServerResponse'
    - title: Get Stocks Availability Response
    - description: Get Stocks Availability Response
    - type: object
    - properties:
        resource: {}
  AdjustInventoryRequest:
    type: object
    required:
    - delta
    - reason
    - sku
    - warehouseExternalId
    properties:
      warehouseId:
        type: string
        example: null
        description: A unique identifier for a Shipwire or Shipwire Anywhere warehouse. (See the warehouses API.)
        minLength: 1
        maxLength: 32
      warehouseExternalId:
        type: string
        example: DENVER-WH-16
        description: A unique user provided identifier for a Shipwire Anywhere warehouse in an external system. One of warehouseId, warehouseExternalId is required.
        minLength: 1
        maxLength: 32
      reason:
        type: string
        example: Received new inventory
        description: A brief explanation for the adjustment to inventory. Useful for audit purposes.
        minLength: 1
        maxLength: 64
      sku:
        type: string
        example: Laura-s_Pen
        description: SKU (Stock Keeping Unit) is a unique name for your product and is required for both physical and virtual products in inventory. One of sku, productId, productExternalId is required.
        minLength: 1
        maxLength: 50
      productId:
        type: integer
        example: null
        description: A unique auto-generated ID assigned to each new product added to the Shipwire Product Catalog.
      productExternalId:
        type: integer
        example: null
        description: A unique user provided identifier for a product in an external system.
      delta:
        type: integer
        example: 100
        description: Delta is a positive or negative value by which the SKU item quantity is either increased or decreased. One of delta, quantity is required.
      quantity:
        type: integer
        example: null
        description: The adjusted quantity of total SKU items.
    title: Adjust inventory request
    description: Adjust inventory request
  AdjustInventoryResponse:
    allOf:
    - $ref: '#/definitions/StockServerResponse'
    - title: Adjust inventory response
    - description: Adjust inventory response
    - type: object
    - properties:
        resource: {}
  StockModel:
    type: object
    properties:
      productId:
        type: integer
        example: 730
        description: A unique auto-generated ID assigned to each new product added to the Shipwire Product Catalog.
      productExternalId:
        type: string
        example: PRO_730
        description: A unique user provided identifier for a product in an external system.
        minLength: 1
        maxLength: 32
      sku:
        type: string
        example: Laura-s_Pen
        description: SKU (Stock Keeping Unit) is a unique name for your product and is required for both physical and virtual products in inventory.
        minLength: 1
        maxLength: 50
      isBundle:
        type: boolean
        example: false
        description: A boolean value which indicates that the product is packaged as a bundle. (i.e. a virtual kit that consists of one or more regular products)
      isAlias:
        type: boolean
        example: false
        description: A boolean value that indicates that the requested stock resource is an alias of a product. An alias is an alternative name that can be given to a SKU for easy reference.
      warehouseRegion:
        type: string
        example: LAX1
        description: A region identifier created and assigned by Shipwire for a warehouse.
        maxLength: 25
      warehouseId:
        type: integer
        example: 11
        description: A unique identifier for a Shipwire or Shipwire Anywhere warehouse. (See the warehouses API.)
      physicalWarehouseId:
        type: integer
        example: 33
        description: A shipwire warehouse ID used to identify a specific physical warehouse that corresponds to a Shipwire Anywhere warehouse. Useful in consolidating inventory. If the SKU item is at a Shipwire warehouse, then this will be null.
      warehouseExternalId:
        type: string
        example: DENVER-WH-16
        description: A unique user provided identifier for a Shipwire Anywhere warehouse in an external system.
        minLength: 1
        maxLength: 32
      vendorId:
        type: integer
        example: 220
        description: A unique ID assigned to each vendor in the Shipwire system. (See the vendors API.)
      vendorExternalId:
        type: string
        example: VND-17
        description: A unique user provided identifier for a vendor in an external system.
        minLength: 1
        maxLength: 32
      pending:
        type: integer
        example: 23
        description: The number of SKU items expected to be received at the warehouse.
      good:
        type: integer
        example: 322
        description: The number of SKU items ready for fulfillment in the warehouse.
      reserved:
        type: integer
        example: 21
        description: The number of SKU items reserved for an order in progress and not available for any other order.
      backordered:
        type: integer
        example: 23
        description: The number of SKU items backordered.
      shipping:
        type: integer
        example: 45
        description: The number of SKU items currently in the process of being fulfilled (i.e. shipping). It is inventory that is allocated for shipping based on an order that has been transmitted to the warehouse.
      shipped:
        type: integer
        example: 65
        description: The number of SKU items that have shipped out of the warehouse.
      creating:
        type: integer
        example: 45
        description: The number of SKU items currently being processed into a new product as part of a special project. When finished, these will be new SKUs identified as created.
      consuming:
        type: integer
        example: 33
        description: The number of SKU items in the warehouse that are now reserved for completion of a special project. This is used as a placeholder.
      consumed:
        type: integer
        example: 23
        description: The number of SKU items which were ultimately converted to the new SKU/product (or destroyed) during a special project.
      created:
        type: integer
        example: 35
        description: The number of new SKU items which were created as a result of a special project. These SKUs will also appear as good inventory, making them available for fulfillment.
      damaged:
        type: integer
        example: 12
        description: The number of SKU items found to be damaged (during receiving or otherwise) within the warehouse and unavailable for fulfillment.
      returned:
        type: integer
        example: 21
        description: The number of SKU items returned to the warehouse by the customer.
      inreview:
        type: integer
        example: 22
        description: The number of SKU items currently under review within the warehouse. (i.e. items being reviewed to determine if they are in sellable condition or damaged, etc.)
      availableDate:
        type: string
        format: datetime
        example: 2014-05-30T13:08:29-07:00
        description: Date on which the new inventory will be available for sale in the warehouse.
      shippedLastDay:
        type: integer
        example: 12
        description: Total number of SKU items shipped yesterday.
      shippedLastWeek:
        type: integer
        example: 45
        description: Total number of SKU items shipped in the last week.
      shippedLast4Weeks:
        type: integer
        example: 256
        description: Total number of SKU items shipped in the last 4 week period.
      orderedLastDay:
        type: integer
        example: 21
        description: Total number of SKU items ordered yesterday.
      orderedLastWeek:
        type: integer
        example: 76
        description: Total number of SKU items ordered in the last week.
      orderedLast4Weeks:
        type: integer
        example: 654
        description: Total number of SKU items ordered in the last 4 week period.
    title: Stock Model
