### Override Setup method for Jiwa interfaces (C#) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988272/How+to+convert+plugins+or+code+to+be+compatible+with+7.00.177 This example shows how to correctly override the Setup method in classes that implement Jiwa interfaces. It emphasizes the importance of calling the base Setup method as the first line and then using the Manager's EntityFactory to create and initialize dependent entities. ```C# public override void Setup() { base.Setup(); _Debtor = Manager.EntityFactory.CreateEntity(); } ``` -------------------------------- ### Manage SQL Server LocalDB Instances via Command Line Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987422/Create+a+clean+LocalDB+Installation This set of commands provides a step-by-step guide to clean and reset a SQL Server LocalDB installation. It allows users to list, stop, delete, recreate, and start LocalDB instances using the `sqllocaldb` command-line utility, which is useful when SQL Server Management Studio is unavailable. ```Command Line sqllocaldb i ``` ```Command Line sqllocaldb p MSSQLLocalDB ``` ```Command Line sqllocaldb d MSSQLLocalDB ``` ```Command Line sqllocaldb c MSSQLLocalDB ``` ```Command Line sqllocaldb s MSSQLLocalDB ``` -------------------------------- ### Retrieve First 5 Customers by Account Number Prefix Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use Demonstrates how to query the DB_Main table to retrieve the first 5 customer records where the AccountNo starts with '1'. It includes examples for authentication and data retrieval using ServiceStack C#, raw C# WebClient, Curl, and direct HTTP requests. ```ServiceStack Client C# var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" }); var DB_MainQueryRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.Tables.DB_MainQuery() { AccountNoStartsWith = "1", OrderBy = "AccountNo", Take = 5 }; ServiceStack.QueryResponse DB_MainQueryResponse = client.Get(DB_MainQueryRequest); ``` ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(responsebody); var sessionId = authResponse.SessionId; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); responsebody = webClient.DownloadString("https://api.jiwa.com.au/Queries/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5"); } ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' ``` ```Curl 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"}' ``` ```HTTP https://api.jiwa.com.au/auth?username=admin&password=password ``` ```HTTP https://api.jiwa.com.au/Queries/DB_Main?AccountNoStartsWith=1&OrderBy=AccountNo&Take=5&format=json ``` -------------------------------- ### Install ASPluris Casio Client V3.0.2.6 Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/117801081/Warehouse+Management+System Procedure for installing the ASPluris client version V3.0.2.6 on Casio devices. This involves exiting the ASPluris program, restarting it without logging in, and then using the spanner/settings and update icons. ```Procedure 1. Exit the ASPluris program on the scanner 2. Start the program on the scanner. Make sure you don’t login in. 3. Click on the spanner/settings icon 4. Click on the Update icon and follow the prompts ``` -------------------------------- ### List Webhook Events using C# Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988297 Demonstrates how to list all available webhook events using C#. This includes examples using the ServiceStack.JsonServiceClient for a more structured approach and System.Net.WebClient for a simpler HTTP GET request to the Jiwa API endpoint. ```C# var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var eventsListRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.WebhooksEventsGETRequest() { }; List eventsListResponse = client.Get(eventsListRequest); ``` ```C# using (var webClient = new System.Net.WebClient()) { responsebody = webClient.DownloadString("https://api.jiwa.com.au/Webhooks/Events"); } ``` -------------------------------- ### Example Authentication Response from API Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739 This is an example of the JSON response received after a successful authentication request, showing the SessionId that needs to be used in subsequent requests. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Example Authentication Response Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739 An example JSON response received after a successful authentication request, containing the SessionId which needs to be used in subsequent requests. ```APIDOC { "SessionId": "6w1nLX8r0sIrJHClX9Vj", "UserName": "Admin", "DisplayName": "", "ResponseStatus": {} } ``` -------------------------------- ### Run Jiwa Service Release Installer from Elevated Command Prompt Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/983663 Describes how to execute the Jiwa Service Release .msp installer from an elevated command prompt. This method is recommended if the standard double-click installation fails due to digital signature corruption errors, ensuring the installer runs with necessary administrative privileges. ```Shell msiexec /i ``` -------------------------------- ### Authentication API Response Example Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 An example of the JSON response received from the authentication endpoint, which includes the 'SessionId' crucial for subsequent authenticated API requests. ```APIDOC {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Authentication API Response Example Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362/Sales+Order+API+Operations+-+Examples+Of+Use An example of the JSON response received after a successful authentication request, containing the SessionId which is essential for subsequent authenticated API calls. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Jiwa REST API Plugin Information and Import Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/510623745 This section details the Jiwa REST API plugin, including its version compatibility with Service Release 21. It provides instructions on how to obtain the latest plugin by extracting it from the IIS Web package and importing the 'Plugin REST API.xml' file into Jiwa using the Plugin Maintenance form. A critical note is included regarding client compatibility when using the latest plugin version. ```APIDOC Jiwa REST API Plugin: Minimum Version (SR 21): 7.2.1.54 Deployed Version (This Release): 7.2.1.67 Obtaining Plugin: Location: Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaAPI\JiwaAPI.zip Extraction: Extract contents of JiwaAPI.zip to a folder. File to Import: Plugin REST API.xml Import Method: Use Jiwa Plugin Maintenance form. Important Note: Compatibility: Using latest REST API plugin requires all clients to have the same Service Release installed due to plugin dependencies. Enablement: Remember to enable the plugin after import. ``` -------------------------------- ### Example Jiwa API Authentication Response Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 This JSON snippet provides an example of the response structure returned by the Jiwa API upon successful authentication, highlighting the 'SessionId' field. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Example Authentication Response JSON Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362/Sales+Order+API+Operations+-+Examples+Of+Use This is an example of the JSON response received from the authentication endpoint. The 'SessionId' field is crucial for authenticating subsequent API requests by including it in the 'ss-id' cookie. ```APIDOC {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Example JSON Response for Webhook Events Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988297/Webhooks An example of the JSON array returned when listing webhook events. Each object in the array contains the event 'Name' and a 'Description'. ```json [ { "Name":"debtor.created", "Description":"Occurs when a new debtor (customer) is created" }, { "Name":"debtor.deleted", "Description":"Occurs when a debtor (customer) is deleted" } ] ``` -------------------------------- ### Jiwa API Authentication Response Example Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 An example of the JSON response body returned upon successful authentication with the Jiwa API, showing the SessionId which must be used in the ss-id cookie for subsequent requests. ```APIDOC {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Example Jiwa API Authentication Response Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 An example of the JSON response returned by the Jiwa API's authentication endpoint. This response contains the SessionId which is essential for making subsequent authenticated API calls. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Authentication Response Example Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use An example of the JSON response received after a successful authentication request. This response contains the `SessionId` which is crucial for authenticating subsequent API calls by including it in the `ss-id` cookie. ```APIDOC {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Recommended FTP Client Installation Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/985937/How+to+load+a+backup+onto+our+FTP+site This snippet provides information on the recommended FTP client, FileZilla, and where to download it for uploading database backups. ```Instructions NOTE: We recommend FileZilla which is free available from the web on: https://filezilla-project.org/download.php ``` -------------------------------- ### Authentication Response JSON Example Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use An example of the JSON response returned from the authentication endpoint. It contains the SessionId, UserName, DisplayName, and ResponseStatus, with the SessionId being crucial for subsequent authenticated requests. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Get Start of Current Financial Year (VB.NET) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988560/Crystal+Reports+Integration Retrieves the starting date of the current financial year from the General Ledger configuration. The date is then formatted as 'dd/MM/yyyy'. ```VB.NET Dim currentStartDate As Date Manager.GeneralLedgerConfiguration.GetCurrentYearStartingDate(currentStartDate) currentStartDate.ToString("dd/MM/yyyy") ``` -------------------------------- ### C# Example: SetupBeforeHandlers Method for Jiwa Forms Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/76906497/Plugin+Development+Guidelines Demonstrates how to implement the SetupBeforeHandlers method in a Jiwa plugin. This method is called after a form is created but before its default event handlers are added, enabling custom logic to execute first. The example shows how to differentiate logic based on the JiwaForm type, specifically checking for the Purchase Order form. ```C# public void SetupBeforeHandlers(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin) { if (JiwaForm is JiwaFinancials.Jiwa.JiwaPurchaseOrdersUI.MainForm) { // the Purchase Order form } else { // some other form } } ``` -------------------------------- ### Example API Authentication Response Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739 An example of the JSON response body returned by the authentication endpoint, containing the 'SessionId' which must be used in subsequent requests via the 'ss-id' cookie. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Get Next Period Starting Date for Formula (VB.NET) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988560/Crystal+Reports+Integration Retrieves the starting date of the next period from the General Ledger configuration. This date is then used to replace the 'NEXTPERIODSTARTDATE' placeholder in a formula's default value string, formatted as 'yyyy-MM-dd'. ```VB.NET Dim nextPeriodStartingDate As Date = Manager.GeneralLedgerConfiguration.GetNextPeriodStartingDate() formulaDefaultValue = formulaDefaultValue.ToUpper().Replace("NEXTPERIODSTARTDATE", nextPeriodStartingDate.ToString("yyyy-MM-dd")) ``` -------------------------------- ### APIDOC: Jiwa BusinessLogicPlugin Class Setup Method Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/76906497/Plugin+Development+Guidelines Documentation for the BusinessLogicPlugin class and its Setup method. This method is invoked after a business logic object is created via the BusinessLogicFactory and registered on the plugin's Business Logic tab. It's the primary location for adding handlers to business logic events and setting up custom objects. Important considerations for UI interaction are highlighted, advising against direct UI manipulation from this context. ```APIDOC BusinessLogicPlugin class: Implements: IJiwaBusinessLogicPlugin interface Methods: Setup(JiwaBusinessLogic JiwaBusinessLogic, Plugin Plugin): Description: Invoked after a business logic object is created and registered. Used for adding handlers to business logic events and setting up custom objects. Parameters: JiwaBusinessLogic: The business logic object that has been created. Its type should be inspected if multiple business logic objects are registered. Plugin: The plugin instance. Usage Notes: - Do not assume a user interface is present; avoid direct UI interaction (e.g., message boxes). - UI interaction should be handled in the FormPlugin class. ``` -------------------------------- ### Example Authentication Response (JSON) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362/Sales+Order+API+Operations+-+Examples+Of+Use This JSON snippet provides an example of the response received after a successful authentication request to the Jiwa API. It highlights the 'SessionId' field, which is crucial for maintaining the authenticated session in subsequent API calls. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Get Last Year Starting Date for Formula (VB.NET) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988560/Crystal+Reports+Integration Fetches the starting date of the previous year from the General Ledger configuration. This date is then used to replace the 'LASTYEARSTARTDATE' placeholder in a formula's default value string, formatted as 'yyyy-MM-dd'. ```VB.NET Dim lastYearStartingDate As Date Manager.GeneralLedgerConfiguration.GetLastYearStartingDate(lastYearStartingDate) formulaDefaultValue = formulaDefaultValue.ToUpper().Replace("LASTYEARSTARTDATE", lastYearStartingDate.ToString("yyyy-MM-dd")) ``` -------------------------------- ### Example Authentication Response JSON Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use This is an example of the JSON response received after a successful authentication request. The 'SessionId' field is crucial as it must be included in the 'ss-id' cookie for all subsequent authenticated API calls. ```JSON {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` -------------------------------- ### Step-by-Step Guide to Creating Cash Book Receipts Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986791 This section provides a detailed, numbered sequence of actions required to successfully create and activate a cash book receipt entry in the Jiwa accounting software. ```Process Guide 1. Begin by accessing the cash book receipts screen from the Jiwa menu (Cash Book -> Receipts). 2. Click the "New" button on the ribbon. 3. Enter in a Description and select the Bank Ledger. Attempting to activate the form without a Bank Ledger selected reports 'Error: You must select a bank account' 4. Change Date if required 5. Type in Remit No unless Suggest Remit No is ticked 6. Type in or select debtor record and enter the Debtor Receipt Details. 7. Type in or select creditor record and enter the Creditor Receipt Details. 8. Enter in the amount and select general ledger account no. and enter the General Ledger Receipt Details. 9. Complete the form, save and activate ``` -------------------------------- ### Example JSON Response for Webhook Subscription List Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988297/Webhooks An example of the JSON structure returned when listing webhook subscriptions. It illustrates the fields available for each subscription, such as RecID, Subscriber ID, EventName, URL, and timestamps. ```APIDOC [ { "RecID":"2a84b900-d178-4de4-8d11-18b318c0276b", "SY_WebhookSubscriber_RecID":"b25a2922-931b-4447-9160-3984b91c02f4", "EventName":"salesorder.created", "URL":"https://example.com/api/dosomething", "ItemNo":1, "LastSavedDateTime":"\/Date(1511400032893-0000)\/", "RowHash":"AAAAAAAAmns=" } ] ``` -------------------------------- ### Get Last Period Starting Date for Formula (VB.NET) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988560/Crystal+Reports+Integration Retrieves the starting date of the last period from the General Ledger configuration. This date is then used to replace the 'LASTPERIODSTARTDATE' placeholder in a formula's default value string, formatted as 'yyyy-MM-dd'. ```VB.NET Dim lastPeriodStartingDate As Date = Manager.GeneralLedgerConfiguration.GetLastPeriodStartingDate() formulaDefaultValue = formulaDefaultValue.ToUpper().Replace("LASTPERIODSTARTDATE", lastPeriodStartingDate.ToString("yyyy-MM-dd")) ``` -------------------------------- ### Configure Jiwa Connections Template for New Users Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/985429/Provisioning+an+Azure+environment This command copies an existing user's JiwaConnections.XML file to the Jiwa program files directory, creating a template. This ensures that new users running Jiwa for the first time will have a pre-defined list of connections. ```Command Line Copy the JiwaConnections.XML from the %appdata%/Jiwa Financials folder to C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaConnectionsTemplate.XML ``` -------------------------------- ### Jiwa API Authentication Response Example Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362/Sales+Order+API+Operations+-+Examples+Of+Use This is an example of the JSON response returned upon successful authentication with the Jiwa API. It contains the `SessionId` which must be included as a cookie (`ss-id`) in subsequent API requests. ```APIDOC { "SessionId": "6w1nLX8r0sIrJHClX9Vj", "UserName": "Admin", "DisplayName": "", "ResponseStatus": {} } ``` -------------------------------- ### Authenticate and Get Session ID using Curl Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use Authenticates with the Jiwa API using username and password via a GET request and retrieves a session ID. This session ID is crucial for subsequent authenticated requests, typically included in the 'ss-id' cookie. An example response is provided below the code. ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' ``` -------------------------------- ### SQL Server Considerations for Ultra-Small Jiwa Deployments Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987439 Provides specific guidance for ultra-small Jiwa deployments (1-2 users), suggesting the possibility of installing MS SQL Server on a desktop machine and utilizing MS SQL Express to reduce costs, while noting scalability limitations. ```APIDOC For ultra-small deployments of 1 or 2 users, the MS SQL Server can be installed on a desktop machine, and the free edition of MS SQL Express could be utilised when cost is a significant factor. Whilst this solution will not scale well, it does eliminate the hardware and software cost of a dedicated MS SQL Server. ``` -------------------------------- ### Retrieve Sales Order Lines using Standard C# WebClient Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 This C# example uses the System.Net.WebClient to authenticate and retrieve sales order lines. It first sends a GET request to the /auth endpoint with username and password, deserializes the response to extract the SessionId, and then includes this SessionId in a cookie header for the subsequent GET request to the sales order lines endpoint. ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(responsebody); var sessionId = authResponse.SessionId; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines"); } ``` -------------------------------- ### Log in and create business logic with Jiwa Manager (C#) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988272/How+to+convert+plugins+or+code+to+be+compatible+with+7.00.177 This snippet demonstrates how to initialize and log into the Jiwa application using the Manager class. It shows authentication, creation of a business logic instance, and accessing the underlying database connection for SQL command execution. ```C# var manager = new JiwaFinancials.Jiwa.JiwaApplication.Manager(); manager.Logon("MyServer", "JiwaDemo", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", password); manager.BusinessLogicFactory.CreateBusinessLogic(null); var db = manager.Database; using (SqlCommand SQLCmd = new SqlCommand(sql, db.SQLConnection, db.SQLTransaction)) { } ``` -------------------------------- ### Get Sales Order Custom Field Value (C# WebClient) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 This C# example uses System.Net.WebClient to authenticate with the Jiwa API and fetch a sales order custom field value. It handles authentication by adding username/password to the query string, deserializing the session ID from the response, and then including the session ID as a cookie in the subsequent GET request. Requires Newtonsoft.Json for deserialization. ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(responsebody); var sessionId = authResponse.SessionId; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/babce67cdbf64f778536/CustomFieldValues/b5432521f1fd46bb9245"); } ``` -------------------------------- ### Delete Customer Contact Name via API Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use This snippet demonstrates how to delete an existing contact name for a customer. It includes examples using ServiceStack Client for C#, a standard C# WebClient, and Curl for direct API interaction. Authentication is required to obtain a session ID for subsequent requests. The Curl example first authenticates to get a session ID, then uses it for the DELETE request. ```ServiceStack Client C# var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" }); var debtorContactNameDELETERequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorContactNameDELETERequest { DebtorID = "0000000061000000001V", ContactNameID = "00000000NX00000000AX" }; client.Delete(debtorContactNameDELETERequest); ``` ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(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/ContactNames/00000000NX00000000AX", "DELETE", ""); } ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X DELETE https://api.jiwa.com.au/Debtors/0000000061000000001V/ContactNames/00000000NX00000000AX ``` -------------------------------- ### Workstation Hardware and Software Recommendations for Small Deployments Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987439 Outlines the recommended hardware and software specifications for user workstations in small-scale Jiwa deployments (1-5 users), covering CPU, RAM, disk, and operating system. ```APIDOC Workstation: Feature: CPU Recommendation: 1 x Intel Core i5 or better Feature: RAM Recommendation: 8GB RAM Feature: DISK Recommendation: Single 80GB or better SATA Feature: SOFTWARE Recommendation: MS Windows 10 or later ``` -------------------------------- ### Update Customer Contact Name via API Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use This snippet demonstrates how to update an existing contact name for a customer. It includes examples using ServiceStack Client for C#, a standard C# WebClient, and Curl for direct API interaction. Authentication is required to obtain a session ID for subsequent requests. The Curl example first authenticates to get a session ID, then uses it for the PATCH request. ```ServiceStack Client C# var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" }); var debtorContactNamePATCHRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorContactNamePATCHRequest { DebtorID = "0000000061000000001V", ContactNameID = "00000000NX00000000AW", DefaultContact = true }; JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.DebtorContactName debtorContactName = client.Patch(debtorContactNamePATCHRequest); ``` ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(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 { DefaultContact = true }); responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors/0000000061000000001V/ContactNames/00000000NX00000000AW", "PATCH", json); } ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X PATCH https://api.jiwa.com.au/Debtors/0000000061000000001V/ContactNames/00000000NX00000000AW -d '{"DefaultContact":true}' ``` -------------------------------- ### Batch: Start SQL Server in Single User Mode Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/985320/How+to+migrate+a+SQL+2012+x86+instance+to+x64 This command-line snippet starts the SQL Server instance in single-user mode, which is necessary for restoring system databases like master. It requires an elevated command prompt and navigating to the SQL Server Binn directory. Replace '' with your actual SQL Server instance name. ```Batch CD C:\Program Files\Microsoft SQL Server\MSSQL11.\MSSQL\Binn sqlservr.exe -m -s ``` -------------------------------- ### Authenticate API Request with HTTP Bearer Token Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/985963/Consuming+the+REST+API This example demonstrates how to include an API Key as a Bearer token in the 'Authorization' header of an HTTP GET request. This method is suitable for secure transmission of the API key. ```Bash curl -H 'Authorization: Bearer znis9fHm0_D5EGRrGdWG7WA2EP7Hke_gloC6R76A2t0' -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/Debtors ``` -------------------------------- ### SQL Server Hardware and Software Recommendations for Small Deployments Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987439 Details the recommended hardware and software specifications for the SQL Server component in small-scale Jiwa deployments (1-5 users), including CPU, RAM, disk, RAID, power, and operating system/SQL Server versions. ```APIDOC SQL Server: Feature: CPU Recommendation: 2 x Physical Xeon Feature: RAM Recommendation: 64GB ECC RAM Feature: DISK Recommendation: 2x (or more) 72GB or (better) 15K SCSI Feature: RAID Recommendation: Caching RAID controller with 256MB RAM, 2 Channel Feature: POWER Recommendation: Redundant PSU Feature: SOFTWARE Recommendation: MS Windows Server x64 2016 or later, Microsoft SQL Server x64 2016 or later ``` -------------------------------- ### Authenticate and Get Sales Order Line Custom Field Value with Standard C# WebClient Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 This C# example uses System.Net.WebClient to authenticate and retrieve a sales order line custom field value. It performs authentication by adding credentials to the query string, deserializes the session ID from the response, and then uses the session ID in a cookie header for the subsequent GET request to the custom field endpoint. Requires Newtonsoft.Json for deserialization. ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(responsebody); var sessionId = authResponse.SessionId; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/32417fa3bc1c451ea2ba/Historys/5f4a173d84c54ee7ab11/Lines/9905ee354b534102ae2f/CustomFieldValues/1ae102b94dc54dfc8a45 "); } ``` -------------------------------- ### Create Customer with Basic Details and Authenticate (C#, Curl) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use This collection of code snippets demonstrates how to create a new customer record, specifying essential details like account number, name, email, and web access. It covers both authentication to obtain a session ID and the subsequent POST request to create the customer, using ServiceStack Client C#, standard C# WebClient, and Curl. ```C# var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" }); var debtorPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorPOSTRequest { AccountNo = "NewAccountNo", Name = "A new customer", EmailAddress = "name@example.com", WebAccess = true }; JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Debtor Debtor = client.Post(debtorPOSTRequest); ``` ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(responsebody); var sessionId = authResponse.SessionId; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json"; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); webClient.Headers[System.Net.HttpRequestHeader.ContentType] = "application/json"; string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { AccountNo = "NewAccountNo", Name = "A new customer", EmailAddress = "name@example.com", WebAccess = true }); responsebody = webClient.UploadString("https://api.jiwa.com.au/Debtors", "POST", json); } ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' # Example authentication response: # {"SessionId":"6w1nLX8r0sIrJHClX9Vj","UserName":"Admin","DisplayName":"","ResponseStatus":{}} ``` ```Curl 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"}' ``` -------------------------------- ### Authenticate API Request with URL Parameter Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/985963/Consuming+the+REST+API This example shows how to pass an API Key as a query parameter ('apikey') directly in the URL of an HTTP GET request. While simpler, this method might expose the key in logs or browser history. ```Bash curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/Debtors?apikey=znis9fHm0_D5EGRrGdWG7WA2EP7Hke_gloC6R76A2t0 ``` -------------------------------- ### Database Update: ASPlurisPackingInfo SQL File Import Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/117801081/Warehouse+Management+System Instructions to re-import the updated ASPlurisPackingInfo.sql file into the database. This file contains schema updates for the ASPlurisPackingInfo table, crucial for proper functionality after certain version upgrades. ```SQL C:\Program Files\ASP\ASPluris V3.0\CustomTables\ASPlurisPackingInfo.sql ``` -------------------------------- ### Configure Jiwa Connection Template for Users Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/985429 This snippet provides the command to copy a pre-configured JiwaConnections.XML file from the user's application data folder to the Jiwa program files directory. This action makes the template available for new users, ensuring they have a pre-defined list of connections when they first launch the Jiwa application. ```Windows Command Copy the JiwaConnections.XML from the %appdata%/Jiwa Financials folder to C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaConnectionsTemplate.XML ``` -------------------------------- ### Authenticate and Get Session ID (Curl) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 Illustrates how to authenticate with the API using Curl to obtain a session ID. This session ID is crucial for subsequent authenticated requests and is typically passed in the 'ss-id' cookie. An example response structure is provided in the source text. ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' ``` -------------------------------- ### Jiwa Old Login Example (Deprecated) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988272/How+to+convert+plugins+or+code+to+be+compatible+with+7.00.177 This C# code demonstrates the deprecated method of logging into Jiwa using the Manager.Instance singleton property. This approach is no longer supported in Jiwa 7.00.177.00 and later, even though it might still compile, and should be replaced with an instance-based approach. ```C# JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Logon("MyServer", "JiwaDemo", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", password); JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(null); var db = JiwaApplication.Manager.Instance.Database; using (SqlCommand SQLCmd = new SqlCommand(sql, db.SQLConnection, db.SQLTransaction)) { } ``` -------------------------------- ### Read Sales Order Lines using Curl with SessionId Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362/Sales+Order+API+Operations+-+Examples+Of+Use Demonstrates how to make an authenticated GET request to retrieve sales order lines using Curl. This example includes the previously obtained SessionId in the 'ss-id' cookie header, which is required for successful authorization. ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/Lines ``` -------------------------------- ### Authenticate and Get Sales Order Custom Fields (ServiceStack C#) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362/Sales+Order+API+Operations+-+Examples+Of+Use This C# example demonstrates how to authenticate with the Jiwa API using ServiceStack.JsonServiceClient and then retrieve a list of all sales order custom fields by sending a GETManyRequest. It assumes the ServiceStack client library is available. ```C# var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" }); var SalesOrderCustomFieldsGETManyRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.SalesOrderCustomFieldsGETManyRequest(); var salesOrderCustomFieldsGETManyResponse = client.Get(SalesOrderCustomFieldsGETManyRequest); ``` -------------------------------- ### Workstation Hardware and Software Requirements Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987439/Deployment+Planning Recommended hardware and software specifications for end-user workstations to ensure compatibility and performance within the deployment. ```APIDOC Workstation: CPU: 1 x Intel Core i5 or better RAM: 8GB RAM DISK: Single 80GB or better SATA SOFTWARE: MS Windows 10 or later ``` -------------------------------- ### Jiwa Application Manager and Factories API Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988272/How+to+convert+plugins+or+code+to+be+compatible+with+7.00.177 This API documentation describes the structure and usage of the Jiwa Application's Manager class, its associated factories, and the core interfaces that now include a Manager property and Setup method. This design facilitates dependency injection and supports concurrent operations after the removal of the singleton pattern. ```APIDOC Manager Class: Properties: BusinessLogicFactory: Factory for IJiwaBusinessLogic instances CollectionFactory: Factory for IJiwaCollection instances CollectionItemFactory: Factory for IJiwaCollectionItem instances DialogFactory: Factory for IJiwaDialog instances EntityFactory: Factory for IJiwaEntity instances FormFactory: Factory for IJiwaForm instances Interfaces (implementing classes require Manager property and Setup method): JiwaFinancials.Jiwa.JiwaApplication.IJiwaBusinessLogic JiwaFinancials.Jiwa.JiwaApplication.IJiwaCollection JiwaFinancials.Jiwa.JiwaApplication.IJiwaCollectionItem JiwaFinancials.Jiwa.JiwaApplication.IJiwaDialog JiwaFinancials.Jiwa.JiwaApplication.IJiwaEntity JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm Methods (for implementing classes): Setup(): void - Initializes the object; must call base.Setup() first. ``` -------------------------------- ### Authenticate and Get Customer Notes using Curl Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739 Provides a sequence of Curl commands to first authenticate with the API to obtain a session ID, and then use that session ID in a cookie to retrieve all notes for a specific customer. The authentication response example is also provided. ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/auth -d '{"username":"Admin","password":"password"}' ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' --cookie 'ss-id=6w1nLX8r0sIrJHClX9Vj' -X GET https://api.jiwa.com.au/Debtors/0000000061000000001V/Notes ``` -------------------------------- ### Workstation Hardware and Software Recommendations for Medium Deployments Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987439 Outlines the recommended hardware and software specifications for user workstations in medium-sized Jiwa deployments (5-50 users) utilizing RDS, covering CPU, RAM, disk, and operating system. ```APIDOC Workstation: Feature: CPU Recommendation: 1 x Intel Core i5 or better Feature: RAM Recommendation: 4GB RAM Feature: DISK Recommendation: Single 80GB or better SATA Feature: SOFTWARE Recommendation: MS Windows 10 or later ``` -------------------------------- ### Get End of Current Financial Year (VB.NET) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988560/Crystal+Reports+Integration Calculates the end date of the current financial year by adding one year to the financial year start date and subtracting one second. The result is formatted as 'dd/MM/yyyy'. ```VB.NET Dim currentStartDate As Date Manager.GeneralLedgerConfiguration.GetCurrentYearStartingDate(currentStartDate) DateAdd(Microsoft.VisualBasic.DateInterval.Second, -1, currentStartDate.AddYears(1)).ToString("dd/MM/yyyy") ``` -------------------------------- ### Create Customer with Multiple Notes (C#) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739/Debtor+API+Operations+-+Examples+Of+Use This example demonstrates how to create a new customer record and simultaneously associate multiple notes with it. It showcases the use of ServiceStack Client C# to add Note objects to the DebtorPOSTRequest before sending the request. An incomplete standard C# WebClient example is also provided. ```C# var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var authResponse = client.Get(new ServiceStack.Authenticate() { UserName = "admin", Password = "password" }); var debtorPOSTRequest = new JiwaFinancials.Jiwa.JiwaServiceModel.DebtorPOSTRequest { AccountNo = "NewAccountNo", Name = "A new customer", EmailAddress = "name@example.com", WebAccess = true }; debtorPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 1" }); debtorPOSTRequest.Notes.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.Notes.Note() { NoteText = "Note text 2" }); JiwaFinancials.Jiwa.JiwaServiceModel.Debtors.Debtor Debtor = client.Post(debtorPOSTRequest); ``` ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(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"; ``` -------------------------------- ### Update Sales Order Custom Field Value using C# WebClient Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362 This C# example illustrates how to authenticate and update a sales order custom field value using the standard System.Net.WebClient. It also uses Newtonsoft.Json for serialization and deserialization, which needs to be installed as a NuGet package. ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(responsebody); var sessionId = authResponse.SessionId; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); string json = Newtonsoft.Json.JsonConvert.SerializeObject(new { Contents = "New Contents"} ); responsebody = webClient.UploadString("https://api.jiwa.com.au/SalesOrders/5244dd5e199749f4b6fe/Historys/29a71d4380c5437b972e/CustomFieldValues/3231d2153d124a8ab2ad /", "PATCH", json); } ``` -------------------------------- ### Authenticate and Get Sales Order Custom Fields (C# WebClient) Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/987362/Sales+Order+API+Operations+-+Examples+Of+Use This C# example uses System.Net.WebClient to authenticate with the Jiwa API by sending username and password, extracting the SessionId from the JSON response (requires Newtonsoft.Json), and then using it in a cookie to fetch sales order custom fields. ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(responsebody); var sessionId = authResponse.SessionId; webClient.Headers.Add(System.Net.HttpRequestHeader.Cookie, string.Format("ss-id={0}", sessionId)); responsebody = webClient.DownloadString("https://api.jiwa.com.au/SalesOrders/CustomFields"); } ``` -------------------------------- ### Billing Tab Overview Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988264/Service+Manager General information about the Billing Tab. ```APIDOC Section: Billing Tab\nDescription: Billing information for the task can be set here. ``` -------------------------------- ### Filter and Order Webhook Messages for a Subscriber Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/988297/Webhooks Illustrates how to retrieve a filtered and ordered list of messages for a subscriber. This example specifically shows how to get the first 10 failed messages (status 2), with selected fields (MessageID, EventName, URL, Retries) and ordered by the number of retries. ```C# (ServiceStack Client) var client = new ServiceStack.JsonServiceClient("https://api.jiwa.com.au"); var webhooksMessagesGETRequest= new JiwaFinancials.Jiwa.JiwaServiceModel.WebhooksMessagesGETRequest() { SubscriberID = "b25a2922-931b-4447-9160-3984b91c02f4", Take = 10, Status = 2, Fields="MessageID,EventName,URL,Retries", Orderby=Retries }; QueryDb webhooksMessagesGETResponse = client.Get(webhooksMessagesGETRequest); ``` ```C# using (var webClient = new System.Net.WebClient()) { responsebody = webClient.DownloadString("https://api.jiwa.com.au/Webhooks/Subscribers/b25a2922-931b-4447-9160-3984b91c02f4/Messages/?Take=10&Status=2&Fields=MessageID,EventName,URL,Retries,Orderby=Retries"); } ``` ```Curl curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://api.jiwa.com.au/Webhooks/Subscribers/b25a2922-931b-4447-9160-3984b91c02f4/Messages/?Take=10&Status=2&Fields=MessageID,EventName,URL,Retries,Orderby=Retries ``` ```Web Browser https://api.jiwa.com.au/Webhooks/Subscribers/b25a2922-931b-4447-9160-3984b91c02f4/Messages/?Take=10&Status=2&Fields=MessageID,EventName,URL,Retries,Orderby=Retries&format=json ``` -------------------------------- ### Authenticate and Get Customer Delivery Addresses using C# WebClient Source: https://jiwa.atlassian.net/wiki/spaces/J7UG/pages/986739 This C# example uses System.Net.WebClient to authenticate with the API and then fetch customer delivery addresses. It handles session ID extraction from the authentication response and includes it in subsequent requests via cookies. Requires Newtonsoft.Json for deserialization. ```C# using (var webClient = new System.Net.WebClient()) { // Authenticate webClient.QueryString.Add("username", "Admin"); webClient.QueryString.Add("password", "password"); string responsebody = webClient.DownloadString("https://api.jiwa.com.au/auth"); // Above returns something like this: {"SessionId":"0hKBFAnutUk8Mw6YY6DN","UserName":"api","DisplayName":"","ResponseStatus":{}} // Deserialise response into a dynamic - below requires the Newtonsoft.Json nuget package var authResponse = Newtonsoft.Json.JsonConvert.DeserializeObject(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"); } ```