onfact / onfact-api-php
PHP Classes to help connect to the onFact API
Installs: 28
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/onfact/onfact-api-php
Requires (Dev)
- codeception/codeception: ^2.1
This package is not auto-updated.
Last update: 2025-09-28 01:17:34 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
?>