This opensource project is about procountor API
use Procountor\Interfaces\LoggerInterface;
$yourLogger = new class() implements LoggerInterface {....}
$client = new Client($yourLogger);
$client->authenticateByApiKey(
$clientId,
$clientSecret,
$redirectUri,
$apiKey,
$company
);
This is how to connect to invoices's API endpoint:
$invoicesApi = new Invoices($client);
$invoices = $invoicesApi->get();
To get an invoice with ID = 1212:
$invoicesApi->get(1212);
To post a new invoice, you need first to implement your own adapter:
$newInvoice = new class($yourdata) implements \Procountor\Interfaces\Write\Invoice {
private $data;
public function __construct($yourdata) {
$this->data = $yourdata;
}
// then create the related getters:
public function getPartnerId() {
return $this->data->partnerid;
}
// ...etc
}
Finally you can properly post the invoice:
$invoice = $invoicesApi->post($newInvoice)
Documents about developing this project can be found under /doc
directory