orb-billing 1.22.0 → 1.24.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 (107) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/core.d.ts.map +1 -1
  3. package/core.js +8 -10
  4. package/core.js.map +1 -1
  5. package/core.mjs +8 -10
  6. package/core.mjs.map +1 -1
  7. package/index.d.mts +2 -2
  8. package/index.d.ts +2 -2
  9. package/index.d.ts.map +1 -1
  10. package/index.js +4 -0
  11. package/index.js.map +1 -1
  12. package/index.mjs +4 -0
  13. package/index.mjs.map +1 -1
  14. package/package.json +3 -1
  15. package/resources/coupons/coupons.d.ts +60 -2
  16. package/resources/coupons/coupons.d.ts.map +1 -1
  17. package/resources/coupons/coupons.js.map +1 -1
  18. package/resources/coupons/coupons.mjs.map +1 -1
  19. package/resources/credit-notes.d.ts +57 -5
  20. package/resources/credit-notes.d.ts.map +1 -1
  21. package/resources/credit-notes.js.map +1 -1
  22. package/resources/credit-notes.mjs.map +1 -1
  23. package/resources/customers/balance-transactions.d.ts +2 -2
  24. package/resources/customers/balance-transactions.d.ts.map +1 -1
  25. package/resources/customers/balance-transactions.js.map +1 -1
  26. package/resources/customers/balance-transactions.mjs.map +1 -1
  27. package/resources/customers/customers.d.ts +696 -8
  28. package/resources/customers/customers.d.ts.map +1 -1
  29. package/resources/customers/customers.js.map +1 -1
  30. package/resources/customers/customers.mjs.map +1 -1
  31. package/resources/customers/usage.d.ts +74 -58
  32. package/resources/customers/usage.d.ts.map +1 -1
  33. package/resources/customers/usage.js +14 -14
  34. package/resources/customers/usage.js.map +1 -1
  35. package/resources/customers/usage.mjs +14 -14
  36. package/resources/customers/usage.mjs.map +1 -1
  37. package/resources/events/events.d.ts +40 -40
  38. package/resources/events/events.js +40 -40
  39. package/resources/events/events.mjs +40 -40
  40. package/resources/index.d.ts +4 -3
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js +19 -4
  43. package/resources/index.js.map +1 -1
  44. package/resources/index.mjs +2 -1
  45. package/resources/index.mjs.map +1 -1
  46. package/resources/invoice-line-items.d.ts +2 -2
  47. package/resources/invoice-line-items.d.ts.map +1 -1
  48. package/resources/invoices.d.ts +358 -71
  49. package/resources/invoices.d.ts.map +1 -1
  50. package/resources/invoices.js.map +1 -1
  51. package/resources/invoices.mjs.map +1 -1
  52. package/resources/plans/plans.d.ts +648 -4
  53. package/resources/plans/plans.d.ts.map +1 -1
  54. package/resources/plans/plans.js.map +1 -1
  55. package/resources/plans/plans.mjs.map +1 -1
  56. package/resources/prices/index.d.ts +1 -1
  57. package/resources/prices/index.d.ts.map +1 -1
  58. package/resources/prices/index.js +3 -3
  59. package/resources/prices/index.js.map +1 -1
  60. package/resources/prices/index.mjs +1 -1
  61. package/resources/prices/index.mjs.map +1 -1
  62. package/resources/prices/prices.d.ts +56 -83
  63. package/resources/prices/prices.d.ts.map +1 -1
  64. package/resources/prices/prices.js.map +1 -1
  65. package/resources/prices/prices.mjs.map +1 -1
  66. package/resources/shared.d.ts +62 -0
  67. package/resources/shared.d.ts.map +1 -0
  68. package/resources/shared.js +4 -0
  69. package/resources/shared.js.map +1 -0
  70. package/resources/shared.mjs +3 -0
  71. package/resources/shared.mjs.map +1 -0
  72. package/resources/subscriptions.d.ts +1084 -241
  73. package/resources/subscriptions.d.ts.map +1 -1
  74. package/resources/subscriptions.js.map +1 -1
  75. package/resources/subscriptions.mjs.map +1 -1
  76. package/src/_shims/index.d.ts +1 -1
  77. package/src/_shims/index.mjs +1 -1
  78. package/src/core.ts +8 -12
  79. package/src/index.ts +8 -3
  80. package/src/resources/coupons/coupons.ts +82 -8
  81. package/src/resources/coupons/subscriptions.ts +7 -7
  82. package/src/resources/credit-notes.ts +86 -10
  83. package/src/resources/customers/balance-transactions.ts +23 -7
  84. package/src/resources/customers/costs.ts +5 -5
  85. package/src/resources/customers/credits/credits.ts +6 -6
  86. package/src/resources/customers/credits/ledger.ts +5 -5
  87. package/src/resources/customers/customers.ts +1153 -21
  88. package/src/resources/customers/usage.ts +83 -65
  89. package/src/resources/events/backfills.ts +5 -5
  90. package/src/resources/events/events.ts +45 -45
  91. package/src/resources/index.ts +3 -3
  92. package/src/resources/invoice-line-items.ts +6 -6
  93. package/src/resources/invoices.ts +604 -97
  94. package/src/resources/items.ts +5 -5
  95. package/src/resources/metrics.ts +5 -5
  96. package/src/resources/plans/external-plan-id.ts +5 -5
  97. package/src/resources/plans/plans.ts +817 -11
  98. package/src/resources/prices/external-price-id.ts +3 -3
  99. package/src/resources/prices/index.ts +1 -1
  100. package/src/resources/prices/prices.ts +73 -106
  101. package/src/resources/shared.ts +84 -0
  102. package/src/resources/subscriptions.ts +1299 -287
  103. package/src/resources/top-level.ts +3 -3
  104. package/src/version.ts +1 -1
  105. package/version.d.ts +1 -1
  106. package/version.js +1 -1
  107. package/version.mjs +1 -1
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../ling/core";
4
- import { APIResource } from "../ling/resource";
5
- import { isRequestOptions } from "../ling/core";
6
- import * as CreditNotesAPI from "../ling/resources/credit-notes";
7
- import { Page, type PageParams } from "../ling/pagination";
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import { isRequestOptions } from "../core";
6
+ import * as CreditNotesAPI from "./credit-notes";
7
+ import { Page, type PageParams } from "../pagination";
8
8
 
9
9
  export class CreditNotes extends APIResource {
10
10
  /**
@@ -68,7 +68,7 @@ export interface CreditNote {
68
68
  /**
69
69
  * Any discounts applied on the original invoice.
70
70
  */
71
- discounts: Array<unknown>;
71
+ discounts: Array<CreditNote.Discount>;
72
72
 
73
73
  /**
74
74
  * The id of the invoice resource that this credit note is applied to.
@@ -83,7 +83,7 @@ export interface CreditNote {
83
83
  /**
84
84
  * The maximum amount applied on the original invoice
85
85
  */
86
- maximum_amount_adjustment: unknown | null;
86
+ maximum_amount_adjustment: CreditNote.MaximumAmountAdjustment | null;
87
87
 
88
88
  /**
89
89
  * An optional memo supplied on the credit note.
@@ -95,7 +95,7 @@ export interface CreditNote {
95
95
  */
96
96
  minimum_amount_refunded: string | null;
97
97
 
98
- reason: 'Duplicate' | 'Fraudulent' | 'Order change' | 'Product unsatisfactory';
98
+ reason: 'Duplicate' | 'Fraudulent' | 'Order change' | 'Product unsatisfactory' | null;
99
99
 
100
100
  /**
101
101
  * The total prior to any creditable invoice-level discounts or minimums.
@@ -122,6 +122,26 @@ export namespace CreditNote {
122
122
  external_customer_id: string | null;
123
123
  }
124
124
 
125
+ export interface Discount {
126
+ amount_applied: string;
127
+
128
+ discount_type: 'percentage';
129
+
130
+ percentage_discount: number;
131
+
132
+ applies_to_prices?: Array<Discount.AppliesToPrice> | null;
133
+
134
+ reason?: string | null;
135
+ }
136
+
137
+ export namespace Discount {
138
+ export interface AppliesToPrice {
139
+ id: string;
140
+
141
+ name: string;
142
+ }
143
+ }
144
+
125
145
  export interface LineItem {
126
146
  /**
127
147
  * The Orb id of this resource.
@@ -136,7 +156,7 @@ export namespace CreditNote {
136
156
  /**
137
157
  * Any line items discounts from the invoice's line item.
138
158
  */
139
- discounts: Array<unknown>;
159
+ discounts: Array<LineItem.Discount>;
140
160
 
141
161
  /**
142
162
  * The name of the corresponding invoice line item.
@@ -161,10 +181,26 @@ export namespace CreditNote {
161
181
  /**
162
182
  * Any tax amounts applied onto the line item.
163
183
  */
164
- tax_amounts: Array<unknown>;
184
+ tax_amounts: Array<LineItem.TaxAmount>;
165
185
  }
166
186
 
167
187
  export namespace LineItem {
188
+ export interface Discount {
189
+ id: string;
190
+
191
+ amount_applied: string;
192
+
193
+ applies_to_price_ids: Array<string>;
194
+
195
+ discount_type: 'percentage' | 'amount';
196
+
197
+ percentage_discount: number;
198
+
199
+ amount_discount?: string | null;
200
+
201
+ reason?: string | null;
202
+ }
203
+
168
204
  export interface SubLineItem {
169
205
  amount: string;
170
206
 
@@ -172,6 +208,46 @@ export namespace CreditNote {
172
208
 
173
209
  quantity: number | null;
174
210
  }
211
+
212
+ export interface TaxAmount {
213
+ /**
214
+ * The amount of additional tax incurred by this tax rate.
215
+ */
216
+ amount: string;
217
+
218
+ /**
219
+ * The human-readable description of the applied tax rate.
220
+ */
221
+ tax_rate_description: string;
222
+
223
+ /**
224
+ * The tax rate percentage, out of 100.
225
+ */
226
+ tax_rate_percentage: string | null;
227
+ }
228
+ }
229
+
230
+ /**
231
+ * The maximum amount applied on the original invoice
232
+ */
233
+ export interface MaximumAmountAdjustment {
234
+ amount_applied: string;
235
+
236
+ discount_type: 'percentage';
237
+
238
+ percentage_discount: number;
239
+
240
+ applies_to_prices?: Array<MaximumAmountAdjustment.AppliesToPrice> | null;
241
+
242
+ reason?: string | null;
243
+ }
244
+
245
+ export namespace MaximumAmountAdjustment {
246
+ export interface AppliesToPrice {
247
+ id: string;
248
+
249
+ name: string;
250
+ }
175
251
  }
176
252
  }
177
253
 
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../../ling/core";
4
- import { APIResource } from "../../ling/resource";
5
- import { isRequestOptions } from "../../ling/core";
6
- import * as BalanceTransactionsAPI from "../../ling/resources/customers/balance-transactions";
7
- import { Page, type PageParams } from "../../ling/pagination";
3
+ import * as Core from "../../core";
4
+ import { APIResource } from "../../resource";
5
+ import { isRequestOptions } from "../../core";
6
+ import * as BalanceTransactionsAPI from "./balance-transactions";
7
+ import { Page, type PageParams } from "../../pagination";
8
8
 
9
9
  export class BalanceTransactions extends APIResource {
10
10
  /**
@@ -82,7 +82,15 @@ export interface BalanceTransactionCreateResponse {
82
82
  */
83
83
  id: string;
84
84
 
85
- action: 'applied_to_invoice' | 'prorated_refund' | 'manual_adjustment';
85
+ action:
86
+ | 'applied_to_invoice'
87
+ | 'manual_adjustment'
88
+ | 'prorated_refund'
89
+ | 'revert_prorated_refund'
90
+ | 'return_from_voiding'
91
+ | 'credit_note_applied'
92
+ | 'credit_note_voided'
93
+ | 'overpayment_refund';
86
94
 
87
95
  /**
88
96
  * The value of the amount changed in the transaction.
@@ -140,7 +148,15 @@ export interface BalanceTransactionListResponse {
140
148
  */
141
149
  id: string;
142
150
 
143
- action: 'applied_to_invoice' | 'prorated_refund' | 'manual_adjustment';
151
+ action:
152
+ | 'applied_to_invoice'
153
+ | 'manual_adjustment'
154
+ | 'prorated_refund'
155
+ | 'revert_prorated_refund'
156
+ | 'return_from_voiding'
157
+ | 'credit_note_applied'
158
+ | 'credit_note_voided'
159
+ | 'overpayment_refund';
144
160
 
145
161
  /**
146
162
  * The value of the amount changed in the transaction.
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../../ling/core";
4
- import { APIResource } from "../../ling/resource";
5
- import { isRequestOptions } from "../../ling/core";
6
- import * as CostsAPI from "../../ling/resources/customers/costs";
7
- import * as PricesAPI from "../../ling/resources/prices/prices";
3
+ import * as Core from "../../core";
4
+ import { APIResource } from "../../resource";
5
+ import { isRequestOptions } from "../../core";
6
+ import * as CostsAPI from "./costs";
7
+ import * as PricesAPI from "../prices/prices";
8
8
 
9
9
  export class Costs extends APIResource {
10
10
  /**
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../../../ling/core";
4
- import { APIResource } from "../../../ling/resource";
5
- import { isRequestOptions } from "../../../ling/core";
6
- import * as CreditsAPI from "../../../ling/resources/customers/credits/credits";
7
- import * as LedgerAPI from "../../../ling/resources/customers/credits/ledger";
8
- import { Page, type PageParams } from "../../../ling/pagination";
3
+ import * as Core from "../../../core";
4
+ import { APIResource } from "../../../resource";
5
+ import { isRequestOptions } from "../../../core";
6
+ import * as CreditsAPI from "./credits";
7
+ import * as LedgerAPI from "./ledger";
8
+ import { Page, type PageParams } from "../../../pagination";
9
9
 
10
10
  export class Credits extends APIResource {
11
11
  ledger: LedgerAPI.Ledger = new LedgerAPI.Ledger(this.client);
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../../../ling/core";
4
- import { APIResource } from "../../../ling/resource";
5
- import { isRequestOptions } from "../../../ling/core";
6
- import * as LedgerAPI from "../../../ling/resources/customers/credits/ledger";
7
- import { Page, type PageParams } from "../../../ling/pagination";
3
+ import * as Core from "../../../core";
4
+ import { APIResource } from "../../../resource";
5
+ import { isRequestOptions } from "../../../core";
6
+ import * as LedgerAPI from "./ledger";
7
+ import { Page, type PageParams } from "../../../pagination";
8
8
 
9
9
  export class Ledger extends APIResource {
10
10
  /**