Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

Customers

Get a filtered list of customers

Using v_Jiwa_Debtor_ListQuery

A view, v_Jiwa_Debtor_List is provided with a corresponding query class v_Jiwa_Debtor_ListQuery to facilitate retrieving a filtered, paginated list of customers.  The data returned includes the AccountNo, Name, Address, and Categories.

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.

Retrieve web enabled customers that have changed within the last day
 ServiceStack Client C#
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_Debtor_ListQuery() { WebEnabled = true, LastSavedDateTimeGreaterThan = DateTime.Now.AddDays(-1), Fields = "AccountNo, Name", Include = "Total" };            
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.v_Jiwa_Debtor_List> itemListResponse = client.Get(itemListRequest);
 C#
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/DebtorList?WebEnabled=true&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=AccountNo,Name&Include=Total");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DebtorList?WebEnabled=true&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=AccountNo,Name&Include=Total

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DebtorList -d '{"WebEnabled":"true","LastSavedDateTimeGreaterThan="2017-09-18T00:00:00.000", "Fields":"AccountNo, Name", "Include":"Total"}'
 Web Browser

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

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:

https://api.jiwa.com.au/Queries/DebtorList?WebEnabled=true&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=AccountNo,Name&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_Debtor_ListQuery is to simply use the DB_MainQuery.

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

Retrieve first 5 customers where the AccountNo starts with '1'
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var DB_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_MainQuery() { AccountNoStartsWith = "1", OrderBy = "AccountNo", Take = 5 };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_Main> DB_MainQueryResponse = client.Get(DB_MainQueryRequest);
 C#
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");
	// 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/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Main -d '{"AccountNoStartsWith":"1","OrderBy":"AccountNo","Take":"5"}'
 Web Browser

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

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:

https://api.jiwa.com.au/Queries/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&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 first 5 customers where the AccountNo starts with '1', but limit which fields are returned
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var DB_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_MainQuery() { AccountNoStartsWith = "1", OrderBy = "AccountNo", Take = 5, Fields = "DebtorID,AccountNo,Name,EmailAddress" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_Main> DB_MainQueryResponse = client.Get(DB_MainQueryRequest);
 C#
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/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&Fields=DebtorID,AccountNo,Name,EmailAddress");

}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Main -d '{"AccountNoStartsWith":"1","OrderBy":"AccountNo","Take":"5","Fields":"DebtorID,AccountNo,Name,EmailAddress"}'
 Web Browser

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

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:

https://api.jiwa.com.au/Queries/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&Fields=DebtorID,AccountNo,Name,EmailAddress&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 next 5 customers where the AccountNo starts with '1', and limit which fields are returned
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var DB_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_MainQuery() { AccountNoStartsWith = "1", OrderBy = "AccountNo", Take = 5, Skip = 5, Fields = "DebtorID,AccountNo,Name,EmailAddress" };
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_Main> DB_MainQueryResponse = client.Get(DB_MainQueryRequest);
 C#
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/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&Skip=5&Fields=DebtorID,AccountNo,Name,EmailAddress");

}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Main -d '{"AccountNoStartsWith":"1","OrderBy":"AccountNo","Take":"5","Skip":"5","Fields":"DebtorID,AccountNo,Name,EmailAddress"}'
 Web Browser

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

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:

https://api.jiwa.com.au/Queries/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&Skip=5&Fields=DebtorID,AccountNo,Name,EmailAddress&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 customer

In order to read a customer, the DebtorID must be provided. Note this is a full read of the debtor business logic - so it will include associated elements such as notes, documents, prices and so on.

Read a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorGETRequest() { DebtorID= "0000000061000000001V" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Debtor Debtor = client.Get(debtorGETRequest);
 C#
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/Debtors/0000000061000000001V");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V?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 debtor DTO model from the business logic - see the meta data page for the DebtorGETRequest for more detail.

Create a new customer

You don't need to provide anything to create a customer- an AccountNo and DebtorID will be generated for you - however it's usual practice to provide a AccountNo.  All other fields can be provided, but are not mandatory.  The response DTO will contain the generated DebtorID , and all other fields of the customer.

Create a new customer, and setting the AccountNo, Name, EmailAddress and WebEnabled
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorPOSTRequest { AccountNo = "NewAccountNo", Name = "A new customer", EmailAddress = "name@example.com", WebAccess = true };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Debtor Debtor = client.Post(debtorPOSTRequest);
 C#
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";
    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
    	{
	        AccountNo = "NewAccountNo",
    	    Name = "A new customer",
        	EmailAddress = "name@example.com",
	        WebAccess = true
        });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors", "POST", json);  
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Debtors -d '{"AccountNo":"NewAccountNo","Name":"A new customer","EmailAddress":"name@example.com", "WebAccess"""true"}'

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

Create a customer with 2 notes
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorPOSTRequest { AccountNo = "NewAccountNo", Name = "A new customer", EmailAddress = "name@example.com", WebAccess = true };
debtorPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 1" });
debtorPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 2" });
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Debtor Debtor = client.Post(debtorPOSTRequest);
 C#
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 = "NewAccountNo", Description = "A new customer", EmailAddress = "name@example.com", WebAccess = true, Notes = new List<object>() { new { NoteText = "Note text 1" }, new { NoteText = "Note text 2" } } });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors", "POST", json);
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Debtors -d '{"AccountNo":"NewAccountNo","Name":"A new Customer","EmailAddress ":"name@example.com", "WebAccess":"true", "Notes":[{"NoteText":"Note text 1"}, {"NoteText":"NoteText 2"}]}'

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

Update an existing customer

Update EmailAddress and WebAccess of a customer, add an additional note and update an existing note
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorPatchRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorPATCHRequest { DebtorID = "0000000061000000001V", EmailAddress = "name2@example.com", WebAccess = false };
debtorPatchRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "A new note added" });
debtorPatchRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteID = "DE91CC53-724A-47C6-8920-57AC82BFAD1F", NoteText = "A modified note text" });
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Debtor Debtor = client.Patch(debtorPatchRequest);
 C#
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 { EmailAddress = "name2@example.com", WebAccess = "false", Notes = new List<object>() { new { NoteText = "A new note added" }, new { NoteID = "DE91CC53-724A-47C6-8920-57AC82BFAD1F", NoteText = "A modified note text" } } });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V", "PATCH", json);
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH http://localhost/Debtors/0000000061000000001V -d '{EmailAddress = "name2@example.com", WebAccess = "false","Notes":[{"NoteText":"A new note added"},{"NoteID":"DE91CC53-724A-47C6-8920-57AC82BFAD1F","NoteText":"A modified note text"}]}'

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

Delete a customer

Delete a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDELETERequest { DebtorID = "1c4e1f674674465bb57a" };
client.Delete(debtorDELETERequest);
 C#
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("http://localhost/Debtors/a256102d4b2c4202b0e8", "DELETE", "");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/6c5b4a30c1b645ad9ebb

Custom Fields

Whilst custom fields can be retrieved, or modified as part of the normal debtor GET, POST and PATCH operations, you can also use the following requests.

Get a list of customer custom fields

Get all debtor custom fields
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldsGETManyRequest();
var debtorCustomFieldsGETManyResponse = client.Get(debtorCustomFieldsGETManyRequest );
 C#
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/Debtors/CustomFields");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/CustomFields
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/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 DebtorCustomFieldsGETManyRequest for more detail.

Get a list of custom field values for a customer

Get all custom field values for a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldValuesGETManyRequest() { DebtorID = "0000000061000000001V" };
var debtorCustomFieldsGETManyResponse = client.Get(debtorCustomFieldsGETManyRequest);
 C#
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/Debtors/0000000061000000001V/CustomFieldValues");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/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 DebtorCustomFieldValuesGETManyRequest for more detail.

Get a custom field value for a customer

Get the custom field value for a specific custom field and customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCustomFieldValueGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldValueGETRequest() { DebtorID= "0000000061000000001V", SettingID = "53a277cd848541a694d9                " };
var debtorCustomFieldValueGETResponse= client.Get(debtorCustomFieldValueGETRequest);
 C#
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/Debtors/0000000061000000001V/CustomFieldValues/53a277cd848541a694d9                ");
}
 Curl
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"

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

Then, with the SessionId now known, the route can be called (Note that there are trailing spaces as part of the SettingID!):

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues/53a277cd848541a694d9                
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues/53a277cd848541a694d9                ?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 DebtorCustomFieldValueGETRequest for more detail.

Update a custom field value for a customer

Update a custom field value for a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCustomFieldValuePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldValuePATCHRequest() { DebtorID = "0000000061000000001V", SettingID = "53a277cd848541a694d9                ", Contents = "True" };
var debtorCustomFieldValuePATCHResponse = client.Patch(debtorCustomFieldValuePATCHRequest );
 C#
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 = "True" });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues/53a277cd848541a694d9                /", "PATCH", json);
}
 Curl
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"

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

Then, with the SessionId now known, the route can be called (note the trailing spaces of the SettingID have been replaces with '%20'!):

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues/53a277cd848541a694d9%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20 -d '{"Contents":"True"}'

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 DebtorPOSTRequest for more detail.

Delivery Addresses

Whilst delivery addresses can be retrieved, or modified as part of the normal debtor GET, POST and PATCH operations, you can also use the following requests.

Get a list of customer delivery addresses

Get all delivery addresses for a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDeliveryAddressesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressesGETManyRequest { DebtorID = "0000000061000000001V" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress> debtorDeliveryAddresses = client.Get(debtorDeliveryAddressesGETManyRequest);
 C#
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/Debtors/0000000061000000001V/DeliveryAddresses");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses?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 debtor delivery address DTO model from the business logic - see the meta data page for the DebtorDeliveryAddressesGETManyRequest for more detail.

Get a single delivery address for a customer

Get a debtor delivery address
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDeliveryAddressGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressGETRequest { DebtorID= "0000000061000000001V", DeliveryAddressID = "00000000LR000000003O" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress debtorDeliveryAddress = client.Get(debtorDeliveryAddressGETRequest);
 C#
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/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O?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 debtor delivery address DTO model from the business logic - see the meta data page for the DebtorDeliveryAddressGETRequest for more detail.

Add a new delivery address for a customer

Add a new delivery address to a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDeliveryAddressPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressPOSTRequest { DebtorID= "0000000061000000001V", Address1= "Unit 1A", Address2 = "57 Smith Street", Address3 = "Blakeville", Address4 = "NSW", Postcode= "2126", IsDefault = true, Country = "Australia"};
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress debtorDeliveryAddress = client.Post(debtorDeliveryAddressPOSTRequest);
 C#
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", Address1= "Unit 1A", Address2 = "57 Smith Street", Address3 = "Blakeville", Address4 = "NSW", Postcode= "2126", IsDefault = true, Country = "Australia" });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses", "POST", json);  
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses -d '{"DebtorID":"0000000061000000001V", "Address1":"Unit 1A", "Address2":"57 Smith Street", "Address3":"Blakeville", "Address4":"NSW", "Postcode":"2126", "IsDefault":"true", "Country":"Australia" }'

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

Update an existing customer delivery address

Updates an existing delivery address for a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDeliveryAddressPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressPATCHRequest { DebtorID = "0000000061000000001V", DeliveryAddressID = "00000000LR000000003N", Country = "Australia" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress debtorDeliveryAddress = client.Patch(debtorDeliveryAddressPATCHRequest);
 C#
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 { Country = "Australia" });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003N", "PATCH", json);
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003N -d '{"Country":"Australia"}'

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

Delete a customer delivery address

Deletes an existing delivery address for a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDeliveryAddressDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressDELETERequest { DebtorID = "0000000061000000001V", DeliveryAddressID = "00000000LR000000003O" };
client.Delete(debtorDeliveryAddressDELETERequest);
 C#
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/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O", "DELETE", "");
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O

Notes

Get all notes for a customer

While you could always use the DB_NotesQuery class to return all notes with a given DebtorID - There is also a GET method for retrieving all notes for a given DebtorID.

Get all notes for a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorNotesGETManyRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNotesGETManyRequest() { DebtorID = "0000000061000000001V" };
var debtorNotesGETManyResponse = client.Get(debtorNotesGETManyRequest);
 C#
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/Debtors/0000000061000000001V/Notes");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/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 debtor note DTO model from the business logic - see the meta data page for the DebtorNotesGETManyRequest for more detail.

Get a specific note for a customer

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

Get a specific note
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorNoteGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNoteGETRequest() { DebtorID = "0000000061000000001V", NoteID = "80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3" };
var debtorNoteGETResponse= client.Get(debtorNoteGETRequest);
 C#
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/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3?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 debtor note DTO model from the business logic - see the meta data page for the DebtorNoteGETRequest for more detail.

Add a new note

Add a new note to a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorNotePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNotePOSTRequest() { DebtorID = "0000000061000000001V", NoteText = "This is a new note" };
var debtorNotePOSTResponse = client.Post(debtorNotePOSTRequest);
 C#
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/Debtors/0000000061000000001V/Notes", "POST", json);
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes -d '{"NoteText":"This is a new note"}'

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

Update an existing note

Update an existing note
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorNotePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNotePATCHRequest() { DebtorID = "0000000061000000001V", NoteID = "80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3", NoteText = "This is an updated note" };
var debtorNotePOSTResponse = client.Patch(debtorNotePATCHRequest);
 C#
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/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3", "PATCH", json);      
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3 -d '{"NoteText":"This is an updated note"}'

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

Delete a note for a customer

Delete a specific note
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorNoteDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNoteDELETERequest() { DebtorID= "0000000061000000001V", NoteID = "80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3" };
var client.Delete(debtorNoteDELETERequest);
 C#
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/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3", "DELETE", "");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3

Documents

Get all documents for a customer

While you could always use the DB_DocumentsQuery class to return all documents with a given DebtorID - There is also a GET method for retrieving all documents for a given DebtorID.

Get all documents for a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDocumentsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentsGETManyRequest() { DebtorID= "0000000061000000001V" };
var debtorDocumentsGETManyResponse = client.Get(debtorDocumentsGETManyRequest);
 C#
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/Debtors/0000000061000000001V/Documents");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/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 debtor document DTO model from the business logic - see the meta data page for the DocumentDocumentsGETManyRequest for more detail.

Get a specific document for a customer

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

Get a specific document
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDocumentGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentGETRequest() { DebtorID = "0000000061000000001V", DocumentID = "45ff4e14-23c5-4744-a8d2-0905e8a2723b" };
var debtorDocumentGETResponse= client.Get(debtorDocumentGETRequest);
 C#
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/Debtors/0000000061000000001V/Documents/45ff4e14-23c5-4744-a8d2-0905e8a2723b");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/45ff4e14-23c5-4744-a8d2-0905e8a2723b
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/45ff4e14-23c5-4744-a8d2-0905e8a2723b?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 debtor document DTO model from the business logic - see the meta data page for the DebtorDocumentGETRequest for more detail.

Add a new document

Add a new document to a customer
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDocumentPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentPOSTRequest() { DebtorID = "0000000061000000001V", 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/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL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GSQJxCS+0pCZbEhAAOw==") };
var debtorDocumentPOSTResponse = client.Post(debtorDocumentPOSTRequest);
 C#
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", 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+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0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7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") } );
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents", "POST", json); 
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Debtors/0000000061000000001V/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///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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JFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/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 debtor document DTO model from the business logic - see the meta data page for the DebtorDocumentPOSTRequest for more detail.

Update an existing document

Update an existing document
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDocumentPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentPATCHRequest() { DebtorID= "0000000061000000001V", DocumentID = "ba141e00-23bd-440d-8754-595ffbc24620", FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4A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b/v37YUOAG2sigCIiIpA6I4LW4DLt6OhApKwRL2fQE9AjV+3dy5cvczUTb8ONhhhljKurK55Gr5WPTAftJ/dDsPQrVzhTm/CJEYooAGVhCuflXcjNze3svA/7FDwuLs7ZyZkgyEMP81emIyQuLv5sxlkWVJ8rAx+cwQETDh/A8R7DGVLjvxHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") };
var debtorDocumentPATCHResponse = client.Patch(debtorDocumentPATCHRequest);
 C#
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("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJz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2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") } );
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/ba141e00-23bd-440d-8754-595ffbc24620", "PATCH", json);
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/ba141e00-23bd-440d-8754-595ffbc24620 -d '{"FileBinary":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9DE2N7eLpf7ubm6hYaEqdWa0tKypqamW7du8ezs7CQ6zj9+/Li3t/fOnTtNTc2DzwdJi5xqamr8/QPIRo81Yh+gz5zJ8PDwvH79enNz8+3bt8G6e/fu/fv37927xwIHfCotLb148VJ+fn5jIy9ulZ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WFjIeYRRVlrmtW07rQ8JgFK6vr5+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 debtor document DTO model from the business logic - see the meta data page for the DebtorDocumentPATCHRequest for more detail.

Delete a document for a customer

Delete a specific document
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorDocumentDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentDELETERequest() { DebtorID= "0000000061000000001V", DocumentID = "ba141e00-23bd-440d-8754-595ffbc24620" };
client.Delete(debtorDocumentDELETERequest);
 C#
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/Debtors/0000000061000000001V/Documents/9462c9ea-fbce-4e81-873d-c6375d5edfe8", "DELETE", "");
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/45ff4e14-23c5-4744-a8d2-0905e8a2723b
Retrieve products for the NSW / Main warehouse where they changed within the last day
 ServiceStack Client C#
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);
 C#
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");
}
 Curl
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"

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

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

 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:

 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"}'
 Web Browser

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

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:

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.

Categories

Get a list of all categories

Retrieve all debtor categories
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var DB_CategoriesRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_CategoriesQuery();
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_Categories> DB_CategoriesResponse = client.Get(DB_CategoriesRequest);
 C#
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/DB_Categories");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Categories
 Web Browser

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

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:

https://api.jiwa.com.au/Queries/DB_Categories?format=json

Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned.

Get a list of a specific category number

Retrieve all Category 1 debtor categories
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var DB_CategoriesRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_CategoriesQuery() { CategoryNo = 1};
ServiceStack.QueryResponse<JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_Categories> DB_CategoriesResponse = client.Get(DB_CategoriesRequest);
 C#
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/DB_Categories?CategoryNo=1");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Categories?CategoryNo=1
 Web Browser

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

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:

https://api.jiwa.com.au/Queries/DB_Categories?CategoryNo=1&format=json

Note the &format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned.

Get a specific category

Retrieve a specific category
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCategoryGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCategoryGETRequest() { CategoryID = "F6DDF94F-D41B-4DE4-8A8C-62BF03C32573" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Category.DebtorCategory Category = client.Get(debtorCategoryGETRequest);
 C#
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/Debtors/Categories/F6DDF94F-D41B-4DE4-8A8C-62BF03C32573");
}
 Curl
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"

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

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

 curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/Categories/F6DDF94F-D41B-4DE4-8A8C-62BF03C32573
 Web Browser

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

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:

https://api.jiwa.com.au/Debtors/Categories/F6DDF94F-D41B-4DE4-8A8C-62BF03C32573?format=json

Note the ?format=json in the above URL this overrides the content type returned. For browsers the default content type is HTML - if a content type override is omitted, then a HTML razor view of the data will be returned instead of json. xml and csv are also valid overrides for the content type to be returned.

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

Create a category

Create a new category
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCategoryPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCategoryPOSTRequest() { Description = "A new category", CategoryNo = 1 };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Category.DebtorCategory Category = client.Post(debtorCategoryPOSTRequest);
 C#
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 = "Another new category", CategoryNo = 1 });
	responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/Categories", "POST", json);
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Debtors/Categories -d '{"Description":"Yet another new category", "CategoryNo":1}'

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

Update a category

Update an existing category
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCategoryPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCategoryPATCHRequest() { CategoryID = "F6DDF94F-D41B-4DE4-8A8C-62BF03C32573", Description = "A modified category" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Category.DebtorCategory Category = client.Patch(debtorCategoryPATCHRequest);
 C#
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 = "Another modified category" });
    responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/Categories/F6DDF94F-D41B-4DE4-8A8C-62BF03C32573", "PATCH", json);
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Debtors/Categories/F6DDF94F-D41B-4DE4-8A8C-62BF03C32573 -d '{"Description":"Yet another modified category"}'

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

Delete a category

Delete an existing category
 ServiceStack Client C#
var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });

var debtorCategoryDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCategoryDELETERequest() { CategoryID = "f4f5433cac3645779398                " };
client.Delete(debtorCategoryDELETERequest);
 C#
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("http://localhost/Debtors/Categories/de671c1d5d6241319ffa                /", "DELETE", "");
}
 Curl
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"

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

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

curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/Categories/31ab4a44-61ee-4729-a75a-6d438b0044f7
  • No labels