ruby kashflow api

25-01-2011 @ 14:57   ·  By Paul   ·  Tagged: ruby

We've released (well, a couple weeks ago, but we're just getting this new & improved blog online), a ruby wrapper for the Kashflow API

Installation

gem install kashflow

Use

k = Kashflow.client('my_login', 'my_password')

# call the GetCustomers method
k.get_customers

# call the GetInvoices_Unpaid method
k.get_invoices_unpaid

# call a method with a parameter
k.get_customer_by_email(:customer_email => 'customer@example.com')

k.delete_invoice(:invoice_number => 5)

The full SOAP API should be usable. Any data returned will be stuffed into an OpenStruct so you can do something like:

customers = k.get_customers
customers.each do |cust|
  next unless cust.email.ends_with?('.co.uk')

  puts "#{cust.name}: #{cust.contact} - #{cust.website}"
end

Otherwise, there's not much code so if you have questions dig in, or contact dev@pogodan.com for help

blog comments powered by Disqus

© Copyright 2012 | All Rights Reserved | Pogodan Ltd | Registered in England 07429329