Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents



Products

Get a filtered list of products

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.

Panel
borderStylesolid
titleRetrieve products for the NSW / Main warehouse where they changed within the last day


Deck
idv_Jiwa_Inventory_Item_ListQuery_1


Card
idv_Jiwa_Inventory_Item_ListQuery_1_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var itemListRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.v_Jiwa_Inventory_Item_ListQuery() { PhysicalWarehouseDescription = "New South Wales", LogicalWarehouseDescription = "Main", LastSavedDateTimeGreaterThan = DateTime.Now.AddDays(-1), Fields = "PartNo, Description, Picture, AvailableStock, SellPrice", Include = "Total" };            
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.v_Jiwa_Inventory_Item_List> itemListResponse = client.Get(itemListRequest);



Card
idv_Jiwa_Inventory_Item_ListQuery_1_csharp
labelC#


Code Block
languagec#
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/InventoryItemList?PhysicalWarehouseDescription=New South Wales&LogicalWarehouseDescription=Main&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=PartNo,Description,Picture,AvailableStock,SellPrice&Include=Total");
}



Card
idv_Jiwa_Inventory_Item_ListQuery_1_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/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
idv_Jiwa_Inventory_Item_ListQuery_1_webbrowser
labelWeb 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/InventoryItemList?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.




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
borderStylesolid
titleRetrieve first 25 products where the PartNo starts with 'a'


Deck
idIN_MainQuery_1


Card
idIN_MainQuery_1_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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 };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest);



Card
idIN_MainQuery_1_csharp
labelC#


Code Block
languagec#
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");
}



Card
idIN_MainQuery_1_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idIN_MainQuery_1_webbrowser
labelWeb 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&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
borderStylesolid
titleRetrieve first 25 products where the PartNo starts with 'a', but limit which fields are returned


Deck
idIN_MainQuery_2


Card
idIN_MainQuery_2_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idIN_MainQuery_2_csharp
labelC#


Code Block
languagec#
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
idIN_MainQuery_2_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idIN_MainQuery_2_webbrowser
labelWeb 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
borderStylesolid
titleRetrieve next 25 products where the PartNo starts with 'a', and limit which fields are returned


Deck
idIN_MainQuery_3


Card
idIN_MainQuery_3_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idIN_MainQuery_3_csharp
labelC#


Code Block
languagec#
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
idIN_MainQuery_3_curl
labelCurl


Code Block
languagebash
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
languagebash
 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","Skip":"25","Fields":"InventoryID,PartNo,Description,Picture"}'



Card
idIN_MainQuery_3_webbrowser
labelWeb 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

Anchor
ReadAProduct
ReadAProduct

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
borderStylesolid
titleRead a product


Deck
idread_a_product


Card
idread_a_product_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var inventoryGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryGETRequest() { InventoryID = "000000000K00000000BQ" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Get(inventoryGETRequest);



Card
idread_a_product_csharp
labelC#


Code Block
languagec#
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
idread_a_product_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ



Card
idread_a_product_webbrowser
labelWeb 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
borderStylesolid
titleCreate a new product, and setting the PartNo, Description, DefaultPrice and Picture


Deck
idcreate_a_product


Card
idcreate_a_product_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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, 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+Dg4GImIP8gIH0sKEA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CyJ58fgmIKX5RQGOZowxaZwYA+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
idcreate_a_product_csharp
labelC#


Code Block
languagec#
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+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///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teBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);      
}



Card
idcreate_a_product_curl
labelCurl


Code Block
languagebash
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
languagebash
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":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9DE2N7eLpf7ubm6hYaEqdWa0tKypqamW7du8ezs7CQ6zj9+/Li3t/fOnTtNTc2DzwdJi5xqamr8/QPIRo81Yh+gz5zJ8PDwvH79enNz8+3bt8G6e/fu/fv37927xwIHfCotLb148VJ+fn5jIy9ulZeVt7W2CWxcunTp4MGDY5nRQxcVFYWHh0MosRNaa2tbXV0dh2GT3bxkz+DgIF6fPn0Kv8XFxXV119LTf2poaGi82Tg8PEz4wcE7iUkAxHTQvA0LC+vr62NNcRobGwU4EiTSkW06q6qqGhoa4j1ALF68eNHS0lJZWUlthGCvXbsWGhoKmrBfB80mf39/drMeGBjg5MuXL3nyk8CFkDFeEq9SqXRycrKzs1MEKXDMfnIVNrBwcHCEd+GnCAiNJjYhIeHXEcONl9d2U1PTJSZLFIod2m6tAE0sOTk5YrH1lStX3N08Phk34bMJkxcvNsnMzESIeGUbx0tKStauXdvb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XmpPiMJPTM810wPiuWK4ljw9txUVFeOffAMDgxAPn7y2eSOsjo7O4qLirc6uNjZ2aJlGQ6mQiRy51Wg9AVQwPSHCzUaO+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 the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail.


Panel
borderStylesolid
titleCreate a product with 2 notes


Deck
idcreate_a_product_with_2_notes


Card
idcreate_a_product_with_2_notes_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idcreate_a_product_with_2_notes_csharp
labelC#


Code Block
languagec#
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
idcreate_a_product_with_2_notes_curl
labelCurl


Code Block
languagebash
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
languagebash
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
borderStylesolid
titleUpdate Description and Picture of a product, add an additional note and update an existing note


Deck
idupdate_a_product


Card
idupdate_a_product_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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("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///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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B1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+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
idupdate_a_product_csharp
labelC#


Code Block
languagec#
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///wAAAAAAAA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+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++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" } } });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "PATCH", json);
}



Card
idupdate_a_product_curl
labelCurl


Code Block
languagebash
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
languagebash
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
borderStylesolid
titleDelete a product


Deck
idInventoryDELETERequest


Card
idInventoryDELETERequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryDELETERequest_csharp
labelC#


Code Block
languagec#
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
idInventoryDELETERequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
borderStylesolid
titleRetrieve stock levels for an array of inventory ID's - but only for one warehouse


Deck
idIN_WarehouseSOHQuery_1


Card
idIN_WarehouseSOHQuery_1_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idIN_WarehouseSOHQuery_1_csharp
labelC#


Code Block
languagec#
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
idIN_WarehouseSOHQuery_1_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idIN_WarehouseSOHQuery_1_webbrowser
labelWeb 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
borderStylesolid
titleGet all Inventory custom fields


Deck
idInventoryCustomFieldsGETManyRequest


Card
idInventoryCustomFieldsGETManyRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryCustomFieldsGETManyRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryCustomFieldsGETManyRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/CustomFields



Card
idInventoryCustomFieldsGETManyRequest_webbrowser
labelWeb 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
borderStylesolid
titleGet all custom field values for a product


Deck
idInventoryCustomFieldValuesGETManyRequest


Card
idInventoryCustomFieldValuesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryCustomFieldValuesGETManyRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryCustomFieldValuesGETManyRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idInventoryCustomFieldValuesGETManyRequest_webbrowser
labelWeb 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
borderStylesolid
titleGet the custom field value for a specific custom field and product


Deck
idInventoryCustomFieldValueGETRequest


Card
idInventoryCustomFieldValueGETRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryCustomFieldValueGETRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryCustomFieldValueGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idInventoryCustomFieldValueGETRequest_webbrowser
labelWeb 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
borderStylesolid
titleUpdate a custom field value for a product


Deck
idInventoryCustomFieldValuePATCHRequest


Card
idInventoryCustomFieldValuePATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryCustomFieldValuePATCHRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryCustomFieldValuePATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
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
borderStylesolid
titlePrice Query


Deck
idInventoryPriceGETRequest


Card
idInventoryPriceGETRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryPriceGETRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryPriceGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idInventoryPriceGETRequest_webbrowser
labelWeb 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
borderStylesolid
titleGet all debtor specific prices for a product


Deck
idInventoryDebtorSpecificPricesGETManyRequest


Card
idInventoryDebtorSpecificPricesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryDebtorSpecificPricesGETManyRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryDebtorSpecificPricesGETManyRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idInventoryDebtorSpecificPricesGETManyRequest_webbrowser
labelWeb 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
borderStylesolid
titleGet a debtor specific price


Deck
idInventoryDebtorSpecificPriceGETRequest


Card
idInventoryDebtorSpecificPriceGETRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryDebtorSpecificPriceGETRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryDebtorSpecificPriceGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idInventoryDebtorSpecificPriceGETRequest_webbrowser
labelWeb 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
borderStylesolid
titleAdd a new debtor specific price to a product


Deck
idInventoryDebtorSpecificPricePOSTRequest


Card
idInventoryDebtorSpecificPricePOSTRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
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
idInventoryDebtorSpecificPricePOSTRequest_csharp
labelC#


Code Block
languagec#
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 });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices", "POST", json);  
}



Card
idInventoryDebtorSpecificPricePOSTRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST 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

Panel
borderStylesolid
titleUpdates an existing debtor specific price for a product


Deck
idInventoryDebtorSpecificPricePATCHRequest


Card
idInventoryDebtorSpecificPricePATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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
idInventoryDebtorSpecificPricePATCHRequest_csharp
labelC#


Code Block
languagec#
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.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813", "PATCH", json);
}



Card
idInventoryDebtorSpecificPricePATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
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
borderStylesolid
titleDeletes an existing debtor specific price for a product


Deck
idInventoryDebtorSpecificPriceDELETERequest


Card
idInventoryDebtorSpecificPriceDELETERequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
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
idInventoryDebtorSpecificPriceDELETERequest_csharp
labelC#


Code Block
languagec#
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/3791217a18204bcb8813", "DELETE", "");
}



Card
idInventoryDebtorSpecificPriceDELETERequest_curl
labelCurl


Code Block
languagebash
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
languagebash
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




Anchor
DebtorClassificationPrices
DebtorClassificationPrices

Debtor Classification Prices

Get all debtor classification prices for a product

Panel
borderStylesolid
titleGet all debtor classification prices for a product


Deck
idInventoryDebtorClassificationPricesGETManyRequest


Card
idInventoryDebtorClassificationPricesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorClassificationPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPricesGETManyRequest { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice> inventoryDebtorClassificationPrices = client.Get(InventoryDebtorClassificationPricesGETManyRequest);



Card
idInventoryDebtorClassificationPricesGETManyRequest_csharp
labelC#


Code Block
languagec#
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");
}



Card
idInventoryDebtorClassificationPricesGETManyRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices



Card
idInventoryDebtorClassificationPricesGETManyRequest_webbrowser
labelWeb 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?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
borderStylesolid
titleGet a debtor classification price


Deck
idInventoryDebtorClassificationPriceGETRequest


Card
idInventoryDebtorClassificationPriceGETRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
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
idInventoryDebtorClassificationPriceGETRequest_csharp
labelC#


Code Block
languagec#
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
idInventoryDebtorClassificationPriceGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 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
idInventoryDebtorClassificationPriceGETRequest_webbrowser
labelWeb 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
borderStylesolid
titleAdd a new debtor classification price to a product


Deck
idInventoryDebtorClassificationPricePOSTRequest


Card
idInventoryDebtorClassificationPricePOSTRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorClassificationPricePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.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.Post(InventoryDebtorClassificationPricePOSTRequest);



Card
idInventoryDebtorClassificationPricePOSTRequest_csharp
labelC#


Code Block
languagec#
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.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices", "POST", json);  
}



Card
idInventoryDebtorClassificationPricePOSTRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/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 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 classification price

Panel
borderStylesolid
titleUpdates an existing debtor classification price for a product


Deck
idInventoryDebtorClassificationPricePATCHRequest


Card
idInventoryDebtorClassificationPricePATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorClassificationPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPricePATCHRequest { InventoryID = "000000000K00000000BQ", DebtorClassificationPriceID = "0000000011000000000X", Amount = 250.45M };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice inventoryDebtorClassificationPrice = client.Patch(InventoryDebtorClassificationPricePATCHRequest);



Card
idInventoryDebtorClassificationPricePATCHRequest_csharp
labelC#


Code Block
languagec#
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.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X", "PATCH", json);
}



Card
idInventoryDebtorClassificationPricePATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X-d '{"Amount":250.45}'




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 classification price

Panel
borderStylesolid
titleDeletes an existing debtor classification price for a product


Deck
idInventoryDebtorClassificationPriceDELETERequest


Card
idInventoryDebtorClassificationPriceDELETERequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorClassificationPriceDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPriceDELETERequest { InventoryID = "000000000K00000000BQ", DebtorClassificationPriceID = "0000000011000000000X"};
client.Delete(InventoryDebtorClassificationPriceDELETERequest);



Card
idInventoryDebtorClassificationPriceDELETERequest_csharp
labelC#


Code Block
languagec#
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/DebtorClassificationPrices/0000000011000000000X", "DELETE", "");
}



Card
idInventoryDebtorClassificationPriceDELETERequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X 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
borderStylesolid
titleGet all debtor price group prices for a product


Deck
idInventoryDebtorPriceGroupPricesGETManyRequest


Card
idInventoryDebtorPriceGroupPricesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorPriceGroupPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPricesGETManyRequest { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific> debtorGroupPrice = client.Get(InventoryDebtorPriceGroupPricesGETManyRequest);



Card
idInventoryDebtorPriceGroupPricesGETManyRequest_csharp
labelC#


Code Block
languagec#
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/DebtorPriceGroupPrices");
}



Card
idInventoryDebtorPriceGroupPricesGETManyRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices



Card
idInventoryDebtorPriceGroupPricesGETManyRequest_webbrowser
labelWeb 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 inventory item debtor classification price DTO model from the business logic - see the meta data page for the InventoryDebtorPriceGroupPricesGETManyRequest for more detail.

Get a single debtor price group price for a product

Panel
borderStylesolid
titleGet a debtor price group price


Deck
idInventoryDebtorPriceGroupPriceGETRequest


Card
idInventoryDebtorPriceGroupPriceGETRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorPriceGroupPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorPriceGroupInventorySpecificID = "804a5fb1-e7ac-4759-94a3-04ed1938560e"  };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific debtorGroupPrice = client.Get(InventoryDebtorPriceGroupPriceGETRequest);



Card
idInventoryDebtorPriceGroupPriceGETRequest_csharp
labelC#


Code Block
languagec#
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/DebtorPriceGroupPrices/804a5fb1-e7ac-4759-94a3-04ed1938560e");
}



Card
idInventoryDebtorPriceGroupPriceGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices/804a5fb1-e7ac-4759-94a3-04ed1938560e



Card
idInventoryDebtorPriceGroupPriceGETRequest_webbrowser
labelWeb 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/DebtorPriceGroupPrices/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 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 price group price for a product

Panel
borderStylesolid
titleAdd a new debtor price group price to a product


Deck
idInventoryDebtorPriceGroupPricePOSTRequest


Card
idInventoryDebtorPriceGroupPricePOSTRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorPriceGroupPricePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPricePOSTRequest { 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 };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific debtorGroupPrice = client.Post(InventoryDebtorPriceGroupPricePOSTRequest);



Card
idInventoryDebtorPriceGroupPricePOSTRequest_csharp
labelC#


Code Block
languagec#
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 { DebtorPriceGroupID = "703AB465-604C-46B5-98A3-2D3F01E0CDE3", Mode = 2, Amount = 11.23M, UseQuantityPriceBreak = true, QuantityPriceBreak = 21, StartDate = DateTime.Now });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices", "POST", json);  
}



Card
idInventoryDebtorPriceGroupPricePOSTRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorPriceGroupPricePOSTRequest for more detail.

Update an existing debtor price group price

Panel
borderStylesolid
titleUpdates an existing debtor price group price for a product


Deck
idInventoryDebtorPriceGroupPricePATCHRequest


Card
idInventoryDebtorPriceGroupPricePATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorPriceGroupPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPricePATCHRequest { InventoryID = "000000000K00000000BQ", DebtorPriceGroupInventorySpecificID = "07d602d8-0b4d-4ed3-b1a5-012945c76707", Amount = 15.99M };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific debtorGroupPrice = client.Patch(InventoryDebtorPriceGroupPricePATCHRequest);



Card
idInventoryDebtorPriceGroupPricePATCHRequest_csharp
labelC#


Code Block
languagec#
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.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707", "PATCH", json);
}



Card
idInventoryDebtorPriceGroupPricePATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 InventoryDebtorPriceGroupPricePATCHRequest for more detail.

Delete a debtor price group price

Panel
borderStylesolid
titleDeletes an existing debtor price group price for a product


Deck
idInventoryDebtorPriceGroupPriceDELETERequest


Card
idInventoryDebtorPriceGroupPriceDELETERequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDebtorPriceGroupPriceDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPriceDELETERequest { InventoryID = "000000000K00000000BQ", DebtorPriceGroupInventorySpecificID = "07d602d8-0b4d-4ed3-b1a5-012945c76707"};
client.Delete(InventoryDebtorPriceGroupPriceDELETERequest);



Card
idInventoryDebtorPriceGroupPriceDELETERequest_csharp
labelC#


Code Block
languagec#
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/DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707", "DELETE", "");
}



Card
idInventoryDebtorPriceGroupPriceDELETERequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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
borderStylesolid
titleGet the P1...P10 Selling Prices


Deck
idInventorySellingPriceGETRequest


Card
idInventorySellingPriceGETRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventorySellingPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventorySellingPriceGETRequest { InventoryID = "000000000K00000000BQ"};
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventorySellingPrices sellPrices = client.Get(InventorySellingPriceGETRequest);



Card
idInventorySellingPriceGETRequest_csharp
labelC#


Code Block
languagec#
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/SellingPrices");
}



Card
idInventorySellingPriceGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices



Card
idInventorySellingPriceGETRequest_webbrowser
labelWeb 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/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 selling prices DTO model from the business logic - see the meta data page for the InventorySellingPriceGETRequest for more detail.

Updating the Selling Prices for a product


Panel
borderStylesolid
titleUpdates the selling prices for an item


Deck
idInventorySellingPricePATCHRequest


Card
idInventorySellingPricePATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventorySellingPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventorySellingPricePATCHRequest { InventoryID = "000000000K00000000BQ", CurrentPriceDate = DateTime.Now, ForwardPriceDate = DateTime.Now.AddDays(30) };
InventorySellingPricePATCHRequest.SellPrices.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventorySellingPrice { SellingPriceID = "P1", Price = 10.55M, ForwardPrice = 11.55M });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventorySellingPrices sellPrices = client.Patch(InventorySellingPricePATCHRequest);



Card
idInventorySellingPricePATCHRequest_csharp
labelC#


Code Block
languagec#
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/SellingPrices", "PATCH", json);
}



Card
idInventorySellingPricePATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices -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 selling price DTO model from the business logic - see the meta data page for the InventorySellingPricePATCHRequest for more detail.


Notes

Get all 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
borderStylesolid
titleGet all notes for a product


Deck
idInventoryNotesGETManyRequest


Card
idInventoryNotesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var inventoryNotesGETManyRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var inventoryNotesGETManyResponse = client.Get(inventoryNotesGETManyRequest);



Card
idInventoryNotesGETManyRequest_csharp
labelC#


Code Block
languagec#
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/Notes");
}



Card
idInventoryNotesGETManyRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes



Card
idInventoryNotesGETManyRequest_webbrowser
labelWeb 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/Notes?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 InventoryNotesGETManyRequest for more detail.


Get a specific note for a product

With a provided InventoryID, and a NoteID a single note can be retrieved.

Panel
borderStylesolid
titleGet a specific note


Deck
idInventoryNotesGETRequest


Card
idInventoryGETNotesRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var inventoryNotesGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETRequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E" };
var inventoryNotesGETResponse= client.Get(inventoryNotesGETRequest);



Card
idInventoryNotesGETRequest_csharp
labelC#


Code Block
languagec#
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/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E");
}



Card
idInventoryNotesGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E



Card
idInventoryNotesGETRequest_webbrowser
labelWeb 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/Notes/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 item note DTO model from the business logic - see the meta data page for the InventoryNoteGETRequest for more detail.


Add a new note

Panel
borderStylesolid
titleAdd a new note to a product


Deck
idInventoryNotePOSTRequest


Card
idInventoryNotePOSTRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var inventoryNotePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotePOSTRequest() { InventoryID = "000000000K00000000BQ", NoteText = "This is a new note" };
var inventoryNotesPOSTResponse = client.Post(inventoryNotePOSTRequest);



Card
idInventoryNotePOSTRequest_csharp
labelC#


Code Block
languagec#
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" });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes", "POST", json);      
}



Card
idInventoryNotePOSTRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes -d '{"NoteText":"This is a new note"}'




The response returned from the above request will be a json document representing a inventory item note DTO model from the business logic - see the meta data page for the InventoryNotePOSTRequest for more detail.


Update an existing note

Panel
borderStylesolid
titleUpdate an existing note


Deck
idInventoryNotePATCHRequest


Card
idInventoryNotePATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var inventoryNotePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotePATCHRequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E", NoteText = "This is an updated note" };
var inventoryNotesPOSTResponse = client.Patch(inventoryNotePOSTRequest);



Card
idInventoryNotePATCHRequest_csharp
labelC#


Code Block
languagec#
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 an updated note" });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "PATCH", json);      
}



Card
idInventoryNotePATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E -d '{"NoteText":"This is an updated note"}'




The response returned from the above request will be a json document representing a inventory item note DTO model from the business logic - see the meta data page for the InventoryNotePATCHRequest for more detail.


Delete a note for a product

Panel
borderStylesolid
titleDelete a specific note


Deck
idInventoryNoteDELETERequest


Card
idInventoryNoteDELETERequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var inventoryNoteDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNoteDELETERequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E" };
var client.Delete(inventoryNoteDELETERequest);



Card
idInventoryNoteDELETERequest_csharp
labelC#


Code Block
languagec#
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/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "DELETE", "");
}



Card
idInventoryNoteDELETERequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X 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_DocumentsQuery class to return all documents with a given InventoryID - There is also a GET method for retrieving all documents for a given InventoryID.

Panel
borderStylesolid
titleGet all documents for a product


Deck
idInventoryDocumentsGETManyRequest


Card
idInventoryDocumentsGETManyRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDocumentsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDocumentsGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var inventoryDocumentsGETManyResponse = client.Get(InventoryDocumentsGETManyRequest);



Card
idInventoryDocumentsGETManyRequest_csharp
labelC#


Code Block
languagec#
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/Documents");
}



Card
idInventoryDocumentsGETManyRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents



Card
idInventoryDocumentsGETManyRequest_webbrowser
labelWeb 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/Documents?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 document DTO model from the business logic - see the meta data page for the InventoryDocumentsGETManyRequest for more detail.


Get a specific document for a product

With a provided InventoryID, and a DocumentID a single document can be retrieved.

Panel
borderStylesolid
titleGet a specific notedocument


Deck
idInventoryNotesGETRequestInventoryDocumentGETRequest


Card
idInventoryGETNotesRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
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", DocumentID = "87E73C5A-896C-4EF2-8323-3DFCA0C2B042" };
var inventoryNotesGETResponseinventoryDocumentGETResponse= client.Get(inventoryNotesGETRequestinventoryDocumentGETRequest);



Card
idInventoryNotesGETRequestInventoryDocumentGETRequest_csharp
labelC#


Code Block
languagec#
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/Documents/87E73C5A-896C-4EF2-8323-3DFCA0C2B042");
}



Card
idInventoryNotesGETRequestInventoryDocumentGETRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/87E73C5A-896C-4EF2-8323-3DFCA0C2B042



Card
idInventoryNotesGETRequestInventoryDocumentGETRequest_webbrowser
labelWeb 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/Documents/87E73C5A-896C-4EF2-8323-3DFCA0C2B042?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 document DTO model from the business logic - see the meta data page for the InventoryDocumentGETRequest for more detail.


Add a new document

Panel
borderStylesolid
titleAdd a new note to a product


Deck
idInventoryNotePOSTRequestInventoryDocumentPOSTRequest


Card
idInventoryNotePOSTRequestInventoryDocumentPOSTRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDocumentPOSTRequestinventoryDocumentPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDocumentPOSTRequest() { 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/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///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teBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
var InventoryDocumentPOSTResponseinventoryDocumentPOSTResponse = client.Post(InventoryDocumentPOSTRequestinventoryDocumentPOSTRequest);



Card
idInventoryNotePOSTRequestInventoryDocumentPOSTRequest_csharp
labelC#


Code Block
languagec#
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 { 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/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///wAAAAAAAAAAAAAAAAAAA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it4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") } );
	responsebody = webClient.UploadString("http://localhost/Inventory/000000000K00000000BQ/Documents", "POST", json); 
}



Card
idInventoryNotePOSTRequestDocumentNotePOSTRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.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/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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SlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/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 InventoryDocumentPOSTRequest for more detail.


Update an existing document

Panel
borderStylesolid
titleUpdate an existing document


Deck
idInventoryDocumentPATCHRequest


Card
idInventoryNotePATCHRequestInventoryDocumentPATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDocumentPATCHRequestinventoryDocumentPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDocumentPATCHRequest() { InventoryID = "000000000K00000000BQ", DocumentID = "3b15e611-d78c-49bb-8818-7eaa46fd2200", FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAA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v37YUOAG2sigCIiIpA6I4LW4DLt6OhApKwRL2fQE9AjV+3dy5cvczUTb8ONhhhljKurK55Gr5WPTAftJ/dDsPQrVzhTm/CJEYooAGVhCuflXcjNze3svA/7FDwuLs7ZyZkgyEMP81emIyQuLv5sxlkWVJ8rAx+cwQETDh/A8R7DGVLjvxHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") };
var InventoryDocumentPATCHResponseinventoryDocumentPATCHResponse = client.Patch(InventoryDocumentPATCHRequestinventoryDocumentPATCHRequest);



Card
idInventoryDocumentPATCHRequest_csharp
labelC#


Code Block
languagec#
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 { FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJ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xHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") } );
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/3b15e611-d78c-49bb-8818-7eaa46fd2200", "PATCH", json);
}



Card
idInventoryDocumentPATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
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/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9DE2N7eLpf7ubm6hY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svLy6OxcaZrmYRjCc3NLRp1rLVYIhHbksd8wwXr1683X2++erWZtbW1ufkGdJaSksKB3bv3VFZWIYOkpBPzDReuWL7y/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 document DTO model from the business logic - see the meta data page for the InventoryDocumentPATCHRequest for more detail.


Delete a document for a product

Panel
borderStylesolid
titleDelete a specific document


Deck
idInventoryDocumentDELETERequest


Card
idInventoryDocumentDELETERequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryDocumentDELETERequestinventoryDocumentDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDocumentDELETERequest() { InventoryID = "000000000K00000000BQ", DocumentID = "3b15e611-d78c-49bb-8818-7eaa46fd2200" };
client.Delete(InventoryDocumentDELETERequest);



Card
idInventoryDocumentDELETERequest_csharp
labelC#


Code Block
languagec#
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/Documents/3b15e611-d78c-49bb-8818-7eaa46fd2200", "DELETE", "");
}



Card
idInventoryDocumentDELETERequest_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/3b15e611-d78c-49bb-8818-7eaa46fd2200





Notes

Categories

Get a list of all categories

Panel
borderStylesolid
titleRetrieve all inventory categories


Deck
idIN_CategoriesQuery_1


Card
idIN_MainQuery_1_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var IN_CategoriesRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_CategoriesQuery();
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Categories> IN_CategoriesResponse = client.Get(IN_CategoriesRequest);



Card
idIN_CategoriesQuery_1_csharp
labelC#


Code Block
languagec#
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_Categories");
}



Card
idIN_CategoriesQuery_1_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Categories



Card
idIN_CategoriesQuery_1_webbrowser
labelWeb 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_Categories?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.



Get a list of a specific category number

Panel
borderStylesolid
titleRetrieve all Category 1 inventory categories


Deck
idIN_CategoriesQuery_2


Card
idIN_CategoriesQuery_2_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var IN_CategoriesRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_CategoriesQuery() { CategoryNo = 1};
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Categories> IN_CategoriesResponse = client.Get(IN_CategoriesRequest);



Card
idIN_CategoriesQuery_2_csharp
labelC#


Code Block
languagec#
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_Categories?CategoryNo=1");
}



Card
idIN_CategoriesQuery_2_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Categories?CategoryNo=1



Card
idIN_CategoriesQuery_2_webbrowser
labelWeb 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_Categories?CategoryNo=1&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.



Get a specific category

Panel
borderStylesolid
titleRetrieve a specific category


Deck
idIN_CategoriesQuery_2


Card
idIN_MainQuery_2_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryCategoryGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCategoryGETRequest() { CategoryID = "000000000E00000000ZJ" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.Category.InventoryCategory Category = client.Get(InventoryCategoryGETRequest);



Card
idIN_CategoriesQuery_2_csharp
labelC#


Code Block
languagec#
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/Categories/000000000E00000000ZJ");
}



Card
idIN_CategoriesQuery_2_curl
labelCurl


Code Block
languagebash
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
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/Categories/000000000E00000000ZJ



Card
idIN_CategoriesQuery_2_webbrowser
labelWeb 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/Categories/000000000E00000000ZJ?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 category DTO model from the business logic - see the meta data page for the InventoryCategoryGETRequest for more detail.

Create a category


Panel
borderStylesolid
titleCreate a new category


Deck
idInventoryCategoryPOSTRequest


Card
idInventoryCategoryPOSTRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryCategoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCategoryPOSTRequest() { Description = "A new category", CategoryNo = 1 };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.Category.InventoryCategory Category = client.Post(InventoryCategoryPOSTRequest);



Card
idInventoryCategoryPOSTRequest_csharp
labelC#


Code Block
languagec#
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 category", CategoryNo = 1 });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/Categories", "POST", json);
}



Card
idInventoryCategoryPOSTRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/Categories -d '{"Description":"A new category"}'




The response returned from the above request will be a json document representing the category DTO model from the business logic - see the meta data page for the InventoryCategoryPOSTRequest for more detail.


Update a category


Panel
borderStylesolid
titleUpdate an existing category


Deck
idInventoryCategoryPATCHRequest


Card
idInventoryCategoryPATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryCategoryPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCategoryPATCHRequest() { CategoryID = "3acb85d7ad4d4b878d5e", Description = "A modified category" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.Category.InventoryCategory Category = client.Patch(InventoryCategoryPATCHRequest);



Card
idInventoryCategoryPATCHRequest_csharp
labelC#


Code Block
languagec#
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 modified category" });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/Categories/3acb85d7ad4d4b878d5e", "PATCH", json);
}



Card
idInventoryCategoryPATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/Categories/3acb85d7ad4d4b878d5e -d '{"Description":"A modified category"}'




The response returned from the above request will be a json document representing the category DTO model from the business logic - see the meta data page for the InventoryCategoryPATCHRequest for more detail.


Delete a category


Panel
borderStylesolid
titleDelete an existing category


Deck
idInventoryCategoryPATCHRequest


Card
idInventoryCategoryPATCHRequest_csharp_servicestack
labelServiceStack Client C#


Code Block
languagec#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var InventoryCategoryDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCategoryDELETERequest() { CategoryID = "3acb85d7ad4d4b878d5e" };
client.Delete(InventoryCategoryDELETERequest);



Card
idInventoryCategoryPATCHRequest_csharp
labelC#


Code Block
languagec#
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/Categories/3acb85d7ad4d4b878d5e", "DELETE", "");
}



Card
idInventoryCategoryPATCHRequest_curl
labelCurl


Code Block
languagebash
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
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/Categories/3acb85d7ad4d4b878d5e