Get Inventory

This API retrieves the inventory details for one or more SKUs from one or more facilities. When the facility is not provided in the request, network level inventory will be returned by the call.

Swagger

			
swagger: '2.0'
info:
  x-ibm-name: inventory
  title: Inventory
  version: 1.0.0
schemes:
  - https
host: $(catalog.host)
basePath: /v1
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  oauth2:
    type: oauth2
    description: ''
    flow: accessCode
    authorizationUrl: 'https://<........................>/fsc/oauth2/authorize'
    scopes:
      Fulfillment_Returns: ''
    tokenUrl: 'https://<........................>/fsc/oauth2/token'
  clientIdHeader:
    type: apiKey
    in: header
    name: X-IBM-Client-Id
    description: Enter Client Id
  clientSecretHeader:
    type: apiKey
    in: header
    name: X-IBM-Client-Secret
    description: Enter Client Secret
security:
  - clientIdHeader: []
    clientSecretHeader: []
    oauth2:
      - Fulfillment_Returns
x-ibm-configuration:
  testable: true
  enforced: true
  phase: realized
paths:
  /inventory:
    get:
      responses:
        200:
          description: 200 OK
      summary: Get Inventory
      description: Retrieves the inventory details for one or more SKUs from one or
        more facilities. When facility is not provide in the request, network level
        inventory will be returned by the call.
      parameters:
      - name: sku
        type: string
        required: false
        in: query
        description: SKU of the Product. This parameter allows upto 25 SKUs.
      - name: facility
        type: string
        required: false
        in: query
        description: Inventory information need to be retrieved from a specific facility.
          If facility is not specified, response will return network level inventory
          across all facilities.
      - name: pageLimit
        type: string
        required: false
        in: query
        description: 'Number of records to be retrieved in each page. Allowed values:
          1 to 100. Default is 50.'
			
		

Sample Request

			
•	Retrieve network level inventory details for all the SKUs across all facilities
https://<........>/api/v1/inventory
•	Retrieve network level inventory details of the SKUs provided across all facilities
https://<........>/api/v1/inventory?sku=CD8560,003-003-0001,005-001-001,OILPULL2
•	Retrieve inventory details of the SKUs provided from HFY facility
https://<........>/api/v1/inventory?sku=CD8560,003-003-0001,005-001-001,OILPULL2&facility=HFY
			
		

Sample Response

Success Response

			
 {
  "requestIdentifier": "01749ea2-4b8f-4f3d-a9dc-f0b862a3d72e",
   "transactionDate": "2017-01-20T15:12:54-05:00",
  "inventory": [
    {
      "sku": "003-003-0001",
      "facility": "HFY",
      "availableCount": 1782,
      "blockedCount": 12,
      "inboundInventoryCount": 52,
      "inboundReturnCount": 15,
      "allocatedCount": 5,
      "backorderedCount": 0
    },
    {
      "sku": "003-003-0002",
      "facility": "HFY",
      "availableCount": 1451,
      "blockedCount": 20,
      "inboundInventoryCount": 52,
      "inboundReturnCount": 15,
      "allocatedCount": 121,
      "backorderedCount": 5
    },
    {
      "sku": "003-003-0003",
      "facility": "HFY",
      "availableCount": 180,
      "blockedCount": 0,
      "inboundInventoryCount": 52,
      "inboundReturnCount": 15,
      "allocatedCount": 1,
      "backorderedCount": 15
    },
    {
      "sku": "Picante",
      "facility": "HFY",
      "availableCount": 901,
      "blockedCount": 0,
      "inboundInventoryCount": 52,
      "inboundReturnCount": 15,
      "allocatedCount": 0,
      "backorderedCount": 0
    }
  ],
  "paging": {
    "previous": "https://<.........>/api/v1/inventory?pageLimit=25&offset=0",
    "next": "https://<............>/api/v1/inventory?pageLimit=25&offset=50"
  }
}

			
		

OAuth 2.0

HTTP Headers Description
Authorization You must always provide the access token for authorization to access the API.

HTTP-Header       Value
Authorization       Bearer accessToken
Origin Origin URL.

HTTP-Header       Value
Origin                domain.com

Custom authentication

HTTP Headers Description
X-IBM-Client-Id You must always provide in the HTTP header your API portal application's client ID (X-IBM-Client-Id) to access the API.

HTTP-Header       Value
X-IBM-Client-Id     ************
X-IBM-Client-Secret You must always provide in the HTTP header your API portal application's client secret (X-IBM-Client-Secret) to access the API.

HTTP-Header       Value
X-IBM-Client-Secret     ************
AccessToken Application Access Token
Origin Origin URL.

HTTP-Header       Value
Origin                domain.com

Query Parameter

Parameter Data Type Description Multiple Values allowed Required
sku String SKU of the Product. This parameter allows up to 25 SKUs. Y N
facility String Inventory information needs to be retrieved from a specific facility. If the facility is not specified, the response will return network-level inventory across all facilities.
Valid values: HFY (Greenwood, IN), FCA (Fontana, CA)
Y N
pageLimit Number Number of records to be retrieved in each page. Allowed values: 1 to 100. Default is 50. N N
offset Number Offset value to be passed retrieve the previous/next page. Not applicable for initial request. N N

Response Attribute

Parameter Data Type Description
requestIdentifier String Request identifier
transactionDate String Transaction date/time
inventory[]    
sku String SKU of the product
facility String Facility name
availableCount String Quantity available for selling
blockedCount String Quantity blocked and not available for selling
inboundInventoryCount String Inventory quantity is waiting to receive
inboundReturnCount String Return quantity warehouse is waiting to receive
allocatedCount String Quantity allocated for outbound orders
backorderedCount String Quantity that are backordered
paging    
previous String Link to retrieve the previous page, if applicable.
next String Link to retrieve the next page, if applicable.
error[]    
code String Code associated with the error
description String Description of the error

HTTP Status Code

Code Description
200 OK - HTTP Response for successfully processed requests
400 Bad Request.
403 Forbidden
404 Not Found - Server couldn’t find anything matching request URI
500 Internal Server Error – Unable to process the request

Error Code

Code Description
ERR-SYS-0001 Your request cannot be processed due to a system error.
ERR-CMR-0001 Input data validation failed.
ERR-CMR-0002 Authentication Failed. Invalid Access Token.
ERR-CMR-0003 Missing mandatory fields.
ERR-INV-0001 Request cannot be processed with more than 25 SKUs in the filter.
ERR-INV-0002 Connection is inactive.