API Quick Start

New User

Sign up now and activate your subscription then come back here for info on enabling api access for your file.

Existing User

Create a free sandbox file now if you haven’t got one.

Activating API Access for Your File

You will need a web service access key (WSAccessKey) and file id (FileUid) to access your file through the web service api.

To activate api access for your file or retrieve the API key:

  1. While signed into your Saasu file, click on My Saasu in the top menu.
  2. Click on your Subscription e.g. Subscription: SampleCo
  3. Pick an existing user as an API user for your file or create a separate user account (recommended).
  4. Click on the user you want to give an API access key to.
  5. In this Edit User screen tick the check box “This user has permission to connect via web services key”.
  6. Click save to reveal the user specific API key.
  7. Click close to go back to Manage Subscription screen.
  8. Click on the file that you want to be made accessible via web service.
  9. In this Edit File screen, tick the check box “Allow access to this File via web services” and permission the API user to access this file by giving it an appropriate access level.
  10. Click “Save” to reveal the file id.

You will need the API key and the file id to connect to your file via web services.

Web Services URLs

Sandbox and Production

  • https://secure.saasu.com/webservices/rest/r1/Tasks?wsaccesskey={WSAccessKey}&FileUid={FileUid}

Preview area for upcoming release (includes sandbox and production snapshot, so use production credentials here)

  • https://secure.saasu.com/alpha/webservices/rest/r1/Tasks?wsaccesskey={WSAccessKey}&FileUid={FileUid}

HTTP POST Examples

Data processing requests are submitted through HTTP POST request to Tasks resource. Multiple tasks can be submitted at once. The following example illustrates submitting three tasks in a single request:

  • Task #1: update contact (updateContact).
  • Task #2: insert a service sale with quick payment (insertInvoice).
  • Task #3: insert an unpaid item sale (insertInvoice).

Sample request data


<?xml version=”1.0″ encoding=”utf-8″?>
<tasks>
<updateContact>
<contact uid=”23985″ lastUpdatedUid=”AD3872E=”>
<salutation>Mrs.</salutation>
<givenName>Mary</givenName>
<familyName>Smith</familyName>
<organisationName>ACME Pty Ltd</organisationName>
<organisataionAbn>11 111 111 111</organisationAbn>
<contactID>223</contactID>
<organisationWebsite>www.acme.com</organisationWebsite>
<mobilePhone>0666 666 666</mobilePhone>
<homePhone> 02 8888 8888</homePhone>
<tags>Prospect, IT</tags>
<postalAddress>
<street>11/111 ABC Av</street>
<city>Sydney</city>
<state>NSW</state>
</postalAddress>
</otherAddress>
<isActive>true</isActive>
</contact>
</updateContact>
<insertInvoice emailToContact=”false”>
<invoice uid=”0″>
<transactionType>S</transactionType>
<date>2005-09-30</date>
<contactUid>23986</contactUid>
<tags>Online Sales, XYZ</tags>
<summary>Test POST sale</summary>
<notes>From REST</notes>
<requiresFollowUp>false</requiresFollowUp>
<dueOrExpiryDate>2005-12-01</dueOrExpiryDate>
<layout>S</layout>
<status>I</status>
<invoiceNumber><Auto Number></invoiceNumber>
<purchaseOrderNumber>PO222</purchaseOrderNumber>
<invoiceItems>
<serviceInvoiceItem>
<description>Design & Development of REST WS</description>
<accountUid>24502</accountUid>
<taxCode>G1</taxCode>
<totalAmountInclTax>2132.51</totalAmountInclTax>
</serviceInvoiceItem>
<serviceInvoiceItem>
<description>Subscription to XYZ</description>
<accountUid>24504</accountUid>
<taxCode>G1</taxCode>
<totalAmountInclTax>11.22</totalAmountInclTax>
</serviceInvoiceItem>
</invoiceItems>
<quickPayment>
<datePaid>2005-09-30</datePaid>
<dateCleared />0001-01-01</dateCleared>
<bankedToAccountUid>24509</bankedToAccountUid>
<amount>100</amount>
<reference>CASH</reference>
<summary>Quick payment from Westpac.</summary>
</quickPayment>
<isSent>false</isSent>
</invoice>
</insertInvoice>
<insertInvoice emailToContact=”true”>
<invoice uid=”0″>
<transactionType>S</transactionType>
<date>2005-10-06</date>
<contactUid>23987</contactUid>
<tags>Online Sales, ABC123</tags>
<summary>Test Insert Item Sale</summary>
<notes>From REST</notes>
<requiresFollowUp>false</requiresFollowUp>
<dueOrExpiryDate>2005-11-06</dueOrExpiryDate>
<layout>I</layout>
<status>I</status>
<invoiceNumber><Auto Number></invoiceNumber>
<purchaseOrderNumber>PO333</purchaseOrderNumber>
<invoiceItems>
<itemInvoiceItem>
<quantity>2</quantity>
<inventoryItemUid>4822</inventoryItemUid>
<description>Seagate HDD - 300G</description>
<taxCode>G1</taxCode>
<unitPriceInclTax>120.75</unitPriceInclTax>
</itemInvoiceItem>
<itemInvoiceItem>
<quantity>5.125</quantity>
<inventoryItemUid>4821</inventoryItemUid>
<description>Cat 5 Cable (in meter)</description>
<taxCode>G1</taxCode>
<unitPriceInclTax>2.555</unitPriceInclTax>
</itemInvoiceItem>
</invoiceItems>
<quickPayment>
<datePaid>0001-01-01</datePaid>
<dateCleared>0001-01-01</dateCleared>
<bankedToAccountUid>0</bankedToAccountUid>
<amount>0</amount>
</quickPayment>
<isSent>false</isSent>
</invoice>
<createAsAdjustmentNote>false</createAsAdjustmentNote>
<emailMessage>
<from>test@acme.com.au</from>
<to>smith@acme.com.au</to>
<subject>Invoice</subject>
<body>Thanks for shopping with us. Attached is a PDF invoice for your record.</body>
</emailMessage>
</insertInvoice>
</tasks>

Sample Response (Success):


<?xml version=”1.0″ encoding=”utf-8″?>
<tasksResponse>
<updateContactResult updatedEntityUid=”23985″ LastUpdatedUid=”1AB72C=” />
<insertInvoiceResult insertedEntityUid=”253490″ LastUpdatedUid=”90DFDA=” sentToContact=”false” />
<insertInvoiceResult insertedEntityUid=”253492″ LastUpdatedUid=”379A9ACD=” sentToContact=”true” />
</tasksResponse>

Sample Response (Error in executing a task):


<?xml version=”1.0″ encoding=”utf-8″?>
<tasksResponse>
<updateContactResult updatedEntityUid=”24001″ LastUpdatedUid=”A37CA998″ />
<insertInvoiceResult sentToContact=”false”>
<errors>
<error>
<type>InvalidReferenceException</type>
<message>The referenced Contact does not exist.</message>
</error>
</errors>
</insertInvoiceResult>
<insertInvoiceResult insertedEntityUid=”253501″ LastUpdatedUid=”78273DA=” sentToContact=”true” />
</tasksResponse>

Sample Response (Error – invalid task submitted or the XML submitted does not conform to schema):


<?xml version=”1.0″ encoding=”utf-8″?>
<tasksResponse>
<errors>
<error>
<type>SchemaValidationException</type>
<message>The element ‘tasks’ has invalid content. An error occurred at , (3, 4).</message>
</error>
</errors>
</tasksResponse>

HTTP GET Examples

The following is an example of retrieving a purchase order with uid 253502. Sample request URI: https://secure.saasu.com/webservices/rest/r1/Invoice?wsaccesskey=TEST-888-888&FileUid=888&uid=253502

Sample return (No errors):


<?xml version=”1.0″ encoding=”utf-8″?>
<invoiceResponse>
<invoice uid=”253502″>
<transactionType>P</transactionType>
<date>2005-11-24</date>
<contactUid>24012</contactUid>
<summary>Test POST Purchase</summary>
<notes>From REST</notes>
<requiresFollowUp>false</requiresFollowUp>
<dueOrExpiryDate>2005-12-24</dueOrExpiryDate>
<status>O</status>
<invoiceNumber />
<purchaseOrderNumber><Auto Number></purchaseOrderNumber>
<invoiceItems>
<serviceInvoiceItem>
<description>Purchase - Line Item 1</description>
<accountUid>24662</accountUid>
<taxCode>G11</taxCode>
<totalAmountInclTax>123.4500</totalAmountInclTax>
</serviceInvoiceItem>
<serviceInvoiceItem>
<description>Purchase - Line Item 2</description>
<accountUid>24664</accountUid>
<taxCode>G11,G15</taxCode>
<totalAmountInclTax>678.9000</totalAmountInclTax>
</serviceInvoiceItem>
</invoiceItems>
<isSent>false</isSent>
</invoice>
</invoiceResponse>

Sample return (with errors):


<?xml version=”1.0″ encoding=”utf-8″?>
<invoiceResponse>
<errors>
<error>
<type>RecordNotFoundException</type>
<message>The requested Invoice is not found.</message>
</error>
</errors>
</invoiceResponse >

HTTP DELETE Examples

For deleting an entity.

The following sample illustrates deleting an invoice given the invoice uid. Sample request URI: https://secure.saasu.com/webservices/rest/r1/Invoice?wsaccesskey=TEST-888-888&FileUid=888&uid=251362

Sample return (No errors):


<?xml version=”1.0″ encoding=”utf-8″?>
<invoiceResponse>
<deleteResult uid=”251362″ />
</invoiceResponse>

  • Share/Save/Bookmark