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 |
---|
borderStyle | solid |
---|
title | Retrieve products for the NSW / Main warehouse where they changed within the last day |
---|
|
Deck |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1 |
---|
|
Card |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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 |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/InventoryItemList?PhysicalWarehouseDescription=New South Wales&LogicalWarehouseDescription=Main&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=PartNo,Description,Picture,AvailableStock,SellPrice&Include=Total");
} |
|
Card |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/InventoryItemList?PhysicalWarehouseDescription=New%20South%20Wales&LogicalWarehouseDescription=Main&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=PartNo,Description,Picture,AvailableStock,SellPrice&Include=Total |
Instead of using URL parameters as above, you can also use a DTO to set the parameters: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/InventoryItemList -d '{"PhysicalWarehouseDescription":"New South Wales", "LogicalWarehouseDescription":"Main","LastSavedDateTimeGreaterThan="2017-09-18T00:00:00.000", "Fields":"PartNo, Description, Picture, AvailableStock, SellPrice", "Include":"Total"}' |
|
Card |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/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 |
---|
borderStyle | solid |
---|
title | Retrieve first 25 products where the PartNo starts with 'a' |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_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 |
---|
id | IN_MainQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25");
} |
|
Card |
---|
id | IN_MainQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25"}' |
|
Card |
---|
id | IN_MainQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
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 |
---|
borderStyle | solid |
---|
title | Retrieve first 25 products where the PartNo starts with 'a', but limit which fields are returned |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_2_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Fields = "InventoryID,PartNo,Description,Picture" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest); |
|
Card |
---|
id | IN_MainQuery_2_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Fields=InventoryID,PartNo,Description,Picture");
} |
|
Card |
---|
id | IN_MainQuery_2_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25","Fields":"InventoryID,PartNo,Description,Picture"}' |
|
Card |
---|
id | IN_MainQuery_2_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Fields=InventoryID,PartNo,Description,Picture&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Panel |
---|
borderStyle | solid |
---|
title | Retrieve next 25 products where the PartNo starts with 'a', and limit which fields are returned |
---|
|
Deck |
---|
|
Card |
---|
id | IN_MainQuery_3_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_MainQuery() { PartNoStartsWith = "a", OrderBy = "PartNo", Take = 25, Skip = 25, Fields = "InventoryID,PartNo,Description,Picture" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_Main> IN_MainQueryResponse = client.Get(IN_MainQueryRequest); |
|
Card |
---|
id | IN_MainQuery_3_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture");
} |
|
Card |
---|
id | IN_MainQuery_3_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_Main -d '{"PartNoStartsWith":"a","OrderBy":"PartNo","Take":"25","Skip":"25","Fields":"InventoryID,PartNo,Description,Picture"}' |
|
Card |
---|
id | IN_MainQuery_3_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_Main?PartNoStartsWith=a&OrderBy=PartNo&Take=25&Skip=25&Fields=InventoryID,PartNo,Description,Picture&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Read a product
In order to read a product, the InventoryID must be provided. Note this is a full read of the inventory business logic - so it will include associated elements such as notes, documents, prices and so on.
Panel |
---|
borderStyle | solid |
---|
title | Read a product |
---|
|
Deck |
---|
|
Card |
---|
id | read_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryGETRequest() { InventoryID = "000000000K00000000BQ" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Get(inventoryGETRequest); |
|
Card |
---|
id | read_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ");
} |
|
Card |
---|
id | read_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ |
|
Card |
---|
id | read_a_product_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryGETRequest for more detail. |
Create a new product
You don't need to provide anything to create a product - a PartNo and InventoryID will be generated for you - however it's usual practice to provide a PartNo. All other fields can be provided, but are not mandatory. The response DTO will contain the generated InventoryID, and all other fields of the product.
Panel |
---|
borderStyle | solid |
---|
title | Create a new product, and setting the PartNo, Description, DefaultPrice and Picture |
---|
|
Deck |
---|
|
Card |
---|
id | create_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequest { PartNo = "NewPartNo", Description = "A new product", 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/Gx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KUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
|
Card |
---|
id | create_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50, Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MT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OMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);
} |
|
Card |
---|
id | create_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50,"FileBinary":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9DE2N7eLpf7ubm6hYaEqdWa0tKypqamW7du8ezs7CQ6zj9+/Li3t/fOnTtNTc2DzwdJi5xqamr8/QPIRo81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v3VFZWIYOkpBPzDReuWL7y/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 the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Panel |
---|
borderStyle | solid |
---|
title | Create a product with 2 notes |
---|
|
Deck |
---|
id | create_a_product_with_2_notes |
---|
|
Card |
---|
id | create_a_product_with_2_notes_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPOSTRequest { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50M };
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 1" });
inventoryPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 2" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Post(inventoryPOSTRequest);
|
|
Card |
---|
id | create_a_product_with_2_notes_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "NewPartNo", Description = "A new product", DefaultPrice = 10.50, Notes = new List<object>() { new { NoteText = "Note text 1" }, new { NoteText = "Note text 2" } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory", "POST", json);
} |
|
Card |
---|
id | create_a_product_with_2_notes_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory -d '{"PartNo":"NewPartNo","Description":"A new product","DefaultPrice":10.50,"Notes":[{"NoteText":"Note text 1"}, {"NoteText":"NoteText 2"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Update an existing product
Anchor |
---|
| InventoryPatchRequest |
---|
| InventoryPatchRequest |
---|
|
Panel |
---|
borderStyle | solid |
---|
title | Update Description and Picture of a product, add an additional note and update an existing note |
---|
|
Deck |
---|
|
Card |
---|
id | update_a_product_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPATCHRequest { InventoryID = "000000000K00000000BQ", Description = "A new description", Picture = Convert.FromBase64String("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/9wcM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+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "A new note added" });
inventoryPATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" });
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryItem inventoryItem = client.Patch(inventoryPATCHRequest); |
|
Card |
---|
id | update_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Description = "A new description", Picture = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+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0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="), Notes = new List<object>() { new { NoteText = "A new note added" }, new { NoteID = "cb39806c-1b52-411b-a3ba-e16b6281ea63", NoteText = "A modified note text" } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "PATCH", json);
} |
|
Card |
---|
id | update_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ -d '{"Description":"A new description","Notes":[{"NoteText":"A new note added"},{"NoteID":"cb39806c-1b52-411b-a3ba-e16b6281ea63","NoteText":"A modified note text"}]}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Delete a product
Panel |
---|
borderStyle | solid |
---|
title | Delete a product |
---|
|
Deck |
---|
|
Card |
---|
id | InventoryDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDELETERequest{ InventoryID = "000000000K00000000BQ" };
client.Delete(inventoryDELETERequest); |
|
Card |
---|
id | InventoryDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ", "DELETE", "");
} |
|
Card |
---|
id | InventoryDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ |
|
|
|
Stock Levels
The stock levels are contained in the DTO response returned when you Read A Product. The WarehouseSOHs property is a list of WarehouseSOH records for each warehouse, containing the stock level information.
Another method available is the v_Jiwa_Inventory_Item_ListQuery as described previously - this returns a filtered list of products, including stock levels.
Alternatively, you can use the Autoquery for the IN_WarehouseSOH table to retrieve a filtered list, returning a row per product per warehouse:
Panel |
---|
borderStyle | solid |
---|
title | Retrieve stock levels for an array of inventory ID's - but only for one warehouse |
---|
|
Deck |
---|
|
Card |
---|
id | IN_WarehouseSOHQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var IN_WarehouseSOHQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_WarehouseSOHQuery() { InventoryIDIn = new string[] { "000000000K00000000BQ", "000000000K00000000BV", "000000000K00000000C5" }, IN_LogicalID = "ZZZZZZZZZZ0000000000" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.IN_WarehouseSOH> IN_WarehouseSOHQueryResponse = client.Get(IN_WarehouseSOHQueryRequest); |
|
Card |
---|
id | IN_WarehouseSOHQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/IN_WarehouseSOH?InventoryIDIn=000000000K00000000BQ,000000000K00000000BV,000000000K00000000C5&IN_LogicalID=ZZZZZZZZZZ0000000000");
} |
|
Card |
---|
id | IN_WarehouseSOHQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/IN_WarehouseSOH -d '{"InventoryIDIn": [ "000000000K00000000BQ", "000000000K00000000BV", "000000000K00000000C5"], "IN_LogicalID":"ZZZZZZZZZZ0000000000" }' |
|
Card |
---|
id | IN_WarehouseSOHQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/IN_WarehouseSOH?InventoryIDIn=000000000K00000000BQ,000000000K00000000BV,000000000K00000000C5&IN_LogicalID=ZZZZZZZZZZ0000000000&format=json |
Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
|
Custom Fields
Whilst custom fields can be retrieved, or modified as part of the normal inventory item GET, POST and PATCH operations, you can also use the following requests.
Get a list of Inventory Custom Fields
Panel |
---|
borderStyle | solid |
---|
title | Get all Inventory custom fields |
---|
|
Deck |
---|
id | InventoryCustomFieldsGETManyRequest |
---|
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldsGETManyRequest();
var InventoryCustomFieldsGETManyResponse = client.Get(InventoryCustomFieldsGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/CustomFields");
} |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/CustomFields |
|
Card |
---|
id | InventoryCustomFieldsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/CustomFields?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the a list of the DTO model for a custom field - see the meta data page for the InventoryCustomFieldsGETManyRequest for more detail. |
Get a list of custom field values for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all custom field values for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuesGETManyRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuesGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var InventoryCustomFieldsGETManyResponse = client.Get(InventoryCustomFieldsGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues");
} |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the Custom Field Value DTO model - see the meta data page for the InventoryCustomFieldValuesGETManyRequest for more detail. |
Get a custom field value for a product
Panel |
---|
borderStyle | solid |
---|
title | Get the custom field value for a specific custom field and product |
---|
|
Deck |
---|
id | InventoryCustomFieldValueGETRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldValueGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValueGETRequest() { InventoryID = "000000000K00000000BQ", SettingID = "b450e24b-0b83-4650-b812-311f26dfeeb2" };
var InventoryCustomFieldValueGETResponse= client.Get(InventoryCustomFieldValueGETRequest); |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2");
} |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 |
|
Card |
---|
id | InventoryCustomFieldValueGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the Custom Field Value DTO model - see the meta data page for the InventoryCustomFieldValueGETRequest for more detail. |
Update a custom field value for a product
Panel |
---|
borderStyle | solid |
---|
title | Update a custom field value for a product |
---|
|
Deck |
---|
id | InventoryCustomFieldValuePATCHRequest |
---|
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryCustomFieldValuePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryCustomFieldValuePATCHRequest() { InventoryID = "000000000K00000000BQ", SettingID = "b450e24b-0b83-4650-b812-311f26dfeeb2", Contents = "New Contents" };
var InventoryCustomFieldValuePATCHResponse = client.Patch(InventoryCustomFieldValuePATCHRequest); |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "New Contents" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2", "PATCH", json);
} |
|
Card |
---|
id | InventoryCustomFieldValuePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/CustomFieldValues/b450e24b-0b83-4650-b812-311f26dfeeb2 -d '{"Contents":"New Contents"}' |
|
|
The response returned from the above request will be a json document representing the full inventory item DTO model from the business logic - see the meta data page for the InventoryPOSTRequest for more detail. |
Prices
Price Query
Retrieve a price for a product, given the InventoryID, DebtorID, WarehouseID, date and quantity. This uses the Jiwa pricing business logic to determine the price based on the Price Scheme associated with the Debtor, and all prices involved in that price scheme.
Panel |
---|
borderStyle | solid |
---|
title | Price Query |
---|
|
Deck |
---|
id | InventoryPriceGETRequest |
---|
|
Card |
---|
id | InventoryPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorID = "0000000061000000001V", IN_LogicalID = "ZZZZZZZZZZ0000000000", Date = DateTime.Now, Quantity = 6 };
var InventoryPriceGETResponse = client.Get(InventoryPriceGETRequest); |
|
Card |
---|
id | InventoryPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6");
} |
|
Card |
---|
id | InventoryPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6 |
|
Card |
---|
id | InventoryPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Pricing/0000000061000000001V/ZZZZZZZZZZ0000000000/2017-09-14/6?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing the DTO model from the business logic - see the meta data page for the InventoryPriceGETRequest for more detail. |
Debtor Specific Prices
Get all debtor specific prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all debtor specific prices for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricesGETManyRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricesGETManyRequest { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice> inventoryDebtorPrices = client.Get(InventoryDebtorSpecificPricesGETManyRequest); |
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices");
} |
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices |
|
Card |
---|
id | InventoryDebtorSpecificPricesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricesGETManyRequest for more detail. |
Get a single debtor specific price for a product
Panel |
---|
borderStyle | solid |
---|
title | Get a debtor specific price |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPriceGETRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceID = "0000000011000000000Z" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice = client.Get(InventoryDebtorSpecificPriceGETRequest); |
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z");
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z |
|
Card |
---|
id | InventoryDebtorSpecificPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/0000000011000000000Z?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPriceGETRequest for more detail. |
Add a new debtor specific price for a product
Panel |
---|
borderStyle | solid |
---|
title | Add a new debtor specific price to a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricePOSTRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePOSTRequest { InventoryID = "000000000K00000000BQ", DebtorID = "0000000061000000001V", Mode = JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice.PriceModes.None, Amount = 150.00M, UseQuantityPriceBreak= true, QuantityPriceBreak = 15, StartDate = DateTime.Now };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice = client.Post(InventoryDebtorSpecificPricePOSTRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorID = "0000000061000000001V", Mode = 2, Amount = 150.00M, UseQuantityPriceBreak = true, QuantityPriceBreak = 15, StartDate = DateTime.Now });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices", "POST", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPricePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/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 |
---|
borderStyle | solid |
---|
title | Updates an existing debtor specific price for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPricePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorSpecificPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorSpecificPricePATCHRequest { InventoryID = "000000000K00000000BQ", DebtorSpecificPriceID = "3791217a18204bcb8813", Amount = 160.50M };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPrice inventoryDebtorPrice = client.Patch(InventoryDebtorSpecificPricePATCHRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Amount = 160.50M });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813", "PATCH", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813 -d '{"Amount":160.50}' |
|
|
The response returned from the above request will be a json document representing a inventory item debtor specific price DTO model from the business logic - see the meta data page for the InventoryDebtorSpecificPricePATCHRequest for more detail. |
Delete a debtor specific price
Panel |
---|
borderStyle | solid |
---|
title | Deletes an existing debtor specific price for a product |
---|
|
Deck |
---|
id | InventoryDebtorSpecificPriceDELETERequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| 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 |
---|
id | InventoryDebtorSpecificPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813", "DELETE", "");
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorSpecificPrices/3791217a18204bcb8813 |
|
|
|
Anchor |
---|
| DebtorClassificationPrices |
---|
| DebtorClassificationPrices |
---|
|
Debtor Classification Prices
Get all debtor classification prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all debtor classification prices for a product |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPricesGETManyRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorClassificationPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPricesGETManyRequest { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice> inventoryDebtorClassificationPrices = client.Get(InventoryDebtorClassificationPricesGETManyRequest); |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices");
} |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices |
|
Card |
---|
id | InventoryDebtorClassificationPricesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the inventory item debtor classification price DTO model from the business logic - see the meta data page for the InventoryDebtorClassificationPricesGETManyRequest for more detail. |
Get a single debtor classification price for a product
Panel |
---|
borderStyle | solid |
---|
title | Get a debtor classification price |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPriceGETRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorClassificationPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorClassificationPriceID = "0000000011000000000X" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice inventoryDebtorClassificationPriceGETResponse = client.Get(InventoryDebtorClassificationPriceGETRequest); |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X");
} |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X |
|
Card |
---|
id | InventoryDebtorClassificationPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a inventory debtor classification price DTO model from the business logic - see the meta data page for the InventoryDebtorClassificationPriceGETRequest for more detail. |
Add a new debtor classification price for a product
Panel |
---|
borderStyle | solid |
---|
title | Add a new debtor classification price to a product |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPricePOSTRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPricePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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 |
---|
id | InventoryDebtorClassificationPricePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorClassificationID = "00000000A8000000000C", Mode = 2, Amount = 200.00M, UseQuantityPriceBreak = true, QuantityPriceBreak = 15, StartDate = DateTime.Now });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices", "POST", json);
} |
|
Card |
---|
id | InventoryDebtorClassificationPricePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Updates an existing debtor classification price for a product |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPricePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorClassificationPricePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPricePATCHRequest { InventoryID = "000000000K00000000BQ", DebtorClassificationPriceID = "0000000011000000000X", Amount = 250.45M };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorClassificationPrice inventoryDebtorClassificationPrice = client.Patch(InventoryDebtorClassificationPricePATCHRequest);
|
|
Card |
---|
id | InventoryDebtorClassificationPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Amount = 250.45M });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X", "PATCH", json);
} |
|
Card |
---|
id | InventoryDebtorClassificationPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Deletes an existing debtor classification price for a product |
---|
|
Deck |
---|
id | InventoryDebtorClassificationPriceDELETERequest |
---|
|
Card |
---|
id | InventoryDebtorClassificationPriceDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorClassificationPriceDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorClassificationPriceDELETERequest { InventoryID = "000000000K00000000BQ", DebtorClassificationPriceID = "0000000011000000000X"};
client.Delete(InventoryDebtorClassificationPriceDELETERequest);
|
|
Card |
---|
id | InventoryDebtorClassificationPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X", "DELETE", "");
} |
|
Card |
---|
id | InventoryDebtorClassificationPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorClassificationPrices/0000000011000000000X |
|
|
|
Anchor |
---|
| DebtorPriceGroupPrices |
---|
| DebtorPriceGroupPrices |
---|
|
Debtor Price Group Prices
Get all debtor price group prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Get all debtor price group prices for a product |
---|
|
Deck |
---|
id | InventoryDebtorPriceGroupPricesGETManyRequest |
---|
|
Card |
---|
id | InventoryDebtorPriceGroupPricesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorPriceGroupPricesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPricesGETManyRequest { InventoryID = "000000000K00000000BQ" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific> debtorGroupPrice = client.Get(InventoryDebtorPriceGroupPricesGETManyRequest); |
|
Card |
---|
id | InventoryDebtorPriceGroupPricesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices");
} |
|
Card |
---|
id | InventoryDebtorPriceGroupPricesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices |
|
Card |
---|
id | InventoryDebtorPriceGroupPricesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrice?format=json |
Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned. |
|
The response returned from the above request will be a json document representing a list of the 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 |
---|
borderStyle | solid |
---|
title | Get a debtor price group price |
---|
|
Deck |
---|
id | InventoryDebtorPriceGroupPriceGETRequest |
---|
|
Card |
---|
id | InventoryDebtorPriceGroupPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorPriceGroupPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPriceGETRequest { InventoryID = "000000000K00000000BQ", DebtorPriceGroupInventorySpecificID = "804a5fb1-e7ac-4759-94a3-04ed1938560e" };
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventoryDebtorPriceGroupInventorySpecific debtorGroupPrice = client.Get(InventoryDebtorPriceGroupPriceGETRequest); |
|
Card |
---|
id | InventoryDebtorPriceGroupPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices/804a5fb1-e7ac-4759-94a3-04ed1938560e");
} |
|
Card |
---|
id | InventoryDebtorPriceGroupPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices/804a5fb1-e7ac-4759-94a3-04ed1938560e |
|
Card |
---|
id | InventoryDebtorPriceGroupPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Add a new debtor price group price to a product |
---|
|
Deck |
---|
id | InventoryDebtorPriceGroupPricePOSTRequest |
---|
|
Card |
---|
id | InventoryDebtorPriceGroupPricePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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 |
---|
id | InventoryDebtorPriceGroupPricePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { 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 |
---|
id | InventoryDebtorPriceGroupPricePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Updates an existing debtor price group price for a product |
---|
|
Deck |
---|
id | InventoryDebtorPriceGroupPricePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorPriceGroupPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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 |
---|
id | InventoryDebtorPriceGroupPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Amount = 15.99M });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707", "PATCH", json);
} |
|
Card |
---|
id | InventoryDebtorPriceGroupPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Deletes an existing debtor price group price for a product |
---|
|
Deck |
---|
id | InventoryDebtorPriceGroupPriceDELETERequest |
---|
|
Card |
---|
id | InventoryDebtorPriceGroupPriceDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDebtorPriceGroupPriceDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDebtorPriceGroupPriceDELETERequest { InventoryID = "000000000K00000000BQ", DebtorPriceGroupInventorySpecificID = "07d602d8-0b4d-4ed3-b1a5-012945c76707"};
client.Delete(InventoryDebtorPriceGroupPriceDELETERequest);
|
|
Card |
---|
id | InventoryDebtorPriceGroupPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707", "DELETE", "");
} |
|
Card |
---|
id | InventoryDebtorPriceGroupPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/DebtorPriceGroupPrices/07d602d8-0b4d-4ed3-b1a5-012945c76707 |
|
|
|
Quantity Break / Tier Pricing
Quantity break / tier pricing is achieved by the use of Debtor Classification Prices or Debtor Group Prices with a null classification or group (which signifies all classifications or any debtor groups), and with a quantity break set.
Selling Prices
Reading the Selling Prices for a product
Panel |
---|
borderStyle | solid |
---|
title | Get the P1...P10 Selling Prices |
---|
|
Deck |
---|
id | InventorySellingPriceGETRequest |
---|
|
Card |
---|
id | InventorySellingPriceGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventorySellingPriceGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventorySellingPriceGETRequest { InventoryID = "000000000K00000000BQ"};
JiwaFinancials.Jiwa.JiwaServiceModel.Inventory.InventorySellingPrices sellPrices = client.Get(InventorySellingPriceGETRequest); |
|
Card |
---|
id | InventorySellingPriceGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices");
} |
|
Card |
---|
id | InventorySellingPriceGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices |
|
Card |
---|
id | InventorySellingPriceGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Updates the selling prices for an item |
---|
|
Deck |
---|
id | InventorySellingPricePATCHRequest |
---|
|
Card |
---|
id | InventorySellingPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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 |
---|
id | InventorySellingPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { CurrentPriceDate = DateTime.Now, ForwardPriceDate = DateTime.Now.AddDays(30), SellPrices = new[] { new { SellingPriceID = "P1", Price = 10.55M, ForwardPrice = 11.55M } } });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices", "PATCH", json);
} |
|
Card |
---|
id | InventorySellingPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/SellingPrices -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 |
---|
borderStyle | solid |
---|
title | Get all notes for a product |
---|
|
Deck |
---|
id | InventoryNotesGETManyRequest |
---|
|
Card |
---|
id | InventoryNotesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotesGETManyRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var inventoryNotesGETManyResponse = client.Get(inventoryNotesGETManyRequest); |
|
Card |
---|
id | InventoryNotesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes");
} |
|
Card |
---|
id | InventoryNotesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes |
|
Card |
---|
id | InventoryNotesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Get a specific note |
---|
|
Deck |
---|
id | InventoryNotesGETRequest |
---|
|
Card |
---|
id | InventoryGETNotesRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotesGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETRequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E" };
var inventoryNotesGETResponse= client.Get(inventoryNotesGETRequest); |
|
Card |
---|
id | InventoryNotesGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E");
} |
|
Card |
---|
id | InventoryNotesGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E |
|
Card |
---|
id | InventoryNotesGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Add a new note to a product |
---|
|
Deck |
---|
id | InventoryNotePOSTRequest |
---|
|
Card |
---|
id | InventoryNotePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotePOSTRequest() { InventoryID = "000000000K00000000BQ", NoteText = "This is a new note" };
var inventoryNotesPOSTResponse = client.Post(inventoryNotePOSTRequest);
|
|
Card |
---|
id | InventoryNotePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteText = "This is a new note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes", "POST", json);
} |
|
Card |
---|
id | InventoryNotePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Update an existing note |
---|
|
Deck |
---|
id | InventoryNotePATCHRequest |
---|
|
Card |
---|
id | InventoryNotePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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 |
---|
id | InventoryNotePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteText = "This is an updated note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "PATCH", json);
} |
|
Card |
---|
id | InventoryNotePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Delete a specific note |
---|
|
Deck |
---|
id | InventoryNoteDELETERequest |
---|
|
Card |
---|
id | InventoryNoteDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNoteDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNoteDELETERequest() { InventoryID = "000000000K00000000BQ", NoteID = "8F25C1BF-532A-4304-A44F-078AC5D1C54E" };
var client.Delete(inventoryNoteDELETERequest); |
|
Card |
---|
id | InventoryNoteDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Notes/8F25C1BF-532A-4304-A44F-078AC5D1C54E", "DELETE", "");
} |
|
Card |
---|
id | InventoryNoteDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Get all documents for a product |
---|
|
Deck |
---|
id | InventoryDocumentsGETManyRequest |
---|
|
Card |
---|
id | InventoryDocumentsGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDocumentsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDocumentsGETManyRequest() { InventoryID = "000000000K00000000BQ" };
var inventoryDocumentsGETManyResponse = client.Get(InventoryDocumentsGETManyRequest); |
|
Card |
---|
id | InventoryDocumentsGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents");
} |
|
Card |
---|
id | InventoryDocumentsGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents |
|
Card |
---|
id | InventoryDocumentsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Get a specific notedocument |
---|
|
Deck |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest |
---|
|
Card |
---|
id | InventoryGETNotesRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var inventoryNotesGETRequestinventoryDocumentGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryNotesGETRequestInventoryDocumentGETRequest() { InventoryID = "000000000K00000000BQ", DocumentID = "87E73C5A-896C-4EF2-8323-3DFCA0C2B042" };
var inventoryNotesGETResponseinventoryDocumentGETResponse= client.Get(inventoryNotesGETRequestinventoryDocumentGETRequest); |
|
Card |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/87E73C5A-896C-4EF2-8323-3DFCA0C2B042");
} |
|
Card |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/87E73C5A-896C-4EF2-8323-3DFCA0C2B042 |
|
Card |
---|
id | InventoryNotesGETRequestInventoryDocumentGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Inventory/000000000K00000000BQ/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 |
---|
borderStyle | solid |
---|
title | Add a new note to a product |
---|
|
Deck |
---|
id | InventoryNotePOSTRequestInventoryDocumentPOSTRequest |
---|
|
Card |
---|
id | InventoryNotePOSTRequestInventoryDocumentPOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
var InventoryDocumentPOSTResponseinventoryDocumentPOSTResponse = client.Post(InventoryDocumentPOSTRequestinventoryDocumentPOSTRequest);
|
|
Card |
---|
id | InventoryNotePOSTRequestInventoryDocumentPOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { 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///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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oCSK374wbujvOSu4QG6UvxBRydcpKsav++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 |
---|
id | InventoryNotePOSTRequestDocumentNotePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Inventory/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///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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IPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/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 |
---|
borderStyle | solid |
---|
title | Update an existing document |
---|
|
Deck |
---|
id | InventoryDocumentPATCHRequest |
---|
|
Card |
---|
id | InventoryNotePATCHRequestInventoryDocumentPATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDocumentPATCHRequestinventoryDocumentPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDocumentPATCHRequest() { InventoryID = "000000000K00000000BQ", DocumentID = "3b15e611-d78c-49bb-8818-7eaa46fd2200", FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAI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AG2sigCIiIpA6I4LW4DLt6OhApKwRL2fQE9AjV+3dy5cvczUTb8ONhhhljKurK55Gr5WPTAftJ/dDsPQrVzhTm/CJEYooAGVhCuflXcjNze3svA/7FDwuLs7ZyZkgyEMP81emIyQuLv5sxlkWVJ8rAx+cwQETDh/A8R7DGVLjvxHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") };
var InventoryDocumentPATCHResponseinventoryDocumentPATCHResponse = client.Patch(InventoryDocumentPATCHRequestinventoryDocumentPATCHRequest);
|
|
Card |
---|
id | InventoryDocumentPATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2Is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cjx//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 |
---|
id | InventoryDocumentPATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/3b15e611-d78c-49bb-8818-7eaa46fd2200 -d '{"FileBinary":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9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szTwh8DPZ8ymFREo+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 |
---|
borderStyle | solid |
---|
title | Delete a specific document |
---|
|
Deck |
---|
id | InventoryDocumentDELETERequest |
---|
|
Card |
---|
id | InventoryDocumentDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var InventoryDocumentDELETERequestinventoryDocumentDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.InventoryDocumentDELETERequest() { InventoryID = "000000000K00000000BQ", DocumentID = "3b15e611-d78c-49bb-8818-7eaa46fd2200" };
client.Delete(InventoryDocumentDELETERequest); |
|
Card |
---|
id | InventoryDocumentDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/3b15e611-d78c-49bb-8818-7eaa46fd2200", "DELETE", "");
} |
|
Card |
---|
id | InventoryDocumentDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Inventory/000000000K00000000BQ/Documents/3b15e611-d78c-49bb-8818-7eaa46fd2200 |
|
|
|
Notes