EzzyBills API – Sample Applications

The EzzyBills API supports both SOAP and REST endpoints. Below are some example programs.

 

 

Samples that use the EzzyBills  SOAP API

 

Upload an invoice to EzzyBills

 

The following link contains a client program written in c# which uploads an invoice to EzzyBills, then waits for the workflow to complete. The invoice data is then printed out.

EzzyClient.zip

For example, the API call,

InvoiceBlocksSS ib = client.getInvoiceHeaderBlocks(invoice_id);

will return all invoice header data (total amount, tax, invoice date etc), as well as the Invoice table if it exists.

To use it,
• Goto the www.ezzybills.com and click on Free Trial, then create a Trial account (use this username/pwd when running the program).
• You may choose xero as the accounting package to link to (go to https://www.xero.com/au/signup/ to setup a Xero trial account).
• If you just want to extract the Invoice data (without exporting to an accounting system), then contact us and we will change your workflow.

Before you execute the program you will need to add the API key (which we will email you) to app.config file.

 <endpoint address="https://app.ezzydoc.com/EzzyService.svc" binding="customBinding"
 bindingConfiguration="CustomBinding_EzzyService" contract="EzzyServiceReference.EzzyService"
 name="CustomBinding_EzzyService">
      <headers>
         <APIKey>add key here</APIKey>
      </headers>
 </endpoint>

 

Set Supplier and Purchase Order Data (for your EzzyBills account)

 

We also have a sample program which allows you to upload your vendor and purchase order data directly into EzzyBills. This information will be used when extracting the purchase order information off the invoice and when identifying the vendor.

This is unnecessary when you use Ezzybills to inegrate with xero, Quickbooks or MYOB , however if you want to integrate with an ERP system which EzzyBills does not support then you should periodically load this information into your EzzyBills account.

EzzyClientLoad.zip

 

for example,

 
 var csv = new CsvReader(new StreamReader(@"C:\ path to \PURCHASE_ORDERS.csv"));
 var poList = csv.GetRecords<PONumbers>();
 ....

 var csv2 = new CsvReader(new StreamReader(@"C:\ path to \VENDOR_DETAILS.csv"));
 var vendorList = csv2.GetRecords<Vendors>();
 ....

 int rc = client.Login(user, pwd); // rc==1 indicates success

 //upload PPO info.
 client.addPurchaseOrders(po.ToArray(), exporttarget.XERO);
 
 //now lets upload the supplier info.
 client.addContacts(ven.ToArray(), exporttarget.XERO);

 

Converting Invoice to XML file

 

The following program will upload an invoice from your computer to EzzyBills then download the results as an XML file

for example,

 

c:\>EzzyClientToXML.exe  frank blah taxinvoice.pdf
status=uploaded_invoice
Writing output file= 700411.xml

 

EzzyClientToXML.zip

 

The output file will contain the invoice data. You can then extract this xml data and insert it into any Accounting package etc.

<InvoiceBlocksSS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ExtensionData/>
<invoiceForm>
<ExtensionData/>
<ABNnumber>14601156281</ABNnumber>
<RefNumber/>
<chargeTotal>0</chargeTotal>
<discountTotal>0</discountTotal>
<docType>Invoice</docType>
<gstTotal>50.0000</gstTotal>
<invoiceDate>2016-08-23T00:00:00</invoiceDate>
<invoiceNumber>9922</invoiceNumber>
<invoiceTotal>550.0000</invoiceTotal>
<paymentDate xsi:nil="true"/>
<purchaseOrder/>
<subTotal>500.0000</subTotal>
<supplierName/>
<tag>BLAH</tag>
</invoiceForm>
<list>...</list>
<service_status>
<ExtensionData/>
<invoice_id>700411</invoice_id>
<message/>
<status>OK</status>
</service_status>
<table>
<InvoiceRow>
<ExtensionData/>
<article_code/>
<description>Annual subscription for EzzyBills- 6000 Invoices</description>
<gl_code/>
<gst>0</gst>
<quantity>0</quantity>
<row_height>44</row_height>
<row_page>0</row_page>
<row_y>1445</row_y>
<total>500.00</total>
<unit_price>0</unit_price>
</InvoiceRow>
</table>
</InvoiceBlocksSS>

 

Samples that use the EzzyBills  REST API

 

EzzyBills also supports a REST (JSON) API. For example, the following sample logs into your  EzzyBills account and downloads the last 10 invoices processed.


You can download the full sample here EzzyRestClient

 

RestClient client = new RestClient("https://app.ezzydoc.com/EzzyService.svc/");
client.AddDefaultParameter("APIKey", " add your API key"); //need to add your API key

RestRequest login = new RestRequest("/Rest/Login");

login.AddParameter("user", args[0]);
login.AddParameter("pwd", args[1]);


IRestResponse response = client.Execute(login);

CookieContainer cookiecon = new CookieContainer();
var cookie = response.Cookies.FirstOrDefault();
cookiecon.Add(new Cookie(cookie.Name, cookie.Value, cookie.Path, cookie.Domain));
client.CookieContainer = cookiecon;

RestRequest qdata = new RestRequest("/Rest/getMyInvoiceQueue?page=1&size=10&filter=Ordered"); //get the last 10 invoices
response = client.Execute(qdata);