-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathexample.php
76 lines (67 loc) · 1.91 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
require_once(__DIR__.'/lexoffice-php-api.php');
// please add your API Key
$api_key = '';
$lexoffice = new lexoffice_client(array(
'api_key' => $api_key
));
// show active Webhooks
#print_r($lexoffice->get_events_all());
// create webhook
#print_r($lexoffice->add_event('contact.created', 'https://domain.tld/lexoffice-php-client/callback.php'));
// delete webhook
#print_r($lexoffice->delete_event('a8a0a5a6-0dc1-4c9b-bfaa-7de4d4a3d6a5'));
// get specific invoice
#echo '<pre>'.print_r($lexoffice->get_invoice('7f0f0f7f-dd61-4bf7-a9f7-a67b0530c7e9'), true).'</pre>';
// echo specific invoice number
#$invoice = $lexoffice->get_invoice('350d7ea4-63f9-44fb-a404-b4de167b4a8e');
#echo $invoice->voucherNumber;
// download invoice pdf
#$lexoffice->get_invoice_pdf('7f0f0f7f-dd61-4bf7-a9f7-a67b0530c7e9', 'test.pdf'), true);
// create draft invoice
/*
print_r($lexoffice->create_invoice(array(
'voucherDate' => substr(date('c'), 0, 19).'.000'.substr(date('c'), 19),
'introduction' => 'Einleitungstext',
'remark' => "Fußzeile\r\nMehrzeilig",
'address' => array(
#'contactId' => '<id>',
'name' => 'Frau Jane Doe',
'street' => 'Str. 1',
'zip' => '12345',
'city' => 'Stadt',
'countryCode' => 'DE',
),
'lineItems' => array(
array(
'type' => 'custom',
'name' => 'Produktname',
'description' => 'Beschreibung',
'quantity' => 1,
'unitName' => 'Stück',
'unitPrice' => array(
'currency' => 'EUR',
'netAmount' => 10.99,
'taxRatePercentage' => 19,
),
#'discountPercentage' => 0,
),
),
'totalPrice' => array(
'currency' => 'EUR',
#'totalDiscountAbsolute' => 0,
#'totalDiscountPercentage' => 0,
),
'taxConditions' => array(
'taxType' => 'net',
),
'shippingConditions' => array(
'shippingDate' => date(DATE_RFC3339_EXTENDED),
'shippingType' => 'delivery',
),
'paymentConditions' => array(
'paymentTermLabel' => 'Vorkasse',
'paymentTermDuration' => 1,
),
), false));
*/