@openmeter/sdk 1.0.0-beta.98 → 1.0.0-beta-9958c9245841

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 (203) hide show
  1. package/Makefile +43 -0
  2. package/README.md +232 -137
  3. package/biome.json +67 -0
  4. package/dist/cjs/index.cjs +15 -21
  5. package/dist/cjs/index.d.cts +1 -15
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/cjs/src/client/addons.cjs +105 -0
  8. package/dist/cjs/src/client/addons.d.cts +152 -0
  9. package/dist/cjs/src/client/addons.js.map +1 -0
  10. package/dist/cjs/src/client/apps.cjs +247 -0
  11. package/dist/cjs/src/client/apps.d.cts +327 -0
  12. package/dist/cjs/src/client/apps.js.map +1 -0
  13. package/dist/cjs/src/client/billing.cjs +375 -0
  14. package/dist/cjs/src/client/billing.d.cts +563 -0
  15. package/dist/cjs/src/client/billing.js.map +1 -0
  16. package/dist/cjs/src/client/common.cjs +47 -0
  17. package/dist/cjs/src/client/common.d.cts +30 -0
  18. package/dist/cjs/src/client/common.js.map +1 -0
  19. package/dist/cjs/src/client/customers.cjs +469 -0
  20. package/dist/cjs/src/client/customers.d.cts +617 -0
  21. package/dist/cjs/src/client/customers.js.map +1 -0
  22. package/dist/cjs/src/client/debug.cjs +27 -0
  23. package/dist/cjs/src/client/debug.d.cts +17 -0
  24. package/dist/cjs/src/client/debug.js.map +1 -0
  25. package/dist/cjs/src/client/entitlements.cjs +372 -0
  26. package/dist/cjs/src/client/entitlements.d.cts +670 -0
  27. package/dist/cjs/src/client/entitlements.js.map +1 -0
  28. package/dist/cjs/src/client/events.cjs +113 -0
  29. package/dist/cjs/src/client/events.d.cts +48 -0
  30. package/dist/cjs/src/client/events.js.map +1 -0
  31. package/dist/cjs/src/client/features.cjs +78 -0
  32. package/dist/cjs/src/client/features.d.cts +87 -0
  33. package/dist/cjs/src/client/features.js.map +1 -0
  34. package/dist/cjs/src/client/index.cjs +122 -0
  35. package/dist/cjs/src/client/index.d.cts +54 -0
  36. package/dist/cjs/src/client/index.js.map +1 -0
  37. package/dist/cjs/src/client/info.cjs +42 -0
  38. package/dist/cjs/src/client/info.d.cts +34 -0
  39. package/dist/cjs/src/client/info.js.map +1 -0
  40. package/dist/cjs/src/client/meters.cjs +160 -0
  41. package/dist/cjs/src/client/meters.d.cts +151 -0
  42. package/dist/cjs/src/client/meters.js.map +1 -0
  43. package/dist/cjs/src/client/notifications.cjs +269 -0
  44. package/dist/cjs/src/client/notifications.d.cts +412 -0
  45. package/dist/cjs/src/client/notifications.js.map +1 -0
  46. package/dist/cjs/src/client/plans.cjs +204 -0
  47. package/dist/cjs/src/client/plans.d.cts +247 -0
  48. package/dist/cjs/src/client/plans.js.map +1 -0
  49. package/dist/cjs/src/client/portal.cjs +55 -0
  50. package/dist/cjs/src/client/portal.d.cts +48 -0
  51. package/dist/cjs/src/client/portal.js.map +1 -0
  52. package/dist/cjs/src/client/schemas.cjs +3 -0
  53. package/dist/cjs/src/client/schemas.d.cts +27081 -0
  54. package/dist/cjs/src/client/schemas.js.map +1 -0
  55. package/dist/cjs/src/client/subjects.cjs +76 -0
  56. package/dist/cjs/src/client/subjects.d.cts +79 -0
  57. package/dist/cjs/src/client/subjects.js.map +1 -0
  58. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  59. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  60. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  61. package/dist/cjs/src/client/subscriptions.cjs +132 -0
  62. package/dist/cjs/src/client/subscriptions.d.cts +175 -0
  63. package/dist/cjs/src/client/subscriptions.js.map +1 -0
  64. package/dist/cjs/src/client/utils.cjs +67 -0
  65. package/dist/cjs/src/client/utils.d.cts +12 -0
  66. package/dist/cjs/src/client/utils.js.map +1 -0
  67. package/dist/cjs/src/portal/index.cjs +89 -0
  68. package/dist/cjs/src/portal/index.d.cts +43 -0
  69. package/dist/cjs/src/portal/index.js.map +1 -0
  70. package/dist/cjs/src/react/context.cjs +35 -0
  71. package/dist/cjs/src/react/context.d.cts +9 -0
  72. package/dist/cjs/src/react/context.js.map +1 -0
  73. package/dist/cjs/src/zod/index.cjs +13102 -0
  74. package/dist/cjs/src/zod/index.d.cts +20044 -0
  75. package/dist/cjs/src/zod/index.js.map +1 -0
  76. package/dist/cjs/tsconfig.0781fa96.tsbuildinfo +1 -0
  77. package/dist/cjs/tsconfig.6c95ff08.tsbuildinfo +1 -0
  78. package/dist/index.d.ts +1 -15
  79. package/dist/index.js +1 -17
  80. package/dist/index.js.map +1 -1
  81. package/dist/src/client/addons.d.ts +152 -0
  82. package/dist/src/client/addons.js +101 -0
  83. package/dist/src/client/addons.js.map +1 -0
  84. package/dist/src/client/apps.d.ts +327 -0
  85. package/dist/src/client/apps.js +240 -0
  86. package/dist/src/client/apps.js.map +1 -0
  87. package/dist/src/client/billing.d.ts +563 -0
  88. package/dist/src/client/billing.js +368 -0
  89. package/dist/src/client/billing.js.map +1 -0
  90. package/dist/src/client/common.d.ts +30 -0
  91. package/dist/src/client/common.js +42 -0
  92. package/dist/src/client/common.js.map +1 -0
  93. package/dist/src/client/customers.d.ts +617 -0
  94. package/dist/src/client/customers.js +461 -0
  95. package/dist/src/client/customers.js.map +1 -0
  96. package/dist/src/client/debug.d.ts +17 -0
  97. package/dist/src/client/debug.js +23 -0
  98. package/dist/src/client/debug.js.map +1 -0
  99. package/dist/src/client/entitlements.d.ts +670 -0
  100. package/dist/src/client/entitlements.js +365 -0
  101. package/dist/src/client/entitlements.js.map +1 -0
  102. package/dist/src/client/events.d.ts +48 -0
  103. package/dist/src/client/events.js +108 -0
  104. package/dist/src/client/events.js.map +1 -0
  105. package/dist/src/client/features.d.ts +87 -0
  106. package/dist/src/client/features.js +74 -0
  107. package/dist/src/client/features.js.map +1 -0
  108. package/dist/src/client/index.d.ts +54 -0
  109. package/dist/src/client/index.js +82 -0
  110. package/dist/src/client/index.js.map +1 -0
  111. package/dist/src/client/info.d.ts +34 -0
  112. package/dist/src/client/info.js +38 -0
  113. package/dist/src/client/info.js.map +1 -0
  114. package/dist/src/client/meters.d.ts +151 -0
  115. package/dist/src/client/meters.js +156 -0
  116. package/dist/src/client/meters.js.map +1 -0
  117. package/dist/src/client/notifications.d.ts +412 -0
  118. package/dist/src/client/notifications.js +262 -0
  119. package/dist/src/client/notifications.js.map +1 -0
  120. package/dist/src/client/plans.d.ts +247 -0
  121. package/dist/src/client/plans.js +199 -0
  122. package/dist/src/client/plans.js.map +1 -0
  123. package/dist/src/client/portal.d.ts +48 -0
  124. package/dist/src/client/portal.js +51 -0
  125. package/dist/src/client/portal.js.map +1 -0
  126. package/dist/src/client/schemas.d.ts +27081 -0
  127. package/dist/src/client/schemas.js +2 -0
  128. package/dist/src/client/schemas.js.map +1 -0
  129. package/dist/src/client/subjects.d.ts +79 -0
  130. package/dist/src/client/subjects.js +72 -0
  131. package/dist/src/client/subjects.js.map +1 -0
  132. package/dist/src/client/subscription-addons.d.ts +123 -0
  133. package/dist/src/client/subscription-addons.js +66 -0
  134. package/dist/src/client/subscription-addons.js.map +1 -0
  135. package/dist/src/client/subscriptions.d.ts +175 -0
  136. package/dist/src/client/subscriptions.js +128 -0
  137. package/dist/src/client/subscriptions.js.map +1 -0
  138. package/dist/src/client/utils.d.ts +12 -0
  139. package/dist/src/client/utils.js +61 -0
  140. package/dist/src/client/utils.js.map +1 -0
  141. package/dist/src/portal/index.d.ts +43 -0
  142. package/dist/src/portal/index.js +52 -0
  143. package/dist/src/portal/index.js.map +1 -0
  144. package/dist/src/react/context.d.ts +9 -0
  145. package/dist/src/react/context.js +16 -0
  146. package/dist/src/react/context.js.map +1 -0
  147. package/dist/src/zod/index.d.ts +20044 -0
  148. package/dist/src/zod/index.js +13071 -0
  149. package/dist/src/zod/index.js.map +1 -0
  150. package/dist/tsconfig.tsbuildinfo +1 -1
  151. package/orval.config.ts +38 -0
  152. package/package.json +62 -32
  153. package/patches/openapi-typescript.patch +6194 -0
  154. package/dist/cjs/clients/client.cjs +0 -117
  155. package/dist/cjs/clients/client.d.cts +0 -40
  156. package/dist/cjs/clients/client.js.map +0 -1
  157. package/dist/cjs/clients/event.cjs +0 -71
  158. package/dist/cjs/clients/event.d.cts +0 -79
  159. package/dist/cjs/clients/event.js.map +0 -1
  160. package/dist/cjs/clients/meter.cjs +0 -69
  161. package/dist/cjs/clients/meter.d.cts +0 -75
  162. package/dist/cjs/clients/meter.js.map +0 -1
  163. package/dist/cjs/clients/portal.cjs +0 -41
  164. package/dist/cjs/clients/portal.d.cts +0 -22
  165. package/dist/cjs/clients/portal.js.map +0 -1
  166. package/dist/cjs/clients/subject.cjs +0 -60
  167. package/dist/cjs/clients/subject.d.cts +0 -27
  168. package/dist/cjs/clients/subject.js.map +0 -1
  169. package/dist/cjs/schemas/openapi.cjs +0 -7
  170. package/dist/cjs/schemas/openapi.d.cts +0 -2078
  171. package/dist/cjs/schemas/openapi.js.map +0 -1
  172. package/dist/cjs/test/agent.cjs +0 -266
  173. package/dist/cjs/test/agent.d.cts +0 -2
  174. package/dist/cjs/test/agent.js.map +0 -1
  175. package/dist/cjs/test/mocks.cjs +0 -44
  176. package/dist/cjs/test/mocks.d.cts +0 -14
  177. package/dist/cjs/test/mocks.js.map +0 -1
  178. package/dist/cjs/tsconfig.4e4a4d92.tsbuildinfo +0 -1
  179. package/dist/cjs/tsconfig.d9d2f106.tsbuildinfo +0 -1
  180. package/dist/clients/client.d.ts +0 -40
  181. package/dist/clients/client.js +0 -112
  182. package/dist/clients/client.js.map +0 -1
  183. package/dist/clients/event.d.ts +0 -79
  184. package/dist/clients/event.js +0 -64
  185. package/dist/clients/event.js.map +0 -1
  186. package/dist/clients/meter.d.ts +0 -75
  187. package/dist/clients/meter.js +0 -65
  188. package/dist/clients/meter.js.map +0 -1
  189. package/dist/clients/portal.d.ts +0 -22
  190. package/dist/clients/portal.js +0 -37
  191. package/dist/clients/portal.js.map +0 -1
  192. package/dist/clients/subject.d.ts +0 -27
  193. package/dist/clients/subject.js +0 -56
  194. package/dist/clients/subject.js.map +0 -1
  195. package/dist/schemas/openapi.d.ts +0 -2078
  196. package/dist/schemas/openapi.js +0 -6
  197. package/dist/schemas/openapi.js.map +0 -1
  198. package/dist/test/agent.d.ts +0 -2
  199. package/dist/test/agent.js +0 -263
  200. package/dist/test/agent.js.map +0 -1
  201. package/dist/test/mocks.d.ts +0 -14
  202. package/dist/test/mocks.js +0 -41
  203. package/dist/test/mocks.js.map +0 -1
@@ -0,0 +1,563 @@
1
+ import type { Client } from 'openapi-fetch';
2
+ import type { RequestOptions } from './common.js';
3
+ import type { BillingProfileCreate, BillingProfileCustomerOverrideCreate, BillingProfileReplaceUpdateWithWorkflow, InvoicePendingLineCreateInput, InvoiceReplaceUpdate, InvoiceSimulationInput, operations, paths, VoidInvoiceActionInput } from './schemas.js';
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
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
+ } | undefined>;
383
+ /**
384
+ * Snapshot invoice line item quantities
385
+ * @description Snapshot the quantities of the invoice line items. This is useful for invoices that have usage-based line items.
386
+ * @param id - The ID of the invoice to snapshot
387
+ * @param signal - An optional abort signal
388
+ * @returns The invoice with snapshotted quantities
389
+ */
390
+ snapshotQuantities(id: operations['snapshotQuantitiesInvoiceAction']['parameters']['path']['invoiceId'], options?: RequestOptions): Promise<{
391
+ readonly id: string;
392
+ description?: string;
393
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
394
+ readonly createdAt: Date;
395
+ readonly updatedAt: Date;
396
+ readonly deletedAt?: Date;
397
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
398
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
399
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
400
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
401
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
402
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
403
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
404
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
405
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
406
+ readonly issuedAt?: Date;
407
+ draftUntil?: Date;
408
+ readonly quantitySnapshotedAt?: Date;
409
+ readonly collectionAt?: Date;
410
+ readonly dueAt?: Date;
411
+ period?: import("./schemas.js").components["schemas"]["Period"];
412
+ readonly voidedAt?: Date;
413
+ readonly sentToCustomerAt?: Date;
414
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
415
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
416
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
417
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
418
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
419
+ } | undefined>;
420
+ /**
421
+ * Simulate an invoice for a customer
422
+ * @param id - The ID of the customer to simulate the invoice for
423
+ * @param signal - An optional abort signal
424
+ * @returns The simulated invoice
425
+ */
426
+ simulate(id: operations['simulateInvoice']['parameters']['path']['customerId'], body: InvoiceSimulationInput, options?: RequestOptions): Promise<{
427
+ readonly id: string;
428
+ description?: string;
429
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
430
+ readonly createdAt: Date;
431
+ readonly updatedAt: Date;
432
+ readonly deletedAt?: Date;
433
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
434
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
435
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
436
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
437
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
438
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
439
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
440
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
441
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
442
+ readonly issuedAt?: Date;
443
+ draftUntil?: Date;
444
+ readonly quantitySnapshotedAt?: Date;
445
+ readonly collectionAt?: Date;
446
+ readonly dueAt?: Date;
447
+ period?: import("./schemas.js").components["schemas"]["Period"];
448
+ readonly voidedAt?: Date;
449
+ readonly sentToCustomerAt?: Date;
450
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
451
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
452
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
453
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
454
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
455
+ } | undefined>;
456
+ /**
457
+ * Create pending line items
458
+ * @description Create new pending line items (charges).
459
+ * This call is used to create a new pending line item for the customer if required a new
460
+ * gathering invoice will be created.
461
+ *
462
+ * A new invoice will be created if:
463
+ * - there is no invoice in gathering state
464
+ * - the currency of the line item doesn't match the currency of any invoices in gathering state
465
+ * @param customerId - The ID of the customer to create the line items for
466
+ * @param body - The line items to create
467
+ * @param signal - An optional abort signal
468
+ * @returns The created line items
469
+ */
470
+ createLineItems(customerId: operations['createPendingInvoiceLine']['parameters']['path']['customerId'], body: InvoicePendingLineCreateInput, options?: RequestOptions): Promise<{
471
+ readonly lines: import("./schemas.js").components["schemas"]["InvoiceLine"][];
472
+ readonly invoice: import("./schemas.js").components["schemas"]["Invoice"];
473
+ readonly isInvoiceNew: boolean;
474
+ } | undefined>;
475
+ /**
476
+ * Invoice a customer based on the pending line items
477
+ * @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.
478
+ * @param body - The invoice data
479
+ * @param options - The request options
480
+ * @returns The created invoices
481
+ */
482
+ invoicePendingLines(body: operations['invoicePendingLinesAction']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
483
+ readonly id: string;
484
+ description?: string;
485
+ metadata?: import("./schemas.js").components["schemas"]["Metadata"] | null;
486
+ readonly createdAt: Date;
487
+ readonly updatedAt: Date;
488
+ readonly deletedAt?: Date;
489
+ readonly type: import("./schemas.js").components["schemas"]["InvoiceType"];
490
+ supplier: import("./schemas.js").components["schemas"]["BillingParty"];
491
+ customer: import("./schemas.js").components["schemas"]["BillingInvoiceCustomerExtendedDetails"];
492
+ readonly number: import("./schemas.js").components["schemas"]["InvoiceNumber"];
493
+ currency: import("./schemas.js").components["schemas"]["CurrencyCode"];
494
+ readonly preceding?: import("./schemas.js").components["schemas"]["InvoiceDocumentRef"][];
495
+ readonly totals: import("./schemas.js").components["schemas"]["InvoiceTotals"];
496
+ readonly status: import("./schemas.js").components["schemas"]["InvoiceStatus"];
497
+ readonly statusDetails: import("./schemas.js").components["schemas"]["InvoiceStatusDetails"];
498
+ readonly issuedAt?: Date;
499
+ draftUntil?: Date;
500
+ readonly quantitySnapshotedAt?: Date;
501
+ readonly collectionAt?: Date;
502
+ readonly dueAt?: Date;
503
+ period?: import("./schemas.js").components["schemas"]["Period"];
504
+ readonly voidedAt?: Date;
505
+ readonly sentToCustomerAt?: Date;
506
+ workflow: import("./schemas.js").components["schemas"]["InvoiceWorkflowSettings"];
507
+ lines?: import("./schemas.js").components["schemas"]["InvoiceLine"][];
508
+ readonly payment?: import("./schemas.js").components["schemas"]["InvoicePaymentTerms"];
509
+ readonly validationIssues?: import("./schemas.js").components["schemas"]["ValidationIssue"][];
510
+ readonly externalIds?: import("./schemas.js").components["schemas"]["InvoiceAppExternalIds"];
511
+ }[] | undefined>;
512
+ }
513
+ /**
514
+ * Billing Customer Invoices and Overrides
515
+ */
516
+ export declare class BillingCustomers {
517
+ private client;
518
+ constructor(client: Client<paths, `${string}/${string}`>);
519
+ /**
520
+ * Create or update a customer override
521
+ * @param id - The ID of the customer to create the override for
522
+ * @param body - The customer override to create
523
+ * @param signal - An optional abort signal
524
+ * @returns The created customer override
525
+ */
526
+ createOverride(id: operations['upsertBillingProfileCustomerOverride']['parameters']['path']['customerId'], body: BillingProfileCustomerOverrideCreate, options?: RequestOptions): Promise<{
527
+ customerOverride?: import("./schemas.js").components["schemas"]["BillingProfileCustomerOverride"];
528
+ baseBillingProfileId: string;
529
+ customerProfile?: import("./schemas.js").components["schemas"]["BillingCustomerProfile"];
530
+ customer?: import("./schemas.js").components["schemas"]["Customer"];
531
+ } | undefined>;
532
+ /**
533
+ * Get a customer override
534
+ * @param id - The ID of the customer to get the override for
535
+ * @param signal - An optional abort signal
536
+ * @returns The customer override
537
+ */
538
+ getOverride(id: operations['getBillingProfileCustomerOverride']['parameters']['path']['customerId'], options?: RequestOptions): Promise<{
539
+ customerOverride?: import("./schemas.js").components["schemas"]["BillingProfileCustomerOverride"];
540
+ baseBillingProfileId: string;
541
+ customerProfile?: import("./schemas.js").components["schemas"]["BillingCustomerProfile"];
542
+ customer?: import("./schemas.js").components["schemas"]["Customer"];
543
+ } | undefined>;
544
+ /**
545
+ * List customer overrides
546
+ * @param query - The query parameters
547
+ * @param signal - An optional abort signal
548
+ * @returns The customer overrides
549
+ */
550
+ listOverrides(query?: operations['listBillingProfileCustomerOverrides']['parameters']['query'], options?: RequestOptions): Promise<{
551
+ totalCount: number;
552
+ page: number;
553
+ pageSize: number;
554
+ items: import("./schemas.js").components["schemas"]["BillingProfileCustomerOverrideWithDetails"][];
555
+ } | undefined>;
556
+ /**
557
+ * Delete a customer override
558
+ * @param id - The ID of the customer to delete the override for
559
+ * @param signal - An optional abort signal
560
+ * @returns The deleted customer override
561
+ */
562
+ deleteOverride(id: operations['deleteBillingProfileCustomerOverride']['parameters']['path']['customerId'], options?: RequestOptions): Promise<undefined>;
563
+ }