Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit ec43da2

Browse files
committed
Update readme
1 parent c2cffcd commit ec43da2

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,37 @@ $ composer require marcortola/cuentica
1717
Usage
1818
------------
1919
```php
20-
TODO
20+
use MarcOrtola\Cuentica\CuenticaClient;
21+
22+
$cuenticaClient = CuenticaClient::create('your_auth_token');
23+
24+
// Find a customer by ID.
25+
$customer = $cuenticaClient->customer()->customer(1);
26+
27+
// Update a customer by ID.
28+
$customer = $cuenticaClient->customer()->customer(1);
29+
$customer->setCountryCode('US');
30+
$cuenticaClient->customer()->update($customer);
31+
32+
// Create a customer (it's individual, but can be a company or a generic one).
33+
$customer = new Individual(
34+
'My street',
35+
'My City',
36+
'40100',
37+
'44444444I',
38+
'My region',
39+
'My name',
40+
'My surname'
41+
);
42+
$cuenticaClient->customer()->create($customer);
43+
44+
// Create an invoice.
45+
$invoice = new Invoice(
46+
true,
47+
[new InvoiceLine(1, 'Concept', 100, 2, 10, 4)],
48+
[new Charge(false, 103.88, 'other', 42133)]
49+
);
50+
$cuenticaClient->invoice()->create($invoice);
2151
```
2252
Read the Cuéntica API documentation [here](https://apidocs.cuentica.com/versions/latest_release/).
2353

0 commit comments

Comments
 (0)