Customers
Get a filtered list of customers
Anchor |
---|
| v_Jiwa_Debtor_ListQuery_Anchor |
---|
| v_Jiwa_Debtor_ListQuery_Anchor |
---|
|
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.
Panel |
---|
borderStyle | solid |
---|
title | Retrieve web enabled customers that have changed within the last day |
---|
|
Deck |
---|
id | v_Jiwa_Debtor_ListQuery_1 |
---|
|
Card |
---|
id | v_Jiwa_Inventory_Item_ListQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var itemListRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.v_Jiwa_Debtor_ListQuery() { WebAccess = 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); |
|
Card |
---|
id | v_Jiwa_Debtor_ListQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/DebtorList?WebAccess=true&LastSavedDateTimeGreaterThan=2017-09-18T00:00:00.000&Fields=AccountNo,Name&Include=Total");
} |
|
Card |
---|
id | v_Jiwa_Debtor_ListQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/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: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DebtorList -d '{"WebAccess":"true","LastSavedDateTimeGreaterThan="2017-09-18T00:00:00.000", "Fields":"AccountNo, Name", "Include":"Total"}' |
|
Card |
---|
id | v_Jiwa_Debtor_ListQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/DebtorList?WebAccess=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 DB_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.
Panel |
---|
borderStyle | solid |
---|
title | Retrieve first 5 customers where the AccountNo starts with '1' |
---|
|
Deck |
---|
|
Card |
---|
id | DB_MainQuery_1_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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); |
|
Card |
---|
id | DB_MainQuery_1_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au");
// 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");
} |
|
Card |
---|
id | DB_MainQuery_1_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Main -d '{"AccountNoStartsWith":"1","OrderBy":"AccountNo","Take":"5"}' |
|
Card |
---|
id | DB_MainQuery_1_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/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. |
|
|
Panel |
---|
borderStyle | solid |
---|
title | Retrieve first 5 customers where the AccountNo starts with '1', but limit which fields are returned |
---|
|
Deck |
---|
|
Card |
---|
id | DB_MainQuery_2_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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); |
|
Card |
---|
id | IN_MainQuery_2_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&Fields=DebtorID,AccountNo,Name,EmailAddress");
} |
|
Card |
---|
id | DB_MainQuery_2_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Main -d '{"AccountNoStartsWith":"1","OrderBy":"AccountNo","Take":"5","Fields":"DebtorID,AccountNo,Name,EmailAddress"}' |
|
Card |
---|
id | DB_MainQuery_2_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/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. |
|
|
Panel |
---|
borderStyle | solid |
---|
title | Retrieve next 5 customers where the AccountNo starts with '1', and limit which fields are returned |
---|
|
Deck |
---|
|
Card |
---|
id | DB_MainQuery_3_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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); |
|
Card |
---|
id | IN_MainQuery_3_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&Skip=5&Fields=DebtorID,AccountNo,Name,EmailAddress");
} |
|
Card |
---|
id | IN_MainQuery_3_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Queries/DB_Main -d '{"AccountNoStartsWith":"1","OrderBy":"AccountNo","Take":"5","Skip":"5","Fields":"DebtorID,AccountNo,Name,EmailAddress"}' |
|
Card |
---|
id | DB_MainQuery_3_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Queries/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
Anchor |
---|
| ReadACustomer |
---|
| ReadACustomer |
---|
|
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.
Panel |
---|
borderStyle | solid |
---|
title | Read a customer |
---|
|
Deck |
---|
|
Card |
---|
id | read_a_customer_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorGETRequest() { DebtorID= "0000000061000000001V" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Debtor Debtor = client.Get(debtorGETRequest); |
|
Card |
---|
id | read_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V");
} |
|
Card |
---|
id | read_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V |
|
Card |
---|
id | read_a_product_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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.
Panel |
---|
borderStyle | solid |
---|
title | Create a new customer, and setting the AccountNo, Name, EmailAddress and WebEnabled |
---|
|
Deck |
---|
|
Card |
---|
id | create_a_customer_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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);
|
|
Card |
---|
id | create_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
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);
} |
|
Card |
---|
id | create_a_product_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/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. |
Panel |
---|
borderStyle | solid |
---|
title | Create a customer with 2 notes |
---|
|
Deck |
---|
id | create_a_customer_with_2_notes |
---|
|
Card |
---|
id | create_a_customer_with_2_notes_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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);
|
|
Card |
---|
id | create_a_product_with_2_notes_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { PartNo = "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);
} |
|
Card |
---|
id | create_a_customer_with_2_notes_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/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
Anchor |
---|
| DebtorPatchRequest |
---|
| DebtorPatchRequest |
---|
|
Panel |
---|
borderStyle | solid |
---|
title | Update EmailAddress and WebAccess of a customer, add an additional note and update an existing note |
---|
|
Deck |
---|
|
Card |
---|
id | update_a_customer_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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); |
|
Card |
---|
id | update_a_product_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { 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);
} |
|
Card |
---|
id | update_a_customer_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH 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
Panel |
---|
borderStyle | solid |
---|
title | Delete a customer |
---|
|
Deck |
---|
|
Card |
---|
id | DebtorDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDELETERequest { DebtorID = "1c4e1f674674465bb57a" };
client.Delete(debtorDELETERequest); |
|
Card |
---|
id | DebtorDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("http://localhost/Debtors/a256102d4b2c4202b0e8", "DELETE", "");
} |
|
Card |
---|
id | DebtorDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Get all debtor custom fields |
---|
|
Deck |
---|
id | DebtorCustomFieldsGETManyRequest |
---|
|
Card |
---|
id | DebtorCustomFieldsGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldsGETManyRequest();
var debtorCustomFieldsGETManyResponse = client.Get(debtorCustomFieldsGETManyRequest ); |
|
Card |
---|
id | DebtorCustomFieldsGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/CustomFields");
} |
|
Card |
---|
id | DebtorCustomFieldsGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/CustomFields |
|
Card |
---|
id | DebtorCustomFieldsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Get all custom field values for a customer |
---|
|
Deck |
---|
id | DebtorCustomFieldValuesGETManyRequest |
---|
|
Card |
---|
id | DebtorCustomFieldValuesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldValuesGETManyRequest() { DebtorID = "0000000061000000001V" };
var debtorCustomFieldsGETManyResponse = client.Get(debtorCustomFieldsGETManyRequest); |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues");
} |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues |
|
Card |
---|
id | InventoryCustomFieldValuesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Get the custom field value for a specific custom field and customer |
---|
|
Deck |
---|
id | DebtorCustomFieldValueGETRequest |
---|
|
Card |
---|
id | DebtorCustomFieldValueGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorCustomFieldValueGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldValueGETRequest() { DebtorID= "0000000061000000001V", SettingID = "53a277cd848541a694d9 " };
var debtorCustomFieldValueGETResponse= client.Get(debtorCustomFieldValueGETRequest); |
|
Card |
---|
id | DebtorCustomFieldValueGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues/53a277cd848541a694d9 ");
} |
|
Card |
---|
id | DebtorCustomFieldValueGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called (Note that there are trailing spaces as part of the SettingID!): Code Block |
---|
| 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 |
|
Card |
---|
id | DebtorCustomFieldValueGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Update a custom field value for a customer |
---|
|
Deck |
---|
id | DebtorCustomFieldValuePATCHRequest |
---|
|
Card |
---|
id | DebtorCustomFieldValuePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorCustomFieldValuePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorCustomFieldValuePATCHRequest() { DebtorID = "0000000061000000001V", SettingID = "53a277cd848541a694d9 ", Contents = "True" };
var debtorCustomFieldValuePATCHResponse = client.Patch(debtorCustomFieldValuePATCHRequest ); |
|
Card |
---|
id | DebtorCustomFieldValuePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "True" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/CustomFieldValues/53a277cd848541a694d9 /", "PATCH", json);
} |
|
Card |
---|
id | DebtorCustomFieldValuePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called (note the trailing spaces of the SettingID have been replaces with '%20'!): Code Block |
---|
| 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 contact names can be retrieved, or modified as part of the normal debtor GET, POST and PATCH operations, you can also use the following requests.
delivery addresses Panel |
---|
borderStyle | solid |
---|
title | Get all delivery addresses contact names for a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressesGETManyRequestDebtorContactNamesGETManyRequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequestDebtorContactNamesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressesGETManyRequestdebtorContactNamesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressesGETManyRequestDebtorContactNamesGETManyRequest { DebtorID = "0000000061000000001V" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress>DebtorContactName> debtorDeliveryAddressesdebtorContactNames = client.Get(debtorDeliveryAddressesGETManyRequestdebtorContactNamesGETManyRequest); |
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequestDebtorContactNamesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddressesContactNames");
} |
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequestDebtorContactNamesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddressesContactNames |
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequestDebtorContactNamesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddressesContactNames?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 contact names DTO model from the business logic - see the meta data page for the DebtorDeliveryAddressesGETManyRequest DebtorContactNamesGETManyRequest for more detail. |
delivery address Panel |
---|
borderStyle | solid |
---|
title | Get a debtor delivery addresscontact name |
---|
|
Deck |
---|
id | DebtorDeliveryAddressGETRequestDebtorContactNameGETRequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressGETRequestDebtorContactNameGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressGETRequestdebtorContactNameGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressGETRequest { DebtorID = "0000000061000000001V", DeliveryAddressIDContactNameID = "00000000LR000000003O000000002D000000001C" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress debtorDeliveryAddressdebtorContactName = client.Get(debtorDeliveryAddressGETRequestdebtorContactNameGETRequest); |
|
Card |
---|
id | DebtorDeliveryAdddressGETRequestDebtorContactNameGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddressesContactNames/00000000LR000000003O000000002D000000001C");
} |
|
Card |
---|
id | DebtorDeliveryAddressGETRequestDebtorContactNameGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddressesContactNames/00000000LR000000003O000000002D000000001C |
|
Card |
---|
id | DebtorDeliveryAddressGETRequestDebtorContactNameGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddressesContactNames/00000000LR000000003O000000002D000000001C?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 contact name DTO model from the business logic - see the meta data page for the DebtorDeliveryAddressGETRequest DebtorContactNameGETRequest for more detail. |
delivery address Panel |
---|
borderStyle | solid |
---|
title | Add a new delivery address contact name to a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressPOSTRequestDebtorContactNamePOSTRequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressPOSTRequestDebtorContactNamePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressPOSTRequestdebtorContactNamePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressPOSTRequestDebtorContactNamePOSTRequest { DebtorID= "0000000061000000001V", Title Address1= "Unit 1AMr.", Address2FirstName = "57 Smith StreetFred", Address3Surname = "BlakevilleBloggs", Address4PrimaryPositionName = "NSW", Postcode= "2126", IsDefault = true, CountryExternal Accountant" EmailAddress = "AustraliaFred@example.com"};
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddressDebtorContactName debtorDeliveryAddressdebtorContactName = client.Post(debtorDeliveryAddressPOSTRequestdebtorContactNamePOSTRequest);
|
|
Card |
---|
id | DebtorDeliveryAddressPOSTRequestDebtorContactNamePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorID = "0000000061000000001V", Title Address1= "Unit 1AMr.", Address2FirstName = "57 Smith StreetFred", Address3Surname = "BlakevilleBloggs", Address4PrimaryPositionName = "NSWExternal Accountant", Postcode= "2126", IsDefault = true, CountryEmailAddress = "AustraliaFred@example.com" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddressesContactNames", "POST", json);
} |
|
Card |
---|
id | DebtorDeliveryAddressPOSTRequestDebtorContactNamePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses -d '{"DebtorID":"0000000061000000001V", "Address1Title":"Unit 1AMr.", "Address2FirstName":"57 Smith StreetFred", "Address3Surname":"BlakevilleBloggs", "Address4PrimaryPositionName":"NSW", "Postcode":"2126External Accountant", "IsDefaultEmailAddress":"true", "Country":"Australia" Fred@example.com"}' |
|
|
The response returned from the above request will be a json document representing a debtor delivery address contact name DTO model from the business logic - see the meta data page for the DebtorDeliveryAddressPOSTRequest DebtorContactNamePOSTRequest for more detail. |
delivery address Panel |
---|
borderStyle | solid |
---|
title | Updates an existing delivery address contact name for a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressPATCHRequestDebtorContactNamePATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequestDebtorContactNamePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressPATCHRequest { DebtorID = "0000000061000000001V", DeliveryAddressID = "00000000LR000000003N", Country = "Australia" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress debtorDeliveryAddress = client.Patch(debtorDeliveryAddressPATCHRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Country = "Australia" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003N", "PATCH", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Deletes an existing delivery address for a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressDELETERequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressDELETERequest { DebtorID = "0000000061000000001V", DeliveryAddressID = "00000000LR000000003O" };
client.Delete(debtorDeliveryAddressDELETERequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O", "DELETE", "");
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/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.
Panel |
---|
borderStyle | solid |
---|
title | Get all notes for a customer |
---|
|
Deck |
---|
id | DebtorNotesGETManyRequest |
---|
|
Card |
---|
id | InventoryNotesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorNotesGETManyRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNotesGETManyRequest() { DebtorID = "0000000061000000001V" };
var debtorNotesGETManyResponse = client.Get(debtorNotesGETManyRequest); |
|
Card |
---|
id | DebtorNotesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes");
} |
|
Card |
---|
id | DebtorNotesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes |
|
Card |
---|
id | DebtorNotesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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.
Panel |
---|
borderStyle | solid |
---|
title | Get a specific note |
---|
|
Deck |
---|
|
Card |
---|
id | DebtorNotesGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorNoteGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNoteGETRequest() { DebtorID = "0000000061000000001V", NoteID = "80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3" };
var debtorNoteGETResponse= client.Get(debtorNoteGETRequest); |
|
Card |
---|
id | DebtorNotesGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3");
} |
|
Card |
---|
id | DebtorNotesGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3 |
|
Card |
---|
id | InventoryNotesGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Add a new note to a customer |
---|
|
Deck |
---|
|
Card |
---|
id | InventoryNotePOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorNotePOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNotePOSTRequest() { DebtorID = "0000000061000000001V", NoteText = "This is a new note" };
var debtorNotePOSTResponse = client.Post(debtorNotePOSTRequest);
|
|
Card |
---|
id | DebtorNotePOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteText = "This is a new note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes", "POST", json);
} |
|
Card |
---|
id | DebtorNotePOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Update an existing note |
---|
|
Deck |
---|
|
Card |
---|
id | DebtorNotePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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);
|
|
Card |
---|
id | InventoryNotePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { NoteText = "This is an updated note" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3", "PATCH", json);
} |
|
Card |
---|
id | InventoryNotePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Delete a specific note |
---|
|
Deck |
---|
id | DeleteNoteDELETERequest |
---|
|
Card |
---|
id | InventoryNoteDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorNoteDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorNoteDELETERequest() { DebtorID= "0000000061000000001V", NoteID = "80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3" };
var client.Delete(debtorNoteDELETERequest); |
|
Card |
---|
id | DebtorNoteDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes/80C3C46B-9D64-4451-BE6B-9CF68C9BCBE3", "DELETE", "");
} |
|
Card |
---|
id | DeleteNoteDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/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.
Panel |
---|
borderStyle | solid |
---|
title | Get all documents for a customer |
---|
|
Deck |
---|
id | InventoryDocumentsGETManyRequest |
---|
|
Card |
---|
id | DebtorDocumentsGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDocumentsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentsGETManyRequest() { DebtorID= "0000000061000000001V" };
var debtorDocumentsGETManyResponse = client.Get(debtorDocumentsGETManyRequest); |
|
Card |
---|
id | DebtorDocumentsGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents");
} |
|
Card |
---|
id | DebtorDocumentsGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents |
|
Card |
---|
id | DebtorDocumentsGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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.
Panel |
---|
borderStyle | solid |
---|
title | Get a specific document |
---|
|
Deck |
---|
id | DebtorDocumentGETRequest |
---|
|
Card |
---|
id | DebtorDocumentGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDocumentGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentGETRequest() { DebtorID = "0000000061000000001V", DocumentID = "45ff4e14-23c5-4744-a8d2-0905e8a2723b" };
var debtorDocumentGETResponse= client.Get(debtorDocumentGETRequest); |
|
Card |
---|
id | DebtorDocumentGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/45ff4e14-23c5-4744-a8d2-0905e8a2723b");
} |
|
Card |
---|
id | DebtorDocumentGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/45ff4e14-23c5-4744-a8d2-0905e8a2723b |
|
Card |
---|
id | DebtorDocumentGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Add a new document to a customer |
---|
|
Deck |
---|
id | DebtorDocumentPOSTRequest |
---|
|
Card |
---|
id | DebtorDocumentPOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P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ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw==") };
var debtorDocumentPOSTResponse = client.Post(debtorDocumentPOSTRequest); |
|
Card |
---|
id | DebtorDocumentPOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorID = "0000000061000000001V", Description = "A new document", PhysicalFileName = "Test.png", FileBinary = Convert.FromBase64String("R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dg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aoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+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);
} |
|
Card |
---|
id | DebtorDocumentPOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/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///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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G6UvxBRydcpKsav++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
Panel |
---|
borderStyle | solid |
---|
title | Update an existing document |
---|
|
Deck |
---|
id | DebtorDocumentPATCHRequest |
---|
|
Card |
---|
id | DebtorDocumentPATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDocumentPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentPATCHRequest() { DebtorID= "0000000061000000001V", DocumentID = "ba141e00-23bd-440d-8754-595ffbc24620", FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdrQwJCfHz83NxcZNIbGxtbe3sNjk4OHh4ePBSofgRU4yYXC4PClL09PToIf60D9DE2N7eLpf7ubm6hYaEqdWa0tKypqamW7du8ezs7CQ6zj9+/Li3t/fOnTtNTc2DzwdJi5xqamr8/QPIRo81Yh+gz5zJ8PDwvH79enNz8+3bt8G6e/fu/fv37927xwIHfCotLb148VJ+fn5jIy9ulZeVt7W2CWxcunTp4MGDY5nRQxcVFYWHh0MosRNaa2tbXV0dh2GT3bxkz+DgIF6fPn0Kv8XFxXV119LTf2poaGi82Tg8PEz4wcE7iUkAxHTQvA0LC+vr62NNcRobGwU4EiTSkW06q6qqGhoa4j1ALF68eNHS0lJZWUlthGCvXbsWGhoKmrBfB80mf39/drMeGBjg5MuXL3nyk8CFkDFeEq9SqXRycrKzs1MEKXDMfnIVNrBwcHCEd+GnCAiNJjYhIeHXEcONl9d2U1PTJSZLFIod2m6tAE0sOTk5YrH1lStX3N08Phk34bMJkxcvNsnMzESIeGUbx0tKStauXdvb+1gHnZFxNioqisqQ18OHDyF0z569q78ymzVr9rQp002Mv5B5yziJyzVrvk1IOG5hYUHIEREHdu4M2WBuQekoADUnIVJsbW1NT08nuP7+flF8fHxm5rni4hL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scJRJJQEAA/iiadLM9g5TxT36MfEYKgwkV0krsZJYKjI+aDvro0aPcHcw2pEoI7BCo1Gq5bloRDy0jzGU6kBldW1vHPOALuLTb/v37YUOAG2sigCIiIpA6I4LW4DLt6OhApKwRL2fQE9AjV+3dy5cvczUTb8ONhhhljKurK55Gr5WPTAftJ/dDsPQrVzhTm/CJEYooAGVhCuflXcjNze3svA/7FDwuLs7ZyZkgyEMP81emIyQuLv5sxlkWVJ8rAx+cwQETDh/A8R7DGVLjvxHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") };
var debtorDocumentPATCHResponse = client.Patch(debtorDocumentPATCHRequest);
|
|
Card |
---|
id | DebtorDocumentPATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { FileBinary = Convert.FromBase64String("iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50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svA/7FDwuLs7ZyZkgyEMP81emIyQuLv5sxlkWVJ8rAx+cwQETDh/A8R7DGVLjvxHaj5cjx//JdNCkv9XZ5fTp03A9thQIAzhopesk1rY2NjZH449Bnf7zv5kOGuMAOrG0tPL2lnFrMFX27dvPHYoxySgm1AsD9r+bHlowokZP/AdCoRApXMOD/tv/tffv/wAyAr/0hHrPvgAAAABJRU5ErkJggg==") } );
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/ba141e00-23bd-440d-8754-595ffbc24620", "PATCH", json);
} |
|
Card |
---|
id | DebtorDocumentPATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/ba141e00-23bd-440d-8754-595ffbc24620 -d '{"FileBinary":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAIAAAAyxktbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAAG60lEQVRIS5WWh1NUVxTG948w0djHiRUsIMZKJpKJGY2IsCygixSpIgtLILARAbEhsKi7i6AI0jJjQSQIqIAC0gMoIlItYIEFFVASo2DLb3kbZJzUM8ybu+/d+51zvvOdcxG9/3t79+7d27dv37x58/r161evXv02Yr+P2LNnz548eaLVah89etTV1cUe/Zkx9jE0mx48eJCbmxcdr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|
|
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
Panel |
---|
borderStyle | solid |
---|
title | Delete a specific document |
---|
|
Deck |
---|
id | DebtorDocumentDELETERequest |
---|
|
Card |
---|
id | DebtorDocumentDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDocumentDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDocumentDELETERequest() { DebtorID= "0000000061000000001V", DocumentID = "ba141e00-23bd-440d-8754-595ffbc24620" };
client.Delete(debtorDocumentDELETERequest); |
|
Card |
---|
id | DebtorDocumentDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/9462c9ea-fbce-4e81-873d-c6375d5edfe8", "DELETE", "");
} |
|
Card |
---|
id | DebtorDocumentDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/0000000061000000001V/Documents/45ff4e14-23c5-4744-a8d2-0905e8a2723b |
|
|
|
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
Panel |
---|
borderStyle | solid |
---|
title | Get all delivery addresses for a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressesGETManyRequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressesGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressesGETManyRequest { DebtorID = "0000000061000000001V" };
List<JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress> debtorDeliveryAddresses = client.Get(debtorDeliveryAddressesGETManyRequest); |
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses");
} |
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses |
|
Card |
---|
id | DebtorDeliveryAddressesGETManyRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Get a debtor delivery address |
---|
|
Deck |
---|
id | DebtorDeliveryAddressGETRequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressGETRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressGETRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressGETRequest { DebtorID= "0000000061000000001V", DeliveryAddressID = "00000000LR000000003O" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress debtorDeliveryAddress = client.Get(debtorDeliveryAddressGETRequest); |
|
Card |
---|
id | DebtorDeliveryAdddressGETRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
responsebody = webClient.DownloadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O");
} |
|
Card |
---|
id | DebtorDeliveryAddressGETRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O |
|
Card |
---|
id | DebtorDeliveryAddressGETRequest_webbrowser |
---|
label | Web Browser |
---|
| Navigate to the auth URL and provide the username and password as parameters: No Format |
---|
https://api.jiwa.com.au/auth?username=admin&password=password |
This authenticates the user and creates a cookie, so a subsequent request can be made: No Format |
---|
https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Add a new delivery address to a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressPOSTRequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressPOSTRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var 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);
|
|
Card |
---|
id | DebtorDeliveryAddressPOSTRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { DebtorID= "0000000061000000001V", 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);
} |
|
Card |
---|
id | DebtorDeliveryAddressPOSTRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X POST https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Updates an existing delivery address for a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressPATCHRequest |
---|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressPATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressPATCHRequest { DebtorID = "0000000061000000001V", DeliveryAddressID = "00000000LR000000003N", Country = "Australia" };
JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorDeliveryAddress debtorDeliveryAddress = client.Patch(debtorDeliveryAddressPATCHRequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Country = "Australia" });
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003N", "PATCH", json);
} |
|
Card |
---|
id | InventoryDebtorSpecificPricePATCHRequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/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
Panel |
---|
borderStyle | solid |
---|
title | Deletes an existing delivery address for a customer |
---|
|
Deck |
---|
id | DebtorDeliveryAddressDELETERequest |
---|
|
Card |
---|
id | DebtorDeliveryAddressDELETERequest_csharp_servicestack |
---|
label | ServiceStack Client C# |
---|
|
Code Block |
---|
| var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au");
var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" });
var debtorDeliveryAddressDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorDeliveryAddressDELETERequest { DebtorID = "0000000061000000001V", DeliveryAddressID = "00000000LR000000003O" };
client.Delete(debtorDeliveryAddressDELETERequest);
|
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_csharp |
---|
label | C# |
---|
|
Code Block |
---|
| using (var webClient = new System.Net.WebClient())
{
// Authenticate
webClient.QueryString.Add("username", "Admin");
webClient.QueryString.Add("password", "password");
string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth");
// Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}}
// Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package
var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responsebody);
var sessionId = authResponse.SessionId;
webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId));
webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json";
responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O", "DELETE", "");
} |
|
Card |
---|
id | InventoryDebtorSpecificPriceDELETERequest_curl |
---|
label | Curl |
---|
|
Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' |
Returns the following authentication response, containing the SessionId which subsequent requests will need to include in the cookie "ss-id" No Format |
---|
{"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} |
Then, with the SessionId now known, the route can be called: Code Block |
---|
| curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/0000000061000000001V/DeliveryAddresses/00000000LR000000003O |
|
|
|