Merchanter API - Stock
Authentication
At the time of writing this document, the Merchanter API service uses basic authentication. This allows the clients to authenticate themselves by providing a username and password in the Authorization HTTP header.
Operations
Content Types
GET operations can send data in either XML (the default) or JSON format. If JSON is required, the request must be sent with an Accept HTTP header and the value “application/json”.
POST/PUT operations can receive data in either XML (the default) or JSON format. If JSON is required, the request must be sent with a Content-Type HTTP header and the value “application/json”.
Endpoints
The URL of every endpoint always starts with a base url:-
{Merchanter application url}/rest/api.merch/v1
Only the relative URL is shown for each endpoint.
Stock
· GEToperations
o /Stock/DepotStockOverviews– Retrieve stock information at a depot level for products under the current user account’s ledger
§ Parameters
· HTTPheader type
o If-Modified-Since – a UTCtimestamp (format ‘yyyy-MM-dd HH:mm:ss’). Only depot stock overviews and/or stock configurations (for minimum stock level) that have been created ormodified since this timestamp will be returned
· Querytype
o Where – a filterexpression string with ANDed filters. Available filters are
§ IsSpecial – is this stock overviewfor a special product? true/false
§ SellOnline – is this stock overviewfor an ecommerce product? true/false
§ IsEcommerceDepot – is this stockoverview for an ecommerce depot? true/false
E.g.Where=IsSpecial==false&&SellOnline==true&&IsEcommerceDepot==true
o page – page number. Up to100 depot stock overviews will be returned per call when the page parameter isused e.g. page=1.
§ Response schema & body (JSON)
Attribute Name |
Data Type |
Max Length |
Notes |
Response Body (JSON) |
Free |
Decimal |
|
Available stock quantity |
[ { "Free": 0.000, "IsStockControlled": false, "ProductStockLocation": { "StockConfiguration": { "MinimumStock": 0.000 } }, "Product": { "Code": "" }, "Depot": { "Code": "" } } ] |
IsStockControlled |
Boolean |
|
Stock controlled? |
|
ProductStockLocation |
|
|
|
|
- StockConfiguration |
|
|
Stock configuration info |
|
- - MinimumStock |
Decimal |
|
Minimum stock level |
|
Product |
|
|
Product info |
|
- Code |
String |
20 |
Product code |
|
Depot |
|
|
Depot info |
|
- Code |
String |
2 |
Depot code |