Skip to content
Dozey edited this page Jul 28, 2011 · 19 revisions

Hi there!

You've found XeroAPI, a work-in-progress c# / .NET client for Xero's API. The entire project is basically just thrown together at this point, but private applications do work.

The preliminary features include:

  • Read-only access
  • 2-legged OAuth for private applications
  • Linq support for a subset of data exposed by the Xero API
  • Partial object mapping from XML
  • WCF client based on Linq-to-XML (XElement etc., very easy to work with!)

Before starting, make note of the following:

  • All transport level functionality is handled by WCF
  • OAuth functionality has only partially been integrated with WCF. It's rough around the edges, and there's presently no error handling.
  • Linq support is just tacked on and there's no explicit documentation for the scope of query parameters exposed by Xero.
  • Reiteration: this project is hacked together and incomplete

OAuth functionality is provided by the OAuth.net library which you can download here.

Usage

XeroApplication xeroApp = XeroApplication.CreatePrivateApplication("key", "secret", @"./ppk.pfx", "pw");

// All invoices
var invoices = from invoice in xeroApp.Invoices select invoice;

// Overdue invoices
var overdueInvoices = from invoice in xeroApp.Invoices where
    invoice.Type == "ACCREC" &&
    invoice.AmountDue > 0 &&
    invoice.DueDate < DateTime.Now
select invoice;

Help?

There isn't any, really. Touch base with me via email (dozey@epimper.com) if need be - preferably with a paid offer.