Versions Compared

Key

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


Table of Contents





Sales Orders

Get a filtered list of sales orders

Using v_Jiwa_SalesOrder_ListQuery

A view, v_Jiwa_SalesOrder_List is provided with a corresponding query class v_Jiwa_SalesOrder_ListQuery to facilitate retrieving a filtered, paginated list of sales orders.  The data returned includes data from several tables to bring together customer, sales order, delivery information from one query.

Which fields are returned can be limited with the Fields property - so only the required fields are returned.

With the Include property set to "Total" the response will include the total count of records matching the query - this is useful for pagination. The Skip and Take properties can be added specify the starting record number to return and the number of records to return.

Panel
borderStylesolid
titleRetrieve first 25 sales orders from the NSW/Main warehouse, ordered by InvoiceNo.


Deck
idv_Jiwa_Inventory_Item_ListQuery_1


Card
idv_Jiwa_SalesOrder_ListQuery_1_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderListRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.v_Jiwa_SalesOrder_ListQuery() { PhysicalWarehouseDescription = "New South Wales", LogicalWarehouseDescription = "Main", Fields = "InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID,DebtorAccountNo,DebtorName",OrderBy = "InvoiceNo", Include = "Total", Take = 25 };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.v_Jiwa_SalesOrder_List> salesOrderListResponse = client.Get(salesOrderListRequest);



Card
idv_Jiwa_SalesOrder_ListQuery_1_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/SalesOrderList?PhysicalWarehouseDescription=New South Wales&LogicalWarehouseDescription=Main&Fields=InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID,AccountNo,DebtorName&OrderBy=InvoiceNo&Include=Total&Take=25");                
}



Card
idv_Jiwa_SalesOrder_ListQuery_1_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/SalesOrderList?PhysicalWarehouseDescription=New%20South%20Wales&LogicalWarehouseDescription=Main&Fields=InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID,AccountNo,DebtorName&OrderBy=InvoiceNo&Include=Total&Take=25

Instead of using URL parameters as above, you can also use a DTO to set the parameters:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/SalesOrderList -d '{"PhysicalWarehouseDescription":"New South Wales", "LogicalWarehouseDescription":"Main","Fields":"InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID,AccountNo,DebtorName", "OrderBy":"InvoiceNo", "Include":"Total", "Take":25}'



Card
idv_Jiwa_SalesOrder_ListQuery_1_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/Queries/SalesOrderList?PhysicalWarehouseDescription=New%20South%20Wales&LogicalWarehouseDescription=Main&Fields=InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID,DebtorAccountNo,DebtorName&OrderBy=InvoiceNo&Include=Total&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.



With the above example, simply setting the Skip property of the request DTO to 25 will have the effect of retrieving the next 25 records.  Because we include in the request Include=Total, the response will contain a property, Total, which is the count of the total number of records matching the query.

Using SO_MainQuery

An alternative to using the v_Jiwa_SalesOrder_ListQuery is to simply use the SO_MainQuery.

All tables have a corresponding Query class. For example, the table SO_Main has a class SO_MainQuery. The SO_MainQuery class is the DTO used for query operations against the SO_Main table. By setting various properties of an instance of this class, a filtered, ordered set of results can be obtained.

Panel
borderStylesolid
titleRetrieve first 25 sales orders, ordered by InvoiceNo.


Deck
idSO_MainQuery_1


Card
idSO_MainQuery_1_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderListRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.SO_MainQuery() { Fields = "InvoiceID, InvoiceNo, InvoiceInitDate, DebtorID", OrderBy = "InvoiceNo", Take = 25, Include = "Total" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.SO_Main> salesOrderListResponse = client.Get(salesOrderListRequest);



Card
idSO_MainQuery_1_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/SO_Main?Fields=InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID&OrderBy=InvoiceNo&Take=25&Include=Total");                            
}



Card
idSO_MainQuery_1_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/SO_Main?&Fields=InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID&OrderBy=InvoiceNo&Include=Total&Take=25

Instead of using URL parameters as above, you can also use a DTO to set the parameters:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/SO_Main -d '{"Fields":"InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID", "OrderBy":"InvoiceNo", "Include":"Total", "Take":25}'



Card
idSO_MainQuery_1_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/Queries/SO_Main?Fields=InvoiceID,InvoiceNo,InvoiceInitDate,DebtorID&OrderBy=InvoiceNo&Include=Total&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.



Read a Sales Order

Panel
borderStylesolid
titleRead a sales order


Deck
idSalesOrderGETRequest


Card
idSalesOrderGETRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderGETRequest { InvoiceID = "000000000800000000NK" };
var salesOrderGETResponse = client.Get(salesOrderGETRequest);



Card
idSalesOrderGETRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/000000000800000000NK");                            
}



Card
idSalesOrderGETRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/000000000800000000NK



Card
idSalesOrderGETRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/000000000800000000NK?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.



Create a new Sales Order

Panel
borderStylesolid
titleCreate a new sales order with 2 products, a comment and a payment


Deck
idSalesOrderPOSTRequest


Card
idSalesOrderPOSTRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderPOSTRequest()
{
	DebtorID = "00000000080000000002",
	InitiatedDate = DateTime.Now,
	OrderNo = "1234",
	SOReference = "Test order"
};
salesOrderPOSTRequest.Lines.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrders.SalesOrderLine { PartNo = "1170", QuantityOrdered = 5 });
salesOrderPOSTRequest.Lines.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrders.SalesOrderLine { CommentLine = true, CommentText = "This is a comment line" });
salesOrderPOSTRequest.Lines.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrders.SalesOrderLine { InventoryID = "000000000K00000000BV", QuantityOrdered = 2, DiscountedPrice = 15.67M, CustomFieldValues = new List<JiwaFinancials.Jiwa.JiwaServiceModel.CustomFields.CustomFieldValue> { new JiwaFinancials.Jiwa.JiwaServiceModel.CustomFields.CustomFieldValue { SettingID = "1ae102b94dc54dfc8a45                ", Contents = "Fragile - do not drop" } } });

salesOrderPOSTRequest.Payments.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrders.SalesOrderPayment { PaymentRef = "S454873-J5", AmountPaid = 50.00M });

var salesOrderPOSTResponse = client.Post(salesOrderPOSTRequest);



Card
idSalesOrderPOSTRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
    webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
	
	string json = Newtonsoft.Json.JsonConvert.SerializeObject(new
	{
		DebtorID = "00000000080000000002",
		InitiatedDate = DateTime.Now,
		OrderNo = "1234",
		SOReference = "Test order",
		Lines = new List<object>
		{
			new { PartNo = "1170", QuantityOrdered = 5 },
			new { CommentLine = true, CommentText = "This is a comment line" },
			new { InventoryID = "000000000K00000000BV", QuantityOrdered = 2, DiscountedPrice = 15.67M, CustomFieldValues = new List<object> { new { SettingID = "1ae102b94dc54dfc8a45                ", Contents = "Fragile - do not drop" } } }
		},
		Payments = new List<object>
		{
			new { PaymentRef = "S454873-J5", AmountPaid = 50.00M }
		}
	});

	responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders", "POST", json); 
}



Card
idSalesOrderPOSTRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/SalesOrders -d '{"DebtorID":"00000000080000000002","InitiatedDate":"2017-09-20","OrderNo":"1234","SOReference":"Test order","Lines":[{"PartNo":"1170","QuantityOrdered":5},{"CommentLine":"true","CommentText":"This is a comment line"},{"InventoryID":"000000000K00000000BV","QuantityOrdered":2,"DiscountedPrice:15.67,"CustomFieldValues":[{"SettingID":"1ae102b94dc54dfc8a45                ", "Contents":"Fragile - do not drop"}]}],"Payments":[{"PaymentRef":"S454873-J5","AmountPaid":50.00}]}'




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

Note(1): The DebtorID or DebtorAccountNo can be provided. If both are provided, then the DebtorID will be used to resolve the debtor.

Note(2): The sales order line added can provide either the InventoryID, or the PartNo. If both are provided, then the InventoryID will be used to resolve the inventory item.

Note(3): When sales order lines are added, omitting the price will cause Jiwa to determine the price per normal pricing scheme logic.

Note(4): The last line added in the above example sets a custom line field value for a setting with ID "1ae102b94dc54dfc8a45"

Note(5): When adding payments if the PaymentType is omitted, then the default payment type configured in Jiwa is used.

Update an existing Sales Order
Anchor
UpdateAnExistingSalesOrder
UpdateAnExistingSalesOrder

Panel
borderStylesolid
titleUpdates an existing order - adds a new line, adjusts an existing line and adds a note


Deck
idSalesOrderPATCHRequest


Card
idSalesOrderPATCHRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderPATCHRequest()
{
	InvoiceID = "babce67cdbf64f778536",
	ExpectedDeliveryDate = DateTime.Now.AddDays(5)                             
};
salesOrderATCHRequest.Lines.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrders.SalesOrderLine { PartNo = "1172", QuantityOrdered = 5 });
salesOrderATCHRequest.Lines.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrders.SalesOrderLine { InvoiceLineID = "88a358a2822e4319b9b9", QuantityOrdered = 10, CustomFieldValues = new List<JiwaFinancials.Jiwa.JiwaServiceModel.CustomFields.CustomFieldValue> { new JiwaFinancials.Jiwa.JiwaServiceModel.CustomFields.CustomFieldValue { SettingID = "1ae102b94dc54dfc8a45                ", Contents = "Adjustment requested by phone" } } });

salesOrderATCHRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note { NoteText = "Customer telephoned and asked for another few hours of labour" });

var salesOrderATCHResponse = client.Patch(salesOrderATCHRequest);



Card
idSalesOrderPATCHRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
    webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
	
	string json = Newtonsoft.Json.JsonConvert.SerializeObject(new
	{                    
		ExpectedDeliveryDate = DateTime.Now.AddDays(5),
		Lines = new List<object>
		{
			new { PartNo = "1172", QuantityOrdered = 5 },
			new { InvoiceLineID = "88a358a2822e4319b9b9", QuantityOrdered = 10, CustomFieldValues = new List<object> { new { SettingID = "1ae102b94dc54dfc8a45                ", Contents = "Adjustment requested by phone" } } }
		},
		Notes = new List<object>
		{
			new { NoteText = "Customer telephoned and asked for another few hours of labour" }
		}
	});

	responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536", "PATCH", json); 
}



Card
idSalesOrderPATCHRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536 -d '{"ExpectedDeliveryDate":"2017-09-20","Lines":[{"PartNo":"1172","QuantityOrdered":5},{"InvoiceLineID":"88a358a2822e4319b9b9","QuantityOrdered":10,"CustomFieldValues":[{"SettingID":"1ae102b94dc54dfc8a45                ", "Contents":"Adjustment requested by phone"}]}],"Notes":[{"NoteText":"Customer telephoned and asked for another few hours of labour"}]}'




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

Note(1): The DebtorID or DebtorAccountNo can be provided. If both are provided, then the DebtorID will be used to resolve the debtor.

Note(2): A sales order line can update an existing line by providing the InvoiceLineID property. New lines are appended by omitting InvoiceLineID.

Note(3): A new sales order line added can provide either the InventoryID, or the PartNo. If both are provided, then the InventoryID will be used to resolve the inventory item.

Note(4): When sales order lines are added, omitting the price will cause Jiwa to determine the price per normal pricing scheme logic.

Note(5): The last line added in the above example sets a custom line field value for a setting with ID "1ae102b94dc54dfc8a45"

Note(6): When adding notes if the NoteType is omitted, then the default note type configured in Jiwa is used.

Custom Fields

List all custom fields for sales orders

Panel
borderStylesolid
titleGet all sales order custom fields


Deck
idSalesOrderCustomFieldsGETManyRequest


Card
idSalesOrderCustomFieldsGETManyRequest_csharp_servicestack
labelServiceStack Client C#


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

var SalesOrderCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderCustomFieldsGETManyRequest();
var salesOrderCustomFieldsGETManyResponse = client.Get(SalesOrderCustomFieldsGETManyRequest);



Card
idSalesOrderCustomFieldsGETManyRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/CustomFields");
}



Card
idSalesOrderCustomFieldsGETManyRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/CustomFields



Card
idSalesOrderCustomFieldsGETManyRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/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 SalesOrderCustomFieldsGETManyRequest for more detail.

Get All Custom Field Values for a Single Sales Order

Panel
borderStylesolid
titleGet all sales order custom field values for a sales order


Deck
idSalesOrderCustomFieldValuesGETManyRequest


Card
idSalesOrderCustomFieldValuesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


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

var SalesOrderCustomFieldValuesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderCustomFieldValuesGETManyRequest { InvoiceID = "babce67cdbf64f778536" };
var salesOrderCustomFieldValuesGETManyResponse = client.Get(SalesOrderCustomFieldValuesGETManyRequest);



Card
idSalesOrderCustomFieldValuesGETManyRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues");
}



Card
idSalesOrderCustomFieldValuesGETManyRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues



Card
idSalesOrderCustomFieldValuesGETManyRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/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 the a list of the DTO model for a custom field value - see the meta data page for the SalesOrderCustomFieldValuesGETManyRequest for more detail.

Get a Single Custom Field Value for a Sales Order and Custom Field

Panel
borderStylesolid
titleGet a sales order custom field value for a sales order and custom field


Deck
idSalesOrderCustomFieldValueGETRequest


Card
idSalesOrderCustomFieldValueGETRequest_csharp_servicestack
labelServiceStack Client C#


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

var SalesOrderCustomFieldValueGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderCustomFieldValueGETRequest { InvoiceID = "babce67cdbf64f778536", SettingID = "b5432521f1fd46bb9245" };
var salesOrderCustomFieldValueGETResponse = client.Get(SalesOrderCustomFieldValueGETRequest);



Card
idSalesOrderCustomFieldValueGETRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues/b5432521f1fd46bb9245");
}



Card
idSalesOrderCustomFieldValueGETRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues/b5432521f1fd46bb9245



Card
idSalesOrderCustomFieldValueGETRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues/b5432521f1fd46bb9245?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 for a custom field value - see the meta data page for the SalesOrderCustomFieldValueGETRequest for more detail.

Update a Single Custom Field Value for a Sales Order and Custom Field

Panel
borderStylesolid
titleUpdate a sales order custom field value for a sales order and custom field


Deck
idSalesOrderCustomFieldValuePATCHRequest


Card
idSalesOrderCustomFieldValuePATCHRequest_csharp_servicestack
labelServiceStack Client C#


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

var SalesOrderCustomFieldValuePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderCustomFieldValuePATCHRequest { InvoiceID = "babce67cdbf64f778536", SettingID = "b5432521f1fd46bb9245                ", Contents = "New  Contents" };
var salesOrderCustomFieldValuePATCHResponse = client.Get(SalesOrderCustomFieldValuePATCHRequest);



Card
idSalesOrderCustomFieldValuePATCHRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));   
    string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "New  Contents"} );            
    responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues/b5432521f1fd46bb9245                /", "PATCH", json);
}



Card
idSalesOrderCustomFieldValuePATCHRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues/b5432521f1fd46bb9245%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 -d '{"Contents":"New  Contents"}'



The response returned from the above request will be a json document representing the DTO model for a custom field value - see the meta data page for the SalesOrderCustomFieldValuePATCHRequest for more detail.

Sales Order History (Snapshot)

Retrieve a list of sales order histories

Panel
borderStylesolid
titleRead all history records for a sales order


Deck
idSalesOrderHistorysGETManyRequest


Card
idSalesOrderHistorysGETManyRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderHistorysGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderHistorysGETManyRequest { InvoiceID = "000000000800000000NK"};
var salesOrderHistorysGETManyResponse = client.Get(salesOrderHistorysGETManyRequest);



Card
idSalesOrderHistorysGETManyRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys");                            
}



Card
idSalesOrderHistorysGETManyRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys



Card
idSalesOrderHistorysGETManyRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys?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.



Retrieve a sales order history

Panel
borderStylesolid
titleRead a history record for a sales order


Deck
idSalesOrderHistorysGETRequest


Card
idSalesOrderHistorysGETRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderHistorysGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderHistorysGETRequest { InvoiceID = "000000000800000000NK", InvoiceHistoryID = "000000000800000000NL"};
var salesOrderHistorysGETResponse = client.Get(salesOrderHistorysGETRequest);



Card
idSalesOrderHistorysGETRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys/000000000800000000NL");                            
}



Card
idSalesOrderHistorysGETRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys/000000000800000000NL



Card
idSalesOrderHistorysGETRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys/000000000800000000NL?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.



Update a sales order history

Note that to update some fields of the sales order history, you need to not use the SalesOrderHistorysPATCHRequest on /SalesOrders/{InvoiceID}/Historys/{InvoiceHistoryID} but instead use the SalesOrderPATCHRequest - this will pass the values through to the current snaphot number of the sales order.  See Update An Existing Sales Order.

Panel
borderStylesolid
titleUpdate a history record for a sales order


Deck
idSalesOrderHistorysPATCHRequest


Card
idSalesOrderHistorysPATCHRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderHistorysPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderHistorysPATCHRequest { InvoiceID = "000000000800000000NK", InvoiceHistoryID = "000000000800000000NL", Status = JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrders.SalesOrderHistory.SalesOrderHistoryStatuses.e_SalesOrderHistoryStatusReadyForPicking};            
var salesOrderHistorysPATCHResponse = client.Patch(salesOrderHistorysPATCHRequest);



Card
idSalesOrderHistorysPATCHRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));          
    string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Status = 2 });     
    responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys/000000000800000000NL", json);                            
}



Card
idSalesOrderHistorysPATCHRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/000000000800000000NK/Historys/000000000800000000NL -d '{"Status":2}'




Custom Fields

List all custom fields for sales order historys

Panel
borderStylesolid
titleGet all sales order history custom fields


Deck
idSalesOrderHistoryCustomFieldsGETManyRequest


Card
idSalesOrderHistoryCustomFieldsGETManyRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderHistoryCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderHistoryCustomFieldsGETManyRequest(); 
var salesOrderHistoryCustomFieldsGETManyResponse = client.Get(salesOrderHistoryCustomFieldsGETManyRequest);



Card
idSalesOrderHistoryCustomFieldsGETManyRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/Historys/CustomFields");
}



Card
idSalesOrderHistoryCustomFieldsGETManyRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/Historys/CustomFields



Card
idSalesOrderHistoryCustomFieldsGETManyRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/Historys/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 SalesOrderHistoryCustomFieldsGETManyRequest for more detail.

Get All Custom Field Values for a Single Sales Order History

Panel
borderStylesolid
titleGet all sales order custom field values for a sales order history


Deck
idSalesOrderHistoryCustomFieldValuesGETManyRequest


Card
idSalesOrderHistoryCustomFieldValuesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderHistoryCustomFieldValuesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderHistoryCustomFieldValuesGETManyRequest { InvoiceID = "5244dd5e199749f4b6fe", InvoiceHistoryID = "29a71d4380c5437b972e" }; 
var salesOrderHistoryCustomFieldValuesGETManyResponse = client.Get(salesOrderHistoryCustomFieldValuesGETManyRequest);



Card
idSalesOrderHistoryCustomFieldValuesGETManyRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues");
}



Card
idSalesOrderHistoryCustomFieldValuesGETManyRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues



Card
idSalesOrderHistoryCustomFieldValuesGETManyRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/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 the a list of the DTO model for a custom field value - see the meta data page for the SalesOrderHistoryCustomFieldValuesGETManyRequest for more detail.

Get a Single Custom Field Value for a Sales Order history and Custom Field

Panel
borderStylesolid
titleGet a sales order custom field value for a sales order history and custom field


Deck
idSalesOrderHistoryCustomFieldValuesGETRequest


Card
idSalesOrderHistoryCustomFieldValuesGETRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderHistoryCustomFieldValuesGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderHistoryCustomFieldValuesGETRequest { InvoiceID = "5244dd5e199749f4b6fe", InvoiceHistoryID = "29a71d4380c5437b972e", SettingID = "3231d2153d124a8ab2ad                " }; 
var salesOrderHistoryCustomFieldValuesGETResponse = client.Get(salesOrderHistoryCustomFieldValuesGETRequest);



Card
idSalesOrderHistoryCustomFieldValuesGETRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues/3231d2153d124a8ab2ad                /");
}



Card
idSalesOrderHistoryCustomFieldValuesGETRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues/3231d2153d124a8ab2ad%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20



Card
idSalesOrderHistoryCustomFieldValuesGETRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues/3231d2153d124a8ab2ad%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20?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 for a custom field value - see the meta data page for the SalesOrderHistoryCustomFieldValuesGETRequest for more detail.

Update a Single Custom Field Value for a Sales Order history and Custom Field

Panel
borderStylesolid
titleUpdate a sales order custom field value for a sales order history and custom field


Deck
idSalesOrderHistoryCustomFieldValuesPATCHRequest


Card
idSalesOrderHistoryCustomFieldValuesPATCHRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderHistoryCustomFieldValuesPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderHistoryCustomFieldValuesPATCHRequest { InvoiceID = "5244dd5e199749f4b6fe", InvoiceHistoryID = "29a71d4380c5437b972e", SettingID = "3231d2153d124a8ab2ad                ", Contents = "New Contents" }; 
var salesOrderHistoryCustomFieldValuesPATCHResponse = client.Patch(salesOrderHistoryCustomFieldValuesPATCHRequest);



Card
idSalesOrderHistoryCustomFieldValuesPATCHRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));   
    string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "New  Contents"} );            
    responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues/3231d2153d124a8ab2ad                /", "PATCH", json);
}



Card
idSalesOrderHistoryCustomFieldValuesPATCHRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues/3231d2153d124a8ab2ad%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 -d '{"Contents":"New  Contents"}'



The response returned from the above request will be a json document representing the DTO model for a custom field value - see the meta data page for the SalesOrderHistoryCustomFieldValuesPATCHRequest for more detail.


Lines

Read all lines for a sales order

Panel
borderStylesolid
titleRead all lines for a sales order history


Deck
idSalesOrderLinesGETManyRequest


Card
idSalesOrderLinesGETManyRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderLinesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderLinesGETManyRequest  { InvoiceID = "5244dd5e199749f4b6fe", InvoiceHistoryID = "29a71d4380c5437b972e" }; 
var salesOrderLinesGETManyResponse = client.Get(salesOrderLinesGETManyRequest);



Card
idSalesOrderLinesGETManyRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines");                            
}



Card
idSalesOrderLinesGETManyRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines



Card
idSalesOrderLinesGETManyRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines?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 sales order line

Panel
borderStylesolid
titleRead a single sales order line


Deck
idSalesOrderLineGETRequest


Card
idSalesOrderLineGETRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderLineGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderLineGETRequest  { InvoiceID = "5244dd5e199749f4b6fe", InvoiceHistoryID = "29a71d4380c5437b972e", InvoiceLineID = "abf2263e7a6c438b8cdf" }; 
var salesOrderLineGETResponse = client.Get(salesOrderLineGETRequest);



Card
idSalesOrderLineGETRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));               
    responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines/abf2263e7a6c438b8cdf");                            
}



Card
idSalesOrderLineGETRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines/abf2263e7a6c438b8cdf



Card
idSalesOrderLineGETRequest_webbrowser
labelWeb Browser

Navigate to the auth URL and provide the username and password as parameters:

No Format
https://api.jiwa.com.au/auth?username=admin&password=password

This authenticates the user and creates a cookie, so a subsequent request can be made:

No Format
https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines/abf2263e7a6c438b8cdf?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.



Add a line to a sales order

Inventory Item

Panel
borderStylesolid
titleAdds an inventory item to a sales order


Deck
idSalesOrderLinePOSTRequest


Card
idSalesOrderLinePOSTRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderLinePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderLinePOSTRequest  { InvoiceID = "5244dd5e199749f4b6fe", InvoiceHistoryID = "29a71d4380c5437b972e", PartNo = "1170", QuantityOrdered = 5, DiscountedPrice = 15.45M }; 
var salesOrderLinePOSTResponse = client.Post(salesOrderLinePOSTRequest);



Card
idSalesOrderLinePOSTRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
    string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "1170", QuantityOrdered = 5, DiscountedPrice = 15.45M });         
    responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines", "POST", json);                         
}



Card
idSalesOrderLinePOSTRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines -d '{"PartNo":"1170", "QuantityOrdered":5, "DiscountedPrice":15.45}'




Comment Line

Panel
borderStylesolid
titleAdds a comment line to a sales order


Deck
idSalesOrderLinePOSTRequest_comment


Card
idSalesOrderLinePOSTRequest_comment_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderLinePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderLinePOSTRequest  { InvoiceID = "32417fa3bc1c451ea2ba", InvoiceHistoryID = "5f4a173d84c54ee7ab11", CommentLine = true, CommentText = "This is a comment line" }; 
var salesOrderLinePOSTResponse = client.Post(salesOrderLinePOSTRequest);



Card
idSalesOrderLinePOSTRequest_comment_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
    string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { CommentLine = true, CommentText = "This is a comment line" });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/32417fa3bc1c451ea2ba/Historys/5f4a173d84c54ee7ab11/Lines", "POST", json);                      
}



Card
idSalesOrderLinePOSTRequest_comment_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/SalesOrders/32417fa3bc1c451ea2ba/Historys/5f4a173d84c54ee7ab11/Lines -d '{"CommentLine":"true", "CommentText":"This is a comment line"}'




Update a sales order line

Panel
borderStylesolid
titleUpdates an existing sales order line


Deck
idSalesOrderLinePATCHRequest


Card
idSalesOrderLinePATCHRequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderLinePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderLinePATCHRequest  { InvoiceID = "32417fa3bc1c451ea2ba", InvoiceHistoryID = "5f4a173d84c54ee7ab11", InvoiceLineID = "adc8696b69564431bd6c", QuantityOrdered = 6 }; 
var salesOrderLinePOSTResponse = client.Patch(salesOrderLinePOSTRequest);



Card
idSalesOrderLinePATCHRequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
    string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { QuantityOrdered = 6 });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/32417fa3bc1c451ea2ba/Historys/5f4a173d84c54ee7ab11/Lines/adc8696b69564431bd6c", "PATCH", json);
}



Card
idSalesOrderLinePATCHRequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/SalesOrders/32417fa3bc1c451ea2ba/Historys/5f4a173d84c54ee7ab11/Lines/adc8696b69564431bd6c -d '{"QuantityOrdered ":6}'





Delete a sales order line

Panel
borderStylesolid
titleDeletes an existing sales order line


Deck
idSalesOrderLineDELETERequest


Card
idSalesOrderLineDELETERequest_csharp_servicestack
labelServiceStack Client C#


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

var salesOrderLineDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderLineDELETERequest  { InvoiceID = "32417fa3bc1c451ea2ba", InvoiceHistoryID = "5f4a173d84c54ee7ab11", InvoiceLineID = "adc8696b69564431bd6c" }; 
var salesOrderLineDELETEResponse = client.Patch(salesOrderLineDELETERequest);



Card
idSalesOrderLineDELETERequest_csharp
labelC#


Code Block
languagec#
using (var webClient = new System.Net.WebClient())
{
    // Authenticate               
    webClient.QueryString.Add("username", "Admin");
    webClient.QueryString.Add("password", "password");
     
    string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");               
    // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
 
    // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
    var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
    var sessionId = authResponse.SessionId;
 
    webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
    responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/32417fa3bc1c451ea2ba/Historys/5f4a173d84c54ee7ab11/Lines/adc8696b69564431bd6c", "DELETE", "");
}



Card
idSalesOrderLineDELETERequest_curl
labelCurl


Code Block
languagebash
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}'

Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id"

No Format
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}}

Then, with the SessionId now known, the route can be called:

Code Block
languagebash
 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/SalesOrders/32417fa3bc1c451ea2ba/Historys/5f4a173d84c54ee7ab11/Lines/adc8696b69564431bd6c





Notes

Documents

Processing a Sales Order

Printing a Sales Order