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 Invoice create

← Back to API documentation
 1 require 'rubygems'
 2 require 'curb'
 3 
 4 # Create a new Curl instance with the correct accept and content-type headers
 5 c = Curl::Easy.new do |curl|
 6   curl.headers["Accept"] = "application/xml"
 7   curl.headers["Content-Type"] = "application/xml"
 8   curl.http_auth_types = Curl::CURLAUTH_BASIC
 9   curl.userpwd = "admin:testtest"
10 end
11 
12 c.url = "http://bluetools.moneybird.local/invoices.xml"
13 
14 # All information not supplied (like invoice_id, invoice_date and currency)
15 # are copied from the settings or other defaults are used.
16 new_invoice_xml = '<invoice>
17   <name>Bakkerij Jansen</name>
18   <address1>Straatnaam 12</address1>
19   <zipcode>1234AB</zipcode>
20   <city>Amsterdam</city>
21   <details_attributes type="array">
22     <detail>
23       <amount>1</amount>
24       <description>Levering toonbank</description>
25       <price>12345.60</price>
26       <tax>0.19</tax>
27     </detail>
28   </details_attributes>
29 </invoice>'
30 
31 # Create a post request
32 c.http_post(new_invoice_xml)
33 
34 # Check if the request is successfull
35 if c.response_code == 201
36   puts "Created invoice successfully"
37   puts c.body_str
38 else
39   puts "Error creating invoice:"
40   puts c.body_str
41 end