orb-billing 4.73.0 → 5.0.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 (141) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +18 -30
  3. package/index.d.mts +148 -14
  4. package/index.d.ts +148 -14
  5. package/index.d.ts.map +1 -1
  6. package/index.js +0 -3
  7. package/index.js.map +1 -1
  8. package/index.mjs +3 -6
  9. package/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/alerts.d.ts +20 -88
  12. package/resources/alerts.d.ts.map +1 -1
  13. package/resources/alerts.js.map +1 -1
  14. package/resources/alerts.mjs.map +1 -1
  15. package/resources/beta/beta.d.ts +9 -7313
  16. package/resources/beta/beta.d.ts.map +1 -1
  17. package/resources/beta/beta.js.map +1 -1
  18. package/resources/beta/beta.mjs.map +1 -1
  19. package/resources/beta/external-plan-id.d.ts +7 -7074
  20. package/resources/beta/external-plan-id.d.ts.map +1 -1
  21. package/resources/beta/external-plan-id.js.map +1 -1
  22. package/resources/beta/external-plan-id.mjs.map +1 -1
  23. package/resources/credit-notes.d.ts +9 -163
  24. package/resources/credit-notes.d.ts.map +1 -1
  25. package/resources/credit-notes.js +3 -6
  26. package/resources/credit-notes.js.map +1 -1
  27. package/resources/credit-notes.mjs +2 -4
  28. package/resources/credit-notes.mjs.map +1 -1
  29. package/resources/customers/balance-transactions.d.ts +5 -32
  30. package/resources/customers/balance-transactions.d.ts.map +1 -1
  31. package/resources/customers/balance-transactions.js.map +1 -1
  32. package/resources/customers/balance-transactions.mjs.map +1 -1
  33. package/resources/customers/costs.d.ts +3 -81
  34. package/resources/customers/costs.d.ts.map +1 -1
  35. package/resources/customers/credits/credits.d.ts +4 -4
  36. package/resources/customers/credits/credits.d.ts.map +1 -1
  37. package/resources/customers/credits/credits.js.map +1 -1
  38. package/resources/customers/credits/credits.mjs.map +1 -1
  39. package/resources/customers/credits/index.d.ts +2 -2
  40. package/resources/customers/credits/index.d.ts.map +1 -1
  41. package/resources/customers/credits/index.js.map +1 -1
  42. package/resources/customers/credits/index.mjs.map +1 -1
  43. package/resources/customers/credits/ledger.d.ts +171 -962
  44. package/resources/customers/credits/ledger.d.ts.map +1 -1
  45. package/resources/customers/credits/ledger.js.map +1 -1
  46. package/resources/customers/credits/ledger.mjs.map +1 -1
  47. package/resources/customers/credits/top-ups.d.ts +37 -117
  48. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  49. package/resources/customers/credits/top-ups.js.map +1 -1
  50. package/resources/customers/credits/top-ups.mjs.map +1 -1
  51. package/resources/customers/customers.d.ts +72 -678
  52. package/resources/customers/customers.d.ts.map +1 -1
  53. package/resources/customers/customers.js.map +1 -1
  54. package/resources/customers/customers.mjs.map +1 -1
  55. package/resources/customers/index.d.ts +1 -1
  56. package/resources/customers/index.d.ts.map +1 -1
  57. package/resources/customers/index.js.map +1 -1
  58. package/resources/customers/index.mjs.map +1 -1
  59. package/resources/events/events.d.ts +3 -3
  60. package/resources/events/events.d.ts.map +1 -1
  61. package/resources/index.d.ts +7 -7
  62. package/resources/index.d.ts.map +1 -1
  63. package/resources/index.js +1 -4
  64. package/resources/index.js.map +1 -1
  65. package/resources/index.mjs +3 -3
  66. package/resources/index.mjs.map +1 -1
  67. package/resources/invoice-line-items.d.ts +6 -395
  68. package/resources/invoice-line-items.d.ts.map +1 -1
  69. package/resources/invoice-line-items.js.map +1 -1
  70. package/resources/invoice-line-items.mjs.map +1 -1
  71. package/resources/invoices.d.ts +30 -1700
  72. package/resources/invoices.d.ts.map +1 -1
  73. package/resources/invoices.js +3 -6
  74. package/resources/invoices.js.map +1 -1
  75. package/resources/invoices.mjs +2 -4
  76. package/resources/invoices.mjs.map +1 -1
  77. package/resources/plans/plans.d.ts +7 -3801
  78. package/resources/plans/plans.d.ts.map +1 -1
  79. package/resources/plans/plans.js.map +1 -1
  80. package/resources/plans/plans.mjs.map +1 -1
  81. package/resources/prices/external-price-id.d.ts +3 -3
  82. package/resources/prices/external-price-id.d.ts.map +1 -1
  83. package/resources/prices/index.d.ts +1 -1
  84. package/resources/prices/index.d.ts.map +1 -1
  85. package/resources/prices/index.js +1 -2
  86. package/resources/prices/index.js.map +1 -1
  87. package/resources/prices/index.mjs +1 -1
  88. package/resources/prices/index.mjs.map +1 -1
  89. package/resources/prices/prices.d.ts +347 -9373
  90. package/resources/prices/prices.d.ts.map +1 -1
  91. package/resources/prices/prices.js +39 -20
  92. package/resources/prices/prices.js.map +1 -1
  93. package/resources/prices/prices.mjs +38 -18
  94. package/resources/prices/prices.mjs.map +1 -1
  95. package/resources/shared.d.ts +7269 -9
  96. package/resources/shared.d.ts.map +1 -1
  97. package/resources/shared.js +11 -0
  98. package/resources/shared.js.map +1 -1
  99. package/resources/shared.mjs +7 -1
  100. package/resources/shared.mjs.map +1 -1
  101. package/resources/subscription-changes.d.ts +138 -2158
  102. package/resources/subscription-changes.d.ts.map +1 -1
  103. package/resources/subscription-changes.js.map +1 -1
  104. package/resources/subscription-changes.mjs.map +1 -1
  105. package/resources/subscriptions.d.ts +2722 -26580
  106. package/resources/subscriptions.d.ts.map +1 -1
  107. package/resources/subscriptions.js +7 -1
  108. package/resources/subscriptions.js.map +1 -1
  109. package/resources/subscriptions.mjs +7 -1
  110. package/resources/subscriptions.mjs.map +1 -1
  111. package/src/index.ts +221 -40
  112. package/src/resources/alerts.ts +20 -94
  113. package/src/resources/beta/beta.ts +124 -8892
  114. package/src/resources/beta/external-plan-id.ts +118 -8593
  115. package/src/resources/credit-notes.ts +10 -217
  116. package/src/resources/customers/balance-transactions.ts +5 -36
  117. package/src/resources/customers/costs.ts +3 -101
  118. package/src/resources/customers/credits/credits.ts +18 -0
  119. package/src/resources/customers/credits/index.ts +9 -0
  120. package/src/resources/customers/credits/ledger.ts +212 -1435
  121. package/src/resources/customers/credits/top-ups.ts +41 -132
  122. package/src/resources/customers/customers.ts +162 -1454
  123. package/src/resources/customers/index.ts +8 -0
  124. package/src/resources/events/events.ts +3 -3
  125. package/src/resources/index.ts +43 -21
  126. package/src/resources/invoice-line-items.ts +10 -501
  127. package/src/resources/invoices.ts +60 -2394
  128. package/src/resources/plans/plans.ts +38 -4588
  129. package/src/resources/prices/external-price-id.ts +3 -3
  130. package/src/resources/prices/index.ts +2 -2
  131. package/src/resources/prices/prices.ts +501 -11811
  132. package/src/resources/shared.ts +9582 -22
  133. package/src/resources/subscription-changes.ts +171 -2670
  134. package/src/resources/subscriptions.ts +3175 -31993
  135. package/src/version.ts +1 -1
  136. package/version.d.ts +1 -1
  137. package/version.d.ts.map +1 -1
  138. package/version.js +1 -1
  139. package/version.js.map +1 -1
  140. package/version.mjs +1 -1
  141. package/version.mjs.map +1 -1
@@ -127,6 +127,34 @@ export class TopUpListResponsesPage extends Page<TopUpListResponse> {}
127
127
 
128
128
  export class TopUpListByExternalIDResponsesPage extends Page<TopUpListByExternalIDResponse> {}
129
129
 
130
+ export interface TopUpInvoiceSettings {
131
+ /**
132
+ * Whether the credits purchase invoice should auto collect with the customer's
133
+ * saved payment method.
134
+ */
135
+ auto_collection: boolean;
136
+
137
+ /**
138
+ * The net terms determines the difference between the invoice date and the issue
139
+ * date for the invoice. If you intend the invoice to be due on issue, set this
140
+ * to 0.
141
+ */
142
+ net_terms: number;
143
+
144
+ /**
145
+ * An optional memo to display on the invoice.
146
+ */
147
+ memo?: string | null;
148
+
149
+ /**
150
+ * When true, credit blocks created by this top-up will require that the
151
+ * corresponding invoice is paid before they are drawn down from. If any topup
152
+ * block is pending payment, further automatic top-ups will be paused until the
153
+ * invoice is paid or voided.
154
+ */
155
+ require_successful_payment?: boolean;
156
+ }
157
+
130
158
  export interface TopUpCreateResponse {
131
159
  id: string;
132
160
 
@@ -144,7 +172,7 @@ export interface TopUpCreateResponse {
144
172
  /**
145
173
  * Settings for invoices generated by triggered top-ups.
146
174
  */
147
- invoice_settings: TopUpCreateResponse.InvoiceSettings;
175
+ invoice_settings: TopUpInvoiceSettings;
148
176
 
149
177
  /**
150
178
  * How much, in the customer's currency, to charge for each unit.
@@ -169,37 +197,6 @@ export interface TopUpCreateResponse {
169
197
  expires_after_unit?: 'day' | 'month' | null;
170
198
  }
171
199
 
172
- export namespace TopUpCreateResponse {
173
- /**
174
- * Settings for invoices generated by triggered top-ups.
175
- */
176
- export interface InvoiceSettings {
177
- /**
178
- * Whether the credits purchase invoice should auto collect with the customer's
179
- * saved payment method.
180
- */
181
- auto_collection: boolean;
182
-
183
- /**
184
- * The net terms determines the difference between the invoice date and the issue
185
- * date for the invoice. If you intend the invoice to be due on issue, set this
186
- * to 0.
187
- */
188
- net_terms: number;
189
-
190
- /**
191
- * An optional memo to display on the invoice.
192
- */
193
- memo?: string | null;
194
-
195
- /**
196
- * If true, new credit blocks created by this top-up will require that the
197
- * corresponding invoice is paid before they can be drawn down from.
198
- */
199
- require_successful_payment?: boolean;
200
- }
201
- }
202
-
203
200
  export interface TopUpListResponse {
204
201
  id: string;
205
202
 
@@ -217,7 +214,7 @@ export interface TopUpListResponse {
217
214
  /**
218
215
  * Settings for invoices generated by triggered top-ups.
219
216
  */
220
- invoice_settings: TopUpListResponse.InvoiceSettings;
217
+ invoice_settings: TopUpInvoiceSettings;
221
218
 
222
219
  /**
223
220
  * How much, in the customer's currency, to charge for each unit.
@@ -242,37 +239,6 @@ export interface TopUpListResponse {
242
239
  expires_after_unit?: 'day' | 'month' | null;
243
240
  }
244
241
 
245
- export namespace TopUpListResponse {
246
- /**
247
- * Settings for invoices generated by triggered top-ups.
248
- */
249
- export interface InvoiceSettings {
250
- /**
251
- * Whether the credits purchase invoice should auto collect with the customer's
252
- * saved payment method.
253
- */
254
- auto_collection: boolean;
255
-
256
- /**
257
- * The net terms determines the difference between the invoice date and the issue
258
- * date for the invoice. If you intend the invoice to be due on issue, set this
259
- * to 0.
260
- */
261
- net_terms: number;
262
-
263
- /**
264
- * An optional memo to display on the invoice.
265
- */
266
- memo?: string | null;
267
-
268
- /**
269
- * If true, new credit blocks created by this top-up will require that the
270
- * corresponding invoice is paid before they can be drawn down from.
271
- */
272
- require_successful_payment?: boolean;
273
- }
274
- }
275
-
276
242
  export interface TopUpCreateByExternalIDResponse {
277
243
  id: string;
278
244
 
@@ -290,7 +256,7 @@ export interface TopUpCreateByExternalIDResponse {
290
256
  /**
291
257
  * Settings for invoices generated by triggered top-ups.
292
258
  */
293
- invoice_settings: TopUpCreateByExternalIDResponse.InvoiceSettings;
259
+ invoice_settings: TopUpInvoiceSettings;
294
260
 
295
261
  /**
296
262
  * How much, in the customer's currency, to charge for each unit.
@@ -315,37 +281,6 @@ export interface TopUpCreateByExternalIDResponse {
315
281
  expires_after_unit?: 'day' | 'month' | null;
316
282
  }
317
283
 
318
- export namespace TopUpCreateByExternalIDResponse {
319
- /**
320
- * Settings for invoices generated by triggered top-ups.
321
- */
322
- export interface InvoiceSettings {
323
- /**
324
- * Whether the credits purchase invoice should auto collect with the customer's
325
- * saved payment method.
326
- */
327
- auto_collection: boolean;
328
-
329
- /**
330
- * The net terms determines the difference between the invoice date and the issue
331
- * date for the invoice. If you intend the invoice to be due on issue, set this
332
- * to 0.
333
- */
334
- net_terms: number;
335
-
336
- /**
337
- * An optional memo to display on the invoice.
338
- */
339
- memo?: string | null;
340
-
341
- /**
342
- * If true, new credit blocks created by this top-up will require that the
343
- * corresponding invoice is paid before they can be drawn down from.
344
- */
345
- require_successful_payment?: boolean;
346
- }
347
- }
348
-
349
284
  export interface TopUpListByExternalIDResponse {
350
285
  id: string;
351
286
 
@@ -363,7 +298,7 @@ export interface TopUpListByExternalIDResponse {
363
298
  /**
364
299
  * Settings for invoices generated by triggered top-ups.
365
300
  */
366
- invoice_settings: TopUpListByExternalIDResponse.InvoiceSettings;
301
+ invoice_settings: TopUpInvoiceSettings;
367
302
 
368
303
  /**
369
304
  * How much, in the customer's currency, to charge for each unit.
@@ -388,37 +323,6 @@ export interface TopUpListByExternalIDResponse {
388
323
  expires_after_unit?: 'day' | 'month' | null;
389
324
  }
390
325
 
391
- export namespace TopUpListByExternalIDResponse {
392
- /**
393
- * Settings for invoices generated by triggered top-ups.
394
- */
395
- export interface InvoiceSettings {
396
- /**
397
- * Whether the credits purchase invoice should auto collect with the customer's
398
- * saved payment method.
399
- */
400
- auto_collection: boolean;
401
-
402
- /**
403
- * The net terms determines the difference between the invoice date and the issue
404
- * date for the invoice. If you intend the invoice to be due on issue, set this
405
- * to 0.
406
- */
407
- net_terms: number;
408
-
409
- /**
410
- * An optional memo to display on the invoice.
411
- */
412
- memo?: string | null;
413
-
414
- /**
415
- * If true, new credit blocks created by this top-up will require that the
416
- * corresponding invoice is paid before they can be drawn down from.
417
- */
418
- require_successful_payment?: boolean;
419
- }
420
- }
421
-
422
326
  export interface TopUpCreateParams {
423
327
  /**
424
328
  * The amount to increment when the threshold is reached.
@@ -489,8 +393,10 @@ export namespace TopUpCreateParams {
489
393
  memo?: string | null;
490
394
 
491
395
  /**
492
- * If true, new credit blocks created by this top-up will require that the
493
- * corresponding invoice is paid before they can be drawn down from.
396
+ * When true, credit blocks created by this top-up will require that the
397
+ * corresponding invoice is paid before they are drawn down from. If any topup
398
+ * block is pending payment, further automatic top-ups will be paused until the
399
+ * invoice is paid or voided.
494
400
  */
495
401
  require_successful_payment?: boolean;
496
402
  }
@@ -568,8 +474,10 @@ export namespace TopUpCreateByExternalIDParams {
568
474
  memo?: string | null;
569
475
 
570
476
  /**
571
- * If true, new credit blocks created by this top-up will require that the
572
- * corresponding invoice is paid before they can be drawn down from.
477
+ * When true, credit blocks created by this top-up will require that the
478
+ * corresponding invoice is paid before they are drawn down from. If any topup
479
+ * block is pending payment, further automatic top-ups will be paused until the
480
+ * invoice is paid or voided.
573
481
  */
574
482
  require_successful_payment?: boolean;
575
483
  }
@@ -582,6 +490,7 @@ TopUps.TopUpListByExternalIDResponsesPage = TopUpListByExternalIDResponsesPage;
582
490
 
583
491
  export declare namespace TopUps {
584
492
  export {
493
+ type TopUpInvoiceSettings as TopUpInvoiceSettings,
585
494
  type TopUpCreateResponse as TopUpCreateResponse,
586
495
  type TopUpListResponse as TopUpListResponse,
587
496
  type TopUpCreateByExternalIDResponse as TopUpCreateByExternalIDResponse,