marcortola / cuentica
Community API client for Cuéntica online management software
0.0.6
2023-02-03 12:01 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- php-http/discovery: ^1.7
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- phpstan/phpstan: ^0.12.14
- phpstan/phpstan-strict-rules: ^0.12.2
- phpunit/phpunit: ^9
- symplify/easy-coding-standard: 11.1.19
README
Installation
- Install Composer
- Execute:
$ composer require marcortola/cuentica
Usage examples
use MarcOrtola\Cuentica\CuenticaClient; $cuenticaClient = CuenticaClient::create('your_auth_token'); // Find a customer by ID. $customer = $cuenticaClient->customer()->customer(1); // Update a customer by ID. $customer = $cuenticaClient->customer()->customer(1); $customer->setCountryCode('US'); $cuenticaClient->customer()->update($customer); // Delete a customer by ID. $cuenticaClient->customer()->delete(1); // Search customers. $customers = $cuenticaClient->customer()->search('my query string', $pageSize, $page); // Create a customer (it's individual, but can be a company or a generic one). $customer = new Individual( 'My street', 'My City', '40100', '44444444I', 'My region', 'My name', 'My surname' ); $cuenticaClient->customer()->create($customer); // Create an invoice. $invoice = new Invoice( true, [new InvoiceLine(1, 'Concept', 100, 2, 10, 4)], [new Charge(false, 103.88, 'other', 42133)] ); $cuenticaClient->invoice()->create($invoice); // Get invoice PDF contents. $pdfContents = $cuenticaClient->invoice()->pdf(1); // Find an invoice by ID. $pdfContents = $cuenticaClient->invoice()->invoice(1);
Read the Cuéntica API documentation here.
License
Licensed under the MIT License. See License File for more information about it.