@emilgroup/billing-v2-sdk 0.0.0-stage → 1.0.1-beta.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 (265) hide show
  1. package/.openapi-generator/FILES +93 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +50 -2
  5. package/api/bill-runs-api.ts +468 -0
  6. package/api/bills-api.ts +145 -0
  7. package/api/invoices-api.ts +1530 -0
  8. package/api/jobs-api.ts +756 -0
  9. package/api/policy-billings-api.ts +591 -0
  10. package/api.ts +35 -0
  11. package/base.ts +588 -0
  12. package/common.ts +199 -0
  13. package/configuration.ts +130 -0
  14. package/dist/api/bill-runs-api.d.ts +266 -0
  15. package/dist/api/bill-runs-api.js +466 -0
  16. package/dist/api/bills-api.d.ts +87 -0
  17. package/dist/api/bills-api.js +207 -0
  18. package/dist/api/invoices-api.d.ts +847 -0
  19. package/dist/api/invoices-api.js +1353 -0
  20. package/dist/api/jobs-api.d.ts +426 -0
  21. package/dist/api/jobs-api.js +708 -0
  22. package/dist/api/policy-billings-api.d.ts +332 -0
  23. package/dist/api/policy-billings-api.js +561 -0
  24. package/dist/api.d.ts +16 -0
  25. package/dist/api.js +34 -0
  26. package/dist/base.d.ts +120 -0
  27. package/dist/base.js +604 -0
  28. package/dist/common.d.ts +91 -0
  29. package/dist/common.js +277 -0
  30. package/dist/configuration.d.ts +106 -0
  31. package/dist/configuration.js +54 -0
  32. package/dist/index.d.ts +15 -0
  33. package/dist/index.js +36 -0
  34. package/dist/models/any.d.ts +25 -0
  35. package/dist/models/any.js +15 -0
  36. package/dist/models/bill-item.d.ts +132 -0
  37. package/dist/models/bill-item.js +15 -0
  38. package/dist/models/bill-run.d.ts +145 -0
  39. package/dist/models/bill-run.js +15 -0
  40. package/dist/models/bill.d.ts +194 -0
  41. package/dist/models/bill.js +15 -0
  42. package/dist/models/cancel-job-response.d.ts +25 -0
  43. package/dist/models/cancel-job-response.js +15 -0
  44. package/dist/models/create-correction-invoices-request.d.ts +72 -0
  45. package/dist/models/create-correction-invoices-request.js +15 -0
  46. package/dist/models/create-correction-invoices-response.d.ts +31 -0
  47. package/dist/models/create-correction-invoices-response.js +15 -0
  48. package/dist/models/create-detail-export-job-request.d.ts +56 -0
  49. package/dist/models/create-detail-export-job-request.js +15 -0
  50. package/dist/models/create-detail-export-job-response.d.ts +25 -0
  51. package/dist/models/create-detail-export-job-response.js +15 -0
  52. package/dist/models/create-estimated-invoice-for-interval-request.d.ts +42 -0
  53. package/dist/models/create-estimated-invoice-for-interval-request.js +15 -0
  54. package/dist/models/create-estimated-invoice-for-interval-response.d.ts +25 -0
  55. package/dist/models/create-estimated-invoice-for-interval-response.js +15 -0
  56. package/dist/models/create-estimated-invoice-request.d.ts +36 -0
  57. package/dist/models/create-estimated-invoice-request.js +15 -0
  58. package/dist/models/create-estimated-invoice-response.d.ts +25 -0
  59. package/dist/models/create-estimated-invoice-response.js +15 -0
  60. package/dist/models/create-export-job-request.d.ts +68 -0
  61. package/dist/models/create-export-job-request.js +15 -0
  62. package/dist/models/create-export-job-response.d.ts +25 -0
  63. package/dist/models/create-export-job-response.js +15 -0
  64. package/dist/models/create-initial-invoice-request.d.ts +72 -0
  65. package/dist/models/create-initial-invoice-request.js +15 -0
  66. package/dist/models/create-initial-invoice-response.d.ts +25 -0
  67. package/dist/models/create-initial-invoice-response.js +15 -0
  68. package/dist/models/create-invoice-request.d.ts +67 -0
  69. package/dist/models/create-invoice-request.js +15 -0
  70. package/dist/models/create-invoice-response.d.ts +25 -0
  71. package/dist/models/create-invoice-response.js +15 -0
  72. package/dist/models/create-invoice-status-body.d.ts +24 -0
  73. package/dist/models/create-invoice-status-body.js +15 -0
  74. package/dist/models/create-invoice-status-response.d.ts +25 -0
  75. package/dist/models/create-invoice-status-response.js +15 -0
  76. package/dist/models/create-item-request.d.ts +36 -0
  77. package/dist/models/create-item-request.js +15 -0
  78. package/dist/models/create-policy-billing-request.d.ts +42 -0
  79. package/dist/models/create-policy-billing-request.js +15 -0
  80. package/dist/models/create-policy-billing-response.d.ts +25 -0
  81. package/dist/models/create-policy-billing-response.js +15 -0
  82. package/dist/models/create-recurring-invoice-request.d.ts +72 -0
  83. package/dist/models/create-recurring-invoice-request.js +15 -0
  84. package/dist/models/create-recurring-invoice-response.d.ts +31 -0
  85. package/dist/models/create-recurring-invoice-response.js +15 -0
  86. package/dist/models/create-termination-invoice-request.d.ts +60 -0
  87. package/dist/models/create-termination-invoice-request.js +15 -0
  88. package/dist/models/create-termination-invoice-response.d.ts +25 -0
  89. package/dist/models/create-termination-invoice-response.js +15 -0
  90. package/dist/models/create-withdraw-invoice-request.d.ts +48 -0
  91. package/dist/models/create-withdraw-invoice-request.js +15 -0
  92. package/dist/models/create-withdraw-invoice-response.d.ts +25 -0
  93. package/dist/models/create-withdraw-invoice-response.js +15 -0
  94. package/dist/models/estimate-history-entry.d.ts +36 -0
  95. package/dist/models/estimate-history-entry.js +15 -0
  96. package/dist/models/export-column.d.ts +36 -0
  97. package/dist/models/export-column.js +15 -0
  98. package/dist/models/filter-field.d.ts +110 -0
  99. package/dist/models/filter-field.js +15 -0
  100. package/dist/models/filter-value.d.ts +37 -0
  101. package/dist/models/filter-value.js +15 -0
  102. package/dist/models/get-bill-response.d.ts +25 -0
  103. package/dist/models/get-bill-response.js +15 -0
  104. package/dist/models/get-bill-run-filter-catalog-response.d.ts +31 -0
  105. package/dist/models/get-bill-run-filter-catalog-response.js +15 -0
  106. package/dist/models/get-bill-run-response.d.ts +25 -0
  107. package/dist/models/get-bill-run-response.js +15 -0
  108. package/dist/models/get-invoice-filter-catalog-response.d.ts +31 -0
  109. package/dist/models/get-invoice-filter-catalog-response.js +15 -0
  110. package/dist/models/get-invoice-response.d.ts +25 -0
  111. package/dist/models/get-invoice-response.js +15 -0
  112. package/dist/models/get-job-download-response.d.ts +25 -0
  113. package/dist/models/get-job-download-response.js +15 -0
  114. package/dist/models/get-job-filter-catalog-response.d.ts +31 -0
  115. package/dist/models/get-job-filter-catalog-response.js +15 -0
  116. package/dist/models/get-job-response.d.ts +25 -0
  117. package/dist/models/get-job-response.js +15 -0
  118. package/dist/models/get-policies-billing-date-filter-catalog-response.d.ts +31 -0
  119. package/dist/models/get-policies-billing-date-filter-catalog-response.js +15 -0
  120. package/dist/models/get-policies-billing-filter-catalog-response.d.ts +31 -0
  121. package/dist/models/get-policies-billing-filter-catalog-response.js +15 -0
  122. package/dist/models/get-policy-billing-response.d.ts +25 -0
  123. package/dist/models/get-policy-billing-response.js +15 -0
  124. package/dist/models/highlight.d.ts +30 -0
  125. package/dist/models/highlight.js +15 -0
  126. package/dist/models/index.d.ts +75 -0
  127. package/dist/models/index.js +91 -0
  128. package/dist/models/invoice-item.d.ts +204 -0
  129. package/dist/models/invoice-item.js +15 -0
  130. package/dist/models/invoice-payment.d.ts +108 -0
  131. package/dist/models/invoice-payment.js +15 -0
  132. package/dist/models/invoice-payments.d.ts +25 -0
  133. package/dist/models/invoice-payments.js +15 -0
  134. package/dist/models/invoice-status.d.ts +54 -0
  135. package/dist/models/invoice-status.js +15 -0
  136. package/dist/models/invoice.d.ts +275 -0
  137. package/dist/models/invoice.js +15 -0
  138. package/dist/models/job-download.d.ts +36 -0
  139. package/dist/models/job-download.js +15 -0
  140. package/dist/models/job-error.d.ts +30 -0
  141. package/dist/models/job-error.js +15 -0
  142. package/dist/models/job-progress.d.ts +36 -0
  143. package/dist/models/job-progress.js +15 -0
  144. package/dist/models/job.d.ts +134 -0
  145. package/dist/models/job.js +15 -0
  146. package/dist/models/list-bill-runs-response.d.ts +37 -0
  147. package/dist/models/list-bill-runs-response.js +15 -0
  148. package/dist/models/list-invoices-response.d.ts +37 -0
  149. package/dist/models/list-invoices-response.js +15 -0
  150. package/dist/models/list-jobs-response.d.ts +37 -0
  151. package/dist/models/list-jobs-response.js +15 -0
  152. package/dist/models/list-policies-billing-dates-response.d.ts +37 -0
  153. package/dist/models/list-policies-billing-dates-response.js +15 -0
  154. package/dist/models/list-policies-billings-response.d.ts +37 -0
  155. package/dist/models/list-policies-billings-response.js +15 -0
  156. package/dist/models/list-request.d.ts +60 -0
  157. package/dist/models/list-request.js +15 -0
  158. package/dist/models/localized-text.d.ts +30 -0
  159. package/dist/models/localized-text.js +15 -0
  160. package/dist/models/match.d.ts +69 -0
  161. package/dist/models/match.js +15 -0
  162. package/dist/models/payment-term.d.ts +42 -0
  163. package/dist/models/payment-term.js +15 -0
  164. package/dist/models/policy-billing.d.ts +139 -0
  165. package/dist/models/policy-billing.js +15 -0
  166. package/dist/models/request-bill-run-request.d.ts +30 -0
  167. package/dist/models/request-bill-run-request.js +15 -0
  168. package/dist/models/request-bill-run-response.d.ts +25 -0
  169. package/dist/models/request-bill-run-response.js +15 -0
  170. package/dist/models/resolved-billing-config.d.ts +130 -0
  171. package/dist/models/resolved-billing-config.js +15 -0
  172. package/dist/models/revert-invoice-request.d.ts +24 -0
  173. package/dist/models/revert-invoice-request.js +15 -0
  174. package/dist/models/revert-invoice-response.d.ts +25 -0
  175. package/dist/models/revert-invoice-response.js +15 -0
  176. package/dist/models/slice.d.ts +30 -0
  177. package/dist/models/slice.js +15 -0
  178. package/dist/models/status.d.ts +37 -0
  179. package/dist/models/status.js +15 -0
  180. package/dist/models/tax.d.ts +30 -0
  181. package/dist/models/tax.js +15 -0
  182. package/dist/models/update-policy-billing-body.d.ts +24 -0
  183. package/dist/models/update-policy-billing-body.js +15 -0
  184. package/dist/models/update-policy-billing-response.d.ts +25 -0
  185. package/dist/models/update-policy-billing-response.js +15 -0
  186. package/git_push.sh +57 -0
  187. package/index.ts +19 -0
  188. package/models/any.ts +32 -0
  189. package/models/bill-item.ts +138 -0
  190. package/models/bill-run.ts +151 -0
  191. package/models/bill.ts +200 -0
  192. package/models/cancel-job-response.ts +31 -0
  193. package/models/create-correction-invoices-request.ts +78 -0
  194. package/models/create-correction-invoices-response.ts +37 -0
  195. package/models/create-detail-export-job-request.ts +60 -0
  196. package/models/create-detail-export-job-response.ts +31 -0
  197. package/models/create-estimated-invoice-for-interval-request.ts +48 -0
  198. package/models/create-estimated-invoice-for-interval-response.ts +31 -0
  199. package/models/create-estimated-invoice-request.ts +42 -0
  200. package/models/create-estimated-invoice-response.ts +31 -0
  201. package/models/create-export-job-request.ts +74 -0
  202. package/models/create-export-job-response.ts +31 -0
  203. package/models/create-initial-invoice-request.ts +78 -0
  204. package/models/create-initial-invoice-response.ts +31 -0
  205. package/models/create-invoice-request.ts +73 -0
  206. package/models/create-invoice-response.ts +31 -0
  207. package/models/create-invoice-status-body.ts +30 -0
  208. package/models/create-invoice-status-response.ts +31 -0
  209. package/models/create-item-request.ts +42 -0
  210. package/models/create-policy-billing-request.ts +48 -0
  211. package/models/create-policy-billing-response.ts +31 -0
  212. package/models/create-recurring-invoice-request.ts +78 -0
  213. package/models/create-recurring-invoice-response.ts +37 -0
  214. package/models/create-termination-invoice-request.ts +66 -0
  215. package/models/create-termination-invoice-response.ts +31 -0
  216. package/models/create-withdraw-invoice-request.ts +54 -0
  217. package/models/create-withdraw-invoice-response.ts +31 -0
  218. package/models/estimate-history-entry.ts +42 -0
  219. package/models/export-column.ts +42 -0
  220. package/models/filter-field.ts +116 -0
  221. package/models/filter-value.ts +43 -0
  222. package/models/get-bill-response.ts +31 -0
  223. package/models/get-bill-run-filter-catalog-response.ts +37 -0
  224. package/models/get-bill-run-response.ts +31 -0
  225. package/models/get-invoice-filter-catalog-response.ts +37 -0
  226. package/models/get-invoice-response.ts +31 -0
  227. package/models/get-job-download-response.ts +31 -0
  228. package/models/get-job-filter-catalog-response.ts +37 -0
  229. package/models/get-job-response.ts +31 -0
  230. package/models/get-policies-billing-date-filter-catalog-response.ts +37 -0
  231. package/models/get-policies-billing-filter-catalog-response.ts +37 -0
  232. package/models/get-policy-billing-response.ts +31 -0
  233. package/models/highlight.ts +36 -0
  234. package/models/index.ts +75 -0
  235. package/models/invoice-item.ts +210 -0
  236. package/models/invoice-payment.ts +114 -0
  237. package/models/invoice-payments.ts +31 -0
  238. package/models/invoice-status.ts +60 -0
  239. package/models/invoice.ts +281 -0
  240. package/models/job-download.ts +42 -0
  241. package/models/job-error.ts +36 -0
  242. package/models/job-progress.ts +42 -0
  243. package/models/job.ts +140 -0
  244. package/models/list-bill-runs-response.ts +43 -0
  245. package/models/list-invoices-response.ts +43 -0
  246. package/models/list-jobs-response.ts +43 -0
  247. package/models/list-policies-billing-dates-response.ts +43 -0
  248. package/models/list-policies-billings-response.ts +43 -0
  249. package/models/list-request.ts +66 -0
  250. package/models/localized-text.ts +36 -0
  251. package/models/match.ts +75 -0
  252. package/models/payment-term.ts +48 -0
  253. package/models/policy-billing.ts +145 -0
  254. package/models/request-bill-run-request.ts +36 -0
  255. package/models/request-bill-run-response.ts +31 -0
  256. package/models/resolved-billing-config.ts +134 -0
  257. package/models/revert-invoice-request.ts +30 -0
  258. package/models/revert-invoice-response.ts +31 -0
  259. package/models/slice.ts +36 -0
  260. package/models/status.ts +43 -0
  261. package/models/tax.ts +36 -0
  262. package/models/update-policy-billing-body.ts +30 -0
  263. package/models/update-policy-billing-response.ts +31 -0
  264. package/package.json +25 -4
  265. package/tsconfig.json +23 -0
@@ -0,0 +1,1530 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL Billing Service
5
+ * The billing service: bills, bill runs, invoices and policy billings.
6
+ *
7
+ * The version of the OpenAPI document: 2.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
17
+ import { Configuration } from '../configuration';
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
+ // @ts-ignore
22
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
+ // @ts-ignore
24
+ import { CreateCorrectionInvoicesRequest } from '../models';
25
+ // @ts-ignore
26
+ import { CreateCorrectionInvoicesResponse } from '../models';
27
+ // @ts-ignore
28
+ import { CreateEstimatedInvoiceForIntervalRequest } from '../models';
29
+ // @ts-ignore
30
+ import { CreateEstimatedInvoiceForIntervalResponse } from '../models';
31
+ // @ts-ignore
32
+ import { CreateEstimatedInvoiceRequest } from '../models';
33
+ // @ts-ignore
34
+ import { CreateEstimatedInvoiceResponse } from '../models';
35
+ // @ts-ignore
36
+ import { CreateInitialInvoiceRequest } from '../models';
37
+ // @ts-ignore
38
+ import { CreateInitialInvoiceResponse } from '../models';
39
+ // @ts-ignore
40
+ import { CreateInvoiceRequest } from '../models';
41
+ // @ts-ignore
42
+ import { CreateInvoiceResponse } from '../models';
43
+ // @ts-ignore
44
+ import { CreateInvoiceStatusBody } from '../models';
45
+ // @ts-ignore
46
+ import { CreateInvoiceStatusResponse } from '../models';
47
+ // @ts-ignore
48
+ import { CreateRecurringInvoiceRequest } from '../models';
49
+ // @ts-ignore
50
+ import { CreateRecurringInvoiceResponse } from '../models';
51
+ // @ts-ignore
52
+ import { CreateTerminationInvoiceRequest } from '../models';
53
+ // @ts-ignore
54
+ import { CreateTerminationInvoiceResponse } from '../models';
55
+ // @ts-ignore
56
+ import { CreateWithdrawInvoiceRequest } from '../models';
57
+ // @ts-ignore
58
+ import { CreateWithdrawInvoiceResponse } from '../models';
59
+ // @ts-ignore
60
+ import { GetInvoiceFilterCatalogResponse } from '../models';
61
+ // @ts-ignore
62
+ import { GetInvoiceResponse } from '../models';
63
+ // @ts-ignore
64
+ import { GetPoliciesBillingDateFilterCatalogResponse } from '../models';
65
+ // @ts-ignore
66
+ import { ListInvoicesResponse } from '../models';
67
+ // @ts-ignore
68
+ import { ListPoliciesBillingDatesResponse } from '../models';
69
+ // @ts-ignore
70
+ import { RevertInvoiceRequest } from '../models';
71
+ // @ts-ignore
72
+ import { RevertInvoiceResponse } from '../models';
73
+ // @ts-ignore
74
+ import { Status } from '../models';
75
+ /**
76
+ * InvoicesApi - axios parameter creator
77
+ * @export
78
+ */
79
+ export const InvoicesApiAxiosParamCreator = function (configuration?: Configuration) {
80
+ return {
81
+ /**
82
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
83
+ * @summary Creates correction invoices for a policy.
84
+ * @param {CreateCorrectionInvoicesRequest} body The request of `CreateCorrectionInvoices`. Only `policyCode`, the billing interval and `metadata` are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
85
+ * @param {*} [options] Override http request option.
86
+ * @throws {RequiredError}
87
+ */
88
+ billingServiceCreateCorrectionInvoices: async (body: CreateCorrectionInvoicesRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
89
+ // verify required parameter 'body' is not null or undefined
90
+ assertParamExists('billingServiceCreateCorrectionInvoices', 'body', body)
91
+ const localVarPath = `/billingservice/v2/correction-invoices`;
92
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
93
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
94
+ let baseOptions;
95
+ let baseAccessToken;
96
+ if (configuration) {
97
+ baseOptions = configuration.baseOptions;
98
+ baseAccessToken = configuration.accessToken;
99
+ }
100
+
101
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
102
+ const localVarHeaderParameter = {} as any;
103
+ const localVarQueryParameter = {} as any;
104
+
105
+
106
+
107
+ localVarHeaderParameter['Content-Type'] = 'application/json';
108
+
109
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
110
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
111
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
112
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
113
+
114
+ return {
115
+ url: toPathString(localVarUrlObj),
116
+ options: localVarRequestOptions,
117
+ };
118
+ },
119
+ /**
120
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
121
+ * @summary Creates an estimate for the running period of a policy.
122
+ * @param {CreateEstimatedInvoiceRequest} body The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ billingServiceCreateEstimatedInvoice: async (body: CreateEstimatedInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
127
+ // verify required parameter 'body' is not null or undefined
128
+ assertParamExists('billingServiceCreateEstimatedInvoice', 'body', body)
129
+ const localVarPath = `/billingservice/v2/estimated-invoices`;
130
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
131
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
132
+ let baseOptions;
133
+ let baseAccessToken;
134
+ if (configuration) {
135
+ baseOptions = configuration.baseOptions;
136
+ baseAccessToken = configuration.accessToken;
137
+ }
138
+
139
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
140
+ const localVarHeaderParameter = {} as any;
141
+ const localVarQueryParameter = {} as any;
142
+
143
+
144
+
145
+ localVarHeaderParameter['Content-Type'] = 'application/json';
146
+
147
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
148
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
149
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
150
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
151
+
152
+ return {
153
+ url: toPathString(localVarUrlObj),
154
+ options: localVarRequestOptions,
155
+ };
156
+ },
157
+ /**
158
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
159
+ * @summary Creates an estimate for an explicit period of a policy.
160
+ * @param {CreateEstimatedInvoiceForIntervalRequest} body The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
161
+ * @param {*} [options] Override http request option.
162
+ * @throws {RequiredError}
163
+ */
164
+ billingServiceCreateEstimatedInvoiceForInterval: async (body: CreateEstimatedInvoiceForIntervalRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
165
+ // verify required parameter 'body' is not null or undefined
166
+ assertParamExists('billingServiceCreateEstimatedInvoiceForInterval', 'body', body)
167
+ const localVarPath = `/billingservice/v2/estimated-invoices/interval`;
168
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
169
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
170
+ let baseOptions;
171
+ let baseAccessToken;
172
+ if (configuration) {
173
+ baseOptions = configuration.baseOptions;
174
+ baseAccessToken = configuration.accessToken;
175
+ }
176
+
177
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
178
+ const localVarHeaderParameter = {} as any;
179
+ const localVarQueryParameter = {} as any;
180
+
181
+
182
+
183
+ localVarHeaderParameter['Content-Type'] = 'application/json';
184
+
185
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
186
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
187
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
188
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
189
+
190
+ return {
191
+ url: toPathString(localVarUrlObj),
192
+ options: localVarRequestOptions,
193
+ };
194
+ },
195
+ /**
196
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
197
+ * @summary Creates the first invoice of a policy.
198
+ * @param {CreateInitialInvoiceRequest} body The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
199
+ * @param {*} [options] Override http request option.
200
+ * @throws {RequiredError}
201
+ */
202
+ billingServiceCreateInitialInvoice: async (body: CreateInitialInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
203
+ // verify required parameter 'body' is not null or undefined
204
+ assertParamExists('billingServiceCreateInitialInvoice', 'body', body)
205
+ const localVarPath = `/billingservice/v2/initial-invoices`;
206
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
207
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
208
+ let baseOptions;
209
+ let baseAccessToken;
210
+ if (configuration) {
211
+ baseOptions = configuration.baseOptions;
212
+ baseAccessToken = configuration.accessToken;
213
+ }
214
+
215
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
216
+ const localVarHeaderParameter = {} as any;
217
+ const localVarQueryParameter = {} as any;
218
+
219
+
220
+
221
+ localVarHeaderParameter['Content-Type'] = 'application/json';
222
+
223
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
224
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
225
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
226
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
227
+
228
+ return {
229
+ url: toPathString(localVarUrlObj),
230
+ options: localVarRequestOptions,
231
+ };
232
+ },
233
+ /**
234
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
235
+ * @summary Creates a manual invoice with free items.
236
+ * @param {CreateInvoiceRequest} body The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
237
+ * @param {*} [options] Override http request option.
238
+ * @throws {RequiredError}
239
+ */
240
+ billingServiceCreateInvoice: async (body: CreateInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
241
+ // verify required parameter 'body' is not null or undefined
242
+ assertParamExists('billingServiceCreateInvoice', 'body', body)
243
+ const localVarPath = `/billingservice/v2/invoices`;
244
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
245
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
246
+ let baseOptions;
247
+ let baseAccessToken;
248
+ if (configuration) {
249
+ baseOptions = configuration.baseOptions;
250
+ baseAccessToken = configuration.accessToken;
251
+ }
252
+
253
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
254
+ const localVarHeaderParameter = {} as any;
255
+ const localVarQueryParameter = {} as any;
256
+
257
+
258
+
259
+ localVarHeaderParameter['Content-Type'] = 'application/json';
260
+
261
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
262
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
263
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
264
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
265
+
266
+ return {
267
+ url: toPathString(localVarUrlObj),
268
+ options: localVarRequestOptions,
269
+ };
270
+ },
271
+ /**
272
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
273
+ * @summary Adds a status row to an invoice.
274
+ * @param {string} invoiceCode The code of the invoice.
275
+ * @param {CreateInvoiceStatusBody} body
276
+ * @param {*} [options] Override http request option.
277
+ * @throws {RequiredError}
278
+ */
279
+ billingServiceCreateInvoiceStatus: async (invoiceCode: string, body: CreateInvoiceStatusBody, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
280
+ // verify required parameter 'invoiceCode' is not null or undefined
281
+ assertParamExists('billingServiceCreateInvoiceStatus', 'invoiceCode', invoiceCode)
282
+ // verify required parameter 'body' is not null or undefined
283
+ assertParamExists('billingServiceCreateInvoiceStatus', 'body', body)
284
+ const localVarPath = `/billingservice/v2/invoices/{invoiceCode}/statuses`
285
+ .replace(`{${"invoiceCode"}}`, encodeURIComponent(String(invoiceCode)));
286
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
287
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
288
+ let baseOptions;
289
+ let baseAccessToken;
290
+ if (configuration) {
291
+ baseOptions = configuration.baseOptions;
292
+ baseAccessToken = configuration.accessToken;
293
+ }
294
+
295
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
296
+ const localVarHeaderParameter = {} as any;
297
+ const localVarQueryParameter = {} as any;
298
+
299
+
300
+
301
+ localVarHeaderParameter['Content-Type'] = 'application/json';
302
+
303
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
304
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
305
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
306
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
307
+
308
+ return {
309
+ url: toPathString(localVarUrlObj),
310
+ options: localVarRequestOptions,
311
+ };
312
+ },
313
+ /**
314
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
315
+ * @summary Creates the recurring invoice for the next period of a policy.
316
+ * @param {CreateRecurringInvoiceRequest} body The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
317
+ * @param {*} [options] Override http request option.
318
+ * @throws {RequiredError}
319
+ */
320
+ billingServiceCreateRecurringInvoice: async (body: CreateRecurringInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
321
+ // verify required parameter 'body' is not null or undefined
322
+ assertParamExists('billingServiceCreateRecurringInvoice', 'body', body)
323
+ const localVarPath = `/billingservice/v2/recurring-invoices`;
324
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
325
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
326
+ let baseOptions;
327
+ let baseAccessToken;
328
+ if (configuration) {
329
+ baseOptions = configuration.baseOptions;
330
+ baseAccessToken = configuration.accessToken;
331
+ }
332
+
333
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
334
+ const localVarHeaderParameter = {} as any;
335
+ const localVarQueryParameter = {} as any;
336
+
337
+
338
+
339
+ localVarHeaderParameter['Content-Type'] = 'application/json';
340
+
341
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
342
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
343
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
344
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
345
+
346
+ return {
347
+ url: toPathString(localVarUrlObj),
348
+ options: localVarRequestOptions,
349
+ };
350
+ },
351
+ /**
352
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
353
+ * @summary Creates the final invoice of a terminated policy.
354
+ * @param {CreateTerminationInvoiceRequest} body The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
355
+ * @param {*} [options] Override http request option.
356
+ * @throws {RequiredError}
357
+ */
358
+ billingServiceCreateTerminationInvoice: async (body: CreateTerminationInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
359
+ // verify required parameter 'body' is not null or undefined
360
+ assertParamExists('billingServiceCreateTerminationInvoice', 'body', body)
361
+ const localVarPath = `/billingservice/v2/termination-invoices`;
362
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
363
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
364
+ let baseOptions;
365
+ let baseAccessToken;
366
+ if (configuration) {
367
+ baseOptions = configuration.baseOptions;
368
+ baseAccessToken = configuration.accessToken;
369
+ }
370
+
371
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
372
+ const localVarHeaderParameter = {} as any;
373
+ const localVarQueryParameter = {} as any;
374
+
375
+
376
+
377
+ localVarHeaderParameter['Content-Type'] = 'application/json';
378
+
379
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
380
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
381
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
382
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
383
+
384
+ return {
385
+ url: toPathString(localVarUrlObj),
386
+ options: localVarRequestOptions,
387
+ };
388
+ },
389
+ /**
390
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
391
+ * @summary Creates a withdraw invoice for a policy that never came into force.
392
+ * @param {CreateWithdrawInvoiceRequest} body The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
393
+ * @param {*} [options] Override http request option.
394
+ * @throws {RequiredError}
395
+ */
396
+ billingServiceCreateWithdrawInvoice: async (body: CreateWithdrawInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
397
+ // verify required parameter 'body' is not null or undefined
398
+ assertParamExists('billingServiceCreateWithdrawInvoice', 'body', body)
399
+ const localVarPath = `/billingservice/v2/withdraw-invoices`;
400
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
401
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
402
+ let baseOptions;
403
+ let baseAccessToken;
404
+ if (configuration) {
405
+ baseOptions = configuration.baseOptions;
406
+ baseAccessToken = configuration.accessToken;
407
+ }
408
+
409
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
410
+ const localVarHeaderParameter = {} as any;
411
+ const localVarQueryParameter = {} as any;
412
+
413
+
414
+
415
+ localVarHeaderParameter['Content-Type'] = 'application/json';
416
+
417
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
418
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
419
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
420
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
421
+
422
+ return {
423
+ url: toPathString(localVarUrlObj),
424
+ options: localVarRequestOptions,
425
+ };
426
+ },
427
+ /**
428
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
429
+ * @summary Returns one invoice.
430
+ * @param {string} code The invoice\&#39;s code.
431
+ * @param {string} [expand] The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
432
+ * @param {*} [options] Override http request option.
433
+ * @throws {RequiredError}
434
+ */
435
+ billingServiceGetInvoice: async (code: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
436
+ // verify required parameter 'code' is not null or undefined
437
+ assertParamExists('billingServiceGetInvoice', 'code', code)
438
+ const localVarPath = `/billingservice/v2/invoices/{code}`
439
+ .replace(`{${"code"}}`, encodeURIComponent(String(code)));
440
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
441
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
442
+ let baseOptions;
443
+ let baseAccessToken;
444
+ if (configuration) {
445
+ baseOptions = configuration.baseOptions;
446
+ baseAccessToken = configuration.accessToken;
447
+ }
448
+
449
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
450
+ const localVarHeaderParameter = {} as any;
451
+ const localVarQueryParameter = {} as any;
452
+
453
+ if (expand !== undefined) {
454
+ localVarQueryParameter['expand'] = expand;
455
+ }
456
+
457
+
458
+
459
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
460
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
461
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
462
+
463
+ return {
464
+ url: toPathString(localVarUrlObj),
465
+ options: localVarRequestOptions,
466
+ };
467
+ },
468
+ /**
469
+ *
470
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
471
+ * @param {*} [options] Override http request option.
472
+ * @throws {RequiredError}
473
+ */
474
+ billingServiceGetInvoiceFilterCatalog: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
475
+ const localVarPath = `/billingservice/v2/invoices:filterCatalog`;
476
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
477
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
478
+ let baseOptions;
479
+ let baseAccessToken;
480
+ if (configuration) {
481
+ baseOptions = configuration.baseOptions;
482
+ baseAccessToken = configuration.accessToken;
483
+ }
484
+
485
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
486
+ const localVarHeaderParameter = {} as any;
487
+ const localVarQueryParameter = {} as any;
488
+
489
+
490
+
491
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
492
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
493
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
494
+
495
+ return {
496
+ url: toPathString(localVarUrlObj),
497
+ options: localVarRequestOptions,
498
+ };
499
+ },
500
+ /**
501
+ *
502
+ * @summary Returns the filter catalog of the policies-billing-dates list.
503
+ * @param {*} [options] Override http request option.
504
+ * @throws {RequiredError}
505
+ */
506
+ billingServiceGetPoliciesBillingDateFilterCatalog: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
507
+ const localVarPath = `/billingservice/v2/invoices/policies-billing-dates:filterCatalog`;
508
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
509
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
510
+ let baseOptions;
511
+ let baseAccessToken;
512
+ if (configuration) {
513
+ baseOptions = configuration.baseOptions;
514
+ baseAccessToken = configuration.accessToken;
515
+ }
516
+
517
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
518
+ const localVarHeaderParameter = {} as any;
519
+ const localVarQueryParameter = {} as any;
520
+
521
+
522
+
523
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
524
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
525
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
526
+
527
+ return {
528
+ url: toPathString(localVarUrlObj),
529
+ options: localVarRequestOptions,
530
+ };
531
+ },
532
+ /**
533
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
534
+ * @summary Lists invoices.
535
+ * @param {number} [pageSize]
536
+ * @param {string} [pageToken]
537
+ * @param {string} [filter]
538
+ * @param {string} [search]
539
+ * @param {string} [order]
540
+ * @param {string} [expand]
541
+ * @param {string} [filters]
542
+ * @param {*} [options] Override http request option.
543
+ * @throws {RequiredError}
544
+ */
545
+ billingServiceListInvoices: async (pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
546
+ const localVarPath = `/billingservice/v2/invoices`;
547
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
548
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
549
+ let baseOptions;
550
+ let baseAccessToken;
551
+ if (configuration) {
552
+ baseOptions = configuration.baseOptions;
553
+ baseAccessToken = configuration.accessToken;
554
+ }
555
+
556
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
557
+ const localVarHeaderParameter = {} as any;
558
+ const localVarQueryParameter = {} as any;
559
+
560
+ if (pageSize !== undefined) {
561
+ localVarQueryParameter['pageSize'] = pageSize;
562
+ }
563
+
564
+ if (pageToken !== undefined) {
565
+ localVarQueryParameter['pageToken'] = pageToken;
566
+ }
567
+
568
+ if (filter !== undefined) {
569
+ localVarQueryParameter['filter'] = filter;
570
+ }
571
+
572
+ if (search !== undefined) {
573
+ localVarQueryParameter['search'] = search;
574
+ }
575
+
576
+ if (order !== undefined) {
577
+ localVarQueryParameter['order'] = order;
578
+ }
579
+
580
+ if (expand !== undefined) {
581
+ localVarQueryParameter['expand'] = expand;
582
+ }
583
+
584
+ if (filters !== undefined) {
585
+ localVarQueryParameter['filters'] = filters;
586
+ }
587
+
588
+
589
+
590
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
591
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
592
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
593
+
594
+ return {
595
+ url: toPathString(localVarUrlObj),
596
+ options: localVarRequestOptions,
597
+ };
598
+ },
599
+ /**
600
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
601
+ * @summary Lists the billing schedule rows.
602
+ * @param {number} [pageSize]
603
+ * @param {string} [pageToken]
604
+ * @param {string} [filter]
605
+ * @param {string} [search]
606
+ * @param {string} [order]
607
+ * @param {string} [expand]
608
+ * @param {string} [filters]
609
+ * @param {*} [options] Override http request option.
610
+ * @throws {RequiredError}
611
+ */
612
+ billingServiceListPoliciesBillingDates: async (pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
613
+ const localVarPath = `/billingservice/v2/invoices/policies-billing-dates`;
614
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
615
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
616
+ let baseOptions;
617
+ let baseAccessToken;
618
+ if (configuration) {
619
+ baseOptions = configuration.baseOptions;
620
+ baseAccessToken = configuration.accessToken;
621
+ }
622
+
623
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
624
+ const localVarHeaderParameter = {} as any;
625
+ const localVarQueryParameter = {} as any;
626
+
627
+ if (pageSize !== undefined) {
628
+ localVarQueryParameter['pageSize'] = pageSize;
629
+ }
630
+
631
+ if (pageToken !== undefined) {
632
+ localVarQueryParameter['pageToken'] = pageToken;
633
+ }
634
+
635
+ if (filter !== undefined) {
636
+ localVarQueryParameter['filter'] = filter;
637
+ }
638
+
639
+ if (search !== undefined) {
640
+ localVarQueryParameter['search'] = search;
641
+ }
642
+
643
+ if (order !== undefined) {
644
+ localVarQueryParameter['order'] = order;
645
+ }
646
+
647
+ if (expand !== undefined) {
648
+ localVarQueryParameter['expand'] = expand;
649
+ }
650
+
651
+ if (filters !== undefined) {
652
+ localVarQueryParameter['filters'] = filters;
653
+ }
654
+
655
+
656
+
657
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
658
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
659
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
660
+
661
+ return {
662
+ url: toPathString(localVarUrlObj),
663
+ options: localVarRequestOptions,
664
+ };
665
+ },
666
+ /**
667
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
668
+ * @summary Reverses one invoice in full.
669
+ * @param {RevertInvoiceRequest} body The request of &#x60;RevertInvoice&#x60;.
670
+ * @param {*} [options] Override http request option.
671
+ * @throws {RequiredError}
672
+ */
673
+ billingServiceRevertInvoice: async (body: RevertInvoiceRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
674
+ // verify required parameter 'body' is not null or undefined
675
+ assertParamExists('billingServiceRevertInvoice', 'body', body)
676
+ const localVarPath = `/billingservice/v2/correction-invoices/revert`;
677
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
678
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
679
+ let baseOptions;
680
+ let baseAccessToken;
681
+ if (configuration) {
682
+ baseOptions = configuration.baseOptions;
683
+ baseAccessToken = configuration.accessToken;
684
+ }
685
+
686
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
687
+ const localVarHeaderParameter = {} as any;
688
+ const localVarQueryParameter = {} as any;
689
+
690
+
691
+
692
+ localVarHeaderParameter['Content-Type'] = 'application/json';
693
+
694
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
695
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
696
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
697
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
698
+
699
+ return {
700
+ url: toPathString(localVarUrlObj),
701
+ options: localVarRequestOptions,
702
+ };
703
+ },
704
+ }
705
+ };
706
+
707
+ /**
708
+ * InvoicesApi - functional programming interface
709
+ * @export
710
+ */
711
+ export const InvoicesApiFp = function(configuration?: Configuration) {
712
+ const localVarAxiosParamCreator = InvoicesApiAxiosParamCreator(configuration)
713
+ return {
714
+ /**
715
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
716
+ * @summary Creates correction invoices for a policy.
717
+ * @param {CreateCorrectionInvoicesRequest} body The request of &#x60;CreateCorrectionInvoices&#x60;. Only &#x60;policyCode&#x60;, the billing interval and &#x60;metadata&#x60; are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
718
+ * @param {*} [options] Override http request option.
719
+ * @throws {RequiredError}
720
+ */
721
+ async billingServiceCreateCorrectionInvoices(body: CreateCorrectionInvoicesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateCorrectionInvoicesResponse>> {
722
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateCorrectionInvoices(body, options);
723
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
724
+ },
725
+ /**
726
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
727
+ * @summary Creates an estimate for the running period of a policy.
728
+ * @param {CreateEstimatedInvoiceRequest} body The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
729
+ * @param {*} [options] Override http request option.
730
+ * @throws {RequiredError}
731
+ */
732
+ async billingServiceCreateEstimatedInvoice(body: CreateEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEstimatedInvoiceResponse>> {
733
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateEstimatedInvoice(body, options);
734
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
735
+ },
736
+ /**
737
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
738
+ * @summary Creates an estimate for an explicit period of a policy.
739
+ * @param {CreateEstimatedInvoiceForIntervalRequest} body The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
740
+ * @param {*} [options] Override http request option.
741
+ * @throws {RequiredError}
742
+ */
743
+ async billingServiceCreateEstimatedInvoiceForInterval(body: CreateEstimatedInvoiceForIntervalRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateEstimatedInvoiceForIntervalResponse>> {
744
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateEstimatedInvoiceForInterval(body, options);
745
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
746
+ },
747
+ /**
748
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
749
+ * @summary Creates the first invoice of a policy.
750
+ * @param {CreateInitialInvoiceRequest} body The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
751
+ * @param {*} [options] Override http request option.
752
+ * @throws {RequiredError}
753
+ */
754
+ async billingServiceCreateInitialInvoice(body: CreateInitialInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInitialInvoiceResponse>> {
755
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateInitialInvoice(body, options);
756
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
757
+ },
758
+ /**
759
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
760
+ * @summary Creates a manual invoice with free items.
761
+ * @param {CreateInvoiceRequest} body The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
762
+ * @param {*} [options] Override http request option.
763
+ * @throws {RequiredError}
764
+ */
765
+ async billingServiceCreateInvoice(body: CreateInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceResponse>> {
766
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateInvoice(body, options);
767
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
768
+ },
769
+ /**
770
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
771
+ * @summary Adds a status row to an invoice.
772
+ * @param {string} invoiceCode The code of the invoice.
773
+ * @param {CreateInvoiceStatusBody} body
774
+ * @param {*} [options] Override http request option.
775
+ * @throws {RequiredError}
776
+ */
777
+ async billingServiceCreateInvoiceStatus(invoiceCode: string, body: CreateInvoiceStatusBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceStatusResponse>> {
778
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateInvoiceStatus(invoiceCode, body, options);
779
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
780
+ },
781
+ /**
782
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
783
+ * @summary Creates the recurring invoice for the next period of a policy.
784
+ * @param {CreateRecurringInvoiceRequest} body The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
785
+ * @param {*} [options] Override http request option.
786
+ * @throws {RequiredError}
787
+ */
788
+ async billingServiceCreateRecurringInvoice(body: CreateRecurringInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateRecurringInvoiceResponse>> {
789
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateRecurringInvoice(body, options);
790
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
791
+ },
792
+ /**
793
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
794
+ * @summary Creates the final invoice of a terminated policy.
795
+ * @param {CreateTerminationInvoiceRequest} body The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
796
+ * @param {*} [options] Override http request option.
797
+ * @throws {RequiredError}
798
+ */
799
+ async billingServiceCreateTerminationInvoice(body: CreateTerminationInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateTerminationInvoiceResponse>> {
800
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateTerminationInvoice(body, options);
801
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
802
+ },
803
+ /**
804
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
805
+ * @summary Creates a withdraw invoice for a policy that never came into force.
806
+ * @param {CreateWithdrawInvoiceRequest} body The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
807
+ * @param {*} [options] Override http request option.
808
+ * @throws {RequiredError}
809
+ */
810
+ async billingServiceCreateWithdrawInvoice(body: CreateWithdrawInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateWithdrawInvoiceResponse>> {
811
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceCreateWithdrawInvoice(body, options);
812
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
813
+ },
814
+ /**
815
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
816
+ * @summary Returns one invoice.
817
+ * @param {string} code The invoice\&#39;s code.
818
+ * @param {string} [expand] The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
819
+ * @param {*} [options] Override http request option.
820
+ * @throws {RequiredError}
821
+ */
822
+ async billingServiceGetInvoice(code: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInvoiceResponse>> {
823
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetInvoice(code, expand, options);
824
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
825
+ },
826
+ /**
827
+ *
828
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
829
+ * @param {*} [options] Override http request option.
830
+ * @throws {RequiredError}
831
+ */
832
+ async billingServiceGetInvoiceFilterCatalog(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInvoiceFilterCatalogResponse>> {
833
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetInvoiceFilterCatalog(options);
834
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
835
+ },
836
+ /**
837
+ *
838
+ * @summary Returns the filter catalog of the policies-billing-dates list.
839
+ * @param {*} [options] Override http request option.
840
+ * @throws {RequiredError}
841
+ */
842
+ async billingServiceGetPoliciesBillingDateFilterCatalog(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPoliciesBillingDateFilterCatalogResponse>> {
843
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceGetPoliciesBillingDateFilterCatalog(options);
844
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
845
+ },
846
+ /**
847
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
848
+ * @summary Lists invoices.
849
+ * @param {number} [pageSize]
850
+ * @param {string} [pageToken]
851
+ * @param {string} [filter]
852
+ * @param {string} [search]
853
+ * @param {string} [order]
854
+ * @param {string} [expand]
855
+ * @param {string} [filters]
856
+ * @param {*} [options] Override http request option.
857
+ * @throws {RequiredError}
858
+ */
859
+ async billingServiceListInvoices(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListInvoicesResponse>> {
860
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceListInvoices(pageSize, pageToken, filter, search, order, expand, filters, options);
861
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
862
+ },
863
+ /**
864
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
865
+ * @summary Lists the billing schedule rows.
866
+ * @param {number} [pageSize]
867
+ * @param {string} [pageToken]
868
+ * @param {string} [filter]
869
+ * @param {string} [search]
870
+ * @param {string} [order]
871
+ * @param {string} [expand]
872
+ * @param {string} [filters]
873
+ * @param {*} [options] Override http request option.
874
+ * @throws {RequiredError}
875
+ */
876
+ async billingServiceListPoliciesBillingDates(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesBillingDatesResponse>> {
877
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceListPoliciesBillingDates(pageSize, pageToken, filter, search, order, expand, filters, options);
878
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
879
+ },
880
+ /**
881
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
882
+ * @summary Reverses one invoice in full.
883
+ * @param {RevertInvoiceRequest} body The request of &#x60;RevertInvoice&#x60;.
884
+ * @param {*} [options] Override http request option.
885
+ * @throws {RequiredError}
886
+ */
887
+ async billingServiceRevertInvoice(body: RevertInvoiceRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RevertInvoiceResponse>> {
888
+ const localVarAxiosArgs = await localVarAxiosParamCreator.billingServiceRevertInvoice(body, options);
889
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
890
+ },
891
+ }
892
+ };
893
+
894
+ /**
895
+ * InvoicesApi - factory interface
896
+ * @export
897
+ */
898
+ export const InvoicesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
899
+ const localVarFp = InvoicesApiFp(configuration)
900
+ return {
901
+ /**
902
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
903
+ * @summary Creates correction invoices for a policy.
904
+ * @param {CreateCorrectionInvoicesRequest} body The request of &#x60;CreateCorrectionInvoices&#x60;. Only &#x60;policyCode&#x60;, the billing interval and &#x60;metadata&#x60; are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
905
+ * @param {*} [options] Override http request option.
906
+ * @throws {RequiredError}
907
+ */
908
+ billingServiceCreateCorrectionInvoices(body: CreateCorrectionInvoicesRequest, options?: any): AxiosPromise<CreateCorrectionInvoicesResponse> {
909
+ return localVarFp.billingServiceCreateCorrectionInvoices(body, options).then((request) => request(axios, basePath));
910
+ },
911
+ /**
912
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
913
+ * @summary Creates an estimate for the running period of a policy.
914
+ * @param {CreateEstimatedInvoiceRequest} body The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
915
+ * @param {*} [options] Override http request option.
916
+ * @throws {RequiredError}
917
+ */
918
+ billingServiceCreateEstimatedInvoice(body: CreateEstimatedInvoiceRequest, options?: any): AxiosPromise<CreateEstimatedInvoiceResponse> {
919
+ return localVarFp.billingServiceCreateEstimatedInvoice(body, options).then((request) => request(axios, basePath));
920
+ },
921
+ /**
922
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
923
+ * @summary Creates an estimate for an explicit period of a policy.
924
+ * @param {CreateEstimatedInvoiceForIntervalRequest} body The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
925
+ * @param {*} [options] Override http request option.
926
+ * @throws {RequiredError}
927
+ */
928
+ billingServiceCreateEstimatedInvoiceForInterval(body: CreateEstimatedInvoiceForIntervalRequest, options?: any): AxiosPromise<CreateEstimatedInvoiceForIntervalResponse> {
929
+ return localVarFp.billingServiceCreateEstimatedInvoiceForInterval(body, options).then((request) => request(axios, basePath));
930
+ },
931
+ /**
932
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
933
+ * @summary Creates the first invoice of a policy.
934
+ * @param {CreateInitialInvoiceRequest} body The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
935
+ * @param {*} [options] Override http request option.
936
+ * @throws {RequiredError}
937
+ */
938
+ billingServiceCreateInitialInvoice(body: CreateInitialInvoiceRequest, options?: any): AxiosPromise<CreateInitialInvoiceResponse> {
939
+ return localVarFp.billingServiceCreateInitialInvoice(body, options).then((request) => request(axios, basePath));
940
+ },
941
+ /**
942
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
943
+ * @summary Creates a manual invoice with free items.
944
+ * @param {CreateInvoiceRequest} body The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
945
+ * @param {*} [options] Override http request option.
946
+ * @throws {RequiredError}
947
+ */
948
+ billingServiceCreateInvoice(body: CreateInvoiceRequest, options?: any): AxiosPromise<CreateInvoiceResponse> {
949
+ return localVarFp.billingServiceCreateInvoice(body, options).then((request) => request(axios, basePath));
950
+ },
951
+ /**
952
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
953
+ * @summary Adds a status row to an invoice.
954
+ * @param {string} invoiceCode The code of the invoice.
955
+ * @param {CreateInvoiceStatusBody} body
956
+ * @param {*} [options] Override http request option.
957
+ * @throws {RequiredError}
958
+ */
959
+ billingServiceCreateInvoiceStatus(invoiceCode: string, body: CreateInvoiceStatusBody, options?: any): AxiosPromise<CreateInvoiceStatusResponse> {
960
+ return localVarFp.billingServiceCreateInvoiceStatus(invoiceCode, body, options).then((request) => request(axios, basePath));
961
+ },
962
+ /**
963
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
964
+ * @summary Creates the recurring invoice for the next period of a policy.
965
+ * @param {CreateRecurringInvoiceRequest} body The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
966
+ * @param {*} [options] Override http request option.
967
+ * @throws {RequiredError}
968
+ */
969
+ billingServiceCreateRecurringInvoice(body: CreateRecurringInvoiceRequest, options?: any): AxiosPromise<CreateRecurringInvoiceResponse> {
970
+ return localVarFp.billingServiceCreateRecurringInvoice(body, options).then((request) => request(axios, basePath));
971
+ },
972
+ /**
973
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
974
+ * @summary Creates the final invoice of a terminated policy.
975
+ * @param {CreateTerminationInvoiceRequest} body The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
976
+ * @param {*} [options] Override http request option.
977
+ * @throws {RequiredError}
978
+ */
979
+ billingServiceCreateTerminationInvoice(body: CreateTerminationInvoiceRequest, options?: any): AxiosPromise<CreateTerminationInvoiceResponse> {
980
+ return localVarFp.billingServiceCreateTerminationInvoice(body, options).then((request) => request(axios, basePath));
981
+ },
982
+ /**
983
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
984
+ * @summary Creates a withdraw invoice for a policy that never came into force.
985
+ * @param {CreateWithdrawInvoiceRequest} body The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
986
+ * @param {*} [options] Override http request option.
987
+ * @throws {RequiredError}
988
+ */
989
+ billingServiceCreateWithdrawInvoice(body: CreateWithdrawInvoiceRequest, options?: any): AxiosPromise<CreateWithdrawInvoiceResponse> {
990
+ return localVarFp.billingServiceCreateWithdrawInvoice(body, options).then((request) => request(axios, basePath));
991
+ },
992
+ /**
993
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
994
+ * @summary Returns one invoice.
995
+ * @param {string} code The invoice\&#39;s code.
996
+ * @param {string} [expand] The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
997
+ * @param {*} [options] Override http request option.
998
+ * @throws {RequiredError}
999
+ */
1000
+ billingServiceGetInvoice(code: string, expand?: string, options?: any): AxiosPromise<GetInvoiceResponse> {
1001
+ return localVarFp.billingServiceGetInvoice(code, expand, options).then((request) => request(axios, basePath));
1002
+ },
1003
+ /**
1004
+ *
1005
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
1006
+ * @param {*} [options] Override http request option.
1007
+ * @throws {RequiredError}
1008
+ */
1009
+ billingServiceGetInvoiceFilterCatalog(options?: any): AxiosPromise<GetInvoiceFilterCatalogResponse> {
1010
+ return localVarFp.billingServiceGetInvoiceFilterCatalog(options).then((request) => request(axios, basePath));
1011
+ },
1012
+ /**
1013
+ *
1014
+ * @summary Returns the filter catalog of the policies-billing-dates list.
1015
+ * @param {*} [options] Override http request option.
1016
+ * @throws {RequiredError}
1017
+ */
1018
+ billingServiceGetPoliciesBillingDateFilterCatalog(options?: any): AxiosPromise<GetPoliciesBillingDateFilterCatalogResponse> {
1019
+ return localVarFp.billingServiceGetPoliciesBillingDateFilterCatalog(options).then((request) => request(axios, basePath));
1020
+ },
1021
+ /**
1022
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
1023
+ * @summary Lists invoices.
1024
+ * @param {number} [pageSize]
1025
+ * @param {string} [pageToken]
1026
+ * @param {string} [filter]
1027
+ * @param {string} [search]
1028
+ * @param {string} [order]
1029
+ * @param {string} [expand]
1030
+ * @param {string} [filters]
1031
+ * @param {*} [options] Override http request option.
1032
+ * @throws {RequiredError}
1033
+ */
1034
+ billingServiceListInvoices(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListInvoicesResponse> {
1035
+ return localVarFp.billingServiceListInvoices(pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
1036
+ },
1037
+ /**
1038
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
1039
+ * @summary Lists the billing schedule rows.
1040
+ * @param {number} [pageSize]
1041
+ * @param {string} [pageToken]
1042
+ * @param {string} [filter]
1043
+ * @param {string} [search]
1044
+ * @param {string} [order]
1045
+ * @param {string} [expand]
1046
+ * @param {string} [filters]
1047
+ * @param {*} [options] Override http request option.
1048
+ * @throws {RequiredError}
1049
+ */
1050
+ billingServiceListPoliciesBillingDates(pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListPoliciesBillingDatesResponse> {
1051
+ return localVarFp.billingServiceListPoliciesBillingDates(pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
1052
+ },
1053
+ /**
1054
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
1055
+ * @summary Reverses one invoice in full.
1056
+ * @param {RevertInvoiceRequest} body The request of &#x60;RevertInvoice&#x60;.
1057
+ * @param {*} [options] Override http request option.
1058
+ * @throws {RequiredError}
1059
+ */
1060
+ billingServiceRevertInvoice(body: RevertInvoiceRequest, options?: any): AxiosPromise<RevertInvoiceResponse> {
1061
+ return localVarFp.billingServiceRevertInvoice(body, options).then((request) => request(axios, basePath));
1062
+ },
1063
+ };
1064
+ };
1065
+
1066
+ /**
1067
+ * Request parameters for billingServiceCreateCorrectionInvoices operation in InvoicesApi.
1068
+ * @export
1069
+ * @interface InvoicesApiBillingServiceCreateCorrectionInvoicesRequest
1070
+ */
1071
+ export interface InvoicesApiBillingServiceCreateCorrectionInvoicesRequest {
1072
+ /**
1073
+ * The request of &#x60;CreateCorrectionInvoices&#x60;. Only &#x60;policyCode&#x60;, the billing interval and &#x60;metadata&#x60; are read. Without an interval, every invoiced period is corrected; with it, the invoiced bills of that period.
1074
+ * @type {CreateCorrectionInvoicesRequest}
1075
+ * @memberof InvoicesApiBillingServiceCreateCorrectionInvoices
1076
+ */
1077
+ readonly body: CreateCorrectionInvoicesRequest
1078
+ }
1079
+
1080
+ /**
1081
+ * Request parameters for billingServiceCreateEstimatedInvoice operation in InvoicesApi.
1082
+ * @export
1083
+ * @interface InvoicesApiBillingServiceCreateEstimatedInvoiceRequest
1084
+ */
1085
+ export interface InvoicesApiBillingServiceCreateEstimatedInvoiceRequest {
1086
+ /**
1087
+ * The request of &#x60;CreateEstimatedInvoice&#x60;. No policy data is sent: the policy is read by its code, and partial periods are prorated by the day count basis of its billing configuration.
1088
+ * @type {CreateEstimatedInvoiceRequest}
1089
+ * @memberof InvoicesApiBillingServiceCreateEstimatedInvoice
1090
+ */
1091
+ readonly body: CreateEstimatedInvoiceRequest
1092
+ }
1093
+
1094
+ /**
1095
+ * Request parameters for billingServiceCreateEstimatedInvoiceForInterval operation in InvoicesApi.
1096
+ * @export
1097
+ * @interface InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest
1098
+ */
1099
+ export interface InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest {
1100
+ /**
1101
+ * The request of &#x60;CreateEstimatedInvoiceForInterval&#x60;.
1102
+ * @type {CreateEstimatedInvoiceForIntervalRequest}
1103
+ * @memberof InvoicesApiBillingServiceCreateEstimatedInvoiceForInterval
1104
+ */
1105
+ readonly body: CreateEstimatedInvoiceForIntervalRequest
1106
+ }
1107
+
1108
+ /**
1109
+ * Request parameters for billingServiceCreateInitialInvoice operation in InvoicesApi.
1110
+ * @export
1111
+ * @interface InvoicesApiBillingServiceCreateInitialInvoiceRequest
1112
+ */
1113
+ export interface InvoicesApiBillingServiceCreateInitialInvoiceRequest {
1114
+ /**
1115
+ * The request of &#x60;CreateInitialInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateRecurringInvoiceRequest&#x60;.
1116
+ * @type {CreateInitialInvoiceRequest}
1117
+ * @memberof InvoicesApiBillingServiceCreateInitialInvoice
1118
+ */
1119
+ readonly body: CreateInitialInvoiceRequest
1120
+ }
1121
+
1122
+ /**
1123
+ * Request parameters for billingServiceCreateInvoice operation in InvoicesApi.
1124
+ * @export
1125
+ * @interface InvoicesApiBillingServiceCreateInvoiceRequest
1126
+ */
1127
+ export interface InvoicesApiBillingServiceCreateInvoiceRequest {
1128
+ /**
1129
+ * The request of &#x60;CreateInvoice&#x60;: a manual invoice with free items.
1130
+ * @type {CreateInvoiceRequest}
1131
+ * @memberof InvoicesApiBillingServiceCreateInvoice
1132
+ */
1133
+ readonly body: CreateInvoiceRequest
1134
+ }
1135
+
1136
+ /**
1137
+ * Request parameters for billingServiceCreateInvoiceStatus operation in InvoicesApi.
1138
+ * @export
1139
+ * @interface InvoicesApiBillingServiceCreateInvoiceStatusRequest
1140
+ */
1141
+ export interface InvoicesApiBillingServiceCreateInvoiceStatusRequest {
1142
+ /**
1143
+ * The code of the invoice.
1144
+ * @type {string}
1145
+ * @memberof InvoicesApiBillingServiceCreateInvoiceStatus
1146
+ */
1147
+ readonly invoiceCode: string
1148
+
1149
+ /**
1150
+ *
1151
+ * @type {CreateInvoiceStatusBody}
1152
+ * @memberof InvoicesApiBillingServiceCreateInvoiceStatus
1153
+ */
1154
+ readonly body: CreateInvoiceStatusBody
1155
+ }
1156
+
1157
+ /**
1158
+ * Request parameters for billingServiceCreateRecurringInvoice operation in InvoicesApi.
1159
+ * @export
1160
+ * @interface InvoicesApiBillingServiceCreateRecurringInvoiceRequest
1161
+ */
1162
+ export interface InvoicesApiBillingServiceCreateRecurringInvoiceRequest {
1163
+ /**
1164
+ * The request of &#x60;CreateRecurringInvoice&#x60;. The billing interval is optional: without it the invoice bills the next period of the policy\&#39;s schedule, with it that period. The request has the same fields as &#x60;CreateInitialInvoiceRequest&#x60;.
1165
+ * @type {CreateRecurringInvoiceRequest}
1166
+ * @memberof InvoicesApiBillingServiceCreateRecurringInvoice
1167
+ */
1168
+ readonly body: CreateRecurringInvoiceRequest
1169
+ }
1170
+
1171
+ /**
1172
+ * Request parameters for billingServiceCreateTerminationInvoice operation in InvoicesApi.
1173
+ * @export
1174
+ * @interface InvoicesApiBillingServiceCreateTerminationInvoiceRequest
1175
+ */
1176
+ export interface InvoicesApiBillingServiceCreateTerminationInvoiceRequest {
1177
+ /**
1178
+ * The request of &#x60;CreateTerminationInvoice&#x60;. &#x60;billingIntervalFrom&#x60;, &#x60;accountNumber&#x60;, &#x60;policyNumber&#x60; and &#x60;invoiceNumber&#x60; are ignored.
1179
+ * @type {CreateTerminationInvoiceRequest}
1180
+ * @memberof InvoicesApiBillingServiceCreateTerminationInvoice
1181
+ */
1182
+ readonly body: CreateTerminationInvoiceRequest
1183
+ }
1184
+
1185
+ /**
1186
+ * Request parameters for billingServiceCreateWithdrawInvoice operation in InvoicesApi.
1187
+ * @export
1188
+ * @interface InvoicesApiBillingServiceCreateWithdrawInvoiceRequest
1189
+ */
1190
+ export interface InvoicesApiBillingServiceCreateWithdrawInvoiceRequest {
1191
+ /**
1192
+ * The request of &#x60;CreateWithdrawInvoice&#x60;. Only &#x60;policyCode&#x60; and &#x60;metadata&#x60; are read.
1193
+ * @type {CreateWithdrawInvoiceRequest}
1194
+ * @memberof InvoicesApiBillingServiceCreateWithdrawInvoice
1195
+ */
1196
+ readonly body: CreateWithdrawInvoiceRequest
1197
+ }
1198
+
1199
+ /**
1200
+ * Request parameters for billingServiceGetInvoice operation in InvoicesApi.
1201
+ * @export
1202
+ * @interface InvoicesApiBillingServiceGetInvoiceRequest
1203
+ */
1204
+ export interface InvoicesApiBillingServiceGetInvoiceRequest {
1205
+ /**
1206
+ * The invoice\&#39;s code.
1207
+ * @type {string}
1208
+ * @memberof InvoicesApiBillingServiceGetInvoice
1209
+ */
1210
+ readonly code: string
1211
+
1212
+ /**
1213
+ * The parts to add: &#x60;estimateHistory&#x60; adds the earlier estimates of the period to an estimate.
1214
+ * @type {string}
1215
+ * @memberof InvoicesApiBillingServiceGetInvoice
1216
+ */
1217
+ readonly expand?: string
1218
+ }
1219
+
1220
+ /**
1221
+ * Request parameters for billingServiceListInvoices operation in InvoicesApi.
1222
+ * @export
1223
+ * @interface InvoicesApiBillingServiceListInvoicesRequest
1224
+ */
1225
+ export interface InvoicesApiBillingServiceListInvoicesRequest {
1226
+ /**
1227
+ *
1228
+ * @type {number}
1229
+ * @memberof InvoicesApiBillingServiceListInvoices
1230
+ */
1231
+ readonly pageSize?: number
1232
+
1233
+ /**
1234
+ *
1235
+ * @type {string}
1236
+ * @memberof InvoicesApiBillingServiceListInvoices
1237
+ */
1238
+ readonly pageToken?: string
1239
+
1240
+ /**
1241
+ *
1242
+ * @type {string}
1243
+ * @memberof InvoicesApiBillingServiceListInvoices
1244
+ */
1245
+ readonly filter?: string
1246
+
1247
+ /**
1248
+ *
1249
+ * @type {string}
1250
+ * @memberof InvoicesApiBillingServiceListInvoices
1251
+ */
1252
+ readonly search?: string
1253
+
1254
+ /**
1255
+ *
1256
+ * @type {string}
1257
+ * @memberof InvoicesApiBillingServiceListInvoices
1258
+ */
1259
+ readonly order?: string
1260
+
1261
+ /**
1262
+ *
1263
+ * @type {string}
1264
+ * @memberof InvoicesApiBillingServiceListInvoices
1265
+ */
1266
+ readonly expand?: string
1267
+
1268
+ /**
1269
+ *
1270
+ * @type {string}
1271
+ * @memberof InvoicesApiBillingServiceListInvoices
1272
+ */
1273
+ readonly filters?: string
1274
+ }
1275
+
1276
+ /**
1277
+ * Request parameters for billingServiceListPoliciesBillingDates operation in InvoicesApi.
1278
+ * @export
1279
+ * @interface InvoicesApiBillingServiceListPoliciesBillingDatesRequest
1280
+ */
1281
+ export interface InvoicesApiBillingServiceListPoliciesBillingDatesRequest {
1282
+ /**
1283
+ *
1284
+ * @type {number}
1285
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1286
+ */
1287
+ readonly pageSize?: number
1288
+
1289
+ /**
1290
+ *
1291
+ * @type {string}
1292
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1293
+ */
1294
+ readonly pageToken?: string
1295
+
1296
+ /**
1297
+ *
1298
+ * @type {string}
1299
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1300
+ */
1301
+ readonly filter?: string
1302
+
1303
+ /**
1304
+ *
1305
+ * @type {string}
1306
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1307
+ */
1308
+ readonly search?: string
1309
+
1310
+ /**
1311
+ *
1312
+ * @type {string}
1313
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1314
+ */
1315
+ readonly order?: string
1316
+
1317
+ /**
1318
+ *
1319
+ * @type {string}
1320
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1321
+ */
1322
+ readonly expand?: string
1323
+
1324
+ /**
1325
+ *
1326
+ * @type {string}
1327
+ * @memberof InvoicesApiBillingServiceListPoliciesBillingDates
1328
+ */
1329
+ readonly filters?: string
1330
+ }
1331
+
1332
+ /**
1333
+ * Request parameters for billingServiceRevertInvoice operation in InvoicesApi.
1334
+ * @export
1335
+ * @interface InvoicesApiBillingServiceRevertInvoiceRequest
1336
+ */
1337
+ export interface InvoicesApiBillingServiceRevertInvoiceRequest {
1338
+ /**
1339
+ * The request of &#x60;RevertInvoice&#x60;.
1340
+ * @type {RevertInvoiceRequest}
1341
+ * @memberof InvoicesApiBillingServiceRevertInvoice
1342
+ */
1343
+ readonly body: RevertInvoiceRequest
1344
+ }
1345
+
1346
+ /**
1347
+ * InvoicesApi - object-oriented interface
1348
+ * @export
1349
+ * @class InvoicesApi
1350
+ * @extends {BaseAPI}
1351
+ */
1352
+ export class InvoicesApi extends BaseAPI {
1353
+ /**
1354
+ * Every invoiced period that overlaps the request\'s interval is priced again from the policy\'s current state and compared with its last invoiced bill; without an interval, every invoiced period is. One `correction` invoice is created for each period with a difference. No invoice is created, and the response has `noChange` true, when the total difference is zero (the new bill is recorded). No invoice is created either when the difference is below the `minCorrectionAmount` of the billing configuration, or when its `midTermChange` is `NEXT_PERIOD`: then the difference goes into the next recurring invoice. For a member billed through its group policy, the correction invoice belongs to the group policy. Each correction carries `metadata.correctedInvoiceErn`, the invoice it corrects. A `refunded` invoice is not corrected.
1355
+ * @summary Creates correction invoices for a policy.
1356
+ * @param {InvoicesApiBillingServiceCreateCorrectionInvoicesRequest} requestParameters Request parameters.
1357
+ * @param {*} [options] Override http request option.
1358
+ * @throws {RequiredError}
1359
+ * @memberof InvoicesApi
1360
+ */
1361
+ public billingServiceCreateCorrectionInvoices(requestParameters: InvoicesApiBillingServiceCreateCorrectionInvoicesRequest, options?: AxiosRequestConfig) {
1362
+ return InvoicesApiFp(this.configuration).billingServiceCreateCorrectionInvoices(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1363
+ }
1364
+
1365
+ /**
1366
+ * The estimate is priced on request and stored, and it replaces an earlier estimate of the same period. For a period that is already invoiced nothing is stored. For a policy the response has no `code` and `metadata.invoiced` is `\"true\"`; for a group policy it is the period\'s issued invoice. The policy is read by its code, so no policy data is sent. The request\'s `metadata` is not stored. For a member billed through its group policy, the group policy\'s estimate is returned; the member\'s line is on it.
1367
+ * @summary Creates an estimate for the running period of a policy.
1368
+ * @param {InvoicesApiBillingServiceCreateEstimatedInvoiceRequest} requestParameters Request parameters.
1369
+ * @param {*} [options] Override http request option.
1370
+ * @throws {RequiredError}
1371
+ * @memberof InvoicesApi
1372
+ */
1373
+ public billingServiceCreateEstimatedInvoice(requestParameters: InvoicesApiBillingServiceCreateEstimatedInvoiceRequest, options?: AxiosRequestConfig) {
1374
+ return InvoicesApiFp(this.configuration).billingServiceCreateEstimatedInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1375
+ }
1376
+
1377
+ /**
1378
+ * `billingIntervalFrom` and `billingIntervalTo` are required, and the end must be after the start. The estimate is stored and replaced as in `CreateEstimatedInvoice`, and everything else is as there.
1379
+ * @summary Creates an estimate for an explicit period of a policy.
1380
+ * @param {InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest} requestParameters Request parameters.
1381
+ * @param {*} [options] Override http request option.
1382
+ * @throws {RequiredError}
1383
+ * @memberof InvoicesApi
1384
+ */
1385
+ public billingServiceCreateEstimatedInvoiceForInterval(requestParameters: InvoicesApiBillingServiceCreateEstimatedInvoiceForIntervalRequest, options?: AxiosRequestConfig) {
1386
+ return InvoicesApiFp(this.configuration).billingServiceCreateEstimatedInvoiceForInterval(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1387
+ }
1388
+
1389
+ /**
1390
+ * Premium items that are billed once appear on this invoice only. It takes the same request and follows the same rules as `CreateRecurringInvoice`. On a policy that was invoiced before, it creates a `recurring` invoice for the next period. For a group policy whose period no member covers, the response holds an empty invoice.
1391
+ * @summary Creates the first invoice of a policy.
1392
+ * @param {InvoicesApiBillingServiceCreateInitialInvoiceRequest} requestParameters Request parameters.
1393
+ * @param {*} [options] Override http request option.
1394
+ * @throws {RequiredError}
1395
+ * @memberof InvoicesApi
1396
+ */
1397
+ public billingServiceCreateInitialInvoice(requestParameters: InvoicesApiBillingServiceCreateInitialInvoiceRequest, options?: AxiosRequestConfig) {
1398
+ return InvoicesApiFp(this.configuration).billingServiceCreateInitialInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1399
+ }
1400
+
1401
+ /**
1402
+ * `type` defaults to `other`. The types `estimated` and `penalty` are refused. `items` must hold at least one item, and the billing interval is required. Each line is `quantity` times `pricePerUnit`, rounded in the currency of the billing configuration; no tax is added.
1403
+ * @summary Creates a manual invoice with free items.
1404
+ * @param {InvoicesApiBillingServiceCreateInvoiceRequest} requestParameters Request parameters.
1405
+ * @param {*} [options] Override http request option.
1406
+ * @throws {RequiredError}
1407
+ * @memberof InvoicesApi
1408
+ */
1409
+ public billingServiceCreateInvoice(requestParameters: InvoicesApiBillingServiceCreateInvoiceRequest, options?: AxiosRequestConfig) {
1410
+ return InvoicesApiFp(this.configuration).billingServiceCreateInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1411
+ }
1412
+
1413
+ /**
1414
+ * The invoice\'s `status` becomes that status. The status is one of `open`, `paid`, `partially-paid` and `refunded`. An estimate has no status rows. The response is the new row.
1415
+ * @summary Adds a status row to an invoice.
1416
+ * @param {InvoicesApiBillingServiceCreateInvoiceStatusRequest} requestParameters Request parameters.
1417
+ * @param {*} [options] Override http request option.
1418
+ * @throws {RequiredError}
1419
+ * @memberof InvoicesApi
1420
+ */
1421
+ public billingServiceCreateInvoiceStatus(requestParameters: InvoicesApiBillingServiceCreateInvoiceStatusRequest, options?: AxiosRequestConfig) {
1422
+ return InvoicesApiFp(this.configuration).billingServiceCreateInvoiceStatus(requestParameters.invoiceCode, requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1423
+ }
1424
+
1425
+ /**
1426
+ * Without `billingIntervalFrom` and `billingIntervalTo` the invoice bills the next period of the policy\'s schedule, and the schedule always moves on to the period after it. With them the invoice bills that period, and the schedule moves on only when `shouldSetNextBillingDate` is true. A repeated call without an interval returns the invoice that already exists for the period and moves nothing. A period that is already invoiced cannot be invoiced again with an interval. A policy without a billing schedule row gets one first, as `CreatePolicyBilling` opens it. The first invoice of a policy has the type `initial`, whichever creation RPC makes it. For a group policy whose next period no member covers, nothing is created, `noChange` is true and the schedule moves on. With an interval nothing is created.
1427
+ * @summary Creates the recurring invoice for the next period of a policy.
1428
+ * @param {InvoicesApiBillingServiceCreateRecurringInvoiceRequest} requestParameters Request parameters.
1429
+ * @param {*} [options] Override http request option.
1430
+ * @throws {RequiredError}
1431
+ * @memberof InvoicesApi
1432
+ */
1433
+ public billingServiceCreateRecurringInvoice(requestParameters: InvoicesApiBillingServiceCreateRecurringInvoiceRequest, options?: AxiosRequestConfig) {
1434
+ return InvoicesApiFp(this.configuration).billingServiceCreateRecurringInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1435
+ }
1436
+
1437
+ /**
1438
+ * The invoiced periods after the termination date are compared with bills shortened to the covered days. This applies when the `terminationRefund` of the billing configuration is `PRO_RATA`; a negative total is the refund. One `final` invoice is created for each affected period, and the response carries the newest. No invoice is created when `terminationRefund` is `NONE`, and none either when neither the request nor the policy gives an end date. The status of the policy\'s schedule row, if it has one, becomes `terminated`. Each final invoice carries `metadata.terminatedFrom` and `metadata.correctedInvoiceErn`.
1439
+ * @summary Creates the final invoice of a terminated policy.
1440
+ * @param {InvoicesApiBillingServiceCreateTerminationInvoiceRequest} requestParameters Request parameters.
1441
+ * @param {*} [options] Override http request option.
1442
+ * @throws {RequiredError}
1443
+ * @memberof InvoicesApi
1444
+ */
1445
+ public billingServiceCreateTerminationInvoice(requestParameters: InvoicesApiBillingServiceCreateTerminationInvoiceRequest, options?: AxiosRequestConfig) {
1446
+ return InvoicesApiFp(this.configuration).billingServiceCreateTerminationInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1447
+ }
1448
+
1449
+ /**
1450
+ * Every invoice of the policy that is not yet reversed is reversed in one `withdraw` invoice, and each of them becomes `refunded`. The status of the policy\'s schedule row, if it has one, becomes `withdrawn`. When no invoice is left to reverse, nothing is created. Only `policyCode` and `metadata` are read.
1451
+ * @summary Creates a withdraw invoice for a policy that never came into force.
1452
+ * @param {InvoicesApiBillingServiceCreateWithdrawInvoiceRequest} requestParameters Request parameters.
1453
+ * @param {*} [options] Override http request option.
1454
+ * @throws {RequiredError}
1455
+ * @memberof InvoicesApi
1456
+ */
1457
+ public billingServiceCreateWithdrawInvoice(requestParameters: InvoicesApiBillingServiceCreateWithdrawInvoiceRequest, options?: AxiosRequestConfig) {
1458
+ return InvoicesApiFp(this.configuration).billingServiceCreateWithdrawInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1459
+ }
1460
+
1461
+ /**
1462
+ * The response holds the invoice with its lines and status rows. `expand=estimateHistory` adds the earlier estimates of the period when the invoice is an estimate.
1463
+ * @summary Returns one invoice.
1464
+ * @param {InvoicesApiBillingServiceGetInvoiceRequest} requestParameters Request parameters.
1465
+ * @param {*} [options] Override http request option.
1466
+ * @throws {RequiredError}
1467
+ * @memberof InvoicesApi
1468
+ */
1469
+ public billingServiceGetInvoice(requestParameters: InvoicesApiBillingServiceGetInvoiceRequest, options?: AxiosRequestConfig) {
1470
+ return InvoicesApiFp(this.configuration).billingServiceGetInvoice(requestParameters.code, requestParameters.expand, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1471
+ }
1472
+
1473
+ /**
1474
+ *
1475
+ * @summary Returns the filter catalog of the invoice list: the fields a client can filter it by.
1476
+ * @param {*} [options] Override http request option.
1477
+ * @throws {RequiredError}
1478
+ * @memberof InvoicesApi
1479
+ */
1480
+ public billingServiceGetInvoiceFilterCatalog(options?: AxiosRequestConfig) {
1481
+ return InvoicesApiFp(this.configuration).billingServiceGetInvoiceFilterCatalog(this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1482
+ }
1483
+
1484
+ /**
1485
+ *
1486
+ * @summary Returns the filter catalog of the policies-billing-dates list.
1487
+ * @param {*} [options] Override http request option.
1488
+ * @throws {RequiredError}
1489
+ * @memberof InvoicesApi
1490
+ */
1491
+ public billingServiceGetPoliciesBillingDateFilterCatalog(options?: AxiosRequestConfig) {
1492
+ return InvoicesApiFp(this.configuration).billingServiceGetPoliciesBillingDateFilterCatalog(this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1493
+ }
1494
+
1495
+ /**
1496
+ * For each period only the newest estimate is listed. - Filter: `itemPolicyCode` finds the collective invoices that have a line for the given member policy. - Search: the invoice code, the invoice number, the policy code and the account number. - Expand: `items`, `statuses`, `payments`, `estimateHistory`. A listed invoice has its lines, its status rows and, for an estimate, the earlier estimates of its period only with `expand=items`, `expand=statuses` and `expand=estimateHistory`. `payments` is always empty.
1497
+ * @summary Lists invoices.
1498
+ * @param {InvoicesApiBillingServiceListInvoicesRequest} requestParameters Request parameters.
1499
+ * @param {*} [options] Override http request option.
1500
+ * @throws {RequiredError}
1501
+ * @memberof InvoicesApi
1502
+ */
1503
+ public billingServiceListInvoices(requestParameters: InvoicesApiBillingServiceListInvoicesRequest = {}, options?: AxiosRequestConfig) {
1504
+ return InvoicesApiFp(this.configuration).billingServiceListInvoices(requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1505
+ }
1506
+
1507
+ /**
1508
+ * It returns the same rows as `ListPoliciesBillings`, with the same filter, search and sort rules. - Search: as `ListPoliciesBillings`.
1509
+ * @summary Lists the billing schedule rows.
1510
+ * @param {InvoicesApiBillingServiceListPoliciesBillingDatesRequest} requestParameters Request parameters.
1511
+ * @param {*} [options] Override http request option.
1512
+ * @throws {RequiredError}
1513
+ * @memberof InvoicesApi
1514
+ */
1515
+ public billingServiceListPoliciesBillingDates(requestParameters: InvoicesApiBillingServiceListPoliciesBillingDatesRequest = {}, options?: AxiosRequestConfig) {
1516
+ return InvoicesApiFp(this.configuration).billingServiceListPoliciesBillingDates(requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1517
+ }
1518
+
1519
+ /**
1520
+ * The reversal is a `correction` invoice with every line negated and `revertsInvoiceErn` set to the reverted invoice. The status of the reverted invoice becomes `refunded`. The reversal carries `metadata.revertedInvoiceErn`. An estimate, an invoice that is already `refunded` and a reversal cannot be reverted.
1521
+ * @summary Reverses one invoice in full.
1522
+ * @param {InvoicesApiBillingServiceRevertInvoiceRequest} requestParameters Request parameters.
1523
+ * @param {*} [options] Override http request option.
1524
+ * @throws {RequiredError}
1525
+ * @memberof InvoicesApi
1526
+ */
1527
+ public billingServiceRevertInvoice(requestParameters: InvoicesApiBillingServiceRevertInvoiceRequest, options?: AxiosRequestConfig) {
1528
+ return InvoicesApiFp(this.configuration).billingServiceRevertInvoice(requestParameters.body, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
1529
+ }
1530
+ }