Ruby API wrapper for the fastbill.com API
NOTE: This is work in progress and not yet available as a gem.
Add this line to your application's Gemfile:
gem 'fastbill', :git => "git://github.com/philklei/fastbill.git"
And then execute:
bundle
Or install it yourself as:
gem install fastbill
Fastbill::Configuration.configure do |config|
config.email = "your@email.com"
config.api_key = "yourverysecretapikey"
end
Fastbill::Customer.all
Fastbill::Customer.find_by_country("de")
Fastbill::Customer.find_by_id(12)
Fastbill::Customer.search("foo")
There are different required fields depending on e.g. customer_type. Please have a look at the fastbill api documentation.
Fastbill::Customer.create(last_name: "foo", first_name: "bar")
There are different required fields depending on e.g. invoice_type. Please have a look at the fastbill api documentation.
invoice = Fastbill::Invoice.new
invoice.customer_id = 1
invoice.invoice_date = Date.today
invoice.eu_delivery = 0
invoice.template_id = "yourtemplateid"
item = Fastbill::InvoiceItem.new
item.description = "You Item Desc"
item.quantity = 1
item.unit_price = 100.0
item.vat_percent = 19
invoice.items = []
invoice.items << item
invoice.save
There are different required fields depending on e.g. invoice_type. Please have a look at the fastbill api documentation.
expense = Fastbill::Expense.new
expense.invoice_date = Date.today
expense.organization = "Some Company"
expense.sub_total = 100.0
expense.var_total = 19.0
expense.save
Get all expenses in july
Fastbill::Expense.find_by_month("7")
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request