A Symfony2 bundle for working with Moneybird
This bundle uses the official Moneybird PHP API created by Sjors van der Pluijm.
php composer.phar require ruudk/moneybird-bundle
Enable the bundle in the kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Ruudk\MoneybirdBundle\RuudkMoneybirdBundle(),
);
}
Finally, add the following to your config.yml
# app/config/config_prod.yml
ruudk_moneybird:
subdomain: # Subdomain
username: # Username
password: # Password
Congratulations! You're ready.
$moneybird = $this->container->get('moneybird.api');
$contactService = $moneybird->getService('Contact');
$contacts = $contactService->getAll();
foreach($contacts AS $contact) {
echo $contact->name . "<br>";
}
For full usage of the Moneybird API see the documentation.
If you want to reset your Moneybird account and delete all invoices and contacts you can run:
php app/console moneybird:reset