Products
Get a filtered list of products
All tables have a corresponding Query class. For example, the table IN_Main has a class IN_MainQuery. The IN_MainQuery class is the DTO used for query operations against the IN_Main table. By setting various properties of an instance of this class, a filtered, ordered set of results can be obtained.
PanelborderStyle | solid |
---|
title | Retrieve first 25 products where the PartNo starts with 'a' |
---|
Deck CardidIN_MainQuery Anchor |
---|
| v_Jiwa_Inventory_Item_ListQuery_Anchor |
---|
| v_Jiwa_Inventory_Item_ListQuery_Anchor |
---|
|
Using v_Jiwa_Inventory_Item_ListQuery
A view, v_Jiwa_Inventory_Item_List is provided with a corresponding query class v_Jiwa_Inventory_Item_ListQuery to facilitate retrieving a filtered, paginated list of products. The data returned includes the PartNo, Description, Picture, Categories, Sell price, RRP and stock levels.
Which fields are returned can be limited with the Fields property - so only the required fields are returned.
With the Include property set to "Total" the response will include the total count of records matching the query - this is useful for pagination. The Skip and Take properties can be added specify the starting record number to return and the number of records to return.
IN_MainQuery_2 Panel |
---|
borderStyle | solid |
---|
title | Retrieve products for the NSW / Main warehouse where they changed within the last day |
---|
|
Deck |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1 |
---|
|
Card |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequestitemListRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQueryv_Jiwa_Inventory_Item_ListQuery() { PartNoStartsWith PhysicalWarehouseDescription = "New South Wales", LogicalWarehouseDescription = "aMain", OrderBy LastSavedDateTimeGreaterThan = DateTime.Now.AddDays(-1), Fields = "PartNo, Description, Picture, AvailableStock, SellPrice", TakeInclude = 25"Total" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponsev_Jiwa_Inventory_Item_List> itemListResponse = client.Get(IN_MainQueryRequestitemListRequest); |
|
Card |
---|
id | IN_MainQueryv_Jiwa_Inventory_Item_ListQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_MainInventoryItemList?PartNoStartsWith=a&OrderBy=PartNo&Take=25PhysicalWarehouseDescription=New South Wales&LogicalWarehouseDescription=Main&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=PartNo,Description,Picture,AvailableStock,SellPrice&Include=Total");
} |
|
Card |
---|
id | IN_MainQueryv_Jiwa_Inventory_Item_ListQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25"}' |
| Card |
---|
id | IN_MainQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
InventoryItemList?PhysicalWarehouseDescription=New%20South%20Wales&LogicalWarehouseDescription=Main&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=PartNo,Description,Picture,AvailableStock,SellPrice&Include=Total |
Instead of using URL parameters as above, you can also use a DTO to set the parameters: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/auth?username=/Queries/InventoryItemList -d '{"PhysicalWarehouseDescription":"New South Wales", "LogicalWarehouseDescription":"Main","LastSavedDateTimeGreaterThan="2017-09-18T00:00:00.000", "Fields":"PartNo, Description, Picture, AvailableStock, SellPrice", "Include":"Total"}' |
|
Card |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25InventoryItemList?PhysicalWarehouseDescription=New%20South%20Wales&LogicalWarehouseDescription=Main&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=PartNo,Description,Picture,AvailableStock,SellPrice&Include=Total&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Panel |
---|
borderStyle | solid |
---|
title | Retrieve first 25 products where the PartNo starts with 'a', but limit which fields are returned |
---|
|
Deck |
---|
id |
---|
|
Using IN_MainQuery
An alternative to using the v_Jiwa_Inventory_Item_ListQuery is to simply use the IN_MainQuery.
All tables have a corresponding Query class. For example, the table IN_Main has a class IN_MainQuery. The IN_MainQuery class is the DTO used for query operations against the IN_Main table. By setting various properties of an instance of this class, a filtered, ordered set of results can be obtained.
Panel |
---|
borderStyle | solid |
---|
title | Retrieve first 25 products where the PartNo starts with 'a' |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_21_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Fields = "InventoryID,PartNo,Description,Picture" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest); |
|
Card |
---|
id | IN_MainQuery_21_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Fields=InventoryID,PartNo,Description,Picture");
} |
|
Card |
---|
id | IN_MainQuery_21_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25","Fields":"InventoryID,PartNo,Description,Picture"}' |
|
Card |
---|
id | IN_MainQuery_21_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Fields=InventoryID,PartNo,Description,Picture&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Panel |
---|
borderStyle | solid |
---|
title | Retrieve next first 25 products where the PartNo starts with 'a', and but limit which fields are returned |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_32_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Skip = 25, Fields = "InventoryID,PartNo,Description,Picture" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest); |
|
Card |
---|
id | IN_MainQuery_32_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture");
} |
|
Card |
---|
id | IN_MainQuery_32_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25","SkipFields":"25","Fields":"InventoryID,InventoryID,PartNo,Description,Picture"}' |
|
Card |
---|
id | IN_MainQuery_32_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Read a product
AnchorReadAProductReadAProductIn order to read a product, the InventoryID must be provided. Note this is a full read of the inventory business logic - so it will include associated elements such as notes, documents, prices and so on Panel |
---|
borderStyle | solid |
---|
title | Read a productRetrieve next 25 products where the PartNo starts with 'a', and limit which fields are returned |
---|
|
Deck |
---|
id | readIN_aMainQuery_product3 |
---|
|
Card |
---|
id | readIN_aMainQuery_product3_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryGETRequestIN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.InventoryGETRequestIN_MainQuery() { InventoryID PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Skip = 25, Fields = "000000000K00000000BQInventoryID,PartNo,Description,Picture" };
JiwaFinancialsServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.InventoryTables.InventoryItem inventoryItemIN_Main> IN_MainQueryResponse = client.Get(inventoryGETRequestIN_MainQueryRequest); |
|
Card |
---|
id | readIN_aMainQuery_product3_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ");
} |
| Card |
---|
|
id | read_a_product_curl |
---|
Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture");
} |
|
Card |
---|
id | IN_MainQuery_3_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQQueries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25","Skip":"25","Fields":"InventoryID,PartNo,Description,Picture"}' |
|
Card |
---|
id | readIN_aMainQuery_product3_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/InventoryQueries/000000000K00000000BQ?IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture&format=json |
Note the ? &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryGETRequest for more detail. |
Create a new product
You don't need to provide anything to create a product - a PartNo and InventoryID will be generated for you - however it's usual practice to provide a PartNo. All other fields can be provided, but are not mandatory. The response DTO will contain the generated InventoryID, and all other fields of the product.
Panel
Read a product
In order to read a product, the InventoryID must be provided. Note this is a full read of the inventory business logic - so it will include associated elements such as notes, documents, prices and so on.
Panel |
---|
borderStyle | solid |
---|
title | Create Read a new product, and setting the PartNo, Description, DefaultPrice and Picture |
---|
|
Deck |
---|
|
Card |
---|
id | createread_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequestinventoryGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequestInventoryGETRequest() { PartNoInventoryID = "NewPartNo000000000K00000000BQ", Description = "A new product", DefaultPrice = 10.50M, Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ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KX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
| Card |
---|
id | create_a_product_csharp |
---|
label | C# |
---|
| Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");};
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Get(inventoryGETRequest); |
|
Card |
---|
id | read_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json"; string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new
product", DefaultPrice = 10.50, Pictureresponsebody = ConvertwebClient.FromBase64StringDownloadString("R0lGODlhPQBEAPeoAJosMhttps://AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK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aUXGwWjUBChjSPiWJuOO/LYIm4v1tXfE6J4gCSJEZ7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") });
responsebody = webClient.UploadStringapi.jiwa.com.au/Inventory/000000000K00000000BQ");
} |
|
Card |
---|
id | read_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ |
|
Card |
---|
id | read_a_product_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryGETRequest for more detail. |
Create a new product
You don't need to provide anything to create a product - a PartNo and InventoryID will be generated for you - however it's usual practice to provide a PartNo. All other fields can be provided, but are not mandatory. The response DTO will contain the generated InventoryID, and all other fields of the product.
Panel |
---|
borderStyle | solid |
---|
title | Create a new product, and setting the PartNo, Description, DefaultPrice and Picture |
---|
|
Deck |
---|
|
Card |
---|
id | create_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequest { PartNo = "NewPartNo", Description = "A new product", Def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TYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
|
Card |
---|
id | create_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50, Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P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KA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);
} |
|
Card |
---|
id | create_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50,"FileBinary":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJj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opesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg=="}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Panel |
---|
borderStyle | solid |
---|
title | Create a product with 2 notes |
---|
|
Deck |
---|
id | create_a_product_with_2_notes |
---|
|
Card |
---|
id | create_a_product_with_2_notes_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequest { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50M };
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 1" });
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 2" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
|
Card |
---|
id | create_a_product_with_2_notes_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50, Notes = new List<object>() { new { NoteText = "Note text 1" }, new { NoteText = "Note text 2" } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);
} |
|
Card |
---|
id | create_a_product_with_2_notes_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50,"Notes":[{"NoteText":"Note text 1"}, {"NoteText":"NoteText 2"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Update an existing product
Anchor |
---|
| InventoryPatchRequest |
---|
| InventoryPatchRequest |
---|
|
Panel |
---|
borderStyle | solid |
---|
title | Update Description and Picture of a product, add an additional note and update an existing note |
---|
|
Deck |
---|
|
Card |
---|
id | update_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPATCHRequest { InventoryID = "000000000K00000000BQ", Description = "A new description", Picture = Convert.FromBase64String("R0lGODlhPQBEAP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TQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "A new note added" });
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Patch(inventoryPATCHRequest); |
|
Card |
---|
id | update_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Description = "A new description", Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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abI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="), Notes = new List<object>() { new { NoteText = "A new note added" }, new { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "PATCH", json);
} |
|
Card |
---|
id | update_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ -d '{"Description":"A new description","Notes":[{"NoteText":"A new note added"},{"NoteID":"cb39806c-1b52-411b-a3ba-e16b6281ea63","NoteText":"A modified note text"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Delete a product
Panel |
---|
borderStyle | solid |
---|
title | Delete a product |
---|
|
Deck |
---|
|
Card |
---|
id | InventoryDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDELETERequest{ InventoryID = "000000000K00000000BQ" };
client.Delete(inventoryDELETERequest); |
|
Card |
---|
id | InventoryDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "DELETE", "");
} |
|
Card |
---|
id | InventoryDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ |
|
|
|
Stock Levels
The stock levels are contained in the DTO response returned when you Read A Product. The WarehouseSOHs property is a list of WarehouseSOH records for each warehouse, containing the stock level information.
Another method available is the v_Jiwa_Inventory_Item_ListQuery as described previously - this returns a filtered list of products, including stock levels.
Alternatively, you can use the Autoquery for the IN_WarehouseSOH table to retrieve a filtered list, returning a row per product per warehouse:
Panel |
---|
borderStyle | solid |
---|
title | Retrieve stock levels for an array of inventory ID's - but only for one warehouse |
---|
|
Deck |
---|
|
Card |
---|
id | IN_WarehouseSOHQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_WarehouseSOHQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_WarehouseSOHQuery() { InventoryIDIn = new string[] { "000000000K00000000BQ", "000000000K00000000BV", "000000000K00000000C5" }, IN_LogicalID = "ZZZZZZZZZZ0000000000" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_WarehouseSOH> IN_WarehouseSOHQueryResponse = client.Get(IN_WarehouseSOHQueryRequest); |
|
Card |
---|
id | IN_WarehouseSOHQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_WarehouseSOH?InventoryIDIn=000000000K00000000BQ,000000000K00000000BV,000000000K00000000C5&IN_LogicalID=ZZZZZZZZZZ0000000000");
} |
|
Card |
---|
id | IN_WarehouseSOHQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_WarehouseSOH -d '{"InventoryIDIn": [ "000000000K00000000BQ", "000000000K00000000BV", "000000000K00000000C5"], "IN_LogicalID":"ZZZZZZZZZZ0000000000" }' |
|
Card |
---|
id | IN_WarehouseSOHQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_WarehouseSOH?InventoryIDIn=000000000K00000000BQ,000000000K00000000BV,000000000K00000000C5&IN_LogicalID=ZZZZZZZZZZ0000000000&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Custom Fields
Whilst custom fields can be retrieved, or modified as part of the normal inventory item GET, POST and PATCH operations, you can also use the following requests.
Get a list of Inventory Custom Fields
Panel |
---|
borderStyle | solid |
---|
title | Get all Inventory custom fields |
---|
|
Deck |
---|
id | InventoryCustomFieldsGETManyRequest |
---|
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldsGETManyRequest();
var InventoryCustomFieldsGETManyResponse = client.Get(InventoryCustomFieldsGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/CustomFields");
} |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/CustomFields |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/CustomFields?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the a list of the DTO model for a custom field - see the meta data page for the InventoryCustomFieldsGETManyRequest for more detail. |
Get a list of custom field values for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all custom field values for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuesGETManyRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuesGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var InventoryCustomFieldsGETManyResponse = client.Get(InventoryCustomFieldsGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues");
} |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the Custom Field Value DTO model - see the meta data page for the InventoryCustomFieldValuesGETManyRequest for more detail. |
Get a custom field value for a product
Panel |
---|
borderStyle | solid |
---|
title | Get the custom field value for a specific custom field and product |
---|
|
Deck |
---|
id | InventoryCustomFieldValueGETRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldValueGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValueGETRequest() { InventoryID = "000000000K00000000BQ", SettingID = "b450e24b-0b83-4650-b812-311f26dfeeb2" };
var InventoryCustomFieldValueGETResponse= client.Get(InventoryCustomFieldValueGETRequest); |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2");
} |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the Custom Field Value DTO model - see the meta data page for the InventoryCustomFieldValueGETRequest for more detail. |
Update a custom field value for a product
Panel |
---|
borderStyle | solid |
---|
title | Update a custom field value for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuePATCHRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldValuePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuePATCHRequest() { InventoryID = "000000000K00000000BQ", SettingID = "b450e24b-0b83-4650-b812-311f26dfeeb2", Contents = "New Contents" };
var InventoryCustomFieldValuePATCHResponse = client.Patch(InventoryCustomFieldValuePATCHRequest); |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "New Contents" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2", "PATCH", json);
} |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 -d '{"Contents":"New Contents"}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Prices
Price Query
Retrieve a price for a product, given the InventoryID, DebtorID, WarehouseID, date and quantity. This uses the Jiwa pricing business logic to determine the price based on the Price Scheme associated with the Debtor, and all prices involved in that price scheme.
Panel |
---|
borderStyle | solid |
---|
title | Price Query |
---|
|
Deck |
---|
id | InventoryPriceGETRequest |
---|
|
Card |
---|
id | InventoryPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorID = "0000000061000000001V", IN_LogicalID = "ZZZZZZZZZZ0000000000", Date = DateTime.Now, Quantity = 6 };
var InventoryPriceGETResponse = client.Get(InventoryPriceGETRequest); |
|
Card |
---|
id | InventoryPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6");
} |
|
Card |
---|
id | InventoryPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6 |
|
Card |
---|
id | InventoryPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the DTO model from the business logic - see the meta data page for the InventoryPriceGETRequest for more detail. |
Debtor Specific Prices
Get all debtor specific prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all debtor specific prices for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricesGETManyRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricesGETManyRequest { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice> inventoryDebtorPrices = client.Get(InventoryDebtorSpecificPricesGETManyRequest); |
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices");
} |
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices |
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricesGETManyRequest for more detail. |
Get a single debtor specific price for a product
Panel |
---|
borderStyle | solid |
---|
title | Get a debtor specific price |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPriceGETRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceID = "0000000011000000000Z" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice = client.Get(InventoryDebtorSpecificPriceGETRequest); |
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z");
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z |
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPriceGETRequest for more detail. |
Add a new debtor specific price for a product
Panel |
---|
borderStyle | solid |
---|
title | Add a new debtor specific price to a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricePOSTRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au/Inventory", "POST", json);
}");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePOSTRequest { InventoryID = "000000000K00000000BQ", DebtorID = "0000000061000000001V", Mode = JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice.PriceModes.None, Amount = 150.00M, UseQuantityPriceBreak= true, QuantityPriceBreak = 15, StartDate = DateTime.Now };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice = client.Post(InventoryDebtorSpecificPricePOSTRequest);
|
|
Card |
---|
id | create_a_product_curlInventoryDebtorSpecificPricePOSTRequest_csharp |
---|
label | CurlC# |
---|
|
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST Code Block |
---|
Code Block |
---|
| | curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: | using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Panel |
---|
borderStyle | solid |
---|
title | Create a product with 2 notes |
---|
|
InventoryPatchRequestInventoryPatchRequest Panel |
---|
borderStyle | solid |
---|
title | Update Description and Picture of a product, add an additional note and update an existing note |
---|
|
Deck |
---|
id | create_a_product_with_2_notes |
---|
| Card |
---|
id | create_a_product_with_2_notes_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
| Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequest { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50M };
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 1" });
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 2" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
| Card |
---|
id | create_a_product_with_2_notes_csharp |
---|
label | C# |
---|
| Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorID = "0000000061000000001V", Mode = 2, Amount = 150.00M, UseQuantityPriceBreak = true, QuantityPriceBreak = 15, StartDate = DateTime.Now });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices", "POST", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50, Notes = new List<object>() { new { NoteText = "Note text 1" }, new { NoteText = "Note text 2" } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);
} |
| Card |
---|
id | create_a_product_with_2_notes_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50,"Notes":[{"NoteText":"Note text 1"}, {"NoteText":"NoteText 2"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail.
Update an existing product
Anchor Deck |
---|
| Card |
---|
id | update_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
| Code Block |
---|
| var client = new ServiceStack.JsonServiceClientInventory/000000000K00000000BQ/DebtorSpecificPrices -d '{"InventoryID ":"000000000K00000000BQ", "DebtorID":"0000000061000000001V", "OPMode":2, "Amount":150, "UseQuantityPriceBreak":"true", "QuantityPriceBreak":15, "StartDate":"2017-09-15" }' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePOSTRequest for more detail. |
Update an existing debtor specific price
Panel |
---|
borderStyle | solid |
---|
title | Updates an existing debtor specific price for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePATCHRequest { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceID = "3791217a18204bcb8813", Amount = 160.50M };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice = client.Patch(InventoryDebtorSpecificPricePATCHRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPATCHRequest { InventoryID = "000000000K00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xyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "A new note added" });
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Patch(inventoryPATCHRequest); |
| Card |
---|
|
id | update_a_product_csharp |
---|
label | Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Amount = 160.50M });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813", "PATCH", json);
} |
|
---|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813 -d '{"Amount":160.50}' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePATCHRequest for more detail. |
Delete a debtor specific price
Panel |
---|
borderStyle | solid |
---|
title | Deletes an existing debtor specific price for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPriceDELETERequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| using (var webClientclient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("ServiceStack.JsonServiceClient("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPriceDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPriceDELETERequest { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceID = "3791217a18204bcb8813" };
client.Delete(InventoryDebtorSpecificPriceDELETERequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.QueryString.Add("username", "Admin");
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Description = "A new description", Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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uqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="), Notes = new List<object>() { new { NoteText = "A new note added" }, new { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" } } });
QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813", "PATCHDELETE", json"");
} |
|
Card |
---|
id | update_a_productInventoryDebtorSpecificPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCHDELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ -d '{"Description":"A new description","Notes":[{"NoteText":"A new note added"},{"NoteID":"cb39806c-1b52-411b-a3ba-e16b6281ea63","NoteText":"A modified note text"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Delete /DebtorSpecificPrices/3791217a18204bcb8813 |
|
|
|
Anchor |
---|
| DebtorClassificationPrices |
---|
| DebtorClassificationPrices |
---|
|
Debtor Classification Prices
Get all debtor classification prices for a product
Panel |
---|
Delete borderStyle | solid |
---|
title | | Get all debtor classification prices for a product |
---|
|
Deck |
---|
id | InventoryDELETERequestInventoryDebtorClassificationPricesGETManyRequest |
---|
|
Card |
---|
id | InventoryDELETERequestInventoryDebtorClassificationPricesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryDELETERequestInventoryDebtorClassificationPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDELETERequestInventoryDebtorClassificationPricesGETManyRequest { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice> inventoryDebtorClassificationPrices = client.DeleteGet(inventoryDELETERequestInventoryDebtorClassificationPricesGETManyRequest); |
|
Card |
---|
id | InventoryDELETERequestInventoryDebtorClassificationPricesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// AuthenticateDeserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = webClient.QueryString.Add("username", "Admin")Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.QueryStringHeaders.Add("password(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", "password"sessionId)); string
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/authDebtorClassificationPrices");
} |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X
// Above returns something like this: GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"0hKBFAnutUk8Mw6YY6DN6w1nLX8r0sIrJHClX9Vj","UserName":"apiAdmin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "DELETE", "");
}/Inventory/000000000K00000000BQ/DebtorClassificationPrices?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the inventory item debtor classification price DTO model from the business logic - see the meta data page for the InventoryDebtorClassificationPricesGETManyRequest for more detail. |
Get a single debtor classification price for a product
Panel |
---|
borderStyle | solid |
---|
title | Get a debtor classification price |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPriceGETRequest |
---|
|
Card |
---|
id | InventoryDELETERequestInventoryDebtorClassificationPriceGETRequest_csharp_curlservicestack |
---|
label | CurlServiceStack Client C# |
---|
|
|
|
Panel |
---|
borderStyle | solid |
---|
title | Get all Inventory custom fields |
---|
|
Deck |
---|
id | InventoryCustomFieldsGETManyRequest |
---|
| InventoryCustomFieldsGETManyRequest Card |
---|
id |
Code Block |
---|
| curlvar -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ |
|
---|
|
|
Stock Levels
The stock levels are contained in the DTO response returned when you Read A Product. The WarehouseSOHs property is a list of WarehouseSOH records for each warehouse, containing the stock level information. An example fragment of the JSON returned is shown below.
Code Block |
---|
"WarehouseSOHs" : [{
"IN_LogicalID" : "000000002B0000000003",
"Warehouse" : "In Transit / New South Wales",
"TotalSOH" : 0.000000,
"TotalBackOrders" : 0.000000,
"ManualBackOrders" : 0.000000,
"AutoBackOrders" : 0.000000,
"ShipOnCompletion" : 0.000000,
"WarehouseTransfers" : 0.000000,
"UnprocessedSales" : 0.000000,
"ForwardRequirements" : 0.000000,
"BOMComponentWIP" : 0.000000
}, {
"IN_LogicalID" : "0000000035000000000D",
"Warehouse" : "Service / New South Wales",
"TotalSOH" : 0.000000,
"TotalBackOrders" : 0.000000,
"ManualBackOrders" : 0.000000,
"AutoBackOrders" : 0.000000,
"ShipOnCompletion" : 0.000000,
"WarehouseTransfers" : 0.000000,
"UnprocessedSales" : 0.000000,
"ForwardRequirements" : 0.000000,
"BOMComponentWIP" : 0.000000
}, {
"IN_LogicalID" : "00000000IB0000000001",
"Warehouse" : "Damaged Goods / New South Wales",
"TotalSOH" : 0.000000,
"TotalBackOrders" : 0.000000,
"ManualBackOrders" : 0.000000,
"AutoBackOrders" : 0.000000,
"ShipOnCompletion" : 0.000000,
"WarehouseTransfers" : 0.000000,
"UnprocessedSales" : 0.000000,
"ForwardRequirements" : 0.000000,
"BOMComponentWIP" : 0.000000
}, {
"IN_LogicalID" : "00000000IB0000000003",
"Warehouse" : "Bulk / Victoria",
"TotalSOH" : 0.000000,
"TotalBackOrders" : 18.000000,
"ManualBackOrders" : 0.000000,
"AutoBackOrders" : 18.000000,
"ShipOnCompletion" : 0.000000,
"WarehouseTransfers" : 0.000000,
"UnprocessedSales" : 0.000000,
"ForwardRequirements" : 0.000000,
"BOMComponentWIP" : 0.000000
}, {
"IN_LogicalID" : "ZZZZZZZZZZ0000000000",
"Warehouse" : "Main / New South Wales",
"TotalSOH" : 0.000000,
"TotalBackOrders" : 36.000000,
"ManualBackOrders" : 0.000000,
"AutoBackOrders" : 36.000000,
"ShipOnCompletion" : 0.000000,
"WarehouseTransfers" : 0.000000,
"UnprocessedSales" : 0.000000,
"ForwardRequirements" : 0.000000,
"BOMComponentWIP" : 3.000000
}
] |
Custom Fields
Whilst custom fields can be retrieved, or modified as part of the normal inventory item GET, POST and PATCH operations, you can also use the following requests.
Get a list of Inventory Custom Fields
");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorClassificationPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorClassificationPriceID = "0000000011000000000X" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice inventoryDebtorClassificationPriceGETResponse = client.Get(InventoryDebtorClassificationPriceGETRequest); |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X");
} |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory debtor classification price DTO model from the business logic - see the meta data page for the InventoryDebtorClassificationPriceGETRequest for more detail. |
Add a new debtor classification price for a product
Panel |
---|
borderStyle | solid |
---|
title | Add a new debtor classification price to a product |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPricePOSTRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPricePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequestInventoryDebtorClassificationPricePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldsGETManyRequest();
var InventoryCustomFieldsGETManyResponse .InventoryDebtorClassificationPricePOSTRequest { InventoryID = "000000000K00000000BQ", DebtorClassificationID = "00000000A8000000000C", Mode = JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice.PriceModes.None, Amount = 200.00M, UseQuantityPriceBreak = true, QuantityPriceBreak = 15, StartDate = DateTime.Now };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice inventoryDebtorClassificationPrice = client.GetPost(InventoryCustomFieldsGETManyRequestInventoryDebtorClassificationPricePOSTRequest);
|
|
Card |
---|
id | InventoryCustomFieldsGETManyRequestInventoryDebtorClassificationPricePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorClassificationID = "00000000A8000000000C", Mode = 2, Amount = 200.00M, UseQuantityPriceBreak = true, QuantityPriceBreak = 15, StartDate = DateTime.Now });
responsebody = webClient.DownloadStringUploadString("https://api.jiwa.com.au/Inventory/CustomFields"/000000000K00000000BQ/DebtorClassificationPrices", "POST", json);
} |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequestInventoryDebtorClassificationPricePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/CustomFields |
| Card |
---|
id | InventoryCustomFieldsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
--cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/CustomFields?format=json | Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned./000000000K00000000BQ/DebtorClassificationPrices -d '{"InventoryID ":"000000000K00000000BQ", "DebtorClassificationID":"00000000A8000000000C", "OPMode":2, "Amount":200, "UseQuantityPriceBreak":"true", "QuantityPriceBreak":15, "StartDate":"2017-09-15" }' |
|
|
The response returned from the above request will be a json document representing the a list of the DTO model for a custom field a inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryCustomFieldsGETManyRequest InventoryDebtorSpecificPricePOSTRequest for more detail. |
Get a list of custom field values for a productUpdate an existing debtor classification price
Panel |
---|
borderStyle | solid |
---|
title | Get all custom field values Updates an existing debtor classification price for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuesGETManyRequestInventoryDebtorClassificationPricePATCHRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequestInventoryDebtorClassificationPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequestInventoryDebtorClassificationPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuesGETManyRequest()InventoryDebtorClassificationPricePATCHRequest { InventoryID = "000000000K00000000BQ", DebtorClassificationPriceID = "0000000011000000000X", Amount = 250.45M };
var InventoryCustomFieldsGETManyResponseJiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice inventoryDebtorClassificationPrice = client.GetPatch(InventoryCustomFieldsGETManyRequestInventoryDebtorClassificationPricePATCHRequest);
|
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequestInventoryDebtorClassificationPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Amount = 250.45M });
responsebody = webClient.DownloadStringUploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues"/DebtorClassificationPrices/0000000011000000000X", "PATCH", json);
} |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequestInventoryDebtorClassificationPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues |
| Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues?format=json | Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned.DebtorClassificationPrices/0000000011000000000X-d '{"Amount":250.45}' |
|
|
The response returned from the above request will be a json document representing a list of the Custom Field Value inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryCustomFieldValuesGETManyRequest InventoryDebtorSpecificPricePATCHRequest for more detail. |
Get a custom field value for a productDelete a debtor classification price
Panel |
---|
borderStyle | solid |
---|
title | Get the custom field value Deletes an existing debtor classification price for a specific custom field and product |
---|
|
Deck |
---|
id | InventoryCustomFieldValueGETRequestInventoryDebtorClassificationPriceDELETERequest |
---|
|
Card |
---|
id | InventoryCustomFieldValueGETRequestInventoryDebtorClassificationPriceDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorClassificationPriceDELETERequest InventoryCustomFieldValueGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValueGETRequest()InventoryDebtorClassificationPriceDELETERequest { InventoryID = "000000000K00000000BQ", SettingIDDebtorClassificationPriceID = "b450e24b-0b83-4650-b812-311f26dfeeb2" 0000000011000000000X"};
var InventoryCustomFieldValueGETResponse= client.GetDelete(InventoryCustomFieldValueGETRequestInventoryDebtorClassificationPriceDELETERequest);
|
|
Card |
---|
id | InventoryCustomFieldValueGETRequestInventoryDebtorClassificationPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] =
"application/json";
responsebody = webClient.DownloadStringUploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2DebtorClassificationPrices/0000000011000000000X", "DELETE", "");
} |
|
Card |
---|
id | InventoryCustomFieldValueGETRequestInventoryDebtorClassificationPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the Custom Field Value DTO model - see the meta data page for the InventoryCustomFieldValueGETRequest for more detail. |
Update a custom field value DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X |
|
|
|
Anchor |
---|
| DebtorPriceGroupPrices |
---|
| DebtorPriceGroupPrices |
---|
|
Debtor Price Group Prices
Get all debtor price group prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Update a custom field value Get all debtor price group prices for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuePATCHRequestInventoryDebtorPriceGroupPricesGETManyRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequestInventoryDebtorPriceGroupPricesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldValuePATCHRequestInventoryDebtorPriceGroupPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuePATCHRequest()InventoryDebtorPriceGroupPricesGETManyRequest { InventoryID = "000000000K00000000BQ", SettingID = "b450e24b-0b83-4650-b812-311f26dfeeb2", Contents = "New Contents" };
var InventoryCustomFieldValuePATCHResponseList<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific> debtorGroupPrice = client.Get(InventoryCustomFieldValuePATCHRequestInventoryDebtorPriceGroupPricesGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequestInventoryDebtorPriceGroupPricesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json"; string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "New Contents" });
responsebody = webClient.UploadStringDownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2", "PATCH", jsonDebtorPriceGroupPrices");
} |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequestInventoryDebtorPriceGroupPricesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCHGET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 -d '{"Contents":"New Contents"}'/DebtorPriceGroupPrices |
|
Card |
---|
id | InventoryDebtorPriceGroupPricesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrice?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the full inventory item debtor classification price DTO model from the business logic - see the meta data page for the InventoryPOSTRequest InventoryDebtorPriceGroupPricesGETManyRequest for more detail. |
Prices
Price Query
Retrieve a Get a single debtor price group price for a product
, given the InventoryID, DebtorID, WarehouseID, date and quantity. This uses the Jiwa pricing business logic to determine the price based on the Price Scheme associated with the Debtor, and all prices involved in that price scheme. Panel |
---|
borderStyle | solid |
---|
title | Price QueryGet a debtor price group price |
---|
|
Deck |
---|
id | InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest |
---|
|
Card |
---|
id | InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorIDDebtorPriceGroupInventorySpecificID = "0000000061000000001V", IN_LogicalID = "ZZZZZZZZZZ0000000000", Date = DateTime.Now, Quantity = 6 };
var InventoryPriceGETResponse804a5fb1-e7ac-4759-94a3-04ed1938560e" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific debtorGroupPrice = client.Get(InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest); |
|
Card |
---|
id | InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6DebtorPriceGroupPrices/804a5fb1-e7ac-4759-94a3-04ed1938560e");
} |
|
Card |
---|
id | InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6DebtorPriceGroupPrices/804a5fb1-e7ac-4759-94a3-04ed1938560e |
|
Card |
---|
id | InventoryPriceGETRequestInventoryDebtorPriceGroupPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6DebtorPriceGroupPrices/804a5fb1-e7ac-4759-94a3-04ed1938560e?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the a inventory debtor classification price DTO model from the business logic - see the meta data page for the InventoryPriceGETRequest InventoryDebtorClassificationPriceGETRequest for more detail. |
Debtor Specific Prices
Get all debtor specific prices Add a new debtor price group price for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all debtor specific prices for Add a new debtor price group price to a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricesGETManyRequestInventoryDebtorPriceGroupPricePOSTRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequestInventoryDebtorPriceGroupPricePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricesGETManyRequestInventoryDebtorPriceGroupPricePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricesGETManyRequestInventoryDebtorPriceGroupPricePOSTRequest { InventoryID = "000000000K00000000BQ", DebtorPriceGroupID = "703AB465-604C-46B5-98A3-2D3F01E0CDE3", Mode = JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific.PriceModes.None, Amount = 11.23M, UseQuantityPriceBreak = true, QuantityPriceBreak = 21, StartDate = DateTime.Now };
List<JiwaFinancialsJiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice>InventoryDebtorPriceGroupInventorySpecific inventoryDebtorPricedebtorGroupPrice = client.GetPost(InventoryDebtorSpecificPricesGETManyRequestInventoryDebtorPriceGroupPricePOSTRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequestInventoryDebtorPriceGroupPricePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorPriceGroupID = "703AB465-604C-46B5-98A3-2D3F01E0CDE3", Mode = 2, Amount = 11.23M, UseQuantityPriceBreak = true, QuantityPriceBreak = 21, StartDate = DateTime.Now });
responsebody = webClient.DownloadStringUploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices"DebtorPriceGroupPrices", "POST", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequestInventoryDebtorPriceGroupPricePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GETPOST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices |
| Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices?format=json | Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned.DebtorPriceGroupPrices -d '{"InventoryID ":"000000000K00000000BQ", "DebtorPriceGroupID":"703AB465-604C-46B5-98A3-2D3F01E0CDE3", "OPMode":2, "Amount":11.23, "UseQuantityPriceBreak":"true", "QuantityPriceBreak":21, "StartDate":"2017-09-15" }' |
|
|
The response returned from the above request will be a json document representing a list of the inventory item note debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricesGETManyRequest InventoryDebtorPriceGroupPricePOSTRequest for more detail. |
Get a single debtor specific price for a productUpdate an existing debtor price group price
Panel |
---|
borderStyle | solid |
---|
title | Get a debtor specific priceUpdates an existing debtor price group price for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPriceGETRequestInventoryDebtorPriceGroupPricePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequestInventoryDebtorPriceGroupPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPriceGETRequestInventoryDebtorPriceGroupPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPriceGETRequestInventoryDebtorPriceGroupPricePATCHRequest { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceIDDebtorPriceGroupInventorySpecificID = "0000000011000000000Z"07d602d8-0b4d-4ed3-b1a5-012945c76707", Amount = 15.99M };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceInventoryDebtorPriceGroupInventorySpecific inventoryDebtorPricedebtorGroupPrice = client.GetPatch(InventoryDebtorSpecificPriceGETRequestInventoryDebtorPriceGroupPricePATCHRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequestInventoryDebtorPriceGroupPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Amount = 15.99M });
responsebody = webClient.DownloadStringUploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z"DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707", "PATCH", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequestInventoryDebtorPriceGroupPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GETPATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z |
| Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z?format=json | Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned.DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707 -d '{"Amount":15.99}' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPriceGETRequest InventoryDebtorPriceGroupPricePATCHRequest for more detail. |
Add Delete a
new debtor
specific price group price
for a product Panel |
---|
borderStyle | solid |
---|
title | Add a new debtor specific price to Deletes an existing debtor price group price for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricePOSTRequestInventoryDebtorPriceGroupPriceDELETERequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequestInventoryDebtorPriceGroupPriceDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePOSTRequestInventoryDebtorPriceGroupPriceDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePOSTRequestInventoryDebtorPriceGroupPriceDELETERequest { InventoryID = "000000000K00000000BQ", DebtorIDDebtorPriceGroupInventorySpecificID = "0000000061000000001V", Mode = JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice.PriceModes.None, Amount = 150.00M, UseQuantityPriceBreak= true, QuantityPriceBreak = 15, StartDate = DateTime.Now };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice = client.Post(InventoryDebtorSpecificPricePOSTRequest07d602d8-0b4d-4ed3-b1a5-012945c76707"};
client.Delete(InventoryDebtorPriceGroupPriceDELETERequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequestInventoryDebtorPriceGroupPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorID = "0000000061000000001V", Mode = 2, Amount = 150.00M, UseQuantityPriceBreak = true, QuantityPriceBreak = 15, StartDate = DateTime.Now })/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPricesDebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707", "POSTDELETE", json"");
} |
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequestInventoryDebtorPriceGroupPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POSTDELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices -d '{"InventoryID ":"000000000K00000000BQ", "DebtorID":"0000000061000000001V", "OPMode":2, "Amount":150, "UseQuantityPriceBreak":"true", "QuantityPriceBreak":15, "StartDate":"2017-09-15" }' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePOSTRequest for more detail. |
Update an existing debtor specific price
DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707 |
|
|
|
Quantity Break / Tier Pricing
Quantity break / tier pricing is achieved by the use of Debtor Classification Prices or Debtor Group Prices with a null classification or group (which signifies all classifications or any debtor groups), and with a quantity break set.
Selling Prices
Reading the Selling Prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Updates an existing debtor specific price for a productGet the P1...P10 Selling Prices |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricePATCHRequestInventorySellingPriceGETRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequestInventorySellingPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePATCHRequestInventorySellingPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePATCHRequestInventorySellingPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceID = "3791217a18204bcb8813", Amount = 160.50M };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceInventorySellingPrices inventoryDebtorPricesellPrices = client.PatchGet(InventoryDebtorSpecificPricePATCHRequestInventorySellingPriceGETRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequestInventorySellingPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json"; string json = Newtonsoft.Json.JsonConvert.SerializeObject(new {
Amount = 160.50M }); responsebody = webClient.UploadStringDownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813", "PATCH", jsonSellingPrices");
} |
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequestInventorySellingPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices |
|
Card |
---|
id | InventorySellingPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813 -d '{"Amount":160.50}'SellingPrices?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory item debtor specific price selling prices DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePATCHRequest InventorySellingPriceGETRequest for more detail. |
Delete a debtor specific priceUpdating the Selling Prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Deletes an existing debtor specific price for a productUpdates the selling prices for an item |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventorySellingPricePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventorySellingPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPriceDELETERequest = InventorySellingPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventorySellingPricePATCHRequest { InventoryID = "000000000K00000000BQ", CurrentPriceDate = DateTime.Now, ForwardPriceDate = DateTime.Now.AddDays(30) };
InventorySellingPricePATCHRequest.SellPrices.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPriceDELETERequestInventory.InventorySellingPrice { InventoryIDSellingPriceID = "000000000K00000000BQP1", DebtorSpecificPriceID Price = 10.55M, ForwardPrice = "3791217a18204bcb8813"11.55M });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventorySellingPrices sellPrices = client.DeletePatch(InventoryDebtorSpecificPriceDELETERequestInventorySellingPricePATCHRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventorySellingPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { CurrentPriceDate = DateTime.Now, ForwardPriceDate = DateTime.Now.AddDays(30), SellPrices = new[] { new { SellingPriceID = "P1", Price = 10.55M, ForwardPrice = 11.55M } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813SellingPrices", "DELETEPATCH", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventorySellingPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813-d '{"CurrentPriceDate":"2017-09-18","ForwardPriceDate":"2017-10-18","SellingPrices":[{"SellingPriceID":"P1","Price":10.55,"ForwardPrice":11.55}]}' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific selling price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePATCHRequest InventorySellingPricePATCHRequest for more detail. |
Debtor Classification Prices
Notes
Get all
debtor classification prices notes for a product
While you could always use the IN_NotesQuery class to return all notes with a given InventoryID - There is also a GET method for retrieving all notes for a given InventoryID.
Panel |
---|
borderStyle | solid |
---|
title | Get all debtor classification prices notes for a product |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPricesGETManyRequestInventoryNotesGETManyRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequestInventoryNotesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricesGETManyRequest inventoryNotesGETManyRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricesGETManyRequestInventoryNotesGETManyRequest() { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice> inventoryDebtorPricevar inventoryNotesGETManyResponse = client.Get(InventoryDebtorSpecificPricesGETManyRequestinventoryNotesGETManyRequest); |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequestInventoryNotesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPricesNotes");
} |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequestInventoryNotesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPricesNotes |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequestInventoryNotesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPricesNotes?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the inventory item note DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricesGETManyRequest InventoryNotesGETManyRequest for more detail. |
Get a
single debtor classification price specific note for a product
With a provided InventoryID, and a NoteID a single note can be retrieved.
Panel |
---|
borderStyle | solid |
---|
title | Get a debtor classification pricespecific note |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPriceGETRequestInventoryNotesGETRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequestInventoryGETNotesRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPriceGETRequest inventoryNotesGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPriceGETRequestInventoryNotesGETRequest() { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceIDNoteID = "0000000011000000000Z8F25C1BF-532A-4304-A44F-078AC5D1C54E" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice
var inventoryNotesGETResponse= client.Get(InventoryDebtorSpecificPriceGETRequestinventoryNotesGETRequest); |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequestInventoryNotesGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000ZNotes/8F25C1BF-532A-4304-A44F-078AC5D1C54E");
} |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequestInventoryNotesGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000ZNotes/8F25C1BF-532A-4304-A44F-078AC5D1C54E |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequestInventoryNotesGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000ZNotes/8F25C1BF-532A-4304-A44F-078AC5D1C54E?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory debtor specific price item note DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPriceGETRequest InventoryNoteGETRequest for more detail. |
Add a new
debtor classification price for a productnote
Panel |
---|
borderStyle | solid |
---|
title | Add a new debtor classification price note to a product |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPricePOSTRequestInventoryNotePOSTRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPricePOSTRequestInventoryNotePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePOSTRequestinventoryNotePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePOSTRequestInventoryNotePOSTRequest() { InventoryID = "000000000K00000000BQ", DebtorIDNoteText = "0000000061000000001V",This Modeis = JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice.PriceModes.None, Amount = 150.00M, UseQuantityPriceBreak= true, QuantityPriceBreak = 15, StartDate = DateTime.Now };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPricea new note" };
var inventoryNotesPOSTResponse = client.Post(InventoryDebtorSpecificPricePOSTRequestinventoryNotePOSTRequest);
|
|
Card |
---|
id | InventoryDebtorClassificationPricePOSTRequestInventoryNotePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorIDNoteText = "0000000061000000001V",This Modeis =a 2, Amount = 150.00M, UseQuantityPriceBreak = true, QuantityPriceBreak = 15, StartDate = DateTime.Now new note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPricesNotes", "POST", json);;
} |
|
Card |
---|
id | InventoryDebtorClassificationPricePOSTRequestInventoryNotePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPricesNotes -d '{"InventoryID NoteText":"000000000K00000000BQ", "DebtorID":"0000000061000000001V", "OPMode":2, "Amount":150, "UseQuantityPriceBreak":"true", "QuantityPriceBreak":15, "StartDate":"2017-09-15" This is a new note"}' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price note DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePOSTRequest InventoryNotePOSTRequest for more detail. |
Update an existing
debtor classification pricenote
Panel |
---|
borderStyle | solid |
---|
title | Updates Update an existing debtor classification price for a productnote |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPricePATCHRequestInventoryNotePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPricePATCHRequestInventoryNotePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePATCHRequestinventoryNotePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePATCHRequestInventoryNotePATCHRequest() { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceIDNoteID = "3791217a18204bcb88138F25C1BF-532A-4304-A44F-078AC5D1C54E", AmountNoteText = 160.50M "This is an updated note" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPricevar inventoryNotesPOSTResponse = client.Patch(InventoryDebtorSpecificPricePATCHRequestinventoryNotePOSTRequest);
|
|
Card |
---|
id | InventoryDebtorClassificationPricePATCHRequestInventoryNotePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { AmountNoteText = 160.50M "This is an updated note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "PATCH", json);
} |
|
Card |
---|
id | InventoryDebtorClassificationPricePATCHRequestInventoryNotePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E -d '{"Amount":160.50 '{"NoteText":"This is an updated note"}' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price note DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePATCHRequest InventoryNotePATCHRequest for more detail. |
Delete a
debtor specific pricenote for a product
Panel |
---|
borderStyle | solid |
---|
title | Deletes an existing debtor specific price for a productDelete a specific note |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventoryNoteDELETERequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventoryNoteDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPriceDELETERequestinventoryNoteDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPriceDELETERequestInventoryNoteDELETERequest() { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceIDNoteID = "3791217a18204bcb88138F25C1BF-532A-4304-A44F-078AC5D1C54E" };
var client.Delete(InventoryDebtorSpecificPriceDELETERequestinventoryNoteDELETERequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventoryNoteDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "DELETE", "");
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequestInventoryNoteDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813 |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePATCHRequest for more detail. |
Debtor Price Group Prices
Selling Prices
List property operations examples
Inventory Notes
All List properties of DTO's will usually have their own set of routes for various operations. An example is the Notes property of inventory. In the previous example for the Update Existing Product it shows adding a new note by performing a Patch operation on the inventory item. However, the notes list has it's own routes which allow Post, Patch, Get and Delete operations.
Get all notes DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E |
|
|
|
Documents
Get all documents for a product
While you could always use the IN_NotesQuery DocumentsQuery class to return all notes documents with a given InventoryID - There is also a GET method for retrieving all notes documents for a given InventoryID.
Panel |
---|
borderStyle | solid |
---|
title | Get all notes documents for a product |
---|
|
Deck |
---|
id | InventoryNotesGETManyRequestInventoryDocumentsGETManyRequest |
---|
|
Card |
---|
id | InventoryNotesGETManyRequestInventoryDocumentsGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDocumentsGETManyRequest inventoryNotesGETManyRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETManyRequestInventoryDocumentsGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var inventoryNotesGETManyResponseinventoryDocumentsGETManyResponse = client.Get(inventoryNotesGETManyRequestInventoryDocumentsGETManyRequest); |
|
Card |
---|
id | InventoryNotesGETManyRequestInventoryDocumentsGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments");
} |
|
Card |
---|
id | InventoryNotesGETManyRequestInventoryDocumentsGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments |
|
Card |
---|
id | InventoryNotesGETManyRequestInventoryDocumentsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the inventory item note document DTO model from the business logic - see the meta data page for the InventoryNotesGETManyRequest InventoryDocumentsGETManyRequest for more detail. |
Get a specific
note document for a product
With a provided InventoryID, and a NoteID DocumentID a single note document can be retrieved.
Panel |
---|
borderStyle | solid |
---|
title | Get a specific notedocument |
---|
|
Deck |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest |
---|
|
Card |
---|
id | InventoryGETNotesRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotesGETRequestinventoryDocumentGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETRequestInventoryDocumentGETRequest() { InventoryID = "000000000K00000000BQ", NoteIDDocumentID = "8F25C1BF87E73C5A-532A896C-43044EF2-A44F8323-078AC5D1C54E3DFCA0C2B042" };
var inventoryNotesGETResponseinventoryDocumentGETResponse= client.Get(inventoryNotesGETRequestinventoryDocumentGETRequest); |
|
Card |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments/8F25C1BF87E73C5A-532A896C-43044EF2-A44F8323-078AC5D1C54E3DFCA0C2B042");
} |
|
Card |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments/8F25C1BF87E73C5A-532A896C-43044EF2-A44F8323-078AC5D1C54E3DFCA0C2B042 |
|
Card |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments/8F25C1BF87E73C5A-532A896C-43044EF2-A44F8323-078AC5D1C54E3DFCA0C2B042?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory item note document DTO model from the business logic - see the meta data page for the InventoryNoteGETRequest InventoryDocumentGETRequest for more detail. |
Add a new
notedocument
Panel |
---|
borderStyle | solid |
---|
title | Add a new note to a product |
---|
|
Deck |
---|
id | InventoryNotePOSTRequestInventoryDocumentPOSTRequest |
---|
|
Card |
---|
id | InventoryNotePOSTRequestInventoryDocumentPOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotePOSTRequestinventoryDocumentPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotePOSTRequestInventoryDocumentPOSTRequest() { InventoryID = "000000000K00000000BQ", NoteTextDescription = "This is a new note" };
inventoryNotesPOSTResponseA new document", PhysicalFileName = "Test.png", FileBinary = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+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ventoryDocumentPOSTResponse = client.Post(inventoryNotePOSTRequestinventoryDocumentPOSTRequest);
|
|
Card |
---|
id | InventoryNotePOSTRequestInventoryDocumentPOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteText = "This is a new note" } something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { InventoryID = "000000000K00000000BQ", Description = "A new document", PhysicalFileName = "Test.png", FileBinary = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8z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YEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") } );
responsebody = webClient.UploadString("httpshttp://api.jiwa.com.aulocalhost/Inventory/000000000K00000000BQ/NotesDocuments", "POST", json);
} |
|
Card |
---|
id | InventoryNotePOSTRequestDocumentNotePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"NoteText":"This is a new note".au/Inventory/000000000K00000000BQ/Documents -d '{"Description":"A new document", "PhysicalFileName":"Test.png", "FileBinary": "R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTD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MRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="}' |
|
|
The response returned from the above request will be a json document representing a inventory item note document DTO model from the business logic - see the meta data page for the InventoryNotePOSTRequest InventoryDocumentPOSTRequest for more detail. |
Update an existing
notedocument
Panel |
---|
borderStyle | solid |
---|
title | Update an existing notedocument |
---|
|
Deck |
---|
id | InventoryNotePATCHRequestInventoryDocumentPATCHRequest |
---|
|
Card |
---|
id | InventoryNotePATCHRequestInventoryDocumentPATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotePATCHRequestinventoryDocumentPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotePATCHRequestInventoryDocumentPATCHRequest() { InventoryID = "000000000K00000000BQ", DocumentID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E", NoteText = "This is an updated note" };
inventoryNotesPOSTResponse"3b15e611-d78c-49bb-8818-7eaa46fd2200", FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0m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ErkJggg==") };
var inventoryDocumentPATCHResponse = client.Patch(inventoryNotePOSTRequestinventoryDocumentPATCHRequest);
|
|
Card |
---|
id | InventoryNotePATCHRequestInventoryDocumentPATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteTextFileBinary = "This is an updated note" }Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9DE2N7eLpf7ubm6hYaEqdWa0tKypqamW7du8ezs7CQ6zj9+/Li3t/fOnTtNTc2DzwdJi5xqamr8/QPIRo81Yh+gz5zJ8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BPzDReuWL7y/PnzOEBtQIGuUqljY2OJWAednJzc1tamVqlnzZxjaGBYWFjIeYRRVlrmtW07rQ8JgFK6vr5+tUrztdk3c+cY8FSpVOwMDg4uLy8HByNRNzd3YQTqoJEhsy3h2PHPxk+e8OmkaVNnTJ86Y9EiI2KfO9tg2dJlCxcYGRktNjYynjfH0NBgofFCk7KycjxBrpmZWWpqKmoBZ2ho2NnRhbGlcyJAC5LKyvp5xXLT8eMmTZwwhT/cCM/JE6dNHD+Vp8zbp6CgsK2tnWZDqYQWeSAqOjpamDYY1fPx8RkVqw76xIkTVOnmzZvr1n0nk/msW7sueMdOsZXkQESUifGStLS0ivIKsVgMM2zmJLfPuXNZaODIkSOjuOjVXmpPiMJPTM810wPiuWK4ljw9txUVFeOffAMDgxAPn7y2eSOsjo7O4qLirc6uNjZ2aJlGQ6mQiRy51Wg9AVQwPSHCzUaO+fkFvr5yqVS6auWXDlscJRJJQEAA/iiadLM9g5TxT36MfEYKgwkV0krsZJYKjI+aDvro0aPcHcw2pEoI7BCo1Gq5bloRDy0jzGU6kBldW1vHPOALuLTb/v37YUOAG2sigCIiIpA6I4LW4DLt6OhApKwRL2fQE9AjV+3dy5cvczUTb8ONhhhljKurK55Gr5WPTAftJ/dDsPQrVzhTm/CJEYooAGVhCuflXcjNze3svA/7FDwuLs7ZyZkgyEMP81emIyQuLv5sxlkWVJ8rAx+cwQETDh/A8R7DGVLjvxHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") } );
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments/8F25C1BF3b15e611-532Ad78c-430449bb-A44F8818-078AC5D1C54E7eaa46fd2200", "PATCH", json);
} |
|
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E -d '{"NoteText":"This is an updated note"the route can be called: Card |
---|
id | InventoryNotePATCHRequestInventoryDocumentPATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: | Code Block |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/3b15e611-d78c-49bb-8818-7eaa46fd2200 -d '{"FileBinary":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9DE2N7eLpf7ubm6hYaEqdWa0tKypqamW7du8ezs7CQ6zj9+/Li3t/fOnTtNTc2DzwdJi5xqamr8/QPIRo81Yh+gz5zJ8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BPzDReuWL7y/PnzOEBtQIGuUqljY2OJWAednJzc1tamVqlnzZxjaGBYWFjIeYRRVlrmtW07rQ8JgFK6vr5+tUrztdk3c+cY8FSpVOwMDg4uLy8HByNRNzd3YQTqoJEhsy3h2PHPxk+e8OmkaVNnTJ86Y9EiI2KfO9tg2dJlCxcYGRktNjYynjfH0NBgofFCk7KycjxBrpmZWWpqKmoBZ2ho2NnRhbGlcyJAC5LKyvp5xXLT8eMmTZwwhT/cCM/JE6dNHD+Vp8zbp6CgsK2tnWZDqYQWeSAqOjpamDYY1fPx8RkVqw76xIkTVOnmzZvr1n0nk/msW7sueMdOsZXkQESUifGStLS0ivIKsVgMM2zmJLfPuXNZaODIkSOjuOjVXmpPiMJPTM810wPiuWK4ljw9txUVFeOffAMDgxAPn7y2eSOsjo7O4qLirc6uNjZ2aJlGQ6mQiRy51Wg9AVQwPSHCzUaO+fkFvr5yqVS6auWXDlscJRJJQEAA/iiadLM9g5TxT36MfEYKgwkV0krsZJYKjI+aDvro0aPcHcw2pEoI7BCo1Gq5bloRDy0jzGU6kBldW1vHPOALuLTb/v37YUOAG2sigCIiIpA6I4LW4DLt6OhApKwRL2fQE9AjV+3dy5cvczUTb8ONhhhljKurK55Gr5WPTAftJ/dDsPQrVzhTm/CJEYooAGVhCuflXcjNze3svA/7FDwuLs7ZyZkgyEMP81emIyQuLv5sxlkWVJ8rAx+cwQETDh/A8R7DGVLjvxHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg=="}' |
|
|
The response returned from the above request will be a json document representing a inventory item note document DTO model from the business logic - see the meta data page for the InventoryNotePATCHRequest InventoryDocumentPATCHRequest for more detail.
Delete a
note document for a product
Panel |
---|
borderStyle | solid |
---|
title | Delete a specific notedocument |
---|
|
Deck |
---|
id | InventoryNoteDELETERequestInventoryDocumentDELETERequest |
---|
|
Card |
---|
id | InventoryNoteDELETERequestInventoryDocumentDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNoteDELETERequestinventoryDocumentDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNoteDELETERequestInventoryDocumentDELETERequest() { InventoryID = "000000000K00000000BQ", NoteIDDocumentID = "8F25C1BF3b15e611-532Ad78c-430449bb-A44F8818-078AC5D1C54E7eaa46fd2200" };
client.Delete(inventoryNoteDELETERequest InventoryDocumentDELETERequest); |
|
Card |
---|
id | InventoryNoteDELETERequestInventoryDocumentDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments/8F25C1BF3b15e611-532Ad78c-430449bb-A44F8818-078AC5D1C54E7eaa46fd2200", "DELETE", "");
} |
|
Card |
---|
id | InventoryNoteDELETERequestInventoryDocumentDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/NotesDocuments/8F25C1BF3b15e611-532Ad78c-430449bb-A44F8818-078AC5D1C54E7eaa46fd2200 |
|
|
|