C#.NET and the WordPress Woocommerce API

Recently a client wanted a simple line of business iOS and Android app to handle the processing of tickets in a line. After sticking together a simple UI – complete with a QR scanner, I needed to tackle the real issue; The event/ticket data was located in a WordPress Woocommerce backend!

This was a little intimidating at first, thinking that I would have to write my own PHP service to surface the data I needed. Luckily for me, I found that Woocommerce has a handy little REST API that just needs to be enabled!

I slapped together a simple C#.NET Portable Class Library to target my desired platforms on Xamarin using Xamarin forms (iOS, Android and Windows) and was binding the data to views/controls in minutes.

In true open source spirit I decided to stick the code up for others. So should you have a need for the code, you can find the Git repo here: https://bitbucket.org/lukejkw/woocommerceapiclient/

Please note I implement the GET request, to suite my needs. When I get the time (or receive a request from a loving follower/reader) I will kit out the other methods. Also, the benefit of my wrapper class is that it will work in a PCL in Xamarin – there are other more fleshed out solutions.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s