Skip to content

Commit c192de2

Browse files
committed
docs: added usage and link jitpack
1 parent 2a90720 commit c192de2

File tree

2 files changed

+88
-2
lines changed

2 files changed

+88
-2
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 rocketbase.io software productions GmbH
3+
Copyright (c) 2021 rocketbase.io software productions GmbH
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,89 @@
11
# Java Client of Lexoffice API
22

3-
This project is a Java client for the public [lexoffice--developer-api](https://developers.lexoffice.io/s).
3+
This project is a Java client for the public [lexoffice--developer-api](https://developers.lexoffice.io).
4+
5+
## Maven
6+
7+
The project is currently not published on maven-central you can easily use it via [jitpack.io](https://jitpack.io/#rocketbase-io/lexoffice-api/)
8+
9+
## Usage
10+
11+
### Query Contacts
12+
13+
````java
14+
LexofficeApi lexofficeApi = new LexofficeApiBuilder()
15+
.apiToken( "your-api-token")
16+
.build();
17+
18+
Page<Contact> resultList = lexofficeApi.contact().fetch()
19+
.customer(true)
20+
.get();
21+
````
22+
23+
### Create Invoice
24+
25+
````java
26+
LexofficeApi lexofficeApi = getLexofficeApi();
27+
28+
int daysToPay = 14;
29+
Invoice invoice = Invoice.builder()
30+
.title("Rechnung")
31+
.introduction("vielen Dank für Ihren Auftrag, den wir wie folgt berechnen:")
32+
.remark("Besten Dank und freundliche Grüße,")
33+
.language("de")
34+
.archived(false)
35+
.voucherDate(new Date())
36+
.paymentConditions(PaymentConditions.builder()
37+
.paymentTermLabel(String.format("Zahlung innerhalb von %d Tagen ab Rechnungseingang ohne Abzüge.", daysToPay))
38+
.paymentTermDuration(daysToPay)
39+
.build())
40+
.address(Address.builder()
41+
.contactId("contact-uuid")
42+
.build())
43+
.totalPrice(TotalPrice.builder()
44+
.currency(Currency.EUR)
45+
.totalNetAmount(BigDecimal.valueOf(31429, 2))
46+
.build())
47+
.shippingConditions(ShippingConditions.builder()
48+
.shippingDate(new Date())
49+
.shippingType(ShippingType.DELIVERY)
50+
.build())
51+
.taxConditions(new TaxConditions(TaxType.NET, ""))
52+
.lineItems(Arrays.asList(LineItem.builder()
53+
.type(LineItemType.CUSTOM)
54+
.name("Name")
55+
.description("Eine längere Beschreibung\nMehrzeilig funktioniert auch...")
56+
.unitName("Stück")
57+
.unitPrice(UnitPrice.builder()
58+
.netAmount(BigDecimal.valueOf(5055, 2))
59+
.taxRatePercentage(19)
60+
.currency(Currency.EUR)
61+
.build())
62+
.lineItemAmount(BigDecimal.valueOf(30330, 2))
63+
.quantity(BigDecimal.valueOf(6))
64+
.build(),
65+
LineItem.builder()
66+
.type(LineItemType.CUSTOM)
67+
.name("Second")
68+
.unitName("Stück")
69+
.unitPrice(UnitPrice.builder()
70+
.netAmount(BigDecimal.valueOf(1099, 2))
71+
.taxRatePercentage(19)
72+
.currency(Currency.EUR)
73+
.build())
74+
.lineItemAmount(BigDecimal.valueOf(1099, 2))
75+
.quantity(BigDecimal.valueOf(1))
76+
.build()))
77+
.build();
78+
79+
lexofficeApi.invoice().create().submit(invoice);
80+
````
81+
82+
### The MIT License (MIT)
83+
Copyright (c) 2021 rocketbase.io
84+
85+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
86+
87+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
88+
89+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)