GET api/Stocks?stockType={stockType}
Gets all stocks
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| stockType |
(Optional) parameter used to select only stocks of a certain type |
StockType |
Default value is Null |
Body Parameters
None.
Remarks
None.
Example
//Gets every stock of every type
http://localhost/api/Stocks
//Gets the stocks with stock type 1 (Trading Stock)
http://localhost/api/Stocks?stockType=1
//Gets the stocks with stock type 2 (Tyre Hotel)
http://localhost/api/Stocks?stockType=2
Response Information
Resource Description
Stocks.
Collection of StockResponse| Name | Description | Type | Additional information |
|---|---|---|---|
| Id |
The unique identifier for the stock |
globally unique identifier |
Required |
| StockNumber | integer |
None. |
|
| Name | string |
Required Max length: 50 |
|
| BranchId | integer |
Required |
|
| Default | boolean |
Required |
|
| WMSStock |
True if stock belongs to central warehouse branch. |
boolean |
Required |
| IsClosed | boolean |
Required |
|
| IsExternal | boolean |
Required |
|
| Address1 | string |
Max length: 100 |
|
| Address2 | string |
Max length: 100 |
|
| Address3 | string |
Max length: 100 |
|
| PostalCode | string |
Max length: 10 |
|
| Town | string |
Max length: 50 |
|
| StockType |
1 = Trading Stock |
StockType |
Required |
Response Formats
application/json, text/json
[
{
"Id": "a2795076-b6df-4418-a221-8c92f88da91e",
"StockNumber": 1,
"Name": "sample string 2",
"BranchId": 3,
"Default": true,
"WMSStock": true,
"IsClosed": true,
"IsExternal": true,
"Address1": "sample string 7",
"Address2": "sample string 8",
"Address3": "sample string 9",
"PostalCode": "sample string 10",
"Town": "sample string 11",
"StockType": 1
},
{
"Id": "a2795076-b6df-4418-a221-8c92f88da91e",
"StockNumber": 1,
"Name": "sample string 2",
"BranchId": 3,
"Default": true,
"WMSStock": true,
"IsClosed": true,
"IsExternal": true,
"Address1": "sample string 7",
"Address2": "sample string 8",
"Address3": "sample string 9",
"PostalCode": "sample string 10",
"Town": "sample string 11",
"StockType": 1
}
]
application/xml, text/xml
<ArrayOfStockResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Compilator.DDAPI.DTO.Stock">
<StockResponse>
<Address1>sample string 7</Address1>
<Address2>sample string 8</Address2>
<Address3>sample string 9</Address3>
<BranchId>3</BranchId>
<Default>true</Default>
<Id>a2795076-b6df-4418-a221-8c92f88da91e</Id>
<IsClosed>true</IsClosed>
<IsExternal>true</IsExternal>
<Name>sample string 2</Name>
<PostalCode>sample string 10</PostalCode>
<StockNumber>1</StockNumber>
<StockType>TradingStock</StockType>
<Town>sample string 11</Town>
<WMSStock>true</WMSStock>
</StockResponse>
<StockResponse>
<Address1>sample string 7</Address1>
<Address2>sample string 8</Address2>
<Address3>sample string 9</Address3>
<BranchId>3</BranchId>
<Default>true</Default>
<Id>a2795076-b6df-4418-a221-8c92f88da91e</Id>
<IsClosed>true</IsClosed>
<IsExternal>true</IsExternal>
<Name>sample string 2</Name>
<PostalCode>sample string 10</PostalCode>
<StockNumber>1</StockNumber>
<StockType>TradingStock</StockType>
<Town>sample string 11</Town>
<WMSStock>true</WMSStock>
</StockResponse>
</ArrayOfStockResponse>