@openmeter/sdk 1.0.0-beta.22 → 1.0.0-beta.221

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 (170) hide show
  1. package/Makefile +43 -0
  2. package/README.md +38 -150
  3. package/dist/cjs/index.cjs +18 -0
  4. package/dist/cjs/index.d.cts +1 -0
  5. package/dist/cjs/index.js.map +1 -0
  6. package/dist/cjs/src/client/addons.cjs +105 -0
  7. package/dist/cjs/src/client/addons.d.cts +152 -0
  8. package/dist/cjs/src/client/addons.js.map +1 -0
  9. package/dist/cjs/src/client/apps.cjs +247 -0
  10. package/dist/cjs/src/client/apps.d.cts +327 -0
  11. package/dist/cjs/src/client/apps.js.map +1 -0
  12. package/dist/cjs/src/client/billing.cjs +361 -0
  13. package/dist/cjs/src/client/billing.d.cts +526 -0
  14. package/dist/cjs/src/client/billing.js.map +1 -0
  15. package/dist/cjs/src/client/common.cjs +47 -0
  16. package/dist/cjs/src/client/common.d.cts +30 -0
  17. package/dist/cjs/src/client/common.js.map +1 -0
  18. package/dist/cjs/src/client/customers.cjs +283 -0
  19. package/dist/cjs/src/client/customers.d.cts +251 -0
  20. package/dist/cjs/src/client/customers.js.map +1 -0
  21. package/dist/cjs/src/client/debug.cjs +27 -0
  22. package/dist/cjs/src/client/debug.d.cts +17 -0
  23. package/dist/cjs/src/client/debug.js.map +1 -0
  24. package/dist/cjs/src/client/entitlements.cjs +281 -0
  25. package/dist/cjs/src/client/entitlements.d.cts +556 -0
  26. package/dist/cjs/src/client/entitlements.js.map +1 -0
  27. package/dist/cjs/src/client/events.cjs +113 -0
  28. package/dist/cjs/src/client/events.d.cts +48 -0
  29. package/dist/cjs/src/client/events.js.map +1 -0
  30. package/dist/cjs/src/client/features.cjs +78 -0
  31. package/dist/cjs/src/client/features.d.cts +78 -0
  32. package/dist/cjs/src/client/features.js.map +1 -0
  33. package/dist/cjs/src/client/index.cjs +120 -0
  34. package/dist/cjs/src/client/index.d.cts +53 -0
  35. package/dist/cjs/src/client/index.js.map +1 -0
  36. package/dist/cjs/src/client/info.cjs +42 -0
  37. package/dist/cjs/src/client/info.d.cts +34 -0
  38. package/dist/cjs/src/client/info.js.map +1 -0
  39. package/dist/cjs/src/client/meters.cjs +115 -0
  40. package/dist/cjs/src/client/meters.d.cts +123 -0
  41. package/dist/cjs/src/client/meters.js.map +1 -0
  42. package/dist/cjs/src/client/notifications.cjs +249 -0
  43. package/dist/cjs/src/client/notifications.d.cts +397 -0
  44. package/dist/cjs/src/client/notifications.js.map +1 -0
  45. package/dist/cjs/src/client/plans.cjs +204 -0
  46. package/dist/cjs/src/client/plans.d.cts +247 -0
  47. package/dist/cjs/src/client/plans.js.map +1 -0
  48. package/dist/cjs/src/client/portal.cjs +55 -0
  49. package/dist/cjs/src/client/portal.d.cts +48 -0
  50. package/dist/cjs/src/client/portal.js.map +1 -0
  51. package/dist/cjs/src/client/schemas.cjs +3 -0
  52. package/dist/cjs/src/client/schemas.d.cts +25246 -0
  53. package/dist/cjs/src/client/schemas.js.map +1 -0
  54. package/dist/cjs/src/client/subjects.cjs +76 -0
  55. package/dist/cjs/src/client/subjects.d.cts +70 -0
  56. package/dist/cjs/src/client/subjects.js.map +1 -0
  57. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  58. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  59. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  60. package/dist/cjs/src/client/subscriptions.cjs +132 -0
  61. package/dist/cjs/src/client/subscriptions.d.cts +170 -0
  62. package/dist/cjs/src/client/subscriptions.js.map +1 -0
  63. package/dist/cjs/src/client/utils.cjs +69 -0
  64. package/dist/cjs/src/client/utils.d.cts +12 -0
  65. package/dist/cjs/src/client/utils.js.map +1 -0
  66. package/dist/cjs/src/portal/index.cjs +89 -0
  67. package/dist/cjs/src/portal/index.d.cts +43 -0
  68. package/dist/cjs/src/portal/index.js.map +1 -0
  69. package/dist/cjs/src/react/context.cjs +35 -0
  70. package/dist/cjs/src/react/context.d.cts +9 -0
  71. package/dist/cjs/src/react/context.js.map +1 -0
  72. package/dist/cjs/src/zod/index.cjs +12205 -0
  73. package/dist/cjs/src/zod/index.d.cts +19139 -0
  74. package/dist/cjs/src/zod/index.js.map +1 -0
  75. package/dist/cjs/tsconfig.0bedc47d.tsbuildinfo +1 -0
  76. package/dist/cjs/tsconfig.c449a50f.tsbuildinfo +1 -0
  77. package/dist/index.d.ts +1 -14
  78. package/dist/index.js +2 -15
  79. package/dist/index.js.map +1 -0
  80. package/dist/src/client/addons.d.ts +152 -0
  81. package/dist/src/client/addons.js +101 -0
  82. package/dist/src/client/addons.js.map +1 -0
  83. package/dist/src/client/apps.d.ts +327 -0
  84. package/dist/src/client/apps.js +240 -0
  85. package/dist/src/client/apps.js.map +1 -0
  86. package/dist/src/client/billing.d.ts +526 -0
  87. package/dist/src/client/billing.js +354 -0
  88. package/dist/src/client/billing.js.map +1 -0
  89. package/dist/src/client/common.d.ts +30 -0
  90. package/dist/src/client/common.js +42 -0
  91. package/dist/src/client/common.js.map +1 -0
  92. package/dist/src/client/customers.d.ts +251 -0
  93. package/dist/src/client/customers.js +276 -0
  94. package/dist/src/client/customers.js.map +1 -0
  95. package/dist/src/client/debug.d.ts +17 -0
  96. package/dist/src/client/debug.js +23 -0
  97. package/dist/src/client/debug.js.map +1 -0
  98. package/dist/src/client/entitlements.d.ts +556 -0
  99. package/dist/src/client/entitlements.js +276 -0
  100. package/dist/src/client/entitlements.js.map +1 -0
  101. package/dist/src/client/events.d.ts +48 -0
  102. package/dist/src/client/events.js +108 -0
  103. package/dist/src/client/events.js.map +1 -0
  104. package/dist/src/client/features.d.ts +78 -0
  105. package/dist/src/client/features.js +74 -0
  106. package/dist/src/client/features.js.map +1 -0
  107. package/dist/src/client/index.d.ts +53 -0
  108. package/dist/src/client/index.js +80 -0
  109. package/dist/src/client/index.js.map +1 -0
  110. package/dist/src/client/info.d.ts +34 -0
  111. package/dist/src/client/info.js +38 -0
  112. package/dist/src/client/info.js.map +1 -0
  113. package/dist/src/client/meters.d.ts +123 -0
  114. package/dist/src/client/meters.js +111 -0
  115. package/dist/src/client/meters.js.map +1 -0
  116. package/dist/src/client/notifications.d.ts +397 -0
  117. package/dist/src/client/notifications.js +242 -0
  118. package/dist/src/client/notifications.js.map +1 -0
  119. package/dist/src/client/plans.d.ts +247 -0
  120. package/dist/src/client/plans.js +199 -0
  121. package/dist/src/client/plans.js.map +1 -0
  122. package/dist/src/client/portal.d.ts +48 -0
  123. package/dist/src/client/portal.js +51 -0
  124. package/dist/src/client/portal.js.map +1 -0
  125. package/dist/src/client/schemas.d.ts +25246 -0
  126. package/dist/src/client/schemas.js +2 -0
  127. package/dist/src/client/schemas.js.map +1 -0
  128. package/dist/src/client/subjects.d.ts +70 -0
  129. package/dist/src/client/subjects.js +72 -0
  130. package/dist/src/client/subjects.js.map +1 -0
  131. package/dist/src/client/subscription-addons.d.ts +123 -0
  132. package/dist/src/client/subscription-addons.js +66 -0
  133. package/dist/src/client/subscription-addons.js.map +1 -0
  134. package/dist/src/client/subscriptions.d.ts +170 -0
  135. package/dist/src/client/subscriptions.js +128 -0
  136. package/dist/src/client/subscriptions.js.map +1 -0
  137. package/dist/src/client/utils.d.ts +12 -0
  138. package/dist/src/client/utils.js +63 -0
  139. package/dist/src/client/utils.js.map +1 -0
  140. package/dist/src/portal/index.d.ts +43 -0
  141. package/dist/src/portal/index.js +52 -0
  142. package/dist/src/portal/index.js.map +1 -0
  143. package/dist/src/react/context.d.ts +9 -0
  144. package/dist/src/react/context.js +16 -0
  145. package/dist/src/react/context.js.map +1 -0
  146. package/dist/src/zod/index.d.ts +19139 -0
  147. package/dist/src/zod/index.js +12178 -0
  148. package/dist/src/zod/index.js.map +1 -0
  149. package/dist/tsconfig.tsbuildinfo +1 -1
  150. package/orval.config.ts +42 -0
  151. package/package.json +89 -35
  152. package/patches/openapi-typescript.patch +6194 -0
  153. package/dist/clients/client.d.ts +0 -40
  154. package/dist/clients/client.js +0 -104
  155. package/dist/clients/event.d.ts +0 -79
  156. package/dist/clients/event.js +0 -53
  157. package/dist/clients/meter.d.ts +0 -71
  158. package/dist/clients/meter.js +0 -64
  159. package/dist/clients/portal.d.ts +0 -23
  160. package/dist/clients/portal.js +0 -37
  161. package/dist/next.d.ts +0 -15
  162. package/dist/next.js +0 -46
  163. package/dist/schemas/openapi.d.ts +0 -460
  164. package/dist/schemas/openapi.js +0 -5
  165. package/dist/test/agent.d.ts +0 -2
  166. package/dist/test/agent.js +0 -178
  167. package/dist/test/mocks.d.ts +0 -12
  168. package/dist/test/mocks.js +0 -32
  169. package/index.ts +0 -22
  170. package/next.ts +0 -76
@@ -0,0 +1,526 @@
1
+ import type { RequestOptions } from './common.js';
2
+ import type { BillingProfileCreate, BillingProfileCustomerOverrideCreate, BillingProfileReplaceUpdateWithWorkflow, InvoicePendingLineCreateInput, InvoiceReplaceUpdate, InvoiceSimulationInput, operations, paths, VoidInvoiceActionInput } from './schemas.js';
3
+ import type { Client } from 'openapi-fetch';
4
+ /**
5
+ * Billing
6
+ */
7
+ export declare class Billing {
8
+ private client;
9
+ profiles: BillingProfiles;
10
+ invoices: BillingInvoices;
11
+ customers: BillingCustomers;
12
+ constructor(client: Client<paths, `${string}/${string}`>);
13
+ }
14
+ /**
15
+ * Billing Profiles
16
+ */
17
+ export declare class BillingProfiles {
18
+ private client;
19
+ constructor(client: Client<paths, `${string}/${string}`>);
20
+ /**
21
+ * Create a billing profile
22
+ * @param billingProfile - The billing profile to create
23
+ * @param signal - An optional abort signal
24
+ * @returns The created billing profile
25
+ */
26
+ create(billingProfile: BillingProfileCreate, options?: RequestOptions): Promise<{
27
+ readonly id: string;
28
+ name: string;
29
+ description?: string;
30
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
31
+ readonly createdAt: Date;
32
+ readonly updatedAt: Date;
33
+ readonly deletedAt?: Date;
34
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
35
+ readonly workflow: import("./schemas.js").components["schemas"]["BillingWorkflow"];
36
+ readonly apps: import("./schemas.js").components["schemas"]["BillingProfileAppsOrReference"];
37
+ default: boolean;
38
+ }>;
39
+ /**
40
+ * Get a billing profile by ID
41
+ * @param id - The ID of the billing profile to get
42
+ * @param signal - An optional abort signal
43
+ * @returns The billing profile
44
+ */
45
+ get(id: operations['getBillingProfile']['parameters']['path']['id'], options?: RequestOptions): Promise<{
46
+ readonly id: string;
47
+ name: string;
48
+ description?: string;
49
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
50
+ readonly createdAt: Date;
51
+ readonly updatedAt: Date;
52
+ readonly deletedAt?: Date;
53
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
54
+ readonly workflow: import("./schemas.js").components["schemas"]["BillingWorkflow"];
55
+ readonly apps: import("./schemas.js").components["schemas"]["BillingProfileAppsOrReference"];
56
+ default: boolean;
57
+ }>;
58
+ /**
59
+ * List billing profiles
60
+ * @param query - The query parameters
61
+ * @param signal - An optional abort signal
62
+ * @returns The billing profiles
63
+ */
64
+ list(query?: operations['listBillingProfiles']['parameters']['query'], options?: RequestOptions): Promise<{
65
+ totalCount: number;
66
+ page: number;
67
+ pageSize: number;
68
+ items: import("./schemas.js").components["schemas"]["BillingProfile"][];
69
+ }>;
70
+ /**
71
+ * Update a billing profile
72
+ * @param id - The ID of the billing profile to update
73
+ * @param billingProfile - The billing profile to update
74
+ * @param signal - An optional abort signal
75
+ * @returns The updated billing profile
76
+ */
77
+ update(id: operations['updateBillingProfile']['parameters']['path']['id'], billingProfile: BillingProfileReplaceUpdateWithWorkflow, options?: RequestOptions): Promise<{
78
+ readonly id: string;
79
+ name: string;
80
+ description?: string;
81
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
82
+ readonly createdAt: Date;
83
+ readonly updatedAt: Date;
84
+ readonly deletedAt?: Date;
85
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
86
+ readonly workflow: import("./schemas.js").components["schemas"]["BillingWorkflow"];
87
+ readonly apps: import("./schemas.js").components["schemas"]["BillingProfileAppsOrReference"];
88
+ default: boolean;
89
+ }>;
90
+ /**
91
+ * Delete a billing profile
92
+ * @param id - The ID of the billing profile to delete
93
+ * @param options - The request options
94
+ * @returns The deleted billing profile
95
+ */
96
+ delete(id: operations['deleteBillingProfile']['parameters']['path']['id'], options?: RequestOptions): Promise<undefined>;
97
+ }
98
+ /**
99
+ * Billing Invoices
100
+ */
101
+ export declare class BillingInvoices {
102
+ private client;
103
+ constructor(client: Client<paths, `${string}/${string}`>);
104
+ /**
105
+ * List invoices
106
+ * @param query - The query parameters
107
+ * @param signal - An optional abort signal
108
+ * @returns The invoices
109
+ */
110
+ list(query?: operations['listInvoices']['parameters']['query'], options?: RequestOptions): Promise<{
111
+ totalCount: number;
112
+ page: number;
113
+ pageSize: number;
114
+ items: import("./schemas.js").components["schemas"]["Invoice"][];
115
+ }>;
116
+ /**
117
+ * Get an invoice by ID
118
+ * @param id - The ID of the invoice to get
119
+ * @param signal - An optional abort signal
120
+ * @returns The invoice
121
+ */
122
+ get(id: operations['getInvoice']['parameters']['path']['invoiceId'], options?: RequestOptions): Promise<{
123
+ readonly id: string;
124
+ description?: string;
125
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
126
+ readonly createdAt: Date;
127
+ readonly updatedAt: Date;
128
+ readonly deletedAt?: Date;
129
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
130
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
131
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
132
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
133
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
134
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
135
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
136
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
137
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
138
+ readonly issuedAt?: Date;
139
+ draftUntil?: Date;
140
+ readonly quantitySnapshotedAt?: Date;
141
+ readonly collectionAt?: Date;
142
+ readonly dueAt?: Date;
143
+ period?: import("./schemas.js").components["schemas"]["Period"];
144
+ readonly voidedAt?: Date;
145
+ readonly sentToCustomerAt?: Date;
146
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
147
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
148
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
149
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
150
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
151
+ }>;
152
+ /**
153
+ * Update an invoice
154
+ * @description Only invoices in draft or earlier status can be updated.
155
+ * @param id - The ID of the invoice to update
156
+ * @param invoice - The invoice to update
157
+ * @param signal - An optional abort signal
158
+ * @returns The updated invoice
159
+ */
160
+ update(id: operations['updateInvoice']['parameters']['path']['invoiceId'], invoice: InvoiceReplaceUpdate, options?: RequestOptions): Promise<{
161
+ readonly id: string;
162
+ description?: string;
163
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
164
+ readonly createdAt: Date;
165
+ readonly updatedAt: Date;
166
+ readonly deletedAt?: Date;
167
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
168
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
169
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
170
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
171
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
172
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
173
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
174
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
175
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
176
+ readonly issuedAt?: Date;
177
+ draftUntil?: Date;
178
+ readonly quantitySnapshotedAt?: Date;
179
+ readonly collectionAt?: Date;
180
+ readonly dueAt?: Date;
181
+ period?: import("./schemas.js").components["schemas"]["Period"];
182
+ readonly voidedAt?: Date;
183
+ readonly sentToCustomerAt?: Date;
184
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
185
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
186
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
187
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
188
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
189
+ }>;
190
+ /**
191
+ * Delete an invoice
192
+ * @description Only invoices that are in the draft (or earlier) status can be deleted.
193
+ * @param id - The ID of the invoice to delete
194
+ * @param options - The request options
195
+ * @returns The deleted invoice
196
+ */
197
+ delete(id: operations['deleteInvoice']['parameters']['path']['invoiceId'], options?: RequestOptions): Promise<undefined>;
198
+ /**
199
+ * Advance the invoice to the next status
200
+ * @description The call doesn't "approve the invoice", it only advances the invoice to the next status if the transition would be automatic. The action can be called when the invoice's statusDetails' actions field contain the "advance" action.
201
+ * @param id - The ID of the invoice to advance
202
+ * @param signal - An optional abort signal
203
+ * @returns The advanced invoice
204
+ */
205
+ advance(id: operations['advanceInvoiceAction']['parameters']['path']['invoiceId'], options?: RequestOptions): Promise<{
206
+ readonly id: string;
207
+ description?: string;
208
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
209
+ readonly createdAt: Date;
210
+ readonly updatedAt: Date;
211
+ readonly deletedAt?: Date;
212
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
213
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
214
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
215
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
216
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
217
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
218
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
219
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
220
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
221
+ readonly issuedAt?: Date;
222
+ draftUntil?: Date;
223
+ readonly quantitySnapshotedAt?: Date;
224
+ readonly collectionAt?: Date;
225
+ readonly dueAt?: Date;
226
+ period?: import("./schemas.js").components["schemas"]["Period"];
227
+ readonly voidedAt?: Date;
228
+ readonly sentToCustomerAt?: Date;
229
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
230
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
231
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
232
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
233
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
234
+ }>;
235
+ /**
236
+ * Approve an invoice
237
+ * @description This call instantly sends the invoice to the customer using the configured billing profile app.
238
+ * @param id - The ID of the invoice to approve
239
+ * @param signal - An optional abort signal
240
+ * @returns The approved invoice
241
+ */
242
+ approve(id: operations['approveInvoiceAction']['parameters']['path']['invoiceId'], options?: RequestOptions): Promise<{
243
+ readonly id: string;
244
+ description?: string;
245
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
246
+ readonly createdAt: Date;
247
+ readonly updatedAt: Date;
248
+ readonly deletedAt?: Date;
249
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
250
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
251
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
252
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
253
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
254
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
255
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
256
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
257
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
258
+ readonly issuedAt?: Date;
259
+ draftUntil?: Date;
260
+ readonly quantitySnapshotedAt?: Date;
261
+ readonly collectionAt?: Date;
262
+ readonly dueAt?: Date;
263
+ period?: import("./schemas.js").components["schemas"]["Period"];
264
+ readonly voidedAt?: Date;
265
+ readonly sentToCustomerAt?: Date;
266
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
267
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
268
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
269
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
270
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
271
+ }>;
272
+ /**
273
+ * Retry advancing the invoice after a failed attempt.
274
+ * @param id - The ID of the invoice to retry
275
+ * @param signal - An optional abort signal
276
+ * @returns The retried invoice
277
+ */
278
+ retry(id: operations['retryInvoiceAction']['parameters']['path']['invoiceId'], options?: RequestOptions): Promise<{
279
+ readonly id: string;
280
+ description?: string;
281
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
282
+ readonly createdAt: Date;
283
+ readonly updatedAt: Date;
284
+ readonly deletedAt?: Date;
285
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
286
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
287
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
288
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
289
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
290
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
291
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
292
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
293
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
294
+ readonly issuedAt?: Date;
295
+ draftUntil?: Date;
296
+ readonly quantitySnapshotedAt?: Date;
297
+ readonly collectionAt?: Date;
298
+ readonly dueAt?: Date;
299
+ period?: import("./schemas.js").components["schemas"]["Period"];
300
+ readonly voidedAt?: Date;
301
+ readonly sentToCustomerAt?: Date;
302
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
303
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
304
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
305
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
306
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
307
+ }>;
308
+ /**
309
+ * Void an invoice
310
+ * @description Void an invoice
311
+ *
312
+ * Only invoices that have been alread issued can be voided.
313
+ * @param id - The ID of the invoice to void
314
+ * @param signal - An optional abort signal
315
+ * @returns The voided invoice
316
+ */
317
+ void(id: operations['voidInvoiceAction']['parameters']['path']['invoiceId'], body: VoidInvoiceActionInput, options?: RequestOptions): Promise<{
318
+ readonly id: string;
319
+ description?: string;
320
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
321
+ readonly createdAt: Date;
322
+ readonly updatedAt: Date;
323
+ readonly deletedAt?: Date;
324
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
325
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
326
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
327
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
328
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
329
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
330
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
331
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
332
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
333
+ readonly issuedAt?: Date;
334
+ draftUntil?: Date;
335
+ readonly quantitySnapshotedAt?: Date;
336
+ readonly collectionAt?: Date;
337
+ readonly dueAt?: Date;
338
+ period?: import("./schemas.js").components["schemas"]["Period"];
339
+ readonly voidedAt?: Date;
340
+ readonly sentToCustomerAt?: Date;
341
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
342
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
343
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
344
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
345
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
346
+ }>;
347
+ /**
348
+ * Recalculate an invoice's tax amounts
349
+ * @param id - The ID of the invoice to recalculate
350
+ * @param signal - An optional abort signal
351
+ * @returns The recalculated invoice
352
+ */
353
+ recalculateTax(id: operations['recalculateInvoiceTaxAction']['parameters']['path']['invoiceId'], options?: RequestOptions): Promise<{
354
+ readonly id: string;
355
+ description?: string;
356
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
357
+ readonly createdAt: Date;
358
+ readonly updatedAt: Date;
359
+ readonly deletedAt?: Date;
360
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
361
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
362
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
363
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
364
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
365
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
366
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
367
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
368
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
369
+ readonly issuedAt?: Date;
370
+ draftUntil?: Date;
371
+ readonly quantitySnapshotedAt?: Date;
372
+ readonly collectionAt?: Date;
373
+ readonly dueAt?: Date;
374
+ period?: import("./schemas.js").components["schemas"]["Period"];
375
+ readonly voidedAt?: Date;
376
+ readonly sentToCustomerAt?: Date;
377
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
378
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
379
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
380
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
381
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
382
+ }>;
383
+ /**
384
+ * Simulate an invoice for a customer
385
+ * @param id - The ID of the customer to simulate the invoice for
386
+ * @param signal - An optional abort signal
387
+ * @returns The simulated invoice
388
+ */
389
+ simulate(id: operations['simulateInvoice']['parameters']['path']['customerId'], body: InvoiceSimulationInput, options?: RequestOptions): Promise<{
390
+ readonly id: string;
391
+ description?: string;
392
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
393
+ readonly createdAt: Date;
394
+ readonly updatedAt: Date;
395
+ readonly deletedAt?: Date;
396
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
397
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
398
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
399
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
400
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
401
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
402
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
403
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
404
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
405
+ readonly issuedAt?: Date;
406
+ draftUntil?: Date;
407
+ readonly quantitySnapshotedAt?: Date;
408
+ readonly collectionAt?: Date;
409
+ readonly dueAt?: Date;
410
+ period?: import("./schemas.js").components["schemas"]["Period"];
411
+ readonly voidedAt?: Date;
412
+ readonly sentToCustomerAt?: Date;
413
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
414
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
415
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
416
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
417
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
418
+ }>;
419
+ /**
420
+ * Create pending line items
421
+ * @description Create new pending line items (charges).
422
+ * This call is used to create a new pending line item for the customer if required a new
423
+ * gathering invoice will be created.
424
+ *
425
+ * A new invoice will be created if:
426
+ * - there is no invoice in gathering state
427
+ * - the currency of the line item doesn't match the currency of any invoices in gathering state
428
+ * @param customerId - The ID of the customer to create the line items for
429
+ * @param body - The line items to create
430
+ * @param signal - An optional abort signal
431
+ * @returns The created line items
432
+ */
433
+ createLineItems(customerId: operations['createPendingInvoiceLine']['parameters']['path']['customerId'], body: InvoicePendingLineCreateInput, options?: RequestOptions): Promise<{
434
+ readonly lines: import("./schemas.js").components["schemas"]["InvoiceLine"][];
435
+ readonly invoice: import("./schemas.js").components["schemas"]["Invoice"];
436
+ readonly isInvoiceNew: boolean;
437
+ }>;
438
+ /**
439
+ * Invoice a customer based on the pending line items
440
+ * @description Create a new invoice from the pending line items. This should only be called if for some reason we need to invoice a customer outside of the normal billing cycle.
441
+ * @param body - The invoice data
442
+ * @param options - The request options
443
+ * @returns The created invoices
444
+ */
445
+ invoicePendingLines(body: operations['invoicePendingLinesAction']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
446
+ readonly id: string;
447
+ description?: string;
448
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
449
+ readonly createdAt: Date;
450
+ readonly updatedAt: Date;
451
+ readonly deletedAt?: Date;
452
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
453
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
454
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
455
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
456
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
457
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
458
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
459
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
460
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
461
+ readonly issuedAt?: Date;
462
+ draftUntil?: Date;
463
+ readonly quantitySnapshotedAt?: Date;
464
+ readonly collectionAt?: Date;
465
+ readonly dueAt?: Date;
466
+ period?: import("./schemas.js").components["schemas"]["Period"];
467
+ readonly voidedAt?: Date;
468
+ readonly sentToCustomerAt?: Date;
469
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
470
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
471
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
472
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
473
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
474
+ }[]>;
475
+ }
476
+ /**
477
+ * Billing Customer Invoices and Overrides
478
+ */
479
+ export declare class BillingCustomers {
480
+ private client;
481
+ constructor(client: Client<paths, `${string}/${string}`>);
482
+ /**
483
+ * Create or update a customer override
484
+ * @param id - The ID of the customer to create the override for
485
+ * @param body - The customer override to create
486
+ * @param signal - An optional abort signal
487
+ * @returns The created customer override
488
+ */
489
+ createOverride(id: operations['upsertBillingProfileCustomerOverride']['parameters']['path']['customerId'], body: BillingProfileCustomerOverrideCreate, options?: RequestOptions): Promise<{
490
+ customerOverride?: import("./schemas.js").components["schemas"]["BillingProfileCustomerOverride"];
491
+ baseBillingProfileId: string;
492
+ customerProfile?: import("./schemas.js").components["schemas"]["BillingCustomerProfile"];
493
+ customer?: import("./schemas.js").components["schemas"]["Customer"];
494
+ }>;
495
+ /**
496
+ * Get a customer override
497
+ * @param id - The ID of the customer to get the override for
498
+ * @param signal - An optional abort signal
499
+ * @returns The customer override
500
+ */
501
+ getOverride(id: operations['getBillingProfileCustomerOverride']['parameters']['path']['customerId'], options?: RequestOptions): Promise<{
502
+ customerOverride?: import("./schemas.js").components["schemas"]["BillingProfileCustomerOverride"];
503
+ baseBillingProfileId: string;
504
+ customerProfile?: import("./schemas.js").components["schemas"]["BillingCustomerProfile"];
505
+ customer?: import("./schemas.js").components["schemas"]["Customer"];
506
+ }>;
507
+ /**
508
+ * List customer overrides
509
+ * @param query - The query parameters
510
+ * @param signal - An optional abort signal
511
+ * @returns The customer overrides
512
+ */
513
+ listOverrides(query?: operations['listBillingProfileCustomerOverrides']['parameters']['query'], options?: RequestOptions): Promise<{
514
+ totalCount: number;
515
+ page: number;
516
+ pageSize: number;
517
+ items: import("./schemas.js").components["schemas"]["BillingProfileCustomerOverrideWithDetails"][];
518
+ }>;
519
+ /**
520
+ * Delete a customer override
521
+ * @param id - The ID of the customer to delete the override for
522
+ * @param signal - An optional abort signal
523
+ * @returns The deleted customer override
524
+ */
525
+ deleteOverride(id: operations['deleteBillingProfileCustomerOverride']['parameters']['path']['customerId'], options?: RequestOptions): Promise<undefined>;
526
+ }