Connection to the rest of the world

The API of MoneyBird enables you to access the information inside a MoneyBird account. The API is RESTfull and uses XML for the data representation. On this page you can find all information about the API. Don't hesitate to contact us with your questions on info@moneybird.nl.

For Ruby-on-Rails programmers: don't forget to use ActiveResource! If you want to use the MoneyBird API with PHP, please take a look at the PHP library on GitHub.

Example Activeresource invoice create

← Back to API documentation
 1 require 'rubygems'
 2 require 'active_resource'
 3 
 4 # Define the ActiveResource class for communication with the API
 5 class Contact < ActiveResource::Base
 6   self.site         = "https://bluetools.moneybird.nl"
 7   self.user         = "admin"
 8   self.password     = "testtest"
 9 end
10 
11 class Invoice < ActiveResource::Base
12   self.site         = "https://bluetools.moneybird.nl"
13   self.user         = "admin"
14   self.password     = "testtest"
15 end
16 
17 
18 # First, create a new contact
19 contact       = Contact.new
20 contact.name  = "Example company"
21 contact.email = "test@test.com"
22 
23 if contact.save
24   puts "Contact saved"
25 else
26   puts contact.errors.inspect
27 end
28 
29 # Then, create a new invoice based on the contact
30 invoice               = Invoice.new
31 invoice.contact_id    = contact.id
32 invoice.details_attributes = [
33   { :description => "First line", :price => 1302.50 },
34   { :description => "Second line", :price => 103.48 }
35   ]
36   
37 if invoice.save
38   puts "Invoice saved"
39 else
40   puts invoice.errors.inspect
41 end
42