Stock On Hand
Allows customers to retreive Stock on Hand details for products.
Note: There is a limit of 30 products allowed at once.
Access
To get access to this API, please fill in the Developer Registration form
Resource URI
Make an HTTP POST request to:
https://api.mainfreight.com/Warehousing/1.1/Customers/Products/StockOnHand?region={add region}
Resource Information
Type | Value | ||
---|---|---|---|
Authentication | API Key | ||
Response Formats | JSON / XML | ||
HTTP Methods | POST | ||
API Version | 1.1 |
HTTP Headers
You must add the following HTTP Headers to your request:
Header | Type | Description |
---|---|---|
Content-Type | string | Request content type. Supported types are "application/json" or "application/xml." |
Authorization | string |
The word "Secret" followed by a space, then your unique Logistics API Key. e.g: Secret wdnOId93-VXZECxvVRPQEJZNxPB5XZ... |
Parameters
You must provide the parameters marked as required:
HTTP Request Parameters
Header | Description | Type | Required |
---|---|---|---|
region |
Region code, a list of supported regions for each country can be found here |
string | Yes |
Fields
You must provide the fields marked as required:
Request Body
Field | Description | Type | Length | Required |
---|---|---|---|---|
warehouse | Warehouse that can be indentified in our system | array | Yes | |
code | Warehouse code value | string | 50 | Yes |
customer | Customer that can be indentified in our system | array | Yes | |
code | Customer code value | string | 50 | Yes |
products | List of Products that can be identified in our system | array | Yes | |
code | Product SKU in our system | string | 50 | No |
Response Body
Field | Type | Description |
---|---|---|
products | string | |
code | string | product code value |
displayName | string | product description value |
balance | array | |
stockOnHand | integer | Number of units on hand |
committed | integer | Number of units committed to transactions |
available | integer | Number of units available |
receiving | integer | Number of units being transferred |
damaged | integer | Number of units under damage status |
onHold | integer | Number of units under onHold status |
reserved | integer | Number of units reserved for transactions |
restricted | integer | Number of units under restricted status |
availableToOrder | integer | Number of units avaiable to order |
held | integer | Number of units held by transactions |
enteredStock | integer | Number of units assigned to unprocessed transactions |
balanceDetails | array | |
balanceDetail | object | |
stockOnHand | integer | Number of units on hand |
committed | integer | Number of units committed to transactions |
available | integer | Number of units available |
receiving | integer | Number of units being transferred |
damaged | integer | Number of units under damage status |
onHold | integer | Number of units under onHold status |
reserved | integer | Number of units reserved for transactions |
restricted | integer | Number of units under restricted status |
availableToOrder | integer | Number of units avaiable to order |
held | integer | Number of units held by transactions |
enteredStock | integer | Number of units assigned to unprocessed transactions |
grade1 | string |
Grade 1 attribute value |
grade2 | string | Grade 2 attribute value |
grade3 | string | Grade 3 attribute value |
expiryDate | date | Expiry date attribute value |
vfd | string | Value for Duty |
vti | string | Value transport Insurance |
entryNo | string | Entry Number |
entryLineNo | string | Entry Line Number |
Code samples
To Get Stock On Hand in the JSON format you will need to POST a JSON Object:
- URL
https://api.mainfreight.com/Warehousing/1.1/Customer/Products/StockOnHand?region=US
You are going to send a JSON object similar to this:
- REQUEST JSON
{ "warehouse": { "code": "{{warehouseCode}}" }, "customer": { "code": "{{customerCode}}" }, "products": [{ "code": "269495" }, { "code": "065108A" } ] }
You are going get another JSON object similar to this:
- RESPONSE JSON
To Get Stock on Hand in XML format, you will need to POST XML object.
- URL
https://api.mainfreight.com/Warehousing/1.1/Customer/Products/StockOnHand?region=US
You are going to send a XML object similar to this:
- XML REQUEST
<stockOnHand>
<warehouse>
<code>1</code>
</warehouse>
<customer>
<code>43862</code>
</customer>
<products>
<product>
<code>ProductCode1</code>
</product>
</products>
</stockOnHand>
You are going to get a XML document similar to this:
- XML RESPONSE