Tag Archives: saasu integration

Need your Salesforce Inventory linked to Xero or Saasu?

Want to load data from Xero or Saasu?

We’ve added more functionality to our highly successful product, RIO Readymade Inventory Plus. You can now transfer data from Xero or Saasu to RIO Readymade Inventory Plus.

Can I use other csv data files?

Yes! The program can also handle any csv file in the required format.

How does it work?

  1. Send us an email at support@wdcigroup.net and we’ll send you the job.
  2. The upsert uses Skyvva data loader. Skyvva can be downloaded for free.
  3. Install Skyvva (this app is available on Appexchange).
  4. Install our job
  5. Download the data from Xero/Saasu
  6. Follow the instructions to upload your data to Salesforce.

What if I need some help?

Videos and documentation are available here.

Build on Salesforce features. Can I automate it?

Subscribe to Skyvva and you can email the data to automate the process

Saasu Integration: Invoice Number

While pushing invoice data into Saasu, you should go with either approach below:

#1: Let the Saasu decide the invoice number (recommended)
This is the recommended approach. You can do this by providing the <Auto Number> from the API. However, please make sure that you escape both < and >. For example:

<tasks xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <insertInvoice emailToContact="true">
  <invoice uid="0">
   <invoiceNumber>&lt;Auto Number&gt;</invoiceNumber>

#2: Let the source system decide the invoice number
The source system must keep track of the latest running number and the number must be unique.

Salesforce and Multiple Saasu Company Files Integration

We have recently implemented a customised solution for Salesforce to Saasu integration. This solution does not limit to just single currency or company file as it allows integration between Salesforce and multiple Saasu company files.

When there are transactions coming in from different regions many customers will naturally:

  • track SF transactions by enabling multi-currency
  • use different Saasu company files with multi-currency to track respective sales

Below is good illustration of the above scenario:

In the given scenario, it raises a dilemma on knowing which transaction shall be synced to a certain company file. Customers may also have preferences in wanting to have transactions created into the company file based on the set of given contacts as Saasu is a contact based application. To overcome the dilemma, we have extended the scope to:

  1. firstly identify the SF contact that will be associated with the respective company file
  2. associate the SF contact with the company file id
  3. ensure the integration will sync the transactions based on the establishment from Step 2

For more technical details, please refer to a case newly published here.

Saasu REST API: Invalid invoice type error

I have developed an integration tool for one of the customers to create a purchase order with invoice type “Money Out (Expense)” in Saasu via REST API. During the synchronization, I received the following error message saying the invoice type is invalid:

<?xml version="1.0" encoding="utf-8"?>
      <message>Invalid invoice type: Money Out (Expense).</message>
      <stackTrace>System.ArgumentException: Invalid invoice type: Money Out (Expense).
   at Saasu.OnlineAccounting.Service.Transactions.Invoices.InvoiceTypeService.Parse(Int32 fileUid, EntityType entityType, String invoiceTypeString)
   at Netaccounts.Ola.Rest.XmlSerializers.InvoiceSerializer.Deserialize(XmlReader reader, Object target)
   at Netaccounts.Ola.Rest.XmlSerializers.Serializer.Deserialize(String xmlFragment)
   at Netaccounts.Ola.Rest.XmlSerializers.InsertInvoiceSerializer.ParseElementData(XmlReader reader, Object target)
   at Netaccounts.Ola.Rest.XmlSerializers.InsertInvoiceSerializer.Deserialize(XmlReader reader, Object target)
   at Netaccounts.Ola.Rest.XmlSerializers.Serializer.Deserialize(String xmlFragment)
   at Netaccounts.Ola.Rest.XmlSerializers.TasksSerializer.ParseElementData(XmlReader reader, Object target)
   at Netaccounts.Ola.Rest.XmlSerializers.TasksSerializer.Deserialize(XmlReader reader, Object target)
   at Netaccounts.Ola.Rest.XmlSerializers.Serializer.Deserialize(String xmlFragment)
   at Netaccounts.Ola.Rest.RestTasks.TasksRunner.Execute(String xmlTasks)
   at Netaccounts.Ola.Rest.Handlers.TasksPostHandler.HandleRequestInternal()</stackTrace>

The first thing that came to my mind is that the invoice type is not supported in the customer region. This can be identified by looking at the Saasu API doc. However, this is not the case. After further studying on Saasu, I found that I need to have the “I am GST registered from” checkbox checked (can be found in Settings -> File Identity). Once I checked the checkbox, the sync just work like a charm 😀

Saasu Integration : Generate Invoice Number

When we build an integration with Saasu, you may need to create Invoice/PurchaseOrder. How do you generate the correct Invoice/Purchase Order Number? There are two ways of achieving this:

Method  1: Use Auto Number

Instead of putting the invoiceNumber manually, you can let Saasu decide the latest invoiceNumber. This behavior is applicable to Purchase Order too. Your request will look like this:

    <invoice uid="0">
      <invoiceNumber>&lt;Auto Number&gt;</invoiceNumber>

By using this feature, you should not create duplicate Invoice/Purchase Order.

Method 2: Maintain unique Invoice/PurchaseOrder number in another system

This scenario is applicable if you are integrating Saasu with another system. For example: If you are integrating Saasu with Salesforce, you can use Salesforce Auto-Number custom field to generate the Invoice/PurchaseOrder number. Salesforce will take the responsibility of maintaining the unique Invoice/PurchaseOrder number.

Saasu Integration Tip: Concurrent update control in Saasu

Concurrent update happens when an user is trying to update/delete a record that is being updated by another user at the same time in an application. This is very vital as it could cause a data integrity issue and maybe deadlock at the database level. Luckily, most of the applications available in the market nowadays have concurrent update control to prevent an unwanted disaster.

One good example that I will be discussing here is Saasu – one of the very popular cloud accounting applications.
Saasu is using an attribute called “lastUpdatedUid” (which contains an unique value for each record in Saasu) to keep track of the edit sequence and to prevents concurrent update. The value of the “lastUpdatedUid” attribute will be changed whenever a record is updated by someone via Saasu application or programmatically through REST API call.
 You can find out the “lastUpdatedUid” for a record in Saasu by viewing the HTML source in the Edit page, the example that I’m using here is Edit Contact page.
You can also retrieve the value by retrieving the contact via REST API call. Here is the result that you will see in the response:
Here is a simple demo to simulate how to use the “lastUpdatedUid” when updating a contact via the REST API by using CURL and how Saasu prevents the concurrent update.
1. Create a contact in Saasu via REST API and this will return you a “lastUpdatedUid” in the response.
curl -X POST -d '<?xml version="1.0" encoding="utf-8"?><tasks><insertContact><contact uid="0"><salutation>Mr.</salutation><familyName>Smith</familyName><givenName>John</givenName><organisationName></organisationName></contact></insertContact></tasks>' 'https://secure.saasu.com/webservices/rest/r1/Tasks?wsaccesskey=028SADFASD6AE5C4F4IUYIUYKJHJKH122231&FileUid=99999'
Response from Saasu:
  <insertContactResult insertedEntityUid="3536651" lastUpdatedUid="AAAAAA90qwU=" utcLastModified="2012-07-13T07:53:32" />
2. Then, go to the Saasu application to make some changes to the contact and save it. Saasu will generate a new “lastUpdatedUid” for the contact record once the changes are saved.
3. Now, let’s try to update the contact by using the old “lastUpdatedUid” that returned by Saasu in Step 1. You can see that Saasu returned an error response saying that the contact has been updated by someone and the provided lastUpdatedUid is outdated.
curl -X POST -d '<?xml version="1.0" encoding="utf-8"?><tasks><updateContact><contact uid="3536651" lastUpdatedUid="AAAAAA90qwU="><salutation>Mr.</salutation><familyName>Smith</familyName><givenName>John</givenName><organisationName></organisationName></contact></updateContact></tasks>' 'https://secure.saasu.com/webservices/rest/r1/Tasks?wsaccesskey=028SADFASD6AE5C4F4IUYIUYKJHJKH122231&FileUid=99999'
Response from Saasu:
<?xml version="1.0" encoding="utf-8"?>
  <updateContactResult utcLastModified="0001-01-01T00:00:00">
        <message>Record to be updated has changed since last read.</message>
        <stackTrace>Netaccounts.Core.Exceptions.RecordHasChangedException: Record to be updated has changed since last read.
   		at Netaccounts.Ola.Bll.FileEntityManager.SaveInternal(FileEntity fileEntity, Boolean performSyncCheck)
   		at Netaccounts.Ola.Bll.Contact.SaveInternal(FileEntity fileEntity, Boolean performSyncCheck)
   		at Netaccounts.Ola.Bll.FileEntityManager.Save(FileEntity fileEntity, Boolean performSyncCheck)
   		at Netaccounts.Ola.Bll.Contact.Save(FileEntity fileEntity)
   		at Netaccounts.Ola.Rest.RestTasks.EntityTask`2.ExecuteInternal(TaskResult result)
   		at Netaccounts.Ola.Rest.RestTasks.UpdateTask`2.ExecuteInternal(TaskResult result)
   		at Netaccounts.Ola.Rest.RestTasks.Task.Execute()</stackTrace>
In order to update the contact record correctly, I need to provide the latest lastUpdatedUid. Hopefully this gives you a basic idea on how Saasu handles the concurrent update 😀

Application Spotlight: Integrating to Saasu

URL http://www.saasu.com
Description Online Accounting
API Yes, http://help.saasu.com/api/
Trial Version with API Access Yes.
Protocol REST
Data Format XML
Authentication Include Web Service Access Key and File ID in the URL parameter
Query Get Insert Update Delete
Bank Account
Combo Item
Foreign Currency Journal
Foreign Currency Service Sale
Full Combo Item
Full Inventory Item
Inventory Adjustment
Inventory Item
Inventory Transfer
Invoice Payment
Item Invoice
Item Sale
Service Sale
Tax Code
Transaction Category  (Account)
API Limits Maximum of 5 requests per second.
Maximum of 2,000 requests per day.
Sample Use Case Salesforce Opportunity > Creates > Saasu Invoice
Saasu InventoryItem > Creates/Updates > Salesforce Product
Salesforce Account/Contact > Creates/Updates > Saasu Contact/Organisation
F2I 4.1/5

Saasu – Company information via the API

If you are using Saasu and looking to integrate with Salesforce or a CRM that has a Company object, you’ll need to handle this differently with Saasu.  With the Saasu API you are able to create/update a Contact’s Company information via the Contact page as Company in Saasu is not a separate object.
To retrieve or create the Company information, we can do this via the Contact Object. In a Contact profile, Saasu utilizes the following elements to associate with the Contact’s Company:
organisationName, organisationAbn, organisationWebsite
Following is an example of a insertContact Request profile which consist of the Company information (see the bold section):
<?xml version=”1.0″ encoding=”utf-8″?>
    <contact uid=”0″>
      <mainPhone>02 9999 9999</mainPhone>
      <mobilePhone>0444 444 444</mobilePhone>
      <tags>Gold Prospect, Film</tags>
        <street>3/33 Victory Av</street>
        <city>North Sydney</city>
        <street>111 Elizabeth street</street>
      <directDepositAccountName>John Smith</directDepositAccountName>
      <customField1>This is custom field 1</customField1>
      <customField2>This is custom field 2</customField2>
      <twitterID>Contact twitter id</twitterID>
      <skypeID>Contact skype id</skypeID>
For example, when creating/updating a Contact, the operation would use the organisationName value to find for matching Company Name and if there is no match, the defined Company will be created in Saasu instead.

Prevent Concurrent Data Modification

Applications such as Quickbooks or Saasu have a mechanism to prevent cocurrent edit. If you plan to integrate with Quickbooks or integrate with Saasu, this is the mandatory field when you are performing an update call:

  • Quickbooks uses a field called EditSequence 
  • Saasu uses a field called LastUpdatedUid

This field value is automatically updated by the application after an update event. If two connections come in with the same value, one will succeed and one will fail.

This type of mechanism is also useful to prevent concurrent updates from a UI perspective. This is how it works:

  • PersonA is editing a customer named WDCi. (current EditSequence=1000)
  • PersonB is also editing a customer named WDCi using different machine (current EditSequence=1000)
  • PersonA completes the modification first and click the save button. The request is then submitted to the server with EditSequence=1000. Now the new EditSequence = 1001
  • PersonB completes the modication later and click the save button. The request is then submitted to the server with EditSequence=1000 but the server rejected the request because it does not match the latest EditSequence number (1001)