jaakkom / procountor-php
PHP Procountor client
Installs: 17 891
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 4
Open Issues: 2
Requires
- php: >=7.2
- guzzlehttp/guzzle: ^7.0.1
Requires (Dev)
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
- vlucas/phpdotenv: ^5.3
This package is auto-updated.
Last update: 2024-04-20 09:00:32 UTC
README
Introduction
This opensource project is about procountor API
Start
use Procountor\Interfaces\LoggerInterface;
$yourLogger = new class() implements LoggerInterface {....}
$client = new Client($yourLogger);
$client->authenticateByApiKey(
$clientId,
$clientSecret,
$redirectUri,
$apiKey,
$company
);
API connection
This is how to connect to invoices's API endpoint:
$invoicesApi = new Invoices($client);
Search invoices
$invoices = $invoicesApi->get();
Get an invoice
To get an invoice with ID = 1212:
$invoicesApi->get(1212);
Posting a new invoice
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)
Developing
Documents about developing this project can be found under /doc
directory