@emilgroup/payment-sdk 1.22.1-beta.8 → 1.22.1-beta.81

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 (119) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +2 -2
  3. package/api/bank-accounts-api.ts +48 -18
  4. package/api/bank-orders-api.ts +48 -23
  5. package/api/bank-transaction-api.ts +181 -26
  6. package/api/billing-addresses-api.ts +40 -15
  7. package/api/credit-allocation-api.ts +24 -9
  8. package/api/exceeding-credits-api.ts +24 -9
  9. package/api/health-check-api.ts +1 -1
  10. package/api/ibanvalidator-api.ts +8 -3
  11. package/api/payment-methods-api.ts +24 -9
  12. package/api/payment-receipts-api.ts +40 -15
  13. package/api/payment-reminders-api.ts +32 -12
  14. package/api/payment-requests-api.ts +52 -27
  15. package/api/payment-setup-api.ts +16 -6
  16. package/api/payments-api.ts +46 -16
  17. package/api/payout-methods-api.ts +48 -18
  18. package/api/policy-payment-methods-api.ts +24 -9
  19. package/api/refunds-api.ts +24 -9
  20. package/api/tenant-bank-account-api.ts +40 -15
  21. package/api/webhooks-api.ts +2 -2
  22. package/base.ts +239 -43
  23. package/common.ts +3 -2
  24. package/configuration.ts +20 -0
  25. package/dist/api/bank-accounts-api.d.ts +6 -6
  26. package/dist/api/bank-accounts-api.js +82 -46
  27. package/dist/api/bank-orders-api.d.ts +13 -13
  28. package/dist/api/bank-orders-api.js +73 -44
  29. package/dist/api/bank-transaction-api.d.ts +80 -14
  30. package/dist/api/bank-transaction-api.js +194 -52
  31. package/dist/api/billing-addresses-api.d.ts +5 -5
  32. package/dist/api/billing-addresses-api.js +71 -39
  33. package/dist/api/credit-allocation-api.d.ts +3 -3
  34. package/dist/api/credit-allocation-api.js +41 -23
  35. package/dist/api/exceeding-credits-api.d.ts +3 -3
  36. package/dist/api/exceeding-credits-api.js +41 -23
  37. package/dist/api/health-check-api.d.ts +1 -1
  38. package/dist/api/health-check-api.js +1 -1
  39. package/dist/api/ibanvalidator-api.d.ts +1 -1
  40. package/dist/api/ibanvalidator-api.js +15 -8
  41. package/dist/api/payment-methods-api.d.ts +3 -3
  42. package/dist/api/payment-methods-api.js +41 -23
  43. package/dist/api/payment-receipts-api.d.ts +5 -5
  44. package/dist/api/payment-receipts-api.js +67 -38
  45. package/dist/api/payment-reminders-api.d.ts +4 -4
  46. package/dist/api/payment-reminders-api.js +56 -31
  47. package/dist/api/payment-requests-api.d.ts +17 -17
  48. package/dist/api/payment-requests-api.js +76 -47
  49. package/dist/api/payment-setup-api.d.ts +2 -2
  50. package/dist/api/payment-setup-api.js +30 -16
  51. package/dist/api/payments-api.d.ts +4 -4
  52. package/dist/api/payments-api.js +62 -34
  53. package/dist/api/payout-methods-api.d.ts +6 -6
  54. package/dist/api/payout-methods-api.js +82 -46
  55. package/dist/api/policy-payment-methods-api.d.ts +3 -3
  56. package/dist/api/policy-payment-methods-api.js +41 -23
  57. package/dist/api/refunds-api.d.ts +3 -3
  58. package/dist/api/refunds-api.js +37 -22
  59. package/dist/api/tenant-bank-account-api.d.ts +5 -5
  60. package/dist/api/tenant-bank-account-api.js +67 -38
  61. package/dist/api/webhooks-api.d.ts +2 -2
  62. package/dist/api/webhooks-api.js +2 -2
  63. package/dist/base.d.ts +26 -0
  64. package/dist/base.js +243 -60
  65. package/dist/common.d.ts +1 -1
  66. package/dist/common.js +1 -0
  67. package/dist/configuration.d.ts +17 -0
  68. package/dist/configuration.js +2 -0
  69. package/dist/models/bank-order-entity.d.ts +1 -0
  70. package/dist/models/bank-order-entity.js +1 -0
  71. package/dist/models/bank-transaction-class.d.ts +7 -0
  72. package/dist/models/bank-transaction-entity.d.ts +7 -0
  73. package/dist/models/bank-transaction-invoice-entity.d.ts +24 -0
  74. package/dist/models/create-bank-order-request-dto.d.ts +3 -2
  75. package/dist/models/create-bank-order-request-dto.js +1 -0
  76. package/dist/models/create-payment-order-dto.d.ts +1 -1
  77. package/dist/models/create-payment-receipt-request-dto.d.ts +3 -3
  78. package/dist/models/create-payment-request-dto.d.ts +1 -1
  79. package/dist/models/exceeding-credit-entity.d.ts +6 -0
  80. package/dist/models/index.d.ts +4 -0
  81. package/dist/models/index.js +4 -0
  82. package/dist/models/link-bank-transaction-payment-requests-request-dto-rest.d.ts +30 -0
  83. package/dist/models/link-bank-transaction-payment-requests-request-dto-rest.js +15 -0
  84. package/dist/models/link-bank-transaction-payment-requests-response-class.d.ts +25 -0
  85. package/dist/models/link-bank-transaction-payment-requests-response-class.js +15 -0
  86. package/dist/models/payment-class-without-expand-properties.d.ts +1 -1
  87. package/dist/models/payment-class.d.ts +1 -1
  88. package/dist/models/payment-receipt-class.d.ts +13 -1
  89. package/dist/models/payment-receipt-entity.d.ts +139 -0
  90. package/dist/models/payment-receipt-entity.js +20 -0
  91. package/dist/models/payment-request-class.d.ts +19 -0
  92. package/dist/models/payment-request-class.js +1 -0
  93. package/dist/models/payment-request-entity.d.ts +223 -0
  94. package/dist/models/payment-request-entity.js +39 -0
  95. package/dist/models/shared-transaction-class.d.ts +6 -0
  96. package/dist/models/transaction-entity.d.ts +6 -0
  97. package/dist/models/update-bank-order-request-dto.d.ts +2 -2
  98. package/models/bank-order-entity.ts +1 -0
  99. package/models/bank-transaction-class.ts +7 -0
  100. package/models/bank-transaction-entity.ts +7 -0
  101. package/models/bank-transaction-invoice-entity.ts +24 -0
  102. package/models/create-bank-order-request-dto.ts +3 -2
  103. package/models/create-payment-order-dto.ts +1 -1
  104. package/models/create-payment-receipt-request-dto.ts +3 -3
  105. package/models/create-payment-request-dto.ts +1 -1
  106. package/models/exceeding-credit-entity.ts +6 -0
  107. package/models/index.ts +4 -0
  108. package/models/link-bank-transaction-payment-requests-request-dto-rest.ts +36 -0
  109. package/models/link-bank-transaction-payment-requests-response-class.ts +31 -0
  110. package/models/payment-class-without-expand-properties.ts +1 -1
  111. package/models/payment-class.ts +1 -1
  112. package/models/payment-receipt-class.ts +13 -1
  113. package/models/payment-receipt-entity.ts +148 -0
  114. package/models/payment-request-class.ts +19 -0
  115. package/models/payment-request-entity.ts +233 -0
  116. package/models/shared-transaction-class.ts +6 -0
  117. package/models/transaction-entity.ts +6 -0
  118. package/models/update-bank-order-request-dto.ts +2 -2
  119. package/package.json +2 -2
@@ -27,6 +27,10 @@ import { GetBankTransactionsResponseClass } from '../models';
27
27
  // @ts-ignore
28
28
  import { ImportBankTransactionsResponseClass } from '../models';
29
29
  // @ts-ignore
30
+ import { LinkBankTransactionPaymentRequestsRequestDtoRest } from '../models';
31
+ // @ts-ignore
32
+ import { LinkBankTransactionPaymentRequestsResponseClass } from '../models';
33
+ // @ts-ignore
30
34
  import { LinkBankTransactionRequestDtoRest } from '../models';
31
35
  // @ts-ignore
32
36
  import { LinkBankTransactionsResponseClass } from '../models';
@@ -70,8 +74,13 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
70
74
  // http bearer authentication required
71
75
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
72
76
 
73
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
74
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
77
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
78
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
79
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
80
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
81
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
82
+ if (authorizationValue || authorizationKeepEmpty) {
83
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
75
84
  }
76
85
 
77
86
 
@@ -90,7 +99,7 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
90
99
  * @summary Retrieve the bank transaction
91
100
  * @param {string} code
92
101
  * @param {string} [authorization] Bearer Token
93
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices<i>
102
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts<i>
94
103
  * @param {*} [options] Override http request option.
95
104
  * @throws {RequiredError}
96
105
  */
@@ -120,8 +129,13 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
120
129
  localVarQueryParameter['expand'] = expand;
121
130
  }
122
131
 
123
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
124
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
132
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
133
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
134
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
135
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
136
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
137
+ if (authorizationValue || authorizationKeepEmpty) {
138
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
125
139
  }
126
140
 
127
141
 
@@ -165,8 +179,13 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
165
179
  // http bearer authentication required
166
180
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
167
181
 
168
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
169
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
182
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
183
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
184
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
185
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
186
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
187
+ if (authorizationValue || authorizationKeepEmpty) {
188
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
170
189
  }
171
190
 
172
191
 
@@ -220,8 +239,13 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
220
239
  // http bearer authentication required
221
240
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
222
241
 
223
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
224
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
242
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
243
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
244
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
245
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
246
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
247
+ if (authorizationValue || authorizationKeepEmpty) {
248
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
225
249
  }
226
250
 
227
251
 
@@ -238,6 +262,62 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
238
262
  options: localVarRequestOptions,
239
263
  };
240
264
  },
265
+ /**
266
+ * Links an outgoing bank transaction to the payout payment requests it paid. In one database transaction it creates one payment receipt per request for the full request amount, which marks each request paid, closes every bank order of the requests that has no open request left, and marks the transaction linked. The requests must be open payouts (claim regulations, refund allocations or commission settlements) in the transaction currency that hold no received money (no receipts, or receipts that net to zero because the money came back in a collect receipt), and their amounts must add up to the transaction amount. A request in a bank order must be in a payout order past draft that pays from the tenant bank account of the transaction. A bank order given by its code is linked with every open payment request it holds in the transaction currency at the time of the link; it must be such an order, not closed, with at least one. **Required Permissions** \"payment-management.bank-accounts.create\", \"payment-management.payments.create\", \"payment-management.bank-orders.update\"
267
+ * @summary Link bank transaction to payment requests
268
+ * @param {string} code Code of the outgoing bank transaction to link
269
+ * @param {LinkBankTransactionPaymentRequestsRequestDtoRest} linkBankTransactionPaymentRequestsRequestDtoRest
270
+ * @param {string} [authorization] Bearer Token
271
+ * @param {*} [options] Override http request option.
272
+ * @throws {RequiredError}
273
+ */
274
+ linkBankTransactionPaymentRequests: async (code: string, linkBankTransactionPaymentRequestsRequestDtoRest: LinkBankTransactionPaymentRequestsRequestDtoRest, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
275
+ // verify required parameter 'code' is not null or undefined
276
+ assertParamExists('linkBankTransactionPaymentRequests', 'code', code)
277
+ // verify required parameter 'linkBankTransactionPaymentRequestsRequestDtoRest' is not null or undefined
278
+ assertParamExists('linkBankTransactionPaymentRequests', 'linkBankTransactionPaymentRequestsRequestDtoRest', linkBankTransactionPaymentRequestsRequestDtoRest)
279
+ const localVarPath = `/paymentservice/v1/tenant/bank-transactions/{code}/link-payment-requests`
280
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
281
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
282
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
283
+ let baseOptions;
284
+ let baseAccessToken;
285
+ if (configuration) {
286
+ baseOptions = configuration.baseOptions;
287
+ baseAccessToken = configuration.accessToken;
288
+ }
289
+
290
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
291
+ const localVarHeaderParameter = {} as any;
292
+ const localVarQueryParameter = {} as any;
293
+
294
+ // authentication bearer required
295
+ // http bearer authentication required
296
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
297
+
298
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
299
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
300
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
301
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
302
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
303
+ if (authorizationValue || authorizationKeepEmpty) {
304
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
305
+ }
306
+
307
+
308
+
309
+ localVarHeaderParameter['Content-Type'] = 'application/json';
310
+
311
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
312
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
313
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
314
+ localVarRequestOptions.data = serializeDataIfNeeded(linkBankTransactionPaymentRequestsRequestDtoRest, localVarRequestOptions, configuration)
315
+
316
+ return {
317
+ url: toPathString(localVarUrlObj),
318
+ options: localVarRequestOptions,
319
+ };
320
+ },
241
321
  /**
242
322
  * Returns a list of bank transactions you have previously created. The bank transactions are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"payment-management.bank-accounts.view\"
243
323
  * @summary List bank transactions
@@ -247,7 +327,7 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
247
327
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, bankAccountId, bankAccountNumber, messageReference, amount, currency, transactionReference, transactionDate, entryDate, isLinked&lt;/i&gt;
248
328
  * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: id, createdAt, amount&lt;/i&gt;
249
329
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, createdAt, transactionDate, entryDate&lt;/i&gt;
250
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices&lt;i&gt;
330
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts&lt;i&gt;
251
331
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, bankAccountId, bankAccountNumber, messageReference, amount, currency, transactionReference, transactionDate, entryDate, isLinked&lt;/i&gt;
252
332
  * @param {*} [options] Override http request option.
253
333
  * @throws {RequiredError}
@@ -299,8 +379,13 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
299
379
  localVarQueryParameter['filters'] = filters;
300
380
  }
301
381
 
302
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
303
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
382
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
383
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
384
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
385
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
386
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
387
+ if (authorizationValue || authorizationKeepEmpty) {
388
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
304
389
  }
305
390
 
306
391
 
@@ -344,8 +429,13 @@ export const BankTransactionApiAxiosParamCreator = function (configuration?: Con
344
429
  // http bearer authentication required
345
430
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
346
431
 
347
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
348
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
432
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
433
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
434
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
435
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
436
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
437
+ if (authorizationValue || authorizationKeepEmpty) {
438
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
349
439
  }
350
440
 
351
441
 
@@ -386,7 +476,7 @@ export const BankTransactionApiFp = function(configuration?: Configuration) {
386
476
  * @summary Retrieve the bank transaction
387
477
  * @param {string} code
388
478
  * @param {string} [authorization] Bearer Token
389
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices&lt;i&gt;
479
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts&lt;i&gt;
390
480
  * @param {*} [options] Override http request option.
391
481
  * @throws {RequiredError}
392
482
  */
@@ -419,6 +509,19 @@ export const BankTransactionApiFp = function(configuration?: Configuration) {
419
509
  const localVarAxiosArgs = await localVarAxiosParamCreator.linkBankTransaction(code, linkBankTransactionRequestDtoRest, authorization, options);
420
510
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
421
511
  },
512
+ /**
513
+ * Links an outgoing bank transaction to the payout payment requests it paid. In one database transaction it creates one payment receipt per request for the full request amount, which marks each request paid, closes every bank order of the requests that has no open request left, and marks the transaction linked. The requests must be open payouts (claim regulations, refund allocations or commission settlements) in the transaction currency that hold no received money (no receipts, or receipts that net to zero because the money came back in a collect receipt), and their amounts must add up to the transaction amount. A request in a bank order must be in a payout order past draft that pays from the tenant bank account of the transaction. A bank order given by its code is linked with every open payment request it holds in the transaction currency at the time of the link; it must be such an order, not closed, with at least one. **Required Permissions** \"payment-management.bank-accounts.create\", \"payment-management.payments.create\", \"payment-management.bank-orders.update\"
514
+ * @summary Link bank transaction to payment requests
515
+ * @param {string} code Code of the outgoing bank transaction to link
516
+ * @param {LinkBankTransactionPaymentRequestsRequestDtoRest} linkBankTransactionPaymentRequestsRequestDtoRest
517
+ * @param {string} [authorization] Bearer Token
518
+ * @param {*} [options] Override http request option.
519
+ * @throws {RequiredError}
520
+ */
521
+ async linkBankTransactionPaymentRequests(code: string, linkBankTransactionPaymentRequestsRequestDtoRest: LinkBankTransactionPaymentRequestsRequestDtoRest, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LinkBankTransactionPaymentRequestsResponseClass>> {
522
+ const localVarAxiosArgs = await localVarAxiosParamCreator.linkBankTransactionPaymentRequests(code, linkBankTransactionPaymentRequestsRequestDtoRest, authorization, options);
523
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
524
+ },
422
525
  /**
423
526
  * Returns a list of bank transactions you have previously created. The bank transactions are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"payment-management.bank-accounts.view\"
424
527
  * @summary List bank transactions
@@ -428,7 +531,7 @@ export const BankTransactionApiFp = function(configuration?: Configuration) {
428
531
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, bankAccountId, bankAccountNumber, messageReference, amount, currency, transactionReference, transactionDate, entryDate, isLinked&lt;/i&gt;
429
532
  * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: id, createdAt, amount&lt;/i&gt;
430
533
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, createdAt, transactionDate, entryDate&lt;/i&gt;
431
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices&lt;i&gt;
534
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts&lt;i&gt;
432
535
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, bankAccountId, bankAccountNumber, messageReference, amount, currency, transactionReference, transactionDate, entryDate, isLinked&lt;/i&gt;
433
536
  * @param {*} [options] Override http request option.
434
537
  * @throws {RequiredError}
@@ -475,7 +578,7 @@ export const BankTransactionApiFactory = function (configuration?: Configuration
475
578
  * @summary Retrieve the bank transaction
476
579
  * @param {string} code
477
580
  * @param {string} [authorization] Bearer Token
478
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices&lt;i&gt;
581
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts&lt;i&gt;
479
582
  * @param {*} [options] Override http request option.
480
583
  * @throws {RequiredError}
481
584
  */
@@ -505,6 +608,18 @@ export const BankTransactionApiFactory = function (configuration?: Configuration
505
608
  linkBankTransaction(code: string, linkBankTransactionRequestDtoRest: LinkBankTransactionRequestDtoRest, authorization?: string, options?: any): AxiosPromise<LinkBankTransactionsResponseClass> {
506
609
  return localVarFp.linkBankTransaction(code, linkBankTransactionRequestDtoRest, authorization, options).then((request) => request(axios, basePath));
507
610
  },
611
+ /**
612
+ * Links an outgoing bank transaction to the payout payment requests it paid. In one database transaction it creates one payment receipt per request for the full request amount, which marks each request paid, closes every bank order of the requests that has no open request left, and marks the transaction linked. The requests must be open payouts (claim regulations, refund allocations or commission settlements) in the transaction currency that hold no received money (no receipts, or receipts that net to zero because the money came back in a collect receipt), and their amounts must add up to the transaction amount. A request in a bank order must be in a payout order past draft that pays from the tenant bank account of the transaction. A bank order given by its code is linked with every open payment request it holds in the transaction currency at the time of the link; it must be such an order, not closed, with at least one. **Required Permissions** \"payment-management.bank-accounts.create\", \"payment-management.payments.create\", \"payment-management.bank-orders.update\"
613
+ * @summary Link bank transaction to payment requests
614
+ * @param {string} code Code of the outgoing bank transaction to link
615
+ * @param {LinkBankTransactionPaymentRequestsRequestDtoRest} linkBankTransactionPaymentRequestsRequestDtoRest
616
+ * @param {string} [authorization] Bearer Token
617
+ * @param {*} [options] Override http request option.
618
+ * @throws {RequiredError}
619
+ */
620
+ linkBankTransactionPaymentRequests(code: string, linkBankTransactionPaymentRequestsRequestDtoRest: LinkBankTransactionPaymentRequestsRequestDtoRest, authorization?: string, options?: any): AxiosPromise<LinkBankTransactionPaymentRequestsResponseClass> {
621
+ return localVarFp.linkBankTransactionPaymentRequests(code, linkBankTransactionPaymentRequestsRequestDtoRest, authorization, options).then((request) => request(axios, basePath));
622
+ },
508
623
  /**
509
624
  * Returns a list of bank transactions you have previously created. The bank transactions are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"payment-management.bank-accounts.view\"
510
625
  * @summary List bank transactions
@@ -514,7 +629,7 @@ export const BankTransactionApiFactory = function (configuration?: Configuration
514
629
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, bankAccountId, bankAccountNumber, messageReference, amount, currency, transactionReference, transactionDate, entryDate, isLinked&lt;/i&gt;
515
630
  * @param {string} [search] Search the response for matches in any searchable field. Use filter instead where possible for improved performance.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Searchable fields: id, createdAt, amount&lt;/i&gt;
516
631
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, createdAt, transactionDate, entryDate&lt;/i&gt;
517
- * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices&lt;i&gt;
632
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts&lt;i&gt;
518
633
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, code, bankAccountId, bankAccountNumber, messageReference, amount, currency, transactionReference, transactionDate, entryDate, isLinked&lt;/i&gt;
519
634
  * @param {*} [options] Override http request option.
520
635
  * @throws {RequiredError}
@@ -578,7 +693,7 @@ export interface BankTransactionApiGetBankTransactionRequest {
578
693
  readonly authorization?: string
579
694
 
580
695
  /**
581
- * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices&lt;i&gt;
696
+ * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts&lt;i&gt;
582
697
  * @type {string}
583
698
  * @memberof BankTransactionApiGetBankTransaction
584
699
  */
@@ -634,6 +749,34 @@ export interface BankTransactionApiLinkBankTransactionRequest {
634
749
  readonly authorization?: string
635
750
  }
636
751
 
752
+ /**
753
+ * Request parameters for linkBankTransactionPaymentRequests operation in BankTransactionApi.
754
+ * @export
755
+ * @interface BankTransactionApiLinkBankTransactionPaymentRequestsRequest
756
+ */
757
+ export interface BankTransactionApiLinkBankTransactionPaymentRequestsRequest {
758
+ /**
759
+ * Code of the outgoing bank transaction to link
760
+ * @type {string}
761
+ * @memberof BankTransactionApiLinkBankTransactionPaymentRequests
762
+ */
763
+ readonly code: string
764
+
765
+ /**
766
+ *
767
+ * @type {LinkBankTransactionPaymentRequestsRequestDtoRest}
768
+ * @memberof BankTransactionApiLinkBankTransactionPaymentRequests
769
+ */
770
+ readonly linkBankTransactionPaymentRequestsRequestDtoRest: LinkBankTransactionPaymentRequestsRequestDtoRest
771
+
772
+ /**
773
+ * Bearer Token
774
+ * @type {string}
775
+ * @memberof BankTransactionApiLinkBankTransactionPaymentRequests
776
+ */
777
+ readonly authorization?: string
778
+ }
779
+
637
780
  /**
638
781
  * Request parameters for listBankTransactions operation in BankTransactionApi.
639
782
  * @export
@@ -683,7 +826,7 @@ export interface BankTransactionApiListBankTransactionsRequest {
683
826
  readonly order?: string
684
827
 
685
828
  /**
686
- * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices&lt;i&gt;
829
+ * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: bankAccount, invoiceMatchSuggestions, suggestionGenerationProgress, linkedBankOrder, bankTransactionInvoices, paymentReceipts&lt;i&gt;
687
830
  * @type {string}
688
831
  * @memberof BankTransactionApiListBankTransactions
689
832
  */
@@ -734,7 +877,7 @@ export class BankTransactionApi extends BaseAPI {
734
877
  * @memberof BankTransactionApi
735
878
  */
736
879
  public generateInvoiceMatchSuggestion(requestParameters: BankTransactionApiGenerateInvoiceMatchSuggestionRequest, options?: AxiosRequestConfig) {
737
- return BankTransactionApiFp(this.configuration).generateInvoiceMatchSuggestion(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
880
+ return BankTransactionApiFp(this.configuration).generateInvoiceMatchSuggestion(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
738
881
  }
739
882
 
740
883
  /**
@@ -746,7 +889,7 @@ export class BankTransactionApi extends BaseAPI {
746
889
  * @memberof BankTransactionApi
747
890
  */
748
891
  public getBankTransaction(requestParameters: BankTransactionApiGetBankTransactionRequest, options?: AxiosRequestConfig) {
749
- return BankTransactionApiFp(this.configuration).getBankTransaction(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
892
+ return BankTransactionApiFp(this.configuration).getBankTransaction(requestParameters.code, requestParameters.authorization, requestParameters.expand, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
750
893
  }
751
894
 
752
895
  /**
@@ -758,7 +901,7 @@ export class BankTransactionApi extends BaseAPI {
758
901
  * @memberof BankTransactionApi
759
902
  */
760
903
  public importBankTransactions(requestParameters: BankTransactionApiImportBankTransactionsRequest, options?: AxiosRequestConfig) {
761
- return BankTransactionApiFp(this.configuration).importBankTransactions(requestParameters.file, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
904
+ return BankTransactionApiFp(this.configuration).importBankTransactions(requestParameters.file, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
762
905
  }
763
906
 
764
907
  /**
@@ -770,7 +913,19 @@ export class BankTransactionApi extends BaseAPI {
770
913
  * @memberof BankTransactionApi
771
914
  */
772
915
  public linkBankTransaction(requestParameters: BankTransactionApiLinkBankTransactionRequest, options?: AxiosRequestConfig) {
773
- return BankTransactionApiFp(this.configuration).linkBankTransaction(requestParameters.code, requestParameters.linkBankTransactionRequestDtoRest, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
916
+ return BankTransactionApiFp(this.configuration).linkBankTransaction(requestParameters.code, requestParameters.linkBankTransactionRequestDtoRest, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
917
+ }
918
+
919
+ /**
920
+ * Links an outgoing bank transaction to the payout payment requests it paid. In one database transaction it creates one payment receipt per request for the full request amount, which marks each request paid, closes every bank order of the requests that has no open request left, and marks the transaction linked. The requests must be open payouts (claim regulations, refund allocations or commission settlements) in the transaction currency that hold no received money (no receipts, or receipts that net to zero because the money came back in a collect receipt), and their amounts must add up to the transaction amount. A request in a bank order must be in a payout order past draft that pays from the tenant bank account of the transaction. A bank order given by its code is linked with every open payment request it holds in the transaction currency at the time of the link; it must be such an order, not closed, with at least one. **Required Permissions** \"payment-management.bank-accounts.create\", \"payment-management.payments.create\", \"payment-management.bank-orders.update\"
921
+ * @summary Link bank transaction to payment requests
922
+ * @param {BankTransactionApiLinkBankTransactionPaymentRequestsRequest} requestParameters Request parameters.
923
+ * @param {*} [options] Override http request option.
924
+ * @throws {RequiredError}
925
+ * @memberof BankTransactionApi
926
+ */
927
+ public linkBankTransactionPaymentRequests(requestParameters: BankTransactionApiLinkBankTransactionPaymentRequestsRequest, options?: AxiosRequestConfig) {
928
+ return BankTransactionApiFp(this.configuration).linkBankTransactionPaymentRequests(requestParameters.code, requestParameters.linkBankTransactionPaymentRequestsRequestDtoRest, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
774
929
  }
775
930
 
776
931
  /**
@@ -782,7 +937,7 @@ export class BankTransactionApi extends BaseAPI {
782
937
  * @memberof BankTransactionApi
783
938
  */
784
939
  public listBankTransactions(requestParameters: BankTransactionApiListBankTransactionsRequest = {}, options?: AxiosRequestConfig) {
785
- return BankTransactionApiFp(this.configuration).listBankTransactions(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
940
+ return BankTransactionApiFp(this.configuration).listBankTransactions(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
786
941
  }
787
942
 
788
943
  /**
@@ -794,6 +949,6 @@ export class BankTransactionApi extends BaseAPI {
794
949
  * @memberof BankTransactionApi
795
950
  */
796
951
  public unlinkBankTransaction(requestParameters: BankTransactionApiUnlinkBankTransactionRequest, options?: AxiosRequestConfig) {
797
- return BankTransactionApiFp(this.configuration).unlinkBankTransaction(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
952
+ return BankTransactionApiFp(this.configuration).unlinkBankTransaction(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
798
953
  }
799
954
  }
@@ -67,8 +67,13 @@ export const BillingAddressesApiAxiosParamCreator = function (configuration?: Co
67
67
  // http bearer authentication required
68
68
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
69
69
 
70
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
71
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
70
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
71
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
72
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
73
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
74
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
75
+ if (authorizationValue || authorizationKeepEmpty) {
76
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
72
77
  }
73
78
 
74
79
 
@@ -115,8 +120,13 @@ export const BillingAddressesApiAxiosParamCreator = function (configuration?: Co
115
120
  // http bearer authentication required
116
121
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
117
122
 
118
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
119
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
123
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
124
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
125
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
126
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
127
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
128
+ if (authorizationValue || authorizationKeepEmpty) {
129
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
120
130
  }
121
131
 
122
132
 
@@ -160,8 +170,13 @@ export const BillingAddressesApiAxiosParamCreator = function (configuration?: Co
160
170
  // http bearer authentication required
161
171
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
162
172
 
163
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
164
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
173
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
174
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
175
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
176
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
177
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
178
+ if (authorizationValue || authorizationKeepEmpty) {
179
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
165
180
  }
166
181
 
167
182
 
@@ -236,8 +251,13 @@ export const BillingAddressesApiAxiosParamCreator = function (configuration?: Co
236
251
  localVarQueryParameter['filters'] = filters;
237
252
  }
238
253
 
239
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
240
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
254
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
255
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
256
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
257
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
258
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
259
+ if (authorizationValue || authorizationKeepEmpty) {
260
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
241
261
  }
242
262
 
243
263
 
@@ -284,8 +304,13 @@ export const BillingAddressesApiAxiosParamCreator = function (configuration?: Co
284
304
  // http bearer authentication required
285
305
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
286
306
 
287
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
288
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
307
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
308
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
309
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
310
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
311
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
312
+ if (authorizationValue || authorizationKeepEmpty) {
313
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
289
314
  }
290
315
 
291
316
 
@@ -624,7 +649,7 @@ export class BillingAddressesApi extends BaseAPI {
624
649
  * @memberof BillingAddressesApi
625
650
  */
626
651
  public createBillingAddress(requestParameters: BillingAddressesApiCreateBillingAddressRequest, options?: AxiosRequestConfig) {
627
- return BillingAddressesApiFp(this.configuration).createBillingAddress(requestParameters.createBillingAddressRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
652
+ return BillingAddressesApiFp(this.configuration).createBillingAddress(requestParameters.createBillingAddressRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
628
653
  }
629
654
 
630
655
  /**
@@ -636,7 +661,7 @@ export class BillingAddressesApi extends BaseAPI {
636
661
  * @memberof BillingAddressesApi
637
662
  */
638
663
  public deleteBillingAddress(requestParameters: BillingAddressesApiDeleteBillingAddressRequest, options?: AxiosRequestConfig) {
639
- return BillingAddressesApiFp(this.configuration).deleteBillingAddress(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
664
+ return BillingAddressesApiFp(this.configuration).deleteBillingAddress(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
640
665
  }
641
666
 
642
667
  /**
@@ -648,7 +673,7 @@ export class BillingAddressesApi extends BaseAPI {
648
673
  * @memberof BillingAddressesApi
649
674
  */
650
675
  public getBillingAddress(requestParameters: BillingAddressesApiGetBillingAddressRequest, options?: AxiosRequestConfig) {
651
- return BillingAddressesApiFp(this.configuration).getBillingAddress(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
676
+ return BillingAddressesApiFp(this.configuration).getBillingAddress(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
652
677
  }
653
678
 
654
679
  /**
@@ -660,7 +685,7 @@ export class BillingAddressesApi extends BaseAPI {
660
685
  * @memberof BillingAddressesApi
661
686
  */
662
687
  public listBillingAddresses(requestParameters: BillingAddressesApiListBillingAddressesRequest = {}, options?: AxiosRequestConfig) {
663
- return BillingAddressesApiFp(this.configuration).listBillingAddresses(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
688
+ return BillingAddressesApiFp(this.configuration).listBillingAddresses(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
664
689
  }
665
690
 
666
691
  /**
@@ -672,6 +697,6 @@ export class BillingAddressesApi extends BaseAPI {
672
697
  * @memberof BillingAddressesApi
673
698
  */
674
699
  public updateBillingAddress(requestParameters: BillingAddressesApiUpdateBillingAddressRequest, options?: AxiosRequestConfig) {
675
- return BillingAddressesApiFp(this.configuration).updateBillingAddress(requestParameters.code, requestParameters.updateBillingAddressRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
700
+ return BillingAddressesApiFp(this.configuration).updateBillingAddress(requestParameters.code, requestParameters.updateBillingAddressRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
676
701
  }
677
702
  }
@@ -63,8 +63,13 @@ export const CreditAllocationApiAxiosParamCreator = function (configuration?: Co
63
63
  // http bearer authentication required
64
64
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
65
65
 
66
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
67
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
66
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
67
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
68
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
69
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
70
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
71
+ if (authorizationValue || authorizationKeepEmpty) {
72
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
68
73
  }
69
74
 
70
75
 
@@ -111,8 +116,13 @@ export const CreditAllocationApiAxiosParamCreator = function (configuration?: Co
111
116
  // http bearer authentication required
112
117
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
113
118
 
114
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
115
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
119
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
120
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
121
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
122
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
123
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
124
+ if (authorizationValue || authorizationKeepEmpty) {
125
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
116
126
  }
117
127
 
118
128
 
@@ -187,8 +197,13 @@ export const CreditAllocationApiAxiosParamCreator = function (configuration?: Co
187
197
  localVarQueryParameter['filters'] = filters;
188
198
  }
189
199
 
190
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
191
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
200
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
201
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
202
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
203
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
204
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
205
+ if (authorizationValue || authorizationKeepEmpty) {
206
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
192
207
  }
193
208
 
194
209
 
@@ -427,7 +442,7 @@ export class CreditAllocationApi extends BaseAPI {
427
442
  * @memberof CreditAllocationApi
428
443
  */
429
444
  public createAllocateCredit(requestParameters: CreditAllocationApiCreateAllocateCreditRequest, options?: AxiosRequestConfig) {
430
- return CreditAllocationApiFp(this.configuration).createAllocateCredit(requestParameters.createCreditAllocationRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
445
+ return CreditAllocationApiFp(this.configuration).createAllocateCredit(requestParameters.createCreditAllocationRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
431
446
  }
432
447
 
433
448
  /**
@@ -439,7 +454,7 @@ export class CreditAllocationApi extends BaseAPI {
439
454
  * @memberof CreditAllocationApi
440
455
  */
441
456
  public getCreditAllocation(requestParameters: CreditAllocationApiGetCreditAllocationRequest, options?: AxiosRequestConfig) {
442
- return CreditAllocationApiFp(this.configuration).getCreditAllocation(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
457
+ return CreditAllocationApiFp(this.configuration).getCreditAllocation(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
443
458
  }
444
459
 
445
460
  /**
@@ -451,6 +466,6 @@ export class CreditAllocationApi extends BaseAPI {
451
466
  * @memberof CreditAllocationApi
452
467
  */
453
468
  public listCreditAllocations(requestParameters: CreditAllocationApiListCreditAllocationsRequest = {}, options?: AxiosRequestConfig) {
454
- return CreditAllocationApiFp(this.configuration).listCreditAllocations(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
469
+ return CreditAllocationApiFp(this.configuration).listCreditAllocations(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
455
470
  }
456
471
  }