Last year I published a PHP API Helper class for the ever-growing Debitoor accounting software. The API is a RESTful API meaning it responds to JSON and HTTPS requests.
As I have got to use this class in projects of mine, I have built upon this class adding improvements and a new Debitoor class that will process your requests for you returning a clean PHP array ready for you to use.
So what has changed?
You can find a list below of what I changed in this release and some newly added files.
- Improvements to the API Helper Class
- Added a new Debitoor Class to process requests and return a PHP array.
- Added a example.php file to show you how to use this class.
//Debitoor API Class // Code by Daniel Roizer - http://thatblogger.co // v2.0 define(req_code, "REQUEST_CODE"); define(clientID, "CLIENT_ID"); define(clientSecret, "SECRET_KEY"); define(token, "TOKEN_FROM_API"); define(apiURL, "https://app.debitoor.com/api/v1.0/"); require_once("debitoorapi.class.php"); require_once("debitoor.class.php"); $debitoor = new Debitoor(); // Get list of clients as an array() print_r($debitoor->GetCustomers()); // Get list of products as an array() print_r($debitoor->GetProducts()); // Add a client print_r($debitoor->AddClient($name, $address, $phone, $email, $homepage, $cinumber, $vatnumber, $countrycode));