@kreiseck/kasseneck-api 1.1.1 → 1.2.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 (123) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +70 -0
  3. package/dist/cjs/client/aufrufe.d.ts +5 -5
  4. package/dist/cjs/client/aufrufe.js +21 -2
  5. package/dist/cjs/client/errors.d.ts +1 -1
  6. package/dist/cjs/client/errors.js +2 -1
  7. package/dist/cjs/client/receipts.d.ts +9 -1
  8. package/dist/cjs/client/receipts.js +18 -3
  9. package/dist/cjs/client/transport.d.ts +3 -3
  10. package/dist/cjs/client/transport.js +2 -2
  11. package/dist/cjs/index.d.ts +2 -2
  12. package/dist/cjs/index.js +6 -3
  13. package/dist/cjs/invoice/index.d.ts +2 -2
  14. package/dist/cjs/invoice/index.js +3 -1
  15. package/dist/cjs/invoice/typen.d.ts +13 -2
  16. package/dist/cjs/invoice/vertrag.d.ts +10 -1
  17. package/dist/cjs/invoice/vertrag.js +39 -2
  18. package/dist/cjs/models/cancellation.d.ts +14 -2
  19. package/dist/cjs/models/cancellation.js +15 -1
  20. package/dist/cjs/models/cashregister.d.ts +3 -0
  21. package/dist/cjs/models/cashregister.js +1 -0
  22. package/dist/cjs/models/index.d.ts +1 -1
  23. package/dist/cjs/models/index.js +4 -2
  24. package/dist/cjs/models/payment-errors.d.ts +1 -1
  25. package/dist/cjs/models/payment-errors.js +1 -0
  26. package/dist/cjs/models/receipt-email.d.ts +1 -1
  27. package/dist/cjs/models/receipt-email.js +1 -0
  28. package/dist/cjs/models/receipt-errors.d.ts +1 -1
  29. package/dist/cjs/models/receipt-errors.js +1 -0
  30. package/dist/cjs/models/receipt-item.d.ts +9 -0
  31. package/dist/cjs/models/receipt-item.js +5 -0
  32. package/dist/cjs/models/receipt.d.ts +1 -1
  33. package/dist/cjs/models/receipt.js +6 -1
  34. package/dist/cjs/pos/artikel.d.ts +14 -0
  35. package/dist/cjs/pos/artikel.js +13 -2
  36. package/dist/cjs/pos/errors.d.ts +3 -3
  37. package/dist/cjs/pos/errors.js +6 -2
  38. package/dist/cjs/pos/index.d.ts +5 -2
  39. package/dist/cjs/pos/index.js +13 -2
  40. package/dist/cjs/pos/lager.d.ts +95 -0
  41. package/dist/cjs/pos/lager.js +160 -0
  42. package/dist/cjs/register/errors.d.ts +1 -1
  43. package/dist/cjs/register/errors.js +1 -0
  44. package/dist/cjs/register/pairing.d.ts +27 -1
  45. package/dist/cjs/register/pairing.js +18 -1
  46. package/dist/cjs/stored/draht.d.ts +4 -2
  47. package/dist/cjs/stored/draht.js +46 -5
  48. package/dist/cjs/stored/vokabular.d.ts +1 -1
  49. package/dist/cjs/stored/vokabular.js +5 -3
  50. package/dist/cjs/version.d.ts +1 -1
  51. package/dist/cjs/version.js +1 -1
  52. package/dist/esm/client/aufrufe.d.ts +5 -5
  53. package/dist/esm/client/aufrufe.js +21 -2
  54. package/dist/esm/client/errors.d.ts +1 -1
  55. package/dist/esm/client/errors.js +2 -1
  56. package/dist/esm/client/receipts.d.ts +9 -1
  57. package/dist/esm/client/receipts.js +19 -4
  58. package/dist/esm/client/transport.d.ts +3 -3
  59. package/dist/esm/client/transport.js +2 -2
  60. package/dist/esm/index.d.ts +2 -2
  61. package/dist/esm/index.js +2 -2
  62. package/dist/esm/invoice/index.d.ts +2 -2
  63. package/dist/esm/invoice/index.js +1 -1
  64. package/dist/esm/invoice/typen.d.ts +13 -2
  65. package/dist/esm/invoice/vertrag.d.ts +10 -1
  66. package/dist/esm/invoice/vertrag.js +38 -1
  67. package/dist/esm/models/cancellation.d.ts +14 -2
  68. package/dist/esm/models/cancellation.js +13 -0
  69. package/dist/esm/models/cashregister.d.ts +3 -0
  70. package/dist/esm/models/cashregister.js +1 -0
  71. package/dist/esm/models/index.d.ts +1 -1
  72. package/dist/esm/models/index.js +1 -1
  73. package/dist/esm/models/payment-errors.d.ts +1 -1
  74. package/dist/esm/models/payment-errors.js +1 -0
  75. package/dist/esm/models/receipt-email.d.ts +1 -1
  76. package/dist/esm/models/receipt-email.js +1 -0
  77. package/dist/esm/models/receipt-errors.d.ts +1 -1
  78. package/dist/esm/models/receipt-errors.js +1 -0
  79. package/dist/esm/models/receipt-item.d.ts +9 -0
  80. package/dist/esm/models/receipt-item.js +5 -0
  81. package/dist/esm/models/receipt.d.ts +1 -1
  82. package/dist/esm/models/receipt.js +6 -1
  83. package/dist/esm/pos/artikel.d.ts +14 -0
  84. package/dist/esm/pos/artikel.js +13 -3
  85. package/dist/esm/pos/errors.d.ts +3 -3
  86. package/dist/esm/pos/errors.js +6 -2
  87. package/dist/esm/pos/index.d.ts +5 -2
  88. package/dist/esm/pos/index.js +6 -2
  89. package/dist/esm/pos/lager.d.ts +95 -0
  90. package/dist/esm/pos/lager.js +154 -0
  91. package/dist/esm/register/errors.d.ts +1 -1
  92. package/dist/esm/register/errors.js +1 -0
  93. package/dist/esm/register/pairing.d.ts +27 -1
  94. package/dist/esm/register/pairing.js +17 -1
  95. package/dist/esm/stored/draht.d.ts +4 -2
  96. package/dist/esm/stored/draht.js +45 -4
  97. package/dist/esm/stored/vokabular.d.ts +1 -1
  98. package/dist/esm/stored/vokabular.js +5 -3
  99. package/dist/esm/version.d.ts +1 -1
  100. package/dist/esm/version.js +1 -1
  101. package/fixtures/hobex-hps-codes.json +1 -1
  102. package/fixtures/invoice-api-examples/cancel-error-return-disposition.json +17 -0
  103. package/fixtures/invoice-api-examples/credit-error-return-disposition.json +26 -0
  104. package/fixtures/invoice-api-examples/credit-return-disposition.json +23 -0
  105. package/fixtures/invoice-api-examples/issue-error-return-disposition.json +25 -0
  106. package/fixtures/invoice-api-examples/issue-error-stock-id.json +27 -0
  107. package/fixtures/invoice-api-examples/issue-stock.json +22 -0
  108. package/fixtures/invoice-api.schema.json +37 -1
  109. package/fixtures/invoice-texts.json +1 -1
  110. package/fixtures/pos-texts.json +1 -1
  111. package/fixtures/surface.json +48 -4
  112. package/fixtures/v3/antworten/belege.json +1 -1
  113. package/fixtures/v3/antworten/belegmail.json +1 -1
  114. package/fixtures/v3/antworten/kasse-belege.json +1 -1
  115. package/fixtures/v3/antworten/kasse.json +662 -3
  116. package/fixtures/v3/antworten/rechnungen.json +1 -1
  117. package/fixtures/v3/antworten/storno.json +1 -1
  118. package/fixtures/v3/stored/belege.json +1 -1
  119. package/fixtures/v3/stored/kasse.json +58 -3
  120. package/fixtures/v3/stored/rechnungen.json +1 -1
  121. package/fixtures/v3/v3-vokabular.json +249 -16
  122. package/fixtures/v3/zahlbetrag-faelle.json +1 -1
  123. package/package.json +1 -1
@@ -42,6 +42,8 @@ export const ALL_CALLS = [
42
42
  'listMyCashregisters',
43
43
  'listMyPrinters',
44
44
  'listMyReceipts',
45
+ 'listMyStock',
46
+ 'listMyStockLocations',
45
47
  'listMyTipRecipients',
46
48
  'listPartnerCustomers',
47
49
  'listPartnerWebhookDeliveries',
@@ -59,6 +61,7 @@ export const ALL_CALLS = [
59
61
  'sendPartnerCustomerFonLink',
60
62
  'sendPartnerWebhookTest',
61
63
  'sendReceiptEmail',
64
+ 'setMyCashregisterStockLocation',
62
65
  'setMyKasseLogo',
63
66
  'setMyKasseSettings',
64
67
  'setMyRegisterDeviceSettings',
@@ -112,6 +115,8 @@ export const PUBLIC_CALLS = [
112
115
  'listCustomerCashregisters',
113
116
  'getCustomerCredentials',
114
117
  'reportCustomerContract',
118
+ 'getPartnerBilling',
119
+ 'getPartnerBillingMonth',
115
120
  'createCustomer',
116
121
  'getCustomer',
117
122
  'updateCustomer',
@@ -126,6 +131,16 @@ export const PUBLIC_CALLS = [
126
131
  'getInvoiceSetupStatus',
127
132
  'listBrands',
128
133
  'recordInvoicePayment',
134
+ // Rechnungskorb und SEPA-Mandate (Backend keck#557): nur die Namen, damit
135
+ // die Liste dem Vertrag folgt; umhuellt sind sie in diesem Paket noch nicht
136
+ // (der offene Transport nimmt jeden Namen).
137
+ 'createInvoiceItem',
138
+ 'updateInvoiceItem',
139
+ 'withdrawInvoiceItem',
140
+ 'getInvoiceItem',
141
+ 'listInvoiceItems',
142
+ 'setCustomerMandate',
143
+ 'revokeCustomerMandate',
129
144
  ];
130
145
  /**
131
146
  * Die Endpunkte des Kassenwegs (`https://kasse.kasseneck.at/api/v3/<name>`,
@@ -159,16 +174,20 @@ export const POS_CALLS = [
159
174
  'createPrintJob',
160
175
  'getPrintJob',
161
176
  'listMyTipRecipients',
177
+ // Lager an der Kasse (Lager-Kern Stufe 2): nur ueber den Kassenweg.
178
+ 'listMyStockLocations',
179
+ 'listMyStock',
180
+ 'setMyCashregisterStockLocation',
162
181
  ];
163
182
  const OEFFENTLICH = new Set(PUBLIC_CALLS);
164
183
  const KASSENWEG = new Set(POS_CALLS);
165
184
  const NUR_KASSE = new Set(POS_CALLS.filter((name) => !OEFFENTLICH.has(name)));
166
- /** Einer der 25 Aufrufe des Kassenwegs. */
185
+ /** Einer der 28 Aufrufe des Kassenwegs. */
167
186
  export function isPosCall(name) {
168
187
  return KASSENWEG.has(name);
169
188
  }
170
189
  /**
171
- * Nur ueber den Kassenweg erreichbar (19 Namen): unter `api.kasseneck.at/v3`
190
+ * Nur ueber den Kassenweg erreichbar (22 Namen): unter `api.kasseneck.at/v3`
172
191
  * gibt es sie nicht. Der Transport schickt sie darum ohne eigene Basis an
173
192
  * [POS_BASE_URL] statt an die oeffentliche Basis.
174
193
  */
@@ -117,7 +117,7 @@ export type ErrorOutcome = 'unknown' | 'rejected';
117
117
  * v3, `errorCodes`; dieselbe Liste wie `paymentCallRejectedCodes` im
118
118
  * Dart-Zwilling):
119
119
  *
120
- * - `errorCodes.auth` ohne die sieben des Partner-Zugangs (18 Codes):
120
+ * - `errorCodes.auth` ohne die sieben des Partner-Zugangs (19 Codes):
121
121
  * Anmeldung und Pruefung in `checkRequest` laufen vor jeder Zeile des
122
122
  * Handlers; `validation` heisst dort Pflichtfeld fehlt oder falscher Typ.
123
123
  * Der Partner-Zugang trifft diese `api_key`-Aufrufe mit Kassen-Token nie.
@@ -231,7 +231,7 @@ const GELDWEGE = new Set(['hobexPayApi', 'hobexRefundApi', 'stripeCaptureIntent'
231
231
  * v3, `errorCodes`; dieselbe Liste wie `paymentCallRejectedCodes` im
232
232
  * Dart-Zwilling):
233
233
  *
234
- * - `errorCodes.auth` ohne die sieben des Partner-Zugangs (18 Codes):
234
+ * - `errorCodes.auth` ohne die sieben des Partner-Zugangs (19 Codes):
235
235
  * Anmeldung und Pruefung in `checkRequest` laufen vor jeder Zeile des
236
236
  * Handlers; `validation` heisst dort Pflichtfeld fehlt oder falscher Typ.
237
237
  * Der Partner-Zugang trifft diese `api_key`-Aufrufe mit Kassen-Token nie.
@@ -260,6 +260,7 @@ export const PAYMENT_CALL_REJECTED_CODES = Object.freeze([
260
260
  'cashregister_not_found',
261
261
  'account_not_found',
262
262
  'live_not_enabled',
263
+ 'api_not_approved', // Live-API ohne Freigabe (Entwicklerbereich): vor dem Handler abgewiesen
263
264
  'unauthorized',
264
265
  'mfa_required',
265
266
  'user_verification_failed',
@@ -1,5 +1,5 @@
1
1
  import { ReceiptType, type ReceiptTypeKey, KeckPaymentMethod, type KeckPaymentMethodKey } from '../enums/index.js';
2
- import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
2
+ import { type Receipt, type ReceiptCompany, type ReceiptItem, type Voucher, type ReceiptSummary, type ReportMonth, type CancellationItem, type CancellationOf, type CancellationReason, type ReturnDisposition, type ReceiptPaymentInput, type RegistrationInfo, type ReceiptEmailVia } from '../models/index.js';
3
3
  import type { InternerTransport } from './aufrufe.js';
4
4
  import { type ReceiptLayout } from '../receipt/layout.js';
5
5
  import type { PosPaperSize } from '../printing/escpos.js';
@@ -114,6 +114,14 @@ export type CancelReceiptOptions = {
114
114
  items?: CancellationItem[];
115
115
  /** Interne Anmerkung (≤ 200 Zeichen), wird gespeichert, nie gedruckt. */
116
116
  note?: string;
117
+ /**
118
+ * Wohin die Ware der stornierten Artikelzeilen geht (Lager-Kern Stufe 2):
119
+ * Vorgabe fuer alle Positionen, je Position abweichend ueber
120
+ * `items[].returnDisposition`. Fehlt beides, bucht der Server `restock`.
121
+ * Zeilen ohne `articleId` bucht er nie. Ein falscher Wert geht nicht hinaus;
122
+ * der Server meldete ihn als `invalid_return_disposition`.
123
+ */
124
+ returnDisposition?: ReturnDisposition;
117
125
  /**
118
126
  * Rueckzahlung je Zahlung (Betraege negativ, `refundOf` = `id` der
119
127
  * Originalzahlung). Ohne Angabe spiegelt der Server die Restbetraege jeder
@@ -1,5 +1,5 @@
1
1
  import { ReceiptType, KeckPaymentMethod, CreditCardProvider, VoucherAction, VoucherType, } from '../enums/index.js';
2
- import { fromReceiptCompanyPayload, fromReceiptPayload, toReceiptItemPayload, toVoucherPayload, receiptItemIsValid, voucherIsValid, fromReceiptSummaryPayload, isCancellationReason, RECEIPT_EMAIL_VIAS, readRegistrationInfo, } from '../models/index.js';
2
+ import { fromReceiptCompanyPayload, fromReceiptPayload, toReceiptItemPayload, toVoucherPayload, receiptItemIsValid, voucherIsValid, fromReceiptSummaryPayload, isCancellationReason, isReturnDisposition, RETURN_DISPOSITIONS, RECEIPT_EMAIL_VIAS, readRegistrationInfo, } from '../models/index.js';
3
3
  import { parseServerTimeStamp, toViennaWallClock } from '../vienna-time.js';
4
4
  import { euroToCents } from '../money.js';
5
5
  import { KasseneckValidationError, isKasseneckApiError, signiertGelesen } from './errors.js';
@@ -133,6 +133,12 @@ export function sellReceiptWithCompany(transport, options) {
133
133
  return createReceiptWithCompany(transport, { ...options, receiptType: ReceiptType.standard });
134
134
  }
135
135
  const NOTE_MAX = 200;
136
+ /** Prueft eine Rueckgabe-Wahl (Vorgabe oder Position); `pfad` nennt das Feld in der Meldung. */
137
+ function pruefeRueckgabeWahl(wert, pfad) {
138
+ if (wert !== undefined && !isReturnDisposition(wert)) {
139
+ throw new KasseneckValidationError('cancelReceipt', `${pfad}: erlaubt sind ${RETURN_DISPOSITIONS.join(', ')}`, 'request');
140
+ }
141
+ }
136
142
  /**
137
143
  * Storno-Beleg zu einem bestehenden Beleg — voll oder in Teilen. Prueft die
138
144
  * Eingabe, bevor etwas hinausgeht; der Server haelt die Restmengen und die
@@ -151,14 +157,16 @@ export async function cancelReceipt(transport, options) {
151
157
  if (!isCancellationReason(options.reason)) {
152
158
  throw new KasseneckValidationError('cancelReceipt', 'Storno-Grund fehlt oder ist unbekannt', 'request');
153
159
  }
160
+ pruefeRueckgabeWahl(options.returnDisposition, 'returnDisposition');
154
161
  if (options.items !== undefined) {
155
162
  if (!Array.isArray(options.items) || options.items.length === 0) {
156
163
  throw new KasseneckValidationError('cancelReceipt', 'items muss eine nicht leere Liste sein', 'request');
157
164
  }
158
- for (const pos of options.items) {
165
+ for (const [i, pos] of options.items.entries()) {
159
166
  if (!Number.isInteger(pos.index) || pos.index < 0 || !Number.isInteger(pos.quantity) || pos.quantity < 1) {
160
167
  throw new KasseneckValidationError('cancelReceipt', 'Storno-Menge muss eine ganze Zahl >= 1 sein', 'request');
161
168
  }
169
+ pruefeRueckgabeWahl(pos.returnDisposition, `items[${i}].returnDisposition`);
162
170
  }
163
171
  }
164
172
  if (options.note !== undefined && options.note.length > NOTE_MAX) {
@@ -173,8 +181,15 @@ export async function cancelReceipt(transport, options) {
173
181
  if (zahlungen !== undefined)
174
182
  pruefeKartenRueckbuchung(zahlungen, options.receipt);
175
183
  const params = { cashregisterId, originalReceiptId, reason: options.reason };
176
- if (options.items !== undefined)
177
- params.items = options.items.map((p) => ({ index: p.index, quantity: p.quantity }));
184
+ if (options.items !== undefined) {
185
+ params.items = options.items.map((p) => ({
186
+ index: p.index,
187
+ quantity: p.quantity,
188
+ ...(p.returnDisposition !== undefined ? { returnDisposition: p.returnDisposition } : {}),
189
+ }));
190
+ }
191
+ if (options.returnDisposition !== undefined)
192
+ params.returnDisposition = options.returnDisposition;
178
193
  if (options.note !== undefined && options.note !== '')
179
194
  params.note = options.note;
180
195
  if (zahlungen !== undefined)
@@ -85,16 +85,16 @@ export interface TransportOptions {
85
85
  auth: KasseneckAuth;
86
86
  /**
87
87
  * Abweichende Basis der **oeffentlichen** Aufrufe (Vorgabe
88
- * [DEFAULT_BASE_URL]): alles ausser den 25 Aufrufen des Kassenwegs, und die
88
+ * [DEFAULT_BASE_URL]): alles ausser den 28 Aufrufen des Kassenwegs, und die
89
89
  * sechs oeffentlichen davon nur, wenn nicht mit `registerUserAuth`
90
90
  * angemeldet. Muss auf `/v3` enden (eigene Proxys erlaubt), sonst wirft das
91
91
  * Anlegen; `/v1` oder `/api` gibt es in der 1.x-Linie nicht.
92
92
  */
93
93
  baseUrl?: string;
94
94
  /**
95
- * Abweichende Basis des **Kassenwegs** (Vorgabe [POS_BASE_URL]): die 19
95
+ * Abweichende Basis des **Kassenwegs** (Vorgabe [POS_BASE_URL]): die 22
96
96
  * reinen Kassenaufrufe (Kopplung, Anmeldung, Einstellungen, Artikel,
97
- * Drucker, ...) und mit `registerUserAuth` alle 25 Aufrufe des Kassenwegs.
97
+ * Drucker, ...) und mit `registerUserAuth` alle 28 Aufrufe des Kassenwegs.
98
98
  * Die Web-Kasse gibt `'/api/v3'` (gleicher Ursprung). Muss auf `/v3` enden
99
99
  * (in der Regel `/api/v3`), sonst wirft das Anlegen.
100
100
  */
@@ -118,9 +118,9 @@ function createCore(options) {
118
118
  pruefeKennung(kennung);
119
119
  const kopfzeilenSenden = options.omitKasseneckHeaders !== true;
120
120
  /**
121
- * Basis je Aufruf. Die 19 reinen Kassenaufrufe gehen immer an den
121
+ * Basis je Aufruf. Die 22 reinen Kassenaufrufe gehen immer an den
122
122
  * Kassenweg (unter der oeffentlichen Basis gibt es sie nicht), und die
123
- * Kassen-Anmeldung ruft alle 25 Aufrufe des Kassenwegs dort, auch die sechs
123
+ * Kassen-Anmeldung ruft alle 28 Aufrufe des Kassenwegs dort, auch die sechs
124
124
  * oeffentlichen (Kanal `app`). Was der Kassenweg gar nicht fuehrt
125
125
  * (Berichte, Zahlungen, FinanzOnline), geht an die oeffentliche Basis.
126
126
  */
@@ -1,6 +1,6 @@
1
1
  export { ReceiptType, type ReceiptTypeKey, VatRate, type VatRateKey, KeckPaymentMethod, type KeckPaymentMethodKey, CreditCardProvider, type CreditCardProviderKey, VoucherType, type VoucherTypeKey, VoucherAction, type VoucherActionKey, StripeLinkMode, type StripeLinkModeKey, } from './enums/index.js';
2
- export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
2
+ export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid, type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError, type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, type ReceiptErrorCode, type ReceiptFieldError, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, type ReceiptCompany, type ReceiptCompanyPayload, fromReceiptCompanyPayload, receiptCompanyTaxInfo, type Cashregister, type CashregisterOnboarding, type CashregisterPayload, type CashregisterOnboardingPayload, fromCashregisterPayload, type ReceiptSummary, type ReceiptSummaryPayload, fromReceiptSummaryPayload, type ZeroKind, ZERO_KINDS, isZeroKind, type ReportMonth, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, type StripeUrlSession, type StripeUrlSessionPayload, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, type HobexReceipt, type HobexReceiptPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
3
3
  export { type AuthCredentials, type KasseneckAuth, type ApiKeyAuthOptions, type RegisterUserAuthOptions, apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, type HttpResponseLike, type HttpRequestInit, type FetchLike, type TransportOptions, type TransportBodyFields, type KasseneckTransport, type KasseneckBinaryTransport, ALL_CALLS, type ApiCall, PUBLIC_CALLS, POS_CALLS, type PublicCall, type PosCall, createTransport, createBinaryTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, type ValidationScope, type KasseneckError, type HttpFailureReason, type CauseDigest, type ErrorOutcome, CLIENT_ERROR_CODES, type ClientErrorCode, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, type ReceiptCommonOptions, type SellReceiptOptions, type TipOptions, type TipRecipientShare, type CancelReceiptOptions, type CancelReceiptResult, type ReceiptWithCompany, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, type ListMyReceiptsOptions, type ReceiptList, type ReceiptListStats, listMyCashregisters, checkVoucherCombinationError, type SendReceiptEmailOptions, type SendReceiptEmailResult, sendReceiptEmail, downloadDailyReport, downloadMonthlyReport, getReportV2, type ReportV2, type ReportV2Metadata, type ReportV2Options, type CashboxStatus, type SignatureStatus, getCashboxStatus, getSignatureStatus, type KasseneckApi, createKasseneckApi, } from './client/index.js';
4
4
  export { type ReceiptDueTip, type ReceiptDueTipRecipient, type ReceiptDueOptions, type ReceiptDueBuckets, type ReceiptDueBreakdown, type ReceiptDueErrorReason, receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
5
5
  export { parseServerTimeStamp, toViennaWallClock, type ViennaWallClock } from './vienna-time.js';
6
- export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, } from './pos/index.js';
6
+ export { type PosBusinessSettings, type PosDeviceSettings, type PosSettings, type ArticleGroup, type PosArticle, POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, } from './pos/index.js';
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { ReceiptType, VatRate, KeckPaymentMethod, CreditCardProvider, VoucherType, VoucherAction, StripeLinkMode, } from './enums/index.js';
2
- export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
2
+ export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, toVoucherPayload, fromVoucherPayload, voucherIsValid, toReceiptPayload, fromReceiptPayload, receiptSubSumCents, receiptSumCents, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, fromReceiptPaymentPayload, toReceiptPaymentPayload, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, RECEIPT_ERROR_CODES, isReceiptErrorCode, receiptErrorCode, isReceiptError, receiptFieldErrors, remainingQuantities, fromReceiptCompanyPayload, receiptCompanyTaxInfo, fromCashregisterPayload, fromReceiptSummaryPayload, ZERO_KINDS, isZeroKind, reportMonthFromDate, previousReportMonth, nextReportMonth, reportMonthKey, reportMonthReadable, toStripeUrlSessionPayload, fromStripeUrlSessionPayload, toHobexReceiptPayload, fromHobexReceiptPayload, hobexReceiptToCardPaymentData, hobexReceiptNeedsSignature, } from './models/index.js';
3
3
  export { apiKeyAuth, registerUserAuth, DEFAULT_BASE_URL, POS_BASE_URL, DEFAULT_TIMEOUT_MS, ALL_CALLS, PUBLIC_CALLS, POS_CALLS, createTransport, createBinaryTransport, KasseneckApiError, KasseneckAuthError, KasseneckHttpError, KasseneckNetworkError, KasseneckValidationError, CLIENT_ERROR_CODES, isKasseneckApiError, isKasseneckAuthError, isKasseneckHttpError, isKasseneckNetworkError, isKasseneckValidationError, isOutcomeUnknown, sellReceipt, sellReceiptWithCompany, paymentsExpectedCents, cardRefundReference, receiptLayoutFromResult, cancelReceipt, zeroReceipt, getReceipt, getReceiptWithCompany, generateFullReceiptId, getFirstReceiptDate, listMyReceipts, listMyCashregisters, checkVoucherCombinationError, sendReceiptEmail, downloadDailyReport, downloadMonthlyReport, getReportV2, getCashboxStatus, getSignatureStatus, createKasseneckApi, } from './client/index.js';
4
4
  export { receiptDueCents, receiptDueBreakdown, ReceiptDueError, RECEIPT_DUE_ERROR_REASONS, isReceiptDueError, } from './receipt/due.js';
5
5
  export { parseServerTimeStamp, toViennaWallClock } from './vienna-time.js';
6
- export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, } from './pos/index.js';
6
+ export { POS_BUSINESS_DEFAULTS, POS_DEVICE_DEFAULTS, mergePosSettings, fromArticleGroupPayload, fromPosArticlePayload, listMyArticleGroups, listMyArticles, getPosSettings, setMyPosSettings, setMyRegisterDeviceSettings, distributeDiscount, cancelScopeOf, receiptsScopeOf, stockViewOf, } from './pos/index.js';
@@ -14,8 +14,8 @@ export { createInvoiceApi, type InvoiceApi, type InvoiceApiOptions } from './api
14
14
  export { invoiceKeyAuth, type InvoiceKeyAuthOptions } from './auth.js';
15
15
  export { isInvoiceError, isInvoiceErrorCode, invoiceErrorCode, invoiceFieldErrors, type InvoiceApiErrorCode, type InvoiceFieldError, } from './fehler.js';
16
16
  export { cancelInvoice, createCreditNote, createCustomer, getCustomer, getInvoice, getInvoicePdf, getInvoiceSetupStatus, getInvoiceXml, issueInvoice, listBrands, listInvoices, previewInvoice, recordInvoicePayment, searchCustomers, updateCustomer, } from './endpunkte.js';
17
- export type { Brand, CancelInvoiceRequest, CancelResult, CreditNoteRequest, CreditNoteResult, Customer, CustomerInput, CustomerPage, CustomerSearch, EInvoiceStatus, Invoice, InvoiceDetail, InvoiceDetailPayment, InvoiceItem, InvoiceItemInput, InvoiceListQuery, InvoicePage, InvoiceRecipient, InvoiceSetupGap, InvoiceSetupStatus, InvoiceTotals, InvoiceXml, InvoiceNotice, InvoicePayment, InvoicePreview, InvoiceRateTotals, IssueInvoiceRequest, IssueResult, PaymentInput, PreviewResult, RecordPaymentRequest, RecordPaymentResult, } from './typen.js';
17
+ export type { Brand, CancelInvoiceRequest, CancelResult, CreditNoteItemInput, CreditNoteRequest, CreditNoteResult, Customer, CustomerInput, CustomerPage, CustomerSearch, EInvoiceStatus, Invoice, InvoiceDetail, InvoiceDetailPayment, InvoiceItem, InvoiceItemInput, InvoiceListQuery, InvoicePage, InvoiceRecipient, InvoiceSetupGap, InvoiceSetupStatus, InvoiceTotals, InvoiceXml, InvoiceNotice, InvoicePayment, InvoicePreview, InvoiceRateTotals, IssueInvoiceRequest, IssueResult, PaymentInput, PreviewResult, RecordPaymentRequest, RecordPaymentResult, } from './typen.js';
18
18
  export { INVOICE_TEXTS, invoiceText, type InvoiceTextKey } from './texte.js';
19
19
  export { computeInvoiceTotals, ZERO_RATED_TAX_SCHEMES, type TotalsItem } from './summen.js';
20
20
  export { proratedPriceMicros, MAX_AMOUNT_CENTS, itemFromEuro, formatUnitPrice, CalcError, calculateInvoice, roundDiv, vatRateMapKey, formatVatRate, type CalcResult, type CalcErrorCode, type CalcOptions, type CalcItem, type RateTotal, type ItemConversion, type ConversionReason, type LineAmount, } from './calc.js';
21
- export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, type InvoiceEndpoint, type InvoiceErrorCode, type InvoiceRequestErrorCode, type CreditNoteReason, type TaxScheme, type PriceMode, type VatRatePercent, type CustomerType, type InvoiceListStatus, type DocType, type EInvoiceFormat, type EInvoiceMissingCode, type WriteOffReasonCode, type InvoiceLanguage, type InvoicePaymentMethod, type ItemKind, type ReverseChargeReason, type InvoiceNoticeCode, type InvoiceUnit, type InvoiceSetupRequirement, type FieldFormat, type Field, } from './vertrag.js';
21
+ export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, CREDIT_NOTE_ITEM_FIELDS, RETURN_DISPOSITIONS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, type InvoiceEndpoint, type InvoiceErrorCode, type InvoiceRequestErrorCode, type CreditNoteReason, type ReturnDisposition, type TaxScheme, type PriceMode, type VatRatePercent, type CustomerType, type InvoiceListStatus, type DocType, type EInvoiceFormat, type EInvoiceMissingCode, type WriteOffReasonCode, type InvoiceLanguage, type InvoicePaymentMethod, type ItemKind, type ReverseChargeReason, type InvoiceNoticeCode, type InvoiceUnit, type InvoiceSetupRequirement, type FieldFormat, type Field, } from './vertrag.js';
@@ -17,4 +17,4 @@ export { cancelInvoice, createCreditNote, createCustomer, getCustomer, getInvoic
17
17
  export { INVOICE_TEXTS, invoiceText } from './texte.js';
18
18
  export { computeInvoiceTotals, ZERO_RATED_TAX_SCHEMES } from './summen.js';
19
19
  export { proratedPriceMicros, MAX_AMOUNT_CENTS, itemFromEuro, formatUnitPrice, CalcError, calculateInvoice, roundDiv, vatRateMapKey, formatVatRate, } from './calc.js';
20
- export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, } from './vertrag.js';
20
+ export { INVOICE_CONTRACT_VERSION, INVOICE_ENDPOINTS, INVOICE_ERROR_CODES, INVOICE_REQUEST_ERROR_CODES, CREDIT_NOTE_REASONS, TAX_SCHEMES, PRICE_MODES, VAT_RATES, CUSTOMER_TYPES, INVOICE_LIST_STATUS, DOC_TYPES, EINVOICE_FORMATS, EINVOICE_MISSING_CODES, WRITE_OFF_REASON_CODES, INVOICE_LANGUAGES, INVOICE_PAYMENT_METHODS, ITEM_KINDS, REVERSE_CHARGE_REASONS, INVOICE_NOTICE_CODES, INVOICE_UNITS, INVOICE_UNIT_CODES, INVOICE_SETUP_REQUIREMENTS, CUSTOMER_FIELDS, ITEM_FIELDS, CREDIT_NOTE_ITEM_FIELDS, RETURN_DISPOSITIONS, ITEM_PRICE_EXACTLY_ONE, INVOICE_REQUESTS, INVOICE_EXACTLY_ONE, INVOICE_AT_LEAST_ONE, } from './vertrag.js';
@@ -5,7 +5,7 @@
5
5
  * Betraege sind ueberall ganze Cent. Datumsangaben sind `YYYY-MM-DD` nach
6
6
  * Wiener Kalender.
7
7
  */
8
- import type { CreditNoteReason, CustomerType, DocType, EInvoiceFormat, EInvoiceMissingCode, InvoiceLanguage, InvoiceNoticeCode, ItemKind, ReverseChargeReason, InvoicePaymentMethod, InvoiceUnit, InvoiceSetupRequirement, InvoiceListStatus, PriceMode, TaxScheme, VatRatePercent, WriteOffReasonCode } from './vertrag.js';
8
+ import type { CreditNoteReason, CustomerType, DocType, EInvoiceFormat, EInvoiceMissingCode, InvoiceLanguage, InvoiceNoticeCode, ItemKind, ReverseChargeReason, InvoicePaymentMethod, InvoiceUnit, InvoiceSetupRequirement, InvoiceListStatus, PriceMode, ReturnDisposition, TaxScheme, VatRatePercent, WriteOffReasonCode } from './vertrag.js';
9
9
  export interface CustomerInput {
10
10
  type: CustomerType;
11
11
  name: string;
@@ -86,6 +86,13 @@ export interface InvoiceItemInput {
86
86
  vatRate: VatRatePercent;
87
87
  /** Zeilenrabatt in Prozent, hoechstens zwei Nachkommastellen. */
88
88
  discountPct?: number;
89
+ /** Artikel aus dem Artikelstamm; bestandsgefuehrt bucht das Ausstellen ihn vom Lager ab. */
90
+ articleId?: string;
91
+ }
92
+ /** Eine Gutschriftsposition: wie eine Rechnungsposition, dazu die Rueckgabe-Wahl. */
93
+ export interface CreditNoteItemInput extends InvoiceItemInput {
94
+ /** Wohin die Ware dieser Position geht; fehlt = Vorgabe des Aufrufs bzw. `restock`. */
95
+ returnDisposition?: ReturnDisposition;
89
96
  }
90
97
  export interface IssueInvoiceRequest {
91
98
  /** Pflicht: dieselbe Anfrage mit demselben Schluessel erzeugt nie eine zweite Rechnung. */
@@ -115,6 +122,8 @@ export interface IssueInvoiceRequest {
115
122
  language?: InvoiceLanguage;
116
123
  /** Marke (Kennung aus `listBrands`); sonst die Standardmarke. Unbekannt = `brand_not_found`. */
117
124
  brandId?: string;
125
+ /** Lager-Standort fuer bestandsgefuehrte Positionen; sonst der Standard-Standort. */
126
+ stockLocationId?: string;
118
127
  /**
119
128
  * Schon bezahlt (Shop kassiert online, Rechnung folgt). Die Zahlung entsteht
120
129
  * in derselben Transaktion wie das Festschreiben: das PDF traegt dann keine
@@ -175,9 +184,11 @@ export interface CancelInvoiceRequest {
175
184
  invoiceId: string;
176
185
  reason: CreditNoteReason;
177
186
  note?: string;
187
+ /** Wohin die Ware bestandsgefuehrter Positionen geht; fehlt = `restock`. */
188
+ returnDisposition?: ReturnDisposition;
178
189
  }
179
190
  export interface CreditNoteRequest extends CancelInvoiceRequest {
180
- items: InvoiceItemInput[];
191
+ items: CreditNoteItemInput[];
181
192
  }
182
193
  /**
183
194
  * Summen einer Rechnung in Cent, **immer positiv** — auch bei einer Gutschrift
@@ -17,6 +17,9 @@
17
17
  * Beschrieben wird die Anfrage. Was der Server daraus macht — Rechnungsdatum,
18
18
  * Nummer, Summen — ist bewusst **nicht** setzbar.
19
19
  */
20
+ import { RETURN_DISPOSITIONS } from '../models/cancellation.js';
21
+ export { RETURN_DISPOSITIONS };
22
+ export type { ReturnDisposition } from '../models/cancellation.js';
20
23
  export declare const INVOICE_CONTRACT_VERSION = 2;
21
24
  export declare const INVOICE_ENDPOINTS: readonly ["createCustomer", "getCustomer", "updateCustomer", "searchCustomers", "issueInvoice", "cancelInvoice", "createCreditNote", "getInvoice", "listInvoices", "getInvoicePdf", "getInvoiceXml", "getInvoiceSetupStatus", "listBrands", "recordInvoicePayment"];
22
25
  export type InvoiceEndpoint = (typeof INVOICE_ENDPOINTS)[number];
@@ -34,7 +37,7 @@ export type InvoiceErrorCode = (typeof INVOICE_ERROR_CODES)[number];
34
37
  * genau der Katalog des Servers (das Backend vergleicht ihn mit dem Schema);
35
38
  * die Helfer in `./invoice` erkennen beide Listen.
36
39
  */
37
- export declare const INVOICE_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
40
+ export declare const INVOICE_REQUEST_ERROR_CODES: readonly ["account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "route_missing"];
38
41
  export type InvoiceRequestErrorCode = (typeof INVOICE_REQUEST_ERROR_CODES)[number];
39
42
  /** Gruende einer Gutschrift. Der Server druckt den deutschen Anzeigetext. */
40
43
  export declare const CREDIT_NOTE_REASONS: readonly ["cancellation", "price_reduction", "return", "incorrect_invoice", "other"];
@@ -269,6 +272,12 @@ export declare const CUSTOMER_FIELDS: Readonly<Record<string, Field>>;
269
272
  export declare const ITEM_FIELDS: Readonly<Record<string, Field>>;
270
273
  /** Genau einer der beiden Preise je Position (§ 9.1). */
271
274
  export declare const ITEM_PRICE_EXACTLY_ONE: readonly (readonly string[])[];
275
+ /**
276
+ * Eine Gutschriftsposition: die Rechnungsposition plus `returnDisposition`
277
+ * (wohin die zurueckgenommene Ware geht). An einer Rechnungsposition weist der
278
+ * Server das Feld als unbekannt ab.
279
+ */
280
+ export declare const CREDIT_NOTE_ITEM_FIELDS: Readonly<Record<string, Field>>;
272
281
  /**
273
282
  * Eine Zahlung zu einer Rechnung. Ohne `amountCents` gilt der volle
274
283
  * Bruttobetrag, ohne `paidAt` der heutige Wiener Tag. `reference` ist die
@@ -17,6 +17,8 @@
17
17
  * Beschrieben wird die Anfrage. Was der Server daraus macht — Rechnungsdatum,
18
18
  * Nummer, Summen — ist bewusst **nicht** setzbar.
19
19
  */
20
+ import { RETURN_DISPOSITIONS } from '../models/cancellation.js';
21
+ export { RETURN_DISPOSITIONS };
20
22
  export const INVOICE_CONTRACT_VERSION = 2;
21
23
  export const INVOICE_ENDPOINTS = [
22
24
  'createCustomer',
@@ -80,6 +82,7 @@ export const INVOICE_ERROR_CODES = [
80
82
  export const INVOICE_REQUEST_ERROR_CODES = [
81
83
  'account_not_found',
82
84
  'admin_required',
85
+ 'api_not_approved',
83
86
  'cashregister_not_assigned',
84
87
  'cashregister_not_found',
85
88
  'cashregister_token_invalid',
@@ -418,6 +421,13 @@ export const ITEM_FIELDS = Object.freeze({
418
421
  unitPriceMicros: { type: 'integer', required: false, min: 0, max: 1_000_000_000_000 },
419
422
  vatRate: { type: 'enum', required: true, values: VAT_RATES },
420
423
  discountPct: { type: 'number', required: false, min: 0, max: 100, decimals: 2 },
424
+ /**
425
+ * Artikel aus dem Artikelstamm (Lager-Kern Stufe 2): ist er bestandsgefuehrt
426
+ * und das Modul Lager aktiv, bucht das Ausstellen ihn ab -- danach, die
427
+ * Rechnung scheitert nie am Lager. Kein „/“, nicht „.“, „..“ oder „__…__“
428
+ * (prueft der Server, `validation`).
429
+ */
430
+ articleId: id,
421
431
  });
422
432
  /** Genau einer der beiden Preise je Position (§ 9.1). */
423
433
  export const ITEM_PRICE_EXACTLY_ONE = Object.freeze([
@@ -433,6 +443,23 @@ const positionen = {
433
443
  type: 'object', required: true, fields: ITEM_FIELDS, exactlyOne: ITEM_PRICE_EXACTLY_ONE,
434
444
  },
435
445
  };
446
+ /** Rueckgabe-Wahl einer Gutschrift: Vorgabe des Aufrufs oder je Position. */
447
+ const returnDisposition = { type: 'enum', required: false, values: RETURN_DISPOSITIONS };
448
+ /**
449
+ * Eine Gutschriftsposition: die Rechnungsposition plus `returnDisposition`
450
+ * (wohin die zurueckgenommene Ware geht). An einer Rechnungsposition weist der
451
+ * Server das Feld als unbekannt ab.
452
+ */
453
+ export const CREDIT_NOTE_ITEM_FIELDS = Object.freeze({ ...ITEM_FIELDS, returnDisposition });
454
+ const gutschriftPositionen = {
455
+ type: 'list',
456
+ required: true,
457
+ min: 1,
458
+ max: 500,
459
+ item: {
460
+ type: 'object', required: true, fields: CREDIT_NOTE_ITEM_FIELDS, exactlyOne: ITEM_PRICE_EXACTLY_ONE,
461
+ },
462
+ };
436
463
  /**
437
464
  * Eine Zahlung zu einer Rechnung. Ohne `amountCents` gilt der volle
438
465
  * Bruttobetrag, ohne `paidAt` der heutige Wiener Tag. `reference` ist die
@@ -500,6 +527,12 @@ export const INVOICE_REQUESTS = Object.freeze({
500
527
  language: { type: 'enum', required: false, values: INVOICE_LANGUAGES },
501
528
  /** Marke (Kennung aus `listBrands`); sonst die Standardmarke. */
502
529
  brandId: id,
530
+ /**
531
+ * Lager-Standort, von dem bestandsgefuehrte Positionen abgebucht werden;
532
+ * sonst der Standard-Standort. Ein unbekannter oder aufgeloester Standort
533
+ * bucht am Standard-Standort und meldet ein Ereignis im Lager.
534
+ */
535
+ stockLocationId: id,
503
536
  /**
504
537
  * Schon bezahlt: die Zahlung entsteht in **derselben** Transaktion wie das
505
538
  * Festschreiben. Sonst gaebe es einen Moment, in dem die Rechnung offen ist
@@ -518,13 +551,17 @@ export const INVOICE_REQUESTS = Object.freeze({
518
551
  invoiceId: idPflicht,
519
552
  reason: { type: 'enum', required: true, values: CREDIT_NOTE_REASONS },
520
553
  note: text(2000),
554
+ /** Fuer alle bestandsgefuehrten Positionen; fehlt = `restock`. */
555
+ returnDisposition,
521
556
  },
522
557
  createCreditNote: {
523
558
  idempotencyKey: idempotencyKey(true),
524
559
  invoiceId: idPflicht,
525
560
  reason: { type: 'enum', required: true, values: CREDIT_NOTE_REASONS },
526
561
  note: text(2000),
527
- items: positionen,
562
+ items: gutschriftPositionen,
563
+ /** Vorgabe fuer alle Positionen; je Position abweichend ueber `items[].returnDisposition`. */
564
+ returnDisposition,
528
565
  },
529
566
  getInvoice: {
530
567
  invoiceId: id,
@@ -23,6 +23,16 @@ export declare const CANCELLATION_REASONS: Readonly<{
23
23
  }>;
24
24
  export type CancellationReason = keyof typeof CANCELLATION_REASONS;
25
25
  export declare function isCancellationReason(value: unknown): value is CancellationReason;
26
+ /**
27
+ * Rueckgabe-Wahl beim Storno und bei der Gutschrift (Lager-Kern Stufe 2,
28
+ * Katalog `RUECKGABE` des Backends): `restock` zurueck ins Lager (Vorgabe des
29
+ * Servers), `defective` als defekt ins Lager, `disposed` entsorgt. Wirkt nur
30
+ * an Positionen mit `articleId`; alle anderen bucht der Server nie und meldet
31
+ * dafuer auch keinen Fehler.
32
+ */
33
+ export declare const RETURN_DISPOSITIONS: readonly ["restock", "defective", "disposed"];
34
+ export type ReturnDisposition = (typeof RETURN_DISPOSITIONS)[number];
35
+ export declare function isReturnDisposition(value: unknown): value is ReturnDisposition;
26
36
  /**
27
37
  * Stabile Fehlercodes von `cancelReceipt` unter `/v3` (Vokabular
28
38
  * `errorCodes.cancellation`, gleiche Reihenfolge). Das Backend legt sie bei
@@ -43,7 +53,7 @@ export declare function isCancellationReason(value: unknown): value is Cancellat
43
53
  * [PAYMENT_ERROR_CODES]. Ein Code ausserhalb bleibt ueber
44
54
  * `KasseneckApiError.code` lesbar.
45
55
  */
46
- export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "account_not_found", "admin_required", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
56
+ export declare const CANCELLATION_ERROR_CODES: readonly ["receipt_not_found", "receipt_type_not_cancellable", "training_receipt", "already_cancelled", "invalid_line", "quantity_exceeds_remaining", "unknown_reason", "note_too_long", "invalid_items", "cashregister_not_assigned", "not_permitted", "own_receipts_only", "cashregister_incomplete", "cancellation_failed", "cancellation_payments_required", "cancellation_refund_exceeds_payment", "cancellation_refund_reference_required", "cancellation_refund_reference_unknown", "cancellation_outcome_unknown", "invalid_return_disposition", "account_not_found", "admin_required", "api_not_approved", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing", "response_unreadable"];
47
57
  export type CancellationErrorCode = (typeof CANCELLATION_ERROR_CODES)[number];
48
58
  export declare function isCancellationErrorCode(value: unknown): value is CancellationErrorCode;
49
59
  /** Der Code eines geworfenen Fehlers, wenn er in [CANCELLATION_ERROR_CODES] steht; sonst `undefined`. */
@@ -67,10 +77,12 @@ export interface CancellationOf {
67
77
  */
68
78
  timeStamp?: string;
69
79
  }
70
- /** Eine stornierte Position: Index im Original und Menge. */
80
+ /** Eine stornierte Position: Index im Original und Menge, an Artikelzeilen die Rueckgabe-Wahl. */
71
81
  export interface CancellationItem {
72
82
  index: number;
73
83
  quantity: number;
84
+ /** Wohin die Ware dieser Position geht; fehlt = Vorgabe des Aufrufs bzw. `restock`. */
85
+ returnDisposition?: ReturnDisposition;
74
86
  }
75
87
  /**
76
88
  * Eintrag in `cancellations[]` am Original. `pending` = Reservierung, die
@@ -23,6 +23,17 @@ export const CANCELLATION_REASONS = Object.freeze({
23
23
  export function isCancellationReason(value) {
24
24
  return typeof value === 'string' && Object.prototype.hasOwnProperty.call(CANCELLATION_REASONS, value);
25
25
  }
26
+ /**
27
+ * Rueckgabe-Wahl beim Storno und bei der Gutschrift (Lager-Kern Stufe 2,
28
+ * Katalog `RUECKGABE` des Backends): `restock` zurueck ins Lager (Vorgabe des
29
+ * Servers), `defective` als defekt ins Lager, `disposed` entsorgt. Wirkt nur
30
+ * an Positionen mit `articleId`; alle anderen bucht der Server nie und meldet
31
+ * dafuer auch keinen Fehler.
32
+ */
33
+ export const RETURN_DISPOSITIONS = Object.freeze(['restock', 'defective', 'disposed']);
34
+ export function isReturnDisposition(value) {
35
+ return typeof value === 'string' && RETURN_DISPOSITIONS.includes(value);
36
+ }
26
37
  /**
27
38
  * Stabile Fehlercodes von `cancelReceipt` unter `/v3` (Vokabular
28
39
  * `errorCodes.cancellation`, gleiche Reihenfolge). Das Backend legt sie bei
@@ -63,9 +74,11 @@ export const CANCELLATION_ERROR_CODES = Object.freeze([
63
74
  'cancellation_refund_reference_required', // Karten-Rueckzahlung ohne refundOf einer Kartenzahlung
64
75
  'cancellation_refund_reference_unknown', // refundOf nennt keine Zahlung des Originals
65
76
  'cancellation_outcome_unknown', // Ausgang unklar: nachlesen, nie wiederholen
77
+ 'invalid_return_disposition', // Rueckgabe-Wahl nicht restock, defective oder disposed (Lager)
66
78
  // Anmeldung und Rand (errorCodes.auth ohne Partner-Zugang, errorCodes.edge)
67
79
  'account_not_found',
68
80
  'admin_required',
81
+ 'api_not_approved',
69
82
  'cashregister_not_found',
70
83
  'cashregister_token_invalid',
71
84
  'cashregister_token_missing',
@@ -36,6 +36,8 @@ export interface Cashregister {
36
36
  token?: string;
37
37
  /** Zugeordnete Signatureinheit. */
38
38
  signatureId?: string;
39
+ /** Lager-Standort der Kasse (Lager-Kern Stufe 2); fehlt = Standard-Standort des Betriebs. */
40
+ stockLocationId?: string;
39
41
  onboarding: CashregisterOnboarding;
40
42
  }
41
43
  /**
@@ -58,6 +60,7 @@ export interface CashregisterPayload {
58
60
  description?: string | null;
59
61
  create_time?: string | null;
60
62
  signature_id?: string | null;
63
+ stockLocationId?: string | null;
61
64
  token?: string | null;
62
65
  onboarding?: CashregisterOnboardingPayload | null;
63
66
  }
@@ -13,6 +13,7 @@ export function fromCashregisterPayload(payload, id) {
13
13
  ...zeitfeld('createTime', payload.create_time),
14
14
  ...(payload.token ? { token: payload.token } : {}),
15
15
  ...(payload.signature_id ? { signatureId: payload.signature_id } : {}),
16
+ ...(payload.stockLocationId ? { stockLocationId: payload.stockLocationId } : {}),
16
17
  onboarding: {
17
18
  cashboxRegistered: ob.cashbox_registered === true,
18
19
  startReceiptCreated: ob.start_receipt_created === true,
@@ -1,7 +1,7 @@
1
1
  export { type ReceiptItem, type ReceiptItemPayload, type ReceiptItemPayloadRead, toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, type TipRecipient, isTipItem, isDiscountItem, } from './receipt-item.js';
2
2
  export { type Voucher, type VoucherPayload, toVoucherPayload, fromVoucherPayload, voucherIsValid } from './voucher.js';
3
3
  export { type Receipt, type RegistrationInfo, type ReceiptPayload, type ReceiptPayloadRead, toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, } from './receipt.js';
4
- export { type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, remainingQuantities, } from './cancellation.js';
4
+ export { type CancellationOf, type CancellationItem, type Cancellation, type CancellationReason, type CancellationErrorCode, type CancellationStatus, type ReturnDisposition, RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, type CancellationFieldError, remainingQuantities, } from './cancellation.js';
5
5
  export { type ReceiptPayment, type ReceiptPaymentPayload, type ReceiptPaymentInput, fromReceiptPaymentPayload, toReceiptPaymentPayload, } from './receipt-payment.js';
6
6
  export { type PaymentErrorCode, PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors, type PaymentFieldError } from './payment-errors.js';
7
7
  export { type ReceiptEmailErrorCode, type ReceiptEmailVia, RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, type ReceiptEmailSendErrorCode, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, type ReceiptEmailFieldError, } from './receipt-email.js';
@@ -1,7 +1,7 @@
1
1
  export { toReceiptItemPayload, fromReceiptItemPayload, receiptItemTotalCents, receiptItemIsValid, negateReceiptItem, isTipItem, isDiscountItem, } from './receipt-item.js';
2
2
  export { toVoucherPayload, fromVoucherPayload, voucherIsValid } from './voucher.js';
3
3
  export { toReceiptPayload, fromReceiptPayload, readRegistrationInfo, receiptSubSumCents, receiptSumCents, } from './receipt.js';
4
- export { CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, remainingQuantities, } from './cancellation.js';
4
+ export { RETURN_DISPOSITIONS, CANCELLATION_REASONS, CANCELLATION_STATUSES, CANCELLATION_ERROR_CODES, CANCELLATION_RESERVATION_MS, isCancellationReason, isReturnDisposition, isCancellationErrorCode, cancellationErrorCode, isCancellationError, cancellationFieldErrors, remainingQuantities, } from './cancellation.js';
5
5
  export { fromReceiptPaymentPayload, toReceiptPaymentPayload, } from './receipt-payment.js';
6
6
  export { PAYMENT_ERROR_CODES, isPaymentErrorCode, paymentErrorCode, isPaymentError, paymentFieldErrors } from './payment-errors.js';
7
7
  export { RECEIPT_EMAIL_ERROR_CODES, RECEIPT_EMAIL_SEND_ERROR_CODES, RECEIPT_EMAIL_VIAS, isReceiptEmailErrorCode, receiptEmailErrorCode, isReceiptEmailError, receiptEmailFieldErrors, } from './receipt-email.js';
@@ -19,7 +19,7 @@ import { KasseneckApiError } from '../client/errors.js';
19
19
  * ...) und zuletzt `route_missing` (Code des Pakets). Ein Code ausserhalb
20
20
  * bleibt ueber `KasseneckApiError.code` lesbar.
21
21
  */
22
- export declare const PAYMENT_ERROR_CODES: readonly ["payments_invalid", "payment_method_invalid", "payment_amount_invalid", "payment_tendered_invalid", "payment_provider_invalid", "payment_provider_not_allowed", "payments_sum_mismatch", "payments_due_negative", "payments_not_allowed", "payments_conflict", "payments_required", "payment_method_not_supported", "tip_payment_method_invalid", "tip_payment_method_required", "tip_exceeds_payment", "payment_refund_not_allowed", "payment_tip_invalid", "tip_conflict", "account_not_found", "admin_required", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
22
+ export declare const PAYMENT_ERROR_CODES: readonly ["payments_invalid", "payment_method_invalid", "payment_amount_invalid", "payment_tendered_invalid", "payment_provider_invalid", "payment_provider_not_allowed", "payments_sum_mismatch", "payments_due_negative", "payments_not_allowed", "payments_conflict", "payments_required", "payment_method_not_supported", "tip_payment_method_invalid", "tip_payment_method_required", "tip_exceeds_payment", "payment_refund_not_allowed", "payment_tip_invalid", "tip_conflict", "account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
23
23
  export type PaymentErrorCode = (typeof PAYMENT_ERROR_CODES)[number];
24
24
  /** Erkennt einen Code aus [PAYMENT_ERROR_CODES], exakt (klein, wie unter `/v3`). */
25
25
  export declare function isPaymentErrorCode(value: unknown): value is PaymentErrorCode;
@@ -41,6 +41,7 @@ export const PAYMENT_ERROR_CODES = Object.freeze([
41
41
  // Anmeldung und Rand (errorCodes.auth ohne Partner-Zugang, errorCodes.edge)
42
42
  'account_not_found',
43
43
  'admin_required',
44
+ 'api_not_approved',
44
45
  'cashregister_not_assigned',
45
46
  'cashregister_not_found',
46
47
  'cashregister_token_invalid',
@@ -11,7 +11,7 @@ export type ReceiptEmailSendErrorCode = (typeof RECEIPT_EMAIL_SEND_ERROR_CODES)[
11
11
  * als [KasseneckApiError.code] durch; ein Code ausserhalb bleibt dort lesbar.
12
12
  * Zuletzt `route_missing` (Code des Pakets).
13
13
  */
14
- export declare const RECEIPT_EMAIL_ERROR_CODES: readonly ["invalid_address", "receipt_not_found", "too_many_requests", "send_failed", "account_not_found", "admin_required", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
14
+ export declare const RECEIPT_EMAIL_ERROR_CODES: readonly ["invalid_address", "receipt_not_found", "too_many_requests", "send_failed", "account_not_found", "admin_required", "api_not_approved", "cashregister_not_assigned", "cashregister_not_found", "cashregister_token_invalid", "cashregister_token_missing", "dialect_mismatch", "internal_translation_error", "live_not_enabled", "method_not_allowed", "mfa_required", "not_found", "register_user_no_business", "register_user_not_allowed", "register_user_not_found", "response_translation_failed", "session_expired", "session_other_cashregister", "unauthorized", "user_disabled", "user_verification_failed", "validation", "route_missing"];
15
15
  export type ReceiptEmailErrorCode = (typeof RECEIPT_EMAIL_ERROR_CODES)[number];
16
16
  export declare function isReceiptEmailErrorCode(value: unknown): value is ReceiptEmailErrorCode;
17
17
  /** Der Code eines geworfenen Fehlers, wenn er in [RECEIPT_EMAIL_ERROR_CODES] steht; sonst `undefined`. */
@@ -20,6 +20,7 @@ export const RECEIPT_EMAIL_ERROR_CODES = Object.freeze([
20
20
  // Anmeldung und Rand (errorCodes.auth ohne Partner-Zugang, errorCodes.edge)
21
21
  'account_not_found',
22
22
  'admin_required',
23
+ 'api_not_approved',
23
24
  'cashregister_not_assigned',
24
25
  'cashregister_not_found',
25
26
  'cashregister_token_invalid',