onfact / onfact-api-php
PHP Classes to help connect to the onFact API
1.0.2
2017-04-06 17:55 UTC
Requires (Dev)
- codeception/codeception: ^2.1
This package is not auto-updated.
Last update: 2025-04-26 23:15:32 UTC
README
onFact-API-PHP
PHP classes that can be used to connect to the onFact API
Supported endpoints:
- Contacts (customers)
- ContactPeople
- Invoices
- Proposals
- Productgroups
- Products
- Documentevents
- Attachments
Easy setup
Installation using composer:
composer require onfact/onfact-php-api
Include composer autoload (modify path as needed):
<?PHP
require_once('vendor/autoload.php');
?>
Connect and use API
<?PHP
define('ONFACT_API_KEY', '...');
$onFact = new onFact\Api(ONFACT_API_KEY);
$id = $onFact->Customers->add(array(
'Contact' => array(
'name' => 'John Dhoe',
)
));
$customer = $onFact->Customer->view($id);
echo $customer['Contact']['name']; // John Dhoe
?>