@kreiseck/kasseneck-api 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +75 -0
  3. package/dist/cjs/client/aufrufe.d.ts +1 -1
  4. package/dist/cjs/client/aufrufe.js +12 -0
  5. package/dist/cjs/rechnung/api.d.ts +45 -0
  6. package/dist/cjs/rechnung/api.js +36 -0
  7. package/dist/cjs/rechnung/auth.d.ts +21 -0
  8. package/dist/cjs/rechnung/auth.js +36 -0
  9. package/dist/cjs/rechnung/endpunkte.d.ts +54 -0
  10. package/dist/cjs/rechnung/endpunkte.js +147 -0
  11. package/dist/cjs/rechnung/fehler.d.ts +21 -0
  12. package/dist/cjs/rechnung/fehler.js +44 -0
  13. package/dist/cjs/rechnung/index.d.ts +18 -0
  14. package/dist/cjs/rechnung/index.js +54 -0
  15. package/dist/cjs/rechnung/typen.d.ts +238 -0
  16. package/dist/cjs/rechnung/typen.js +9 -0
  17. package/dist/cjs/rechnung/vertrag.d.ts +113 -0
  18. package/dist/cjs/rechnung/vertrag.js +218 -0
  19. package/dist/esm/client/aufrufe.d.ts +1 -1
  20. package/dist/esm/client/aufrufe.js +12 -0
  21. package/dist/esm/rechnung/api.d.ts +45 -0
  22. package/dist/esm/rechnung/api.js +33 -0
  23. package/dist/esm/rechnung/auth.d.ts +21 -0
  24. package/dist/esm/rechnung/auth.js +33 -0
  25. package/dist/esm/rechnung/endpunkte.d.ts +54 -0
  26. package/dist/esm/rechnung/endpunkte.js +133 -0
  27. package/dist/esm/rechnung/fehler.d.ts +21 -0
  28. package/dist/esm/rechnung/fehler.js +39 -0
  29. package/dist/esm/rechnung/index.d.ts +18 -0
  30. package/dist/esm/rechnung/index.js +17 -0
  31. package/dist/esm/rechnung/typen.d.ts +238 -0
  32. package/dist/esm/rechnung/typen.js +8 -0
  33. package/dist/esm/rechnung/vertrag.d.ts +113 -0
  34. package/dist/esm/rechnung/vertrag.js +215 -0
  35. package/fixtures/hobex-hps-codes.json +1 -1
  36. package/fixtures/kasse-texte.json +1 -1
  37. package/fixtures/oberflaeche.json +101 -1
  38. package/fixtures/rechnung-api-beispiele/credit-fehler-grund.json +24 -0
  39. package/fixtures/rechnung-api-beispiele/credit-ok.json +20 -0
  40. package/fixtures/rechnung-api-beispiele/customer-fehler-uid.json +25 -0
  41. package/fixtures/rechnung-api-beispiele/customer-get-fehler-beide.json +15 -0
  42. package/fixtures/rechnung-api-beispiele/customer-ok.json +20 -0
  43. package/fixtures/rechnung-api-beispiele/customer-search-fehler-leer.json +14 -0
  44. package/fixtures/rechnung-api-beispiele/issue-brutto-20.json +27 -0
  45. package/fixtures/rechnung-api-beispiele/issue-fehler-cent.json +26 -0
  46. package/fixtures/rechnung-api-beispiele/issue-fehler-menge.json +26 -0
  47. package/fixtures/rechnung-api-beispiele/issue-fehler-negativ.json +26 -0
  48. package/fixtures/rechnung-api-beispiele/issue-fehler-satz.json +26 -0
  49. package/fixtures/rechnung-api-beispiele/issue-fehler-unbekannt.json +27 -0
  50. package/fixtures/rechnung-api-beispiele/issue-gemischt.json +33 -0
  51. package/fixtures/rechnung-api-beispiele/issue-kleinunternehmer.json +27 -0
  52. package/fixtures/rechnung-api-beispiele/issue-netto-20.json +28 -0
  53. package/fixtures/rechnung-api-beispiele/issue-rabatt.json +28 -0
  54. package/fixtures/rechnung-api-beispiele/setup-status-fehler-feld.json +14 -0
  55. package/fixtures/rechnung-api-beispiele/setup-status-ok.json +8 -0
  56. package/fixtures/rechnung-api.schema.json +681 -0
  57. package/package.json +12 -1
@@ -1,8 +1,11 @@
1
1
  {
2
- "version": "0.14.0",
2
+ "version": "0.16.0",
3
3
  "aufrufe": [
4
4
  "activateCashregister",
5
+ "cancelInvoice",
5
6
  "cancelReceipt",
7
+ "createCreditNote",
8
+ "createCustomer",
6
9
  "createCustomerCashregister",
7
10
  "createPartnerCustomer",
8
11
  "checkPartnerCustomerEmail",
@@ -16,9 +19,14 @@
16
19
  "endRegisterSession",
17
20
  "financeWebService",
18
21
  "generateFullReceiptId",
22
+ "getCustomer",
19
23
  "getCustomerCredentials",
20
24
  "getCustomerSignatureStatus",
21
25
  "getFirstReceiptDate",
26
+ "getInvoice",
27
+ "getInvoicePdf",
28
+ "getInvoiceSetupStatus",
29
+ "getInvoiceXml",
22
30
  "getKasseSettings",
23
31
  "getPartnerCustomer",
24
32
  "getPartnerInfo",
@@ -26,7 +34,9 @@
26
34
  "getReceipt",
27
35
  "hobexPayApi",
28
36
  "hobexRefundApi",
37
+ "issueInvoice",
29
38
  "listCustomerCashregisters",
39
+ "listInvoices",
30
40
  "listMyArticleGroups",
31
41
  "listMyArticles",
32
42
  "listMyCashregisters",
@@ -43,6 +53,7 @@
43
53
  "registerUserLogin",
44
54
  "renewRegisterSession",
45
55
  "requestCustomerSignature",
56
+ "searchCustomers",
46
57
  "sendPartnerCustomerFonLink",
47
58
  "sendPartnerWebhookTest",
48
59
  "sendReceiptEmail",
@@ -51,6 +62,7 @@
51
62
  "stripeCaptureIntent",
52
63
  "unpairRegisterDevice",
53
64
  "rotatePartnerWebhookSecret",
65
+ "updateCustomer",
54
66
  "updatePartnerWebhook"
55
67
  ],
56
68
  "enums": {
@@ -348,5 +360,93 @@
348
360
  "test",
349
361
  "data"
350
362
  ]
363
+ },
364
+ "rechnung": {
365
+ "creditNoteReasons": [
366
+ "cancellation",
367
+ "price_reduction",
368
+ "return",
369
+ "incorrect_invoice",
370
+ "other"
371
+ ],
372
+ "customerTypes": [
373
+ "private",
374
+ "company"
375
+ ],
376
+ "docTypes": [
377
+ "RE",
378
+ "GU"
379
+ ],
380
+ "einvoiceFormats": [
381
+ "ubl",
382
+ "cii"
383
+ ],
384
+ "invoiceErrorCodes": [
385
+ "validation",
386
+ "idempotency_conflict",
387
+ "module_inactive",
388
+ "customer_not_found",
389
+ "customer_exists",
390
+ "short_code_taken",
391
+ "short_code_immutable",
392
+ "recipient_required",
393
+ "invoice_requirements_missing",
394
+ "invoice_not_found",
395
+ "invoice_ambiguous",
396
+ "not_cancellable",
397
+ "partial_credit_exists",
398
+ "credit_exceeds_invoice",
399
+ "einvoice_incomplete",
400
+ "invoice_api_not_enabled",
401
+ "invoice_setup_incomplete"
402
+ ],
403
+ "invoiceListStatus": [
404
+ "final",
405
+ "paid",
406
+ "cancelled",
407
+ "open",
408
+ "overdue"
409
+ ],
410
+ "invoiceSetupRequirements": [
411
+ "module_active",
412
+ "api_enabled",
413
+ "live_enabled",
414
+ "business_name",
415
+ "address",
416
+ "vat_id",
417
+ "bank_account",
418
+ "number_format"
419
+ ],
420
+ "priceModes": [
421
+ "net",
422
+ "gross"
423
+ ],
424
+ "rechnungAufrufe": [
425
+ "createCustomer",
426
+ "getCustomer",
427
+ "updateCustomer",
428
+ "searchCustomers",
429
+ "issueInvoice",
430
+ "cancelInvoice",
431
+ "createCreditNote",
432
+ "getInvoice",
433
+ "listInvoices",
434
+ "getInvoicePdf",
435
+ "getInvoiceXml",
436
+ "getInvoiceSetupStatus"
437
+ ],
438
+ "taxSchemes": [
439
+ "normal",
440
+ "smallBusiness",
441
+ "reverseCharge",
442
+ "igLieferung",
443
+ "exportThirdCountry"
444
+ ],
445
+ "vatRates": [
446
+ 0,
447
+ 10,
448
+ 13,
449
+ 20
450
+ ]
351
451
  }
352
452
  }
@@ -0,0 +1,24 @@
1
+ {
2
+ "aufruf": "createCreditNote",
3
+ "beschreibung": "Unbekannter Grund",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-12",
6
+ "invoiceId": "rechnung_beispiel",
7
+ "reason": "storno",
8
+ "items": [
9
+ {
10
+ "description": "Nachlass",
11
+ "quantity": 1,
12
+ "unitPriceCents": 5000,
13
+ "vatRate": 20
14
+ }
15
+ ]
16
+ },
17
+ "erwartet": {
18
+ "ok": false,
19
+ "code": "validation",
20
+ "fields": [
21
+ "reason"
22
+ ]
23
+ }
24
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "aufruf": "createCreditNote",
3
+ "beschreibung": "Teilgutschrift als Preisnachlass",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-11",
6
+ "invoiceId": "rechnung_beispiel",
7
+ "reason": "price_reduction",
8
+ "items": [
9
+ {
10
+ "description": "Nachlass Beratung",
11
+ "quantity": 1,
12
+ "unitPriceCents": 5000,
13
+ "vatRate": 20
14
+ }
15
+ ]
16
+ },
17
+ "erwartet": {
18
+ "ok": true
19
+ }
20
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "aufruf": "createCustomer",
3
+ "beschreibung": "UID-Nummer im falschen Format",
4
+ "anfrage": {
5
+ "customer": {
6
+ "type": "company",
7
+ "name": "Café Muster GmbH",
8
+ "street": "Hauptplatz",
9
+ "houseNumber": "3",
10
+ "zip": "1010",
11
+ "city": "Wien",
12
+ "country": "AT",
13
+ "email": "rechnung@cafe-muster.example",
14
+ "externalId": "shop-4711",
15
+ "vatId": "ATU1"
16
+ }
17
+ },
18
+ "erwartet": {
19
+ "ok": false,
20
+ "code": "validation",
21
+ "fields": [
22
+ "customer.vatId"
23
+ ]
24
+ }
25
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "aufruf": "getCustomer",
3
+ "beschreibung": "Genau eine Kennung angeben",
4
+ "anfrage": {
5
+ "customerId": "kunde_beispiel",
6
+ "externalId": "shop-4711"
7
+ },
8
+ "erwartet": {
9
+ "ok": false,
10
+ "code": "validation",
11
+ "fields": [
12
+ "customerId"
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "aufruf": "createCustomer",
3
+ "beschreibung": "Firmenkunde mit Kennung aus dem Shop",
4
+ "anfrage": {
5
+ "customer": {
6
+ "type": "company",
7
+ "name": "Café Muster GmbH",
8
+ "street": "Hauptplatz",
9
+ "houseNumber": "3",
10
+ "zip": "1010",
11
+ "city": "Wien",
12
+ "country": "AT",
13
+ "email": "rechnung@cafe-muster.example",
14
+ "externalId": "shop-4711"
15
+ }
16
+ },
17
+ "erwartet": {
18
+ "ok": true
19
+ }
20
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "aufruf": "searchCustomers",
3
+ "beschreibung": "Suche ohne Suchbegriff",
4
+ "anfrage": {
5
+ "limit": 10
6
+ },
7
+ "erwartet": {
8
+ "ok": false,
9
+ "code": "validation",
10
+ "fields": [
11
+ "externalId"
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Bruttopreis: der Server rechnet die USt heraus",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-2",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "gross",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Frühstück",
13
+ "quantity": 1,
14
+ "unitPriceCents": 1200,
15
+ "vatRate": 20
16
+ }
17
+ ]
18
+ },
19
+ "erwartet": {
20
+ "ok": true,
21
+ "totals": {
22
+ "netCents": 1000,
23
+ "vatCents": 200,
24
+ "grossCents": 1200
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Beträge in ganzen Cent",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-9",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Beratung",
13
+ "quantity": 1,
14
+ "unitPriceCents": 12.5,
15
+ "vatRate": 20
16
+ }
17
+ ]
18
+ },
19
+ "erwartet": {
20
+ "ok": false,
21
+ "code": "validation",
22
+ "fields": [
23
+ "items[0].unitPriceCents"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Menge null",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-10",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Beratung",
13
+ "quantity": 0,
14
+ "unitPriceCents": 5000,
15
+ "vatRate": 20
16
+ }
17
+ ]
18
+ },
19
+ "erwartet": {
20
+ "ok": false,
21
+ "code": "validation",
22
+ "fields": [
23
+ "items[0].quantity"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Negativer Preis gehört in eine Gutschrift",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-7",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Nachlass",
13
+ "quantity": 1,
14
+ "unitPriceCents": -1,
15
+ "vatRate": 20
16
+ }
17
+ ]
18
+ },
19
+ "erwartet": {
20
+ "ok": false,
21
+ "code": "validation",
22
+ "fields": [
23
+ "items[0].unitPriceCents"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Steuerfreies Schema mit USt-Satz",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-6",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "smallBusiness",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Reparatur",
13
+ "quantity": 1,
14
+ "unitPriceCents": 5000,
15
+ "vatRate": 20
16
+ }
17
+ ]
18
+ },
19
+ "erwartet": {
20
+ "ok": false,
21
+ "code": "validation",
22
+ "fields": [
23
+ "items[0].vatRate"
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Die Nummer vergibt der Server",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-8",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Beratung",
13
+ "quantity": 1,
14
+ "unitPriceCents": 5000,
15
+ "vatRate": 20
16
+ }
17
+ ],
18
+ "number": "2026-0001"
19
+ },
20
+ "erwartet": {
21
+ "ok": false,
22
+ "code": "validation",
23
+ "fields": [
24
+ "number"
25
+ ]
26
+ }
27
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Zwei Steuersätze auf einer Rechnung",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-4",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Beratung",
13
+ "quantity": 1,
14
+ "unitPriceCents": 10000,
15
+ "vatRate": 20
16
+ },
17
+ {
18
+ "description": "Buch",
19
+ "quantity": 1,
20
+ "unitPriceCents": 5000,
21
+ "vatRate": 10
22
+ }
23
+ ]
24
+ },
25
+ "erwartet": {
26
+ "ok": true,
27
+ "totals": {
28
+ "netCents": 15000,
29
+ "vatCents": 2500,
30
+ "grossCents": 17500
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Kleinunternehmer: USt-Satz 0",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-5",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "smallBusiness",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Reparatur",
13
+ "quantity": 1,
14
+ "unitPriceCents": 5000,
15
+ "vatRate": 0
16
+ }
17
+ ]
18
+ },
19
+ "erwartet": {
20
+ "ok": true,
21
+ "totals": {
22
+ "netCents": 5000,
23
+ "vatCents": 0,
24
+ "grossCents": 5000
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Zwei Positionen netto zu 20 %",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-1",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Beratung",
13
+ "quantity": 2,
14
+ "unitPriceCents": 5000,
15
+ "vatRate": 20,
16
+ "unit": "Std"
17
+ }
18
+ ]
19
+ },
20
+ "erwartet": {
21
+ "ok": true,
22
+ "totals": {
23
+ "netCents": 10000,
24
+ "vatCents": 2000,
25
+ "grossCents": 12000
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "aufruf": "issueInvoice",
3
+ "beschreibung": "Zeilenrabatt, gerundet wie auf dem PDF",
4
+ "anfrage": {
5
+ "idempotencyKey": "bsp-3",
6
+ "customerId": "kunde_beispiel",
7
+ "taxScheme": "normal",
8
+ "priceMode": "net",
9
+ "serviceStart": "2026-09-14",
10
+ "items": [
11
+ {
12
+ "description": "Kaffee",
13
+ "quantity": 3,
14
+ "unitPriceCents": 999,
15
+ "vatRate": 20,
16
+ "discountPct": 10
17
+ }
18
+ ]
19
+ },
20
+ "erwartet": {
21
+ "ok": true,
22
+ "totals": {
23
+ "netCents": 2697,
24
+ "vatCents": 539,
25
+ "grossCents": 3236
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "aufruf": "getInvoiceSetupStatus",
3
+ "beschreibung": "Der Status kennt keine Parameter",
4
+ "anfrage": {
5
+ "environment": "live"
6
+ },
7
+ "erwartet": {
8
+ "ok": false,
9
+ "code": "validation",
10
+ "fields": [
11
+ "environment"
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "aufruf": "getInvoiceSetupStatus",
3
+ "beschreibung": "Einrichtung abfragen, ohne Parameter",
4
+ "anfrage": {},
5
+ "erwartet": {
6
+ "ok": true
7
+ }
8
+ }