@@ -25,33 +25,34 @@ You need an [API Key](https://app.lexoffice.de/addons/public-api) for that.
2525### Basic
2626``` php
2727// store keys in .env file
28- $apiKey = getenv('LEX_OFFICE_API_KEY ');
28+ $apiKey = getenv('LEXOFFICE_API_KEY ');
2929
3030// in this example we are using guzzlehttp/guzzle package, it can be any PSR-18 HTTP Client
3131// see: https://packagist.org/providers/psr/http-client-implementation
3232$httpClient = \GuzzleHttp\Client();
3333$api = new \Sysix\LexOffice\Api($apiKey, $httpClient);
3434```
3535
36- #### Optimize your HTTP Client
36+ ### Optimize your HTTP Client
3737
3838This library only prepares the ` \Psr\Http\Message\RequestInterface ` for the HTTP Client and returns its Response.
3939There are almost no error checks, no caching and no rate limiting. Your PSR-18 HTTP Client should come with a way to deal with it.
4040
4141Here is a example with ` guzzlehttp/guzzle ` , ` kevinrob/guzzle-cache-middleware ` and ` spatie/guzzle-rate-limiter-middleware ` :
4242
4343``` php
44- $apiKey = getenv('LEX_OFFICE_API_KEY ');
44+ $apiKey = getenv('LEXOFFICE_API_KEY ');
4545
4646$stack = \GuzzleHttp\HandlerStack();
4747$stack->push(new \Kevinrob\GuzzleCache\CacheMiddleware\CacheMiddleware(), 'cache');
4848$stack->push(\Spatie\GuzzleRateLimiterMiddleware\RateLimiterMiddleware\RateLimiterMiddleware::perSecond(2));
4949
5050$httpClient = \GuzzleHttp\Client(['handler' => $stack]);
5151$api = new \Sysix\LexOffice\Api($apiKey, $httpClient);
52-
5352```
5453
54+ ## Endpoints
55+
5556### Contact Endpoint
5657``` php
5758
@@ -85,21 +86,22 @@ $voucherList = $api->creditNote()->getVoucherListClient(); // see VoucherlistCli
8586$response = $api->creditNote()->get($entityId);
8687$response = $api->creditNote()->create($data);
8788$response = $api->creditNote()->create($data, true); // finalized
89+ $response = $api->creditNote()->pursue($precedingSalesVoucherId, $data);
90+ $response = $api->creditNote()->pursue($precedingSalesVoucherId, $data, true); // finalized
8891$response = $api->creditNote()->document($entityId); // get document ID
8992$response = $api->creditNote()->document($entityId, true); // get file content
9093$response = $api->creditNote()->document($entityId, true, 'image/*'); // accept only images
91- $response = $api->creditNote()->document($entityId, true, 'application/xml'); // get XRechung XML File (if possible)
9294```
9395
9496### Deliverys Notes Endpoint
9597``` php
9698$voucherList = $api->deliveryNote()->getVoucherListClient(); // see VoucherlistClient Documentation
9799$response = $api->deliveryNote()->get($entityId);
98100$response = $api->deliveryNote()->create($data);
101+ $response = $api->deliveryNote()->pursue($precedingSalesVoucherId, $data);
99102$response = $api->deliveryNote()->document($entityId); // get document ID
100103$response = $api->deliveryNote()->document($entityId, true); // get file content
101104$response = $api->deliveryNote()->document($entityId, true, 'image/*'); // accept only images
102- $response = $api->deliveryNote()->document($entityId, true, 'application/xml'); // get XRechung XML File (if possible)
103105```
104106
105107### Down Payment Invoices Endpoint
@@ -110,7 +112,6 @@ $response = $api->downPaymentInvoice()->create($data);
110112$response = $api->downPaymentInvoice()->document($entityId); // get document ID
111113$response = $api->downPaymentInvoice()->document($entityId, true); // get file content
112114$response = $api->downPaymentInvoice()->document($entityId, true, 'image/*'); // accept only images
113- $response = $api->downPaymentInvoice()->document($entityId, true, 'application/xml'); // get XRechung XML File (if possible)
114115```
115116
116117### Event Subscriptions Endpooint
@@ -135,6 +136,8 @@ $voucherList = $api->invoice()->getVoucherListClient(); // see VoucherlistClient
135136$response = $api->invoice()->get($entityId);
136137$response = $api->invoice()->create($data);
137138$response = $api->invoice()->create($data, true); // finalized
139+ $response = $api->invoice()->pursue($precedingSalesVoucherId, $data);
140+ $response = $api->invoice()->pursue($precedingSalesVoucherId, $data, true); // finalized
138141$response = $api->invoice()->document($entityId); // get document ID
139142$response = $api->invoice()->document($entityId, true); // get file content
140143$response = $api->invoice()->document($entityId, true, 'image/*'); // accept only images
@@ -146,10 +149,10 @@ $response = $api->invoice()->document($entityId, true, 'application/xml'); // ge
146149$voucherList = $api->orderConfirmation()->getVoucherListClient(); // see VoucherlistClient Documentation
147150$response = $api->orderConfirmation()->get($entityId);
148151$response = $api->orderConfirmation()->create($data);
152+ $response = $api->orderConfirmation()->pursue($precedingSalesVoucherId, $data);
149153$response = $api->orderConfirmation()->document($entityId); // get document ID
150154$response = $api->orderConfirmation()->document($entityId, true); // get file content
151155$response = $api->orderConfirmation()->document($entityId, true, 'image/*'); // accept only images
152- $response = $api->orderConfirmation()->document($entityId, true, 'application/xml'); // get XRechung XML File (if possible)
153156```
154157
155158### Payment Endpoint
@@ -181,7 +184,6 @@ $response = $api->quotation()->create($data, true); // finalized
181184$response = $api->quotation()->document($entityId); // get document ID
182185$response = $api->quotation()->document($entityId, true); // get file content
183186$response = $api->quotation()->document($entityId, true, 'image/*'); // accept only images
184- $response = $api->quotation()->document($entityId, true, 'application/xml'); // get XRechung XML File (if possible)
185187```
186188
187189### Recurring Templates Endpoint
@@ -258,6 +260,8 @@ $client->updatedDateTo = new \DateTime('2023-12-01');
258260$response = $client->getPage(0);
259261```
260262
263+ ## Utils
264+
261265### get JSON from Success and Error Response
262266
263267``` php
0 commit comments