onfact/onfact-api-php

PHP Classes to help connect to the onFact API

1.0.2 2017-04-06 17:55 UTC

This package is not auto-updated.

Last update: 2024-05-25 17:46:18 UTC


README

Build

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
?>

© onFact Facturatie Software