orb-billing 4.74.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 (137) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/index.d.mts +148 -14
  3. package/index.d.ts +148 -14
  4. package/index.d.ts.map +1 -1
  5. package/index.js +0 -3
  6. package/index.js.map +1 -1
  7. package/index.mjs +3 -6
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/alerts.d.ts +20 -88
  11. package/resources/alerts.d.ts.map +1 -1
  12. package/resources/alerts.js.map +1 -1
  13. package/resources/alerts.mjs.map +1 -1
  14. package/resources/beta/beta.d.ts +9 -7313
  15. package/resources/beta/beta.d.ts.map +1 -1
  16. package/resources/beta/beta.js.map +1 -1
  17. package/resources/beta/beta.mjs.map +1 -1
  18. package/resources/beta/external-plan-id.d.ts +7 -7074
  19. package/resources/beta/external-plan-id.d.ts.map +1 -1
  20. package/resources/beta/external-plan-id.js.map +1 -1
  21. package/resources/beta/external-plan-id.mjs.map +1 -1
  22. package/resources/credit-notes.d.ts +9 -163
  23. package/resources/credit-notes.d.ts.map +1 -1
  24. package/resources/credit-notes.js +3 -6
  25. package/resources/credit-notes.js.map +1 -1
  26. package/resources/credit-notes.mjs +2 -4
  27. package/resources/credit-notes.mjs.map +1 -1
  28. package/resources/customers/balance-transactions.d.ts +5 -32
  29. package/resources/customers/balance-transactions.d.ts.map +1 -1
  30. package/resources/customers/balance-transactions.js.map +1 -1
  31. package/resources/customers/balance-transactions.mjs.map +1 -1
  32. package/resources/customers/costs.d.ts +3 -81
  33. package/resources/customers/costs.d.ts.map +1 -1
  34. package/resources/customers/credits/credits.d.ts +4 -4
  35. package/resources/customers/credits/credits.d.ts.map +1 -1
  36. package/resources/customers/credits/credits.js.map +1 -1
  37. package/resources/customers/credits/credits.mjs.map +1 -1
  38. package/resources/customers/credits/index.d.ts +2 -2
  39. package/resources/customers/credits/index.d.ts.map +1 -1
  40. package/resources/customers/credits/index.js.map +1 -1
  41. package/resources/customers/credits/index.mjs.map +1 -1
  42. package/resources/customers/credits/ledger.d.ts +171 -962
  43. package/resources/customers/credits/ledger.d.ts.map +1 -1
  44. package/resources/customers/credits/ledger.js.map +1 -1
  45. package/resources/customers/credits/ledger.mjs.map +1 -1
  46. package/resources/customers/credits/top-ups.d.ts +29 -121
  47. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  48. package/resources/customers/credits/top-ups.js.map +1 -1
  49. package/resources/customers/credits/top-ups.mjs.map +1 -1
  50. package/resources/customers/customers.d.ts +72 -678
  51. package/resources/customers/customers.d.ts.map +1 -1
  52. package/resources/customers/customers.js.map +1 -1
  53. package/resources/customers/customers.mjs.map +1 -1
  54. package/resources/customers/index.d.ts +1 -1
  55. package/resources/customers/index.d.ts.map +1 -1
  56. package/resources/customers/index.js.map +1 -1
  57. package/resources/customers/index.mjs.map +1 -1
  58. package/resources/index.d.ts +7 -7
  59. package/resources/index.d.ts.map +1 -1
  60. package/resources/index.js +1 -4
  61. package/resources/index.js.map +1 -1
  62. package/resources/index.mjs +3 -3
  63. package/resources/index.mjs.map +1 -1
  64. package/resources/invoice-line-items.d.ts +6 -395
  65. package/resources/invoice-line-items.d.ts.map +1 -1
  66. package/resources/invoice-line-items.js.map +1 -1
  67. package/resources/invoice-line-items.mjs.map +1 -1
  68. package/resources/invoices.d.ts +30 -1700
  69. package/resources/invoices.d.ts.map +1 -1
  70. package/resources/invoices.js +3 -6
  71. package/resources/invoices.js.map +1 -1
  72. package/resources/invoices.mjs +2 -4
  73. package/resources/invoices.mjs.map +1 -1
  74. package/resources/plans/plans.d.ts +7 -3801
  75. package/resources/plans/plans.d.ts.map +1 -1
  76. package/resources/plans/plans.js.map +1 -1
  77. package/resources/plans/plans.mjs.map +1 -1
  78. package/resources/prices/external-price-id.d.ts +3 -3
  79. package/resources/prices/external-price-id.d.ts.map +1 -1
  80. package/resources/prices/index.d.ts +1 -1
  81. package/resources/prices/index.d.ts.map +1 -1
  82. package/resources/prices/index.js +1 -2
  83. package/resources/prices/index.js.map +1 -1
  84. package/resources/prices/index.mjs +1 -1
  85. package/resources/prices/index.mjs.map +1 -1
  86. package/resources/prices/prices.d.ts +346 -9372
  87. package/resources/prices/prices.d.ts.map +1 -1
  88. package/resources/prices/prices.js +39 -20
  89. package/resources/prices/prices.js.map +1 -1
  90. package/resources/prices/prices.mjs +38 -18
  91. package/resources/prices/prices.mjs.map +1 -1
  92. package/resources/shared.d.ts +7269 -9
  93. package/resources/shared.d.ts.map +1 -1
  94. package/resources/shared.js +11 -0
  95. package/resources/shared.js.map +1 -1
  96. package/resources/shared.mjs +7 -1
  97. package/resources/shared.mjs.map +1 -1
  98. package/resources/subscription-changes.d.ts +138 -2158
  99. package/resources/subscription-changes.d.ts.map +1 -1
  100. package/resources/subscription-changes.js.map +1 -1
  101. package/resources/subscription-changes.mjs.map +1 -1
  102. package/resources/subscriptions.d.ts +2639 -27234
  103. package/resources/subscriptions.d.ts.map +1 -1
  104. package/resources/subscriptions.js +1 -1
  105. package/resources/subscriptions.js.map +1 -1
  106. package/resources/subscriptions.mjs +1 -1
  107. package/resources/subscriptions.mjs.map +1 -1
  108. package/src/index.ts +219 -42
  109. package/src/resources/alerts.ts +20 -94
  110. package/src/resources/beta/beta.ts +124 -8892
  111. package/src/resources/beta/external-plan-id.ts +118 -8593
  112. package/src/resources/credit-notes.ts +10 -217
  113. package/src/resources/customers/balance-transactions.ts +5 -36
  114. package/src/resources/customers/costs.ts +3 -101
  115. package/src/resources/customers/credits/credits.ts +18 -0
  116. package/src/resources/customers/credits/index.ts +9 -0
  117. package/src/resources/customers/credits/ledger.ts +212 -1435
  118. package/src/resources/customers/credits/top-ups.ts +33 -136
  119. package/src/resources/customers/customers.ts +162 -1454
  120. package/src/resources/customers/index.ts +8 -0
  121. package/src/resources/index.ts +42 -22
  122. package/src/resources/invoice-line-items.ts +10 -501
  123. package/src/resources/invoices.ts +60 -2394
  124. package/src/resources/plans/plans.ts +38 -4588
  125. package/src/resources/prices/external-price-id.ts +3 -3
  126. package/src/resources/prices/index.ts +2 -2
  127. package/src/resources/prices/prices.ts +500 -11810
  128. package/src/resources/shared.ts +9582 -22
  129. package/src/resources/subscription-changes.ts +171 -2670
  130. package/src/resources/subscriptions.ts +3162 -32900
  131. package/src/version.ts +1 -1
  132. package/version.d.ts +1 -1
  133. package/version.d.ts.map +1 -1
  134. package/version.js +1 -1
  135. package/version.js.map +1 -1
  136. package/version.mjs +1 -1
  137. package/version.mjs.map +1 -1
@@ -4,14 +4,14 @@ import { APIResource } from '../resource';
4
4
  import { isRequestOptions } from '../core';
5
5
  import * as Core from '../core';
6
6
  import * as Shared from './shared';
7
- import * as PricesAPI from './prices/prices';
8
- import { Page, type PageParams } from '../pagination';
7
+ import { InvoicesPage } from './shared';
8
+ import { type PageParams } from '../pagination';
9
9
 
10
10
  export class Invoices extends APIResource {
11
11
  /**
12
12
  * This endpoint is used to create a one-off invoice for a customer.
13
13
  */
14
- create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
14
+ create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice> {
15
15
  return this._client.post('/invoices', { body, ...options });
16
16
  }
17
17
 
@@ -26,7 +26,7 @@ export class Invoices extends APIResource {
26
26
  invoiceId: string,
27
27
  body: InvoiceUpdateParams,
28
28
  options?: Core.RequestOptions,
29
- ): Core.APIPromise<Invoice> {
29
+ ): Core.APIPromise<Shared.Invoice> {
30
30
  return this._client.put(`/invoices/${invoiceId}`, { body, ...options });
31
31
  }
32
32
 
@@ -45,12 +45,15 @@ export class Invoices extends APIResource {
45
45
  * values for each draft invoice, which may not always be up-to-date since Orb
46
46
  * regularly refreshes invoices asynchronously.
47
47
  */
48
- list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
49
- list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
48
+ list(
49
+ query?: InvoiceListParams,
50
+ options?: Core.RequestOptions,
51
+ ): Core.PagePromise<InvoicesPage, Shared.Invoice>;
52
+ list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Shared.Invoice>;
50
53
  list(
51
54
  query: InvoiceListParams | Core.RequestOptions = {},
52
55
  options?: Core.RequestOptions,
53
- ): Core.PagePromise<InvoicesPage, Invoice> {
56
+ ): Core.PagePromise<InvoicesPage, Shared.Invoice> {
54
57
  if (isRequestOptions(query)) {
55
58
  return this.list({}, query);
56
59
  }
@@ -61,7 +64,7 @@ export class Invoices extends APIResource {
61
64
  * This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an
62
65
  * identifier.
63
66
  */
64
- fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
67
+ fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice> {
65
68
  return this._client.get(`/invoices/${invoiceId}`, options);
66
69
  }
67
70
 
@@ -89,13 +92,13 @@ export class Invoices extends APIResource {
89
92
  invoiceId: string,
90
93
  body?: InvoiceIssueParams,
91
94
  options?: Core.RequestOptions,
92
- ): Core.APIPromise<Invoice>;
93
- issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
95
+ ): Core.APIPromise<Shared.Invoice>;
96
+ issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
94
97
  issue(
95
98
  invoiceId: string,
96
99
  body: InvoiceIssueParams | Core.RequestOptions = {},
97
100
  options?: Core.RequestOptions,
98
- ): Core.APIPromise<Invoice> {
101
+ ): Core.APIPromise<Shared.Invoice> {
99
102
  if (isRequestOptions(body)) {
100
103
  return this.issue(invoiceId, {}, body);
101
104
  }
@@ -110,1481 +113,33 @@ export class Invoices extends APIResource {
110
113
  invoiceId: string,
111
114
  body: InvoiceMarkPaidParams,
112
115
  options?: Core.RequestOptions,
113
- ): Core.APIPromise<Invoice> {
114
- return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
115
- }
116
-
117
- /**
118
- * This endpoint collects payment for an invoice using the customer's default
119
- * payment method. This action can only be taken on invoices with status "issued".
120
- */
121
- pay(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
122
- return this._client.post(`/invoices/${invoiceId}/pay`, options);
123
- }
124
-
125
- /**
126
- * This endpoint allows an invoice's status to be set the `void` status. This can
127
- * only be done to invoices that are in the `issued` status.
128
- *
129
- * If the associated invoice has used the customer balance to change the amount
130
- * due, the customer balance operation will be reverted. For example, if the
131
- * invoice used $10 of customer balance, that amount will be added back to the
132
- * customer balance upon voiding.
133
- *
134
- * If the invoice was used to purchase a credit block, but the invoice is not yet
135
- * paid, the credit block will be voided. If the invoice was created due to a
136
- * top-up, the top-up will be disabled.
137
- */
138
- void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
139
- return this._client.post(`/invoices/${invoiceId}/void`, options);
140
- }
141
- }
142
-
143
- export class InvoicesPage extends Page<Invoice> {}
144
-
145
- /**
146
- * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
147
- * representing the request for payment for a single subscription. This includes a
148
- * set of line items, which correspond to prices in the subscription's plan and can
149
- * represent fixed recurring fees or usage-based fees. They are generated at the
150
- * end of a billing period, or as the result of an action, such as a cancellation.
151
- */
152
- export interface Invoice {
153
- id: string;
154
-
155
- /**
156
- * This is the final amount required to be charged to the customer and reflects the
157
- * application of the customer balance to the `total` of the invoice.
158
- */
159
- amount_due: string;
160
-
161
- auto_collection: Invoice.AutoCollection;
162
-
163
- billing_address: Invoice.BillingAddress | null;
164
-
165
- /**
166
- * The creation time of the resource in Orb.
167
- */
168
- created_at: string;
169
-
170
- /**
171
- * A list of credit notes associated with the invoice
172
- */
173
- credit_notes: Array<Invoice.CreditNote>;
174
-
175
- /**
176
- * An ISO 4217 currency string or `credits`
177
- */
178
- currency: string;
179
-
180
- customer: Invoice.Customer;
181
-
182
- customer_balance_transactions: Array<Invoice.CustomerBalanceTransaction>;
183
-
184
- /**
185
- * Tax IDs are commonly required to be displayed on customer invoices, which are
186
- * added to the headers of invoices.
187
- *
188
- * ### Supported Tax ID Countries and Types
189
- *
190
- * | Country | Type | Description |
191
- * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
192
- * | Andorra | `ad_nrt` | Andorran NRT Number |
193
- * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
194
- * | Australia | `au_abn` | Australian Business Number (AU ABN) |
195
- * | Australia | `au_arn` | Australian Taxation Office Reference Number |
196
- * | Austria | `eu_vat` | European VAT Number |
197
- * | Bahrain | `bh_vat` | Bahraini VAT Number |
198
- * | Belgium | `eu_vat` | European VAT Number |
199
- * | Bolivia | `bo_tin` | Bolivian Tax ID |
200
- * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
201
- * | Brazil | `br_cpf` | Brazilian CPF Number |
202
- * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
203
- * | Bulgaria | `eu_vat` | European VAT Number |
204
- * | Canada | `ca_bn` | Canadian BN |
205
- * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
206
- * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
207
- * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
208
- * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
209
- * | Canada | `ca_qst` | Canadian QST Number (Québec) |
210
- * | Chile | `cl_tin` | Chilean TIN |
211
- * | China | `cn_tin` | Chinese Tax ID |
212
- * | Colombia | `co_nit` | Colombian NIT Number |
213
- * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
214
- * | Croatia | `eu_vat` | European VAT Number |
215
- * | Cyprus | `eu_vat` | European VAT Number |
216
- * | Czech Republic | `eu_vat` | European VAT Number |
217
- * | Denmark | `eu_vat` | European VAT Number |
218
- * | Dominican Republic | `do_rcn` | Dominican RCN Number |
219
- * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
220
- * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
221
- * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
222
- * | Estonia | `eu_vat` | European VAT Number |
223
- * | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
224
- * | Finland | `eu_vat` | European VAT Number |
225
- * | France | `eu_vat` | European VAT Number |
226
- * | Georgia | `ge_vat` | Georgian VAT |
227
- * | Germany | `eu_vat` | European VAT Number |
228
- * | Greece | `eu_vat` | European VAT Number |
229
- * | Hong Kong | `hk_br` | Hong Kong BR Number |
230
- * | Hungary | `eu_vat` | European VAT Number |
231
- * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
232
- * | Iceland | `is_vat` | Icelandic VAT |
233
- * | India | `in_gst` | Indian GST Number |
234
- * | Indonesia | `id_npwp` | Indonesian NPWP Number |
235
- * | Ireland | `eu_vat` | European VAT Number |
236
- * | Israel | `il_vat` | Israel VAT |
237
- * | Italy | `eu_vat` | European VAT Number |
238
- * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
239
- * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
240
- * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
241
- * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
242
- * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
243
- * | Latvia | `eu_vat` | European VAT Number |
244
- * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
245
- * | Lithuania | `eu_vat` | European VAT Number |
246
- * | Luxembourg | `eu_vat` | European VAT Number |
247
- * | Malaysia | `my_frp` | Malaysian FRP Number |
248
- * | Malaysia | `my_itn` | Malaysian ITN |
249
- * | Malaysia | `my_sst` | Malaysian SST Number |
250
- * | Malta | `eu_vat ` | European VAT Number |
251
- * | Mexico | `mx_rfc` | Mexican RFC Number |
252
- * | Netherlands | `eu_vat` | European VAT Number |
253
- * | New Zealand | `nz_gst` | New Zealand GST Number |
254
- * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
255
- * | Norway | `no_vat` | Norwegian VAT Number |
256
- * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
257
- * | Oman | `om_vat` | Omani VAT Number |
258
- * | Peru | `pe_ruc` | Peruvian RUC Number |
259
- * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
260
- * | Poland | `eu_vat` | European VAT Number |
261
- * | Portugal | `eu_vat` | European VAT Number |
262
- * | Romania | `eu_vat` | European VAT Number |
263
- * | Romania | `ro_tin` | Romanian Tax ID Number |
264
- * | Russia | `ru_inn` | Russian INN |
265
- * | Russia | `ru_kpp` | Russian KPP |
266
- * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
267
- * | Serbia | `rs_pib` | Serbian PIB Number |
268
- * | Singapore | `sg_gst` | Singaporean GST |
269
- * | Singapore | `sg_uen` | Singaporean UEN |
270
- * | Slovakia | `eu_vat` | European VAT Number |
271
- * | Slovenia | `eu_vat` | European VAT Number |
272
- * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
273
- * | South Africa | `za_vat` | South African VAT Number |
274
- * | South Korea | `kr_brn` | Korean BRN |
275
- * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
276
- * | Spain | `eu_vat` | European VAT Number |
277
- * | Sweden | `eu_vat` | European VAT Number |
278
- * | Switzerland | `ch_vat` | Switzerland VAT Number |
279
- * | Taiwan | `tw_vat` | Taiwanese VAT |
280
- * | Thailand | `th_vat` | Thai VAT |
281
- * | Turkey | `tr_tin` | Turkish Tax Identification Number |
282
- * | Ukraine | `ua_vat` | Ukrainian VAT |
283
- * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
284
- * | United Kingdom | `eu_vat` | Northern Ireland VAT Number |
285
- * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
286
- * | United States | `us_ein` | United States EIN |
287
- * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
288
- * | Venezuela | `ve_rif` | Venezuelan RIF Number |
289
- * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
290
- */
291
- customer_tax_id: Invoice.CustomerTaxID | null;
292
-
293
- /**
294
- * @deprecated This field is deprecated in favor of `discounts`. If a `discounts`
295
- * list is provided, the first discount in the list will be returned. If the list
296
- * is empty, `None` will be returned.
297
- */
298
- discount: unknown;
299
-
300
- discounts: Array<Shared.InvoiceLevelDiscount>;
301
-
302
- /**
303
- * When the invoice payment is due. The due date is null if the invoice is not yet
304
- * finalized.
305
- */
306
- due_date: string | null;
307
-
308
- /**
309
- * If the invoice has a status of `draft`, this will be the time that the invoice
310
- * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
311
- * true, the invoice will automatically begin issuing at this time.
312
- */
313
- eligible_to_issue_at: string | null;
314
-
315
- /**
316
- * A URL for the customer-facing invoice portal. This URL expires 30 days after the
317
- * invoice's due date, or 60 days after being re-generated through the UI.
318
- */
319
- hosted_invoice_url: string | null;
320
-
321
- /**
322
- * The scheduled date of the invoice
323
- */
324
- invoice_date: string;
325
-
326
- /**
327
- * Automatically generated invoice number to help track and reconcile invoices.
328
- * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
329
- * account or customer.
330
- */
331
- invoice_number: string;
332
-
333
- /**
334
- * The link to download the PDF representation of the `Invoice`.
335
- */
336
- invoice_pdf: string | null;
337
-
338
- invoice_source: 'subscription' | 'partial' | 'one_off';
339
-
340
- /**
341
- * If the invoice failed to issue, this will be the last time it failed to issue
342
- * (even if it is now in a different state.)
343
- */
344
- issue_failed_at: string | null;
345
-
346
- /**
347
- * If the invoice has been issued, this will be the time it transitioned to
348
- * `issued` (even if it is now in a different state.)
349
- */
350
- issued_at: string | null;
351
-
352
- /**
353
- * The breakdown of prices in this invoice.
354
- */
355
- line_items: Array<Invoice.LineItem>;
356
-
357
- maximum: Invoice.Maximum | null;
358
-
359
- maximum_amount: string | null;
360
-
361
- /**
362
- * Free-form text which is available on the invoice PDF and the Orb invoice portal.
363
- */
364
- memo: string | null;
365
-
366
- /**
367
- * User specified key-value pairs for the resource. If not present, this defaults
368
- * to an empty dictionary. Individual keys can be removed by setting the value to
369
- * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
370
- * `null`.
371
- */
372
- metadata: Record<string, string>;
373
-
374
- minimum: Invoice.Minimum | null;
375
-
376
- minimum_amount: string | null;
377
-
378
- /**
379
- * If the invoice has a status of `paid`, this gives a timestamp when the invoice
380
- * was paid.
381
- */
382
- paid_at: string | null;
383
-
384
- /**
385
- * A list of payment attempts associated with the invoice
386
- */
387
- payment_attempts: Array<Invoice.PaymentAttempt>;
388
-
389
- /**
390
- * If payment was attempted on this invoice but failed, this will be the time of
391
- * the most recent attempt.
392
- */
393
- payment_failed_at: string | null;
394
-
395
- /**
396
- * If payment was attempted on this invoice, this will be the start time of the
397
- * most recent attempt. This field is especially useful for delayed-notification
398
- * payment mechanisms (like bank transfers), where payment can take 3 days or more.
399
- */
400
- payment_started_at: string | null;
401
-
402
- /**
403
- * If the invoice is in draft, this timestamp will reflect when the invoice is
404
- * scheduled to be issued.
405
- */
406
- scheduled_issue_at: string | null;
407
-
408
- shipping_address: Invoice.ShippingAddress | null;
409
-
410
- status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
411
-
412
- subscription: Invoice.Subscription | null;
413
-
414
- /**
415
- * The total before any discounts and minimums are applied.
416
- */
417
- subtotal: string;
418
-
419
- /**
420
- * If the invoice failed to sync, this will be the last time an external invoicing
421
- * provider sync was attempted. This field will always be `null` for invoices using
422
- * Orb Invoicing.
423
- */
424
- sync_failed_at: string | null;
425
-
426
- /**
427
- * The total after any minimums and discounts have been applied.
428
- */
429
- total: string;
430
-
431
- /**
432
- * If the invoice has a status of `void`, this gives a timestamp when the invoice
433
- * was voided.
434
- */
435
- voided_at: string | null;
436
-
437
- /**
438
- * This is true if the invoice will be automatically issued in the future, and
439
- * false otherwise.
440
- */
441
- will_auto_issue: boolean;
442
- }
443
-
444
- export namespace Invoice {
445
- export interface AutoCollection {
446
- /**
447
- * True only if auto-collection is enabled for this invoice.
448
- */
449
- enabled: boolean | null;
450
-
451
- /**
452
- * If the invoice is scheduled for auto-collection, this field will reflect when
453
- * the next attempt will occur. If dunning has been exhausted, or auto-collection
454
- * is not enabled for this invoice, this field will be `null`.
455
- */
456
- next_attempt_at: string | null;
457
-
458
- /**
459
- * Number of auto-collection payment attempts.
460
- */
461
- num_attempts: number | null;
462
-
463
- /**
464
- * If Orb has ever attempted payment auto-collection for this invoice, this field
465
- * will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
466
- * this can be used to tell whether the invoice is currently in dunning (that is,
467
- * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
468
- * if dunning has been exhausted (`previously_attempted_at` is non-null, but
469
- * `next_attempt_time` is null).
470
- */
471
- previously_attempted_at: string | null;
472
- }
473
-
474
- export interface BillingAddress {
475
- city: string | null;
476
-
477
- country: string | null;
478
-
479
- line1: string | null;
480
-
481
- line2: string | null;
482
-
483
- postal_code: string | null;
484
-
485
- state: string | null;
486
- }
487
-
488
- export interface CreditNote {
489
- id: string;
490
-
491
- credit_note_number: string;
492
-
493
- /**
494
- * An optional memo supplied on the credit note.
495
- */
496
- memo: string | null;
497
-
498
- reason: string;
499
-
500
- total: string;
501
-
502
- type: string;
503
-
504
- /**
505
- * If the credit note has a status of `void`, this gives a timestamp when the
506
- * credit note was voided.
507
- */
508
- voided_at: string | null;
509
- }
510
-
511
- export interface Customer {
512
- id: string;
513
-
514
- external_customer_id: string | null;
515
- }
516
-
517
- export interface CustomerBalanceTransaction {
518
- /**
519
- * A unique id for this transaction.
520
- */
521
- id: string;
522
-
523
- action:
524
- | 'applied_to_invoice'
525
- | 'manual_adjustment'
526
- | 'prorated_refund'
527
- | 'revert_prorated_refund'
528
- | 'return_from_voiding'
529
- | 'credit_note_applied'
530
- | 'credit_note_voided'
531
- | 'overpayment_refund'
532
- | 'external_payment';
533
-
534
- /**
535
- * The value of the amount changed in the transaction.
536
- */
537
- amount: string;
538
-
539
- /**
540
- * The creation time of this transaction.
541
- */
542
- created_at: string;
543
-
544
- credit_note: CustomerBalanceTransaction.CreditNote | null;
545
-
546
- /**
547
- * An optional description provided for manual customer balance adjustments.
548
- */
549
- description: string | null;
550
-
551
- /**
552
- * The new value of the customer's balance prior to the transaction, in the
553
- * customer's currency.
554
- */
555
- ending_balance: string;
556
-
557
- invoice: CustomerBalanceTransaction.Invoice | null;
558
-
559
- /**
560
- * The original value of the customer's balance prior to the transaction, in the
561
- * customer's currency.
562
- */
563
- starting_balance: string;
564
-
565
- type: 'increment' | 'decrement';
566
- }
567
-
568
- export namespace CustomerBalanceTransaction {
569
- export interface CreditNote {
570
- /**
571
- * The id of the Credit note
572
- */
573
- id: string;
574
- }
575
-
576
- export interface Invoice {
577
- /**
578
- * The Invoice id
579
- */
580
- id: string;
581
- }
582
- }
583
-
584
- /**
585
- * Tax IDs are commonly required to be displayed on customer invoices, which are
586
- * added to the headers of invoices.
587
- *
588
- * ### Supported Tax ID Countries and Types
589
- *
590
- * | Country | Type | Description |
591
- * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
592
- * | Andorra | `ad_nrt` | Andorran NRT Number |
593
- * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
594
- * | Australia | `au_abn` | Australian Business Number (AU ABN) |
595
- * | Australia | `au_arn` | Australian Taxation Office Reference Number |
596
- * | Austria | `eu_vat` | European VAT Number |
597
- * | Bahrain | `bh_vat` | Bahraini VAT Number |
598
- * | Belgium | `eu_vat` | European VAT Number |
599
- * | Bolivia | `bo_tin` | Bolivian Tax ID |
600
- * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
601
- * | Brazil | `br_cpf` | Brazilian CPF Number |
602
- * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
603
- * | Bulgaria | `eu_vat` | European VAT Number |
604
- * | Canada | `ca_bn` | Canadian BN |
605
- * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
606
- * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
607
- * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
608
- * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
609
- * | Canada | `ca_qst` | Canadian QST Number (Québec) |
610
- * | Chile | `cl_tin` | Chilean TIN |
611
- * | China | `cn_tin` | Chinese Tax ID |
612
- * | Colombia | `co_nit` | Colombian NIT Number |
613
- * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
614
- * | Croatia | `eu_vat` | European VAT Number |
615
- * | Cyprus | `eu_vat` | European VAT Number |
616
- * | Czech Republic | `eu_vat` | European VAT Number |
617
- * | Denmark | `eu_vat` | European VAT Number |
618
- * | Dominican Republic | `do_rcn` | Dominican RCN Number |
619
- * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
620
- * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
621
- * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
622
- * | Estonia | `eu_vat` | European VAT Number |
623
- * | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
624
- * | Finland | `eu_vat` | European VAT Number |
625
- * | France | `eu_vat` | European VAT Number |
626
- * | Georgia | `ge_vat` | Georgian VAT |
627
- * | Germany | `eu_vat` | European VAT Number |
628
- * | Greece | `eu_vat` | European VAT Number |
629
- * | Hong Kong | `hk_br` | Hong Kong BR Number |
630
- * | Hungary | `eu_vat` | European VAT Number |
631
- * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
632
- * | Iceland | `is_vat` | Icelandic VAT |
633
- * | India | `in_gst` | Indian GST Number |
634
- * | Indonesia | `id_npwp` | Indonesian NPWP Number |
635
- * | Ireland | `eu_vat` | European VAT Number |
636
- * | Israel | `il_vat` | Israel VAT |
637
- * | Italy | `eu_vat` | European VAT Number |
638
- * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
639
- * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
640
- * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
641
- * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
642
- * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
643
- * | Latvia | `eu_vat` | European VAT Number |
644
- * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
645
- * | Lithuania | `eu_vat` | European VAT Number |
646
- * | Luxembourg | `eu_vat` | European VAT Number |
647
- * | Malaysia | `my_frp` | Malaysian FRP Number |
648
- * | Malaysia | `my_itn` | Malaysian ITN |
649
- * | Malaysia | `my_sst` | Malaysian SST Number |
650
- * | Malta | `eu_vat ` | European VAT Number |
651
- * | Mexico | `mx_rfc` | Mexican RFC Number |
652
- * | Netherlands | `eu_vat` | European VAT Number |
653
- * | New Zealand | `nz_gst` | New Zealand GST Number |
654
- * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
655
- * | Norway | `no_vat` | Norwegian VAT Number |
656
- * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
657
- * | Oman | `om_vat` | Omani VAT Number |
658
- * | Peru | `pe_ruc` | Peruvian RUC Number |
659
- * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
660
- * | Poland | `eu_vat` | European VAT Number |
661
- * | Portugal | `eu_vat` | European VAT Number |
662
- * | Romania | `eu_vat` | European VAT Number |
663
- * | Romania | `ro_tin` | Romanian Tax ID Number |
664
- * | Russia | `ru_inn` | Russian INN |
665
- * | Russia | `ru_kpp` | Russian KPP |
666
- * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
667
- * | Serbia | `rs_pib` | Serbian PIB Number |
668
- * | Singapore | `sg_gst` | Singaporean GST |
669
- * | Singapore | `sg_uen` | Singaporean UEN |
670
- * | Slovakia | `eu_vat` | European VAT Number |
671
- * | Slovenia | `eu_vat` | European VAT Number |
672
- * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
673
- * | South Africa | `za_vat` | South African VAT Number |
674
- * | South Korea | `kr_brn` | Korean BRN |
675
- * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
676
- * | Spain | `eu_vat` | European VAT Number |
677
- * | Sweden | `eu_vat` | European VAT Number |
678
- * | Switzerland | `ch_vat` | Switzerland VAT Number |
679
- * | Taiwan | `tw_vat` | Taiwanese VAT |
680
- * | Thailand | `th_vat` | Thai VAT |
681
- * | Turkey | `tr_tin` | Turkish Tax Identification Number |
682
- * | Ukraine | `ua_vat` | Ukrainian VAT |
683
- * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
684
- * | United Kingdom | `eu_vat` | Northern Ireland VAT Number |
685
- * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
686
- * | United States | `us_ein` | United States EIN |
687
- * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
688
- * | Venezuela | `ve_rif` | Venezuelan RIF Number |
689
- * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
690
- */
691
- export interface CustomerTaxID {
692
- country:
693
- | 'AD'
694
- | 'AE'
695
- | 'AR'
696
- | 'AT'
697
- | 'AU'
698
- | 'BE'
699
- | 'BG'
700
- | 'BH'
701
- | 'BO'
702
- | 'BR'
703
- | 'CA'
704
- | 'CH'
705
- | 'CL'
706
- | 'CN'
707
- | 'CO'
708
- | 'CR'
709
- | 'CY'
710
- | 'CZ'
711
- | 'DE'
712
- | 'DK'
713
- | 'EE'
714
- | 'DO'
715
- | 'EC'
716
- | 'EG'
717
- | 'ES'
718
- | 'EU'
719
- | 'FI'
720
- | 'FR'
721
- | 'GB'
722
- | 'GE'
723
- | 'GR'
724
- | 'HK'
725
- | 'HR'
726
- | 'HU'
727
- | 'ID'
728
- | 'IE'
729
- | 'IL'
730
- | 'IN'
731
- | 'IS'
732
- | 'IT'
733
- | 'JP'
734
- | 'KE'
735
- | 'KR'
736
- | 'KZ'
737
- | 'LI'
738
- | 'LT'
739
- | 'LU'
740
- | 'LV'
741
- | 'MT'
742
- | 'MX'
743
- | 'MY'
744
- | 'NG'
745
- | 'NL'
746
- | 'NO'
747
- | 'NZ'
748
- | 'OM'
749
- | 'PE'
750
- | 'PH'
751
- | 'PL'
752
- | 'PT'
753
- | 'RO'
754
- | 'RS'
755
- | 'RU'
756
- | 'SA'
757
- | 'SE'
758
- | 'SG'
759
- | 'SI'
760
- | 'SK'
761
- | 'SV'
762
- | 'TH'
763
- | 'TR'
764
- | 'TW'
765
- | 'UA'
766
- | 'US'
767
- | 'UY'
768
- | 'VE'
769
- | 'VN'
770
- | 'ZA';
771
-
772
- type:
773
- | 'ad_nrt'
774
- | 'ae_trn'
775
- | 'ar_cuit'
776
- | 'eu_vat'
777
- | 'au_abn'
778
- | 'au_arn'
779
- | 'bg_uic'
780
- | 'bh_vat'
781
- | 'bo_tin'
782
- | 'br_cnpj'
783
- | 'br_cpf'
784
- | 'ca_bn'
785
- | 'ca_gst_hst'
786
- | 'ca_pst_bc'
787
- | 'ca_pst_mb'
788
- | 'ca_pst_sk'
789
- | 'ca_qst'
790
- | 'ch_vat'
791
- | 'cl_tin'
792
- | 'cn_tin'
793
- | 'co_nit'
794
- | 'cr_tin'
795
- | 'do_rcn'
796
- | 'ec_ruc'
797
- | 'eg_tin'
798
- | 'es_cif'
799
- | 'eu_oss_vat'
800
- | 'gb_vat'
801
- | 'ge_vat'
802
- | 'hk_br'
803
- | 'hu_tin'
804
- | 'id_npwp'
805
- | 'il_vat'
806
- | 'in_gst'
807
- | 'is_vat'
808
- | 'jp_cn'
809
- | 'jp_rn'
810
- | 'jp_trn'
811
- | 'ke_pin'
812
- | 'kr_brn'
813
- | 'kz_bin'
814
- | 'li_uid'
815
- | 'mx_rfc'
816
- | 'my_frp'
817
- | 'my_itn'
818
- | 'my_sst'
819
- | 'ng_tin'
820
- | 'no_vat'
821
- | 'no_voec'
822
- | 'nz_gst'
823
- | 'om_vat'
824
- | 'pe_ruc'
825
- | 'ph_tin'
826
- | 'ro_tin'
827
- | 'rs_pib'
828
- | 'ru_inn'
829
- | 'ru_kpp'
830
- | 'sa_vat'
831
- | 'sg_gst'
832
- | 'sg_uen'
833
- | 'si_tin'
834
- | 'sv_nit'
835
- | 'th_vat'
836
- | 'tr_tin'
837
- | 'tw_vat'
838
- | 'ua_vat'
839
- | 'us_ein'
840
- | 'uy_ruc'
841
- | 've_rif'
842
- | 'vn_tin'
843
- | 'za_vat';
844
-
845
- value: string;
846
- }
847
-
848
- export interface LineItem {
849
- /**
850
- * A unique ID for this line item.
851
- */
852
- id: string;
853
-
854
- /**
855
- * The line amount after any adjustments and before overage conversion, credits and
856
- * partial invoicing.
857
- */
858
- adjusted_subtotal: string;
859
-
860
- /**
861
- * All adjustments applied to the line item in the order they were applied based on
862
- * invoice calculations (ie. usage discounts -> amount discounts -> percentage
863
- * discounts -> minimums -> maximums).
864
- */
865
- adjustments: Array<
866
- | LineItem.MonetaryUsageDiscountAdjustment
867
- | LineItem.MonetaryAmountDiscountAdjustment
868
- | LineItem.MonetaryPercentageDiscountAdjustment
869
- | LineItem.MonetaryMinimumAdjustment
870
- | LineItem.MonetaryMaximumAdjustment
871
- >;
872
-
873
- /**
874
- * The final amount for a line item after all adjustments and pre paid credits have
875
- * been applied.
876
- */
877
- amount: string;
878
-
879
- /**
880
- * The number of prepaid credits applied.
881
- */
882
- credits_applied: string;
883
-
884
- discount: Shared.Discount | null;
885
-
886
- /**
887
- * The end date of the range of time applied for this line item's price.
888
- */
889
- end_date: string;
890
-
891
- /**
892
- * An additional filter that was used to calculate the usage for this line item.
893
- */
894
- filter: string | null;
895
-
896
- /**
897
- * [DEPRECATED] For configured prices that are split by a grouping key, this will
898
- * be populated with the key and a value. The `amount` and `subtotal` will be the
899
- * values for this particular grouping.
900
- */
901
- grouping: string | null;
902
-
903
- /**
904
- * @deprecated This field is deprecated in favor of `adjustments`.
905
- */
906
- maximum: LineItem.Maximum | null;
907
-
908
- /**
909
- * @deprecated This field is deprecated in favor of `adjustments`.
910
- */
911
- maximum_amount: string | null;
912
-
913
- /**
914
- * @deprecated This field is deprecated in favor of `adjustments`.
915
- */
916
- minimum: LineItem.Minimum | null;
917
-
918
- /**
919
- * @deprecated This field is deprecated in favor of `adjustments`.
920
- */
921
- minimum_amount: string | null;
922
-
923
- /**
924
- * The name of the price associated with this line item.
925
- */
926
- name: string;
927
-
928
- /**
929
- * Any amount applied from a partial invoice
930
- */
931
- partially_invoiced_amount: string;
932
-
933
- /**
934
- * The Price resource represents a price that can be billed on a subscription,
935
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
936
- * take a quantity and determine an amount to bill.
937
- *
938
- * Orb supports a few different pricing models out of the box. Each of these models
939
- * is serialized differently in a given Price object. The model_type field
940
- * determines the key for the configuration object that is present.
941
- *
942
- * For more on the types of prices, see
943
- * [the core concepts documentation](/core-concepts#plan-and-price)
944
- */
945
- price: PricesAPI.Price;
946
-
947
- /**
948
- * Either the fixed fee quantity or the usage during the service period.
949
- */
950
- quantity: number;
951
-
952
- /**
953
- * The start date of the range of time applied for this line item's price.
954
- */
955
- start_date: string;
956
-
957
- /**
958
- * For complex pricing structures, the line item can be broken down further in
959
- * `sub_line_items`.
960
- */
961
- sub_line_items: Array<LineItem.MatrixSubLineItem | LineItem.TierSubLineItem | LineItem.OtherSubLineItem>;
962
-
963
- /**
964
- * The line amount before before any adjustments.
965
- */
966
- subtotal: string;
967
-
968
- /**
969
- * An array of tax rates and their incurred tax amounts. Empty if no tax
970
- * integration is configured.
971
- */
972
- tax_amounts: Array<LineItem.TaxAmount>;
973
-
974
- /**
975
- * A list of customer ids that were used to calculate the usage for this line item.
976
- */
977
- usage_customer_ids: Array<string> | null;
978
- }
979
-
980
- export namespace LineItem {
981
- export interface MonetaryUsageDiscountAdjustment {
982
- id: string;
983
-
984
- adjustment_type: 'usage_discount';
985
-
986
- /**
987
- * The value applied by an adjustment.
988
- */
989
- amount: string;
990
-
991
- /**
992
- * @deprecated The price IDs that this adjustment applies to.
993
- */
994
- applies_to_price_ids: Array<string>;
995
-
996
- /**
997
- * The filters that determine which prices to apply this adjustment to.
998
- */
999
- filters: Array<MonetaryUsageDiscountAdjustment.Filter>;
1000
-
1001
- /**
1002
- * True for adjustments that apply to an entire invocice, false for adjustments
1003
- * that apply to only one price.
1004
- */
1005
- is_invoice_level: boolean;
1006
-
1007
- /**
1008
- * The reason for the adjustment.
1009
- */
1010
- reason: string | null;
1011
-
1012
- /**
1013
- * The number of usage units by which to discount the price this adjustment applies
1014
- * to in a given billing period.
1015
- */
1016
- usage_discount: number;
1017
- }
1018
-
1019
- export namespace MonetaryUsageDiscountAdjustment {
1020
- export interface Filter {
1021
- /**
1022
- * The property of the price to filter on.
1023
- */
1024
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1025
-
1026
- /**
1027
- * Should prices that match the filter be included or excluded.
1028
- */
1029
- operator: 'includes' | 'excludes';
1030
-
1031
- /**
1032
- * The IDs or values that match this filter.
1033
- */
1034
- values: Array<string>;
1035
- }
1036
- }
1037
-
1038
- export interface MonetaryAmountDiscountAdjustment {
1039
- id: string;
1040
-
1041
- adjustment_type: 'amount_discount';
1042
-
1043
- /**
1044
- * The value applied by an adjustment.
1045
- */
1046
- amount: string;
1047
-
1048
- /**
1049
- * The amount by which to discount the prices this adjustment applies to in a given
1050
- * billing period.
1051
- */
1052
- amount_discount: string;
1053
-
1054
- /**
1055
- * @deprecated The price IDs that this adjustment applies to.
1056
- */
1057
- applies_to_price_ids: Array<string>;
1058
-
1059
- /**
1060
- * The filters that determine which prices to apply this adjustment to.
1061
- */
1062
- filters: Array<MonetaryAmountDiscountAdjustment.Filter>;
1063
-
1064
- /**
1065
- * True for adjustments that apply to an entire invocice, false for adjustments
1066
- * that apply to only one price.
1067
- */
1068
- is_invoice_level: boolean;
1069
-
1070
- /**
1071
- * The reason for the adjustment.
1072
- */
1073
- reason: string | null;
1074
- }
1075
-
1076
- export namespace MonetaryAmountDiscountAdjustment {
1077
- export interface Filter {
1078
- /**
1079
- * The property of the price to filter on.
1080
- */
1081
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1082
-
1083
- /**
1084
- * Should prices that match the filter be included or excluded.
1085
- */
1086
- operator: 'includes' | 'excludes';
1087
-
1088
- /**
1089
- * The IDs or values that match this filter.
1090
- */
1091
- values: Array<string>;
1092
- }
1093
- }
1094
-
1095
- export interface MonetaryPercentageDiscountAdjustment {
1096
- id: string;
1097
-
1098
- adjustment_type: 'percentage_discount';
1099
-
1100
- /**
1101
- * The value applied by an adjustment.
1102
- */
1103
- amount: string;
1104
-
1105
- /**
1106
- * @deprecated The price IDs that this adjustment applies to.
1107
- */
1108
- applies_to_price_ids: Array<string>;
1109
-
1110
- /**
1111
- * The filters that determine which prices to apply this adjustment to.
1112
- */
1113
- filters: Array<MonetaryPercentageDiscountAdjustment.Filter>;
1114
-
1115
- /**
1116
- * True for adjustments that apply to an entire invocice, false for adjustments
1117
- * that apply to only one price.
1118
- */
1119
- is_invoice_level: boolean;
1120
-
1121
- /**
1122
- * The percentage (as a value between 0 and 1) by which to discount the price
1123
- * intervals this adjustment applies to in a given billing period.
1124
- */
1125
- percentage_discount: number;
1126
-
1127
- /**
1128
- * The reason for the adjustment.
1129
- */
1130
- reason: string | null;
1131
- }
1132
-
1133
- export namespace MonetaryPercentageDiscountAdjustment {
1134
- export interface Filter {
1135
- /**
1136
- * The property of the price to filter on.
1137
- */
1138
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1139
-
1140
- /**
1141
- * Should prices that match the filter be included or excluded.
1142
- */
1143
- operator: 'includes' | 'excludes';
1144
-
1145
- /**
1146
- * The IDs or values that match this filter.
1147
- */
1148
- values: Array<string>;
1149
- }
1150
- }
1151
-
1152
- export interface MonetaryMinimumAdjustment {
1153
- id: string;
1154
-
1155
- adjustment_type: 'minimum';
1156
-
1157
- /**
1158
- * The value applied by an adjustment.
1159
- */
1160
- amount: string;
1161
-
1162
- /**
1163
- * @deprecated The price IDs that this adjustment applies to.
1164
- */
1165
- applies_to_price_ids: Array<string>;
1166
-
1167
- /**
1168
- * The filters that determine which prices to apply this adjustment to.
1169
- */
1170
- filters: Array<MonetaryMinimumAdjustment.Filter>;
1171
-
1172
- /**
1173
- * True for adjustments that apply to an entire invocice, false for adjustments
1174
- * that apply to only one price.
1175
- */
1176
- is_invoice_level: boolean;
1177
-
1178
- /**
1179
- * The item ID that revenue from this minimum will be attributed to.
1180
- */
1181
- item_id: string;
1182
-
1183
- /**
1184
- * The minimum amount to charge in a given billing period for the prices this
1185
- * adjustment applies to.
1186
- */
1187
- minimum_amount: string;
1188
-
1189
- /**
1190
- * The reason for the adjustment.
1191
- */
1192
- reason: string | null;
1193
- }
1194
-
1195
- export namespace MonetaryMinimumAdjustment {
1196
- export interface Filter {
1197
- /**
1198
- * The property of the price to filter on.
1199
- */
1200
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1201
-
1202
- /**
1203
- * Should prices that match the filter be included or excluded.
1204
- */
1205
- operator: 'includes' | 'excludes';
1206
-
1207
- /**
1208
- * The IDs or values that match this filter.
1209
- */
1210
- values: Array<string>;
1211
- }
1212
- }
1213
-
1214
- export interface MonetaryMaximumAdjustment {
1215
- id: string;
1216
-
1217
- adjustment_type: 'maximum';
1218
-
1219
- /**
1220
- * The value applied by an adjustment.
1221
- */
1222
- amount: string;
1223
-
1224
- /**
1225
- * @deprecated The price IDs that this adjustment applies to.
1226
- */
1227
- applies_to_price_ids: Array<string>;
1228
-
1229
- /**
1230
- * The filters that determine which prices to apply this adjustment to.
1231
- */
1232
- filters: Array<MonetaryMaximumAdjustment.Filter>;
1233
-
1234
- /**
1235
- * True for adjustments that apply to an entire invocice, false for adjustments
1236
- * that apply to only one price.
1237
- */
1238
- is_invoice_level: boolean;
1239
-
1240
- /**
1241
- * The maximum amount to charge in a given billing period for the prices this
1242
- * adjustment applies to.
1243
- */
1244
- maximum_amount: string;
1245
-
1246
- /**
1247
- * The reason for the adjustment.
1248
- */
1249
- reason: string | null;
1250
- }
1251
-
1252
- export namespace MonetaryMaximumAdjustment {
1253
- export interface Filter {
1254
- /**
1255
- * The property of the price to filter on.
1256
- */
1257
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1258
-
1259
- /**
1260
- * Should prices that match the filter be included or excluded.
1261
- */
1262
- operator: 'includes' | 'excludes';
1263
-
1264
- /**
1265
- * The IDs or values that match this filter.
1266
- */
1267
- values: Array<string>;
1268
- }
1269
- }
1270
-
1271
- /**
1272
- * @deprecated This field is deprecated in favor of `adjustments`.
1273
- */
1274
- export interface Maximum {
1275
- /**
1276
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
1277
- * phase maximums, this can be a subset of prices.
1278
- */
1279
- applies_to_price_ids: Array<string>;
1280
-
1281
- /**
1282
- * The filters that determine which prices to apply this maximum to.
1283
- */
1284
- filters: Array<Maximum.Filter>;
1285
-
1286
- /**
1287
- * Maximum amount applied
1288
- */
1289
- maximum_amount: string;
1290
- }
1291
-
1292
- export namespace Maximum {
1293
- export interface Filter {
1294
- /**
1295
- * The property of the price to filter on.
1296
- */
1297
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1298
-
1299
- /**
1300
- * Should prices that match the filter be included or excluded.
1301
- */
1302
- operator: 'includes' | 'excludes';
1303
-
1304
- /**
1305
- * The IDs or values that match this filter.
1306
- */
1307
- values: Array<string>;
1308
- }
1309
- }
1310
-
1311
- /**
1312
- * @deprecated This field is deprecated in favor of `adjustments`.
1313
- */
1314
- export interface Minimum {
1315
- /**
1316
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
1317
- * phase minimums, this can be a subset of prices.
1318
- */
1319
- applies_to_price_ids: Array<string>;
1320
-
1321
- /**
1322
- * The filters that determine which prices to apply this minimum to.
1323
- */
1324
- filters: Array<Minimum.Filter>;
1325
-
1326
- /**
1327
- * Minimum amount applied
1328
- */
1329
- minimum_amount: string;
1330
- }
1331
-
1332
- export namespace Minimum {
1333
- export interface Filter {
1334
- /**
1335
- * The property of the price to filter on.
1336
- */
1337
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1338
-
1339
- /**
1340
- * Should prices that match the filter be included or excluded.
1341
- */
1342
- operator: 'includes' | 'excludes';
1343
-
1344
- /**
1345
- * The IDs or values that match this filter.
1346
- */
1347
- values: Array<string>;
1348
- }
1349
- }
1350
-
1351
- export interface MatrixSubLineItem {
1352
- /**
1353
- * The total amount for this sub line item.
1354
- */
1355
- amount: string;
1356
-
1357
- grouping: MatrixSubLineItem.Grouping | null;
1358
-
1359
- matrix_config: MatrixSubLineItem.MatrixConfig;
1360
-
1361
- name: string;
1362
-
1363
- quantity: number;
1364
-
1365
- type: 'matrix';
1366
- }
1367
-
1368
- export namespace MatrixSubLineItem {
1369
- export interface Grouping {
1370
- key: string;
1371
-
1372
- /**
1373
- * No value indicates the default group
1374
- */
1375
- value: string | null;
1376
- }
1377
-
1378
- export interface MatrixConfig {
1379
- /**
1380
- * The ordered dimension values for this line item.
1381
- */
1382
- dimension_values: Array<string | null>;
1383
- }
1384
- }
1385
-
1386
- export interface TierSubLineItem {
1387
- /**
1388
- * The total amount for this sub line item.
1389
- */
1390
- amount: string;
1391
-
1392
- grouping: TierSubLineItem.Grouping | null;
1393
-
1394
- name: string;
1395
-
1396
- quantity: number;
1397
-
1398
- tier_config: TierSubLineItem.TierConfig;
1399
-
1400
- type: 'tier';
1401
- }
1402
-
1403
- export namespace TierSubLineItem {
1404
- export interface Grouping {
1405
- key: string;
1406
-
1407
- /**
1408
- * No value indicates the default group
1409
- */
1410
- value: string | null;
1411
- }
1412
-
1413
- export interface TierConfig {
1414
- first_unit: number;
1415
-
1416
- last_unit: number | null;
1417
-
1418
- unit_amount: string;
1419
- }
1420
- }
1421
-
1422
- export interface OtherSubLineItem {
1423
- /**
1424
- * The total amount for this sub line item.
1425
- */
1426
- amount: string;
1427
-
1428
- grouping: OtherSubLineItem.Grouping | null;
1429
-
1430
- name: string;
1431
-
1432
- quantity: number;
1433
-
1434
- type: "'null'";
1435
- }
1436
-
1437
- export namespace OtherSubLineItem {
1438
- export interface Grouping {
1439
- key: string;
1440
-
1441
- /**
1442
- * No value indicates the default group
1443
- */
1444
- value: string | null;
1445
- }
1446
- }
1447
-
1448
- export interface TaxAmount {
1449
- /**
1450
- * The amount of additional tax incurred by this tax rate.
1451
- */
1452
- amount: string;
1453
-
1454
- /**
1455
- * The human-readable description of the applied tax rate.
1456
- */
1457
- tax_rate_description: string;
1458
-
1459
- /**
1460
- * The tax rate percentage, out of 100.
1461
- */
1462
- tax_rate_percentage: string | null;
1463
- }
1464
- }
1465
-
1466
- export interface Maximum {
1467
- /**
1468
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
1469
- * phase maximums, this can be a subset of prices.
1470
- */
1471
- applies_to_price_ids: Array<string>;
1472
-
1473
- /**
1474
- * The filters that determine which prices to apply this maximum to.
1475
- */
1476
- filters: Array<Maximum.Filter>;
1477
-
1478
- /**
1479
- * Maximum amount applied
1480
- */
1481
- maximum_amount: string;
1482
- }
1483
-
1484
- export namespace Maximum {
1485
- export interface Filter {
1486
- /**
1487
- * The property of the price to filter on.
1488
- */
1489
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1490
-
1491
- /**
1492
- * Should prices that match the filter be included or excluded.
1493
- */
1494
- operator: 'includes' | 'excludes';
1495
-
1496
- /**
1497
- * The IDs or values that match this filter.
1498
- */
1499
- values: Array<string>;
1500
- }
1501
- }
1502
-
1503
- export interface Minimum {
1504
- /**
1505
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
1506
- * phase minimums, this can be a subset of prices.
1507
- */
1508
- applies_to_price_ids: Array<string>;
1509
-
1510
- /**
1511
- * The filters that determine which prices to apply this minimum to.
1512
- */
1513
- filters: Array<Minimum.Filter>;
1514
-
1515
- /**
1516
- * Minimum amount applied
1517
- */
1518
- minimum_amount: string;
1519
- }
1520
-
1521
- export namespace Minimum {
1522
- export interface Filter {
1523
- /**
1524
- * The property of the price to filter on.
1525
- */
1526
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1527
-
1528
- /**
1529
- * Should prices that match the filter be included or excluded.
1530
- */
1531
- operator: 'includes' | 'excludes';
1532
-
1533
- /**
1534
- * The IDs or values that match this filter.
1535
- */
1536
- values: Array<string>;
1537
- }
1538
- }
1539
-
1540
- export interface PaymentAttempt {
1541
- /**
1542
- * The ID of the payment attempt.
1543
- */
1544
- id: string;
1545
-
1546
- /**
1547
- * The amount of the payment attempt.
1548
- */
1549
- amount: string;
1550
-
1551
- /**
1552
- * The time at which the payment attempt was created.
1553
- */
1554
- created_at: string;
1555
-
1556
- /**
1557
- * The payment provider that attempted to collect the payment.
1558
- */
1559
- payment_provider: 'stripe' | null;
1560
-
1561
- /**
1562
- * The ID of the payment attempt in the payment provider.
1563
- */
1564
- payment_provider_id: string | null;
1565
-
1566
- /**
1567
- * Whether the payment attempt succeeded.
1568
- */
1569
- succeeded: boolean;
1570
- }
1571
-
1572
- export interface ShippingAddress {
1573
- city: string | null;
1574
-
1575
- country: string | null;
1576
-
1577
- line1: string | null;
1578
-
1579
- line2: string | null;
1580
-
1581
- postal_code: string | null;
116
+ ): Core.APIPromise<Shared.Invoice> {
117
+ return this._client.post(`/invoices/${invoiceId}/mark_paid`, { body, ...options });
118
+ }
1582
119
 
1583
- state: string | null;
120
+ /**
121
+ * This endpoint collects payment for an invoice using the customer's default
122
+ * payment method. This action can only be taken on invoices with status "issued".
123
+ */
124
+ pay(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice> {
125
+ return this._client.post(`/invoices/${invoiceId}/pay`, options);
1584
126
  }
1585
127
 
1586
- export interface Subscription {
1587
- id: string;
128
+ /**
129
+ * This endpoint allows an invoice's status to be set the `void` status. This can
130
+ * only be done to invoices that are in the `issued` status.
131
+ *
132
+ * If the associated invoice has used the customer balance to change the amount
133
+ * due, the customer balance operation will be reverted. For example, if the
134
+ * invoice used $10 of customer balance, that amount will be added back to the
135
+ * customer balance upon voiding.
136
+ *
137
+ * If the invoice was used to purchase a credit block, but the invoice is not yet
138
+ * paid, the credit block will be voided. If the invoice was created due to a
139
+ * top-up, the top-up will be disabled.
140
+ */
141
+ void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice> {
142
+ return this._client.post(`/invoices/${invoiceId}/void`, options);
1588
143
  }
1589
144
  }
1590
145
 
@@ -1599,7 +154,7 @@ export interface InvoiceFetchUpcomingResponse {
1599
154
 
1600
155
  auto_collection: InvoiceFetchUpcomingResponse.AutoCollection;
1601
156
 
1602
- billing_address: InvoiceFetchUpcomingResponse.BillingAddress | null;
157
+ billing_address: Shared.Address | null;
1603
158
 
1604
159
  /**
1605
160
  * The creation time of the resource in Orb.
@@ -1616,7 +171,7 @@ export interface InvoiceFetchUpcomingResponse {
1616
171
  */
1617
172
  currency: string;
1618
173
 
1619
- customer: InvoiceFetchUpcomingResponse.Customer;
174
+ customer: Shared.CustomerMinified;
1620
175
 
1621
176
  customer_balance_transactions: Array<InvoiceFetchUpcomingResponse.CustomerBalanceTransaction>;
1622
177
 
@@ -1727,7 +282,7 @@ export interface InvoiceFetchUpcomingResponse {
1727
282
  * | Venezuela | `ve_rif` | Venezuelan RIF Number |
1728
283
  * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
1729
284
  */
1730
- customer_tax_id: InvoiceFetchUpcomingResponse.CustomerTaxID | null;
285
+ customer_tax_id: Shared.CustomerTaxID | null;
1731
286
 
1732
287
  /**
1733
288
  * @deprecated This field is deprecated in favor of `discounts`. If a `discounts`
@@ -1788,7 +343,7 @@ export interface InvoiceFetchUpcomingResponse {
1788
343
  */
1789
344
  line_items: Array<InvoiceFetchUpcomingResponse.LineItem>;
1790
345
 
1791
- maximum: InvoiceFetchUpcomingResponse.Maximum | null;
346
+ maximum: Shared.Maximum | null;
1792
347
 
1793
348
  maximum_amount: string | null;
1794
349
 
@@ -1805,7 +360,7 @@ export interface InvoiceFetchUpcomingResponse {
1805
360
  */
1806
361
  metadata: Record<string, string>;
1807
362
 
1808
- minimum: InvoiceFetchUpcomingResponse.Minimum | null;
363
+ minimum: Shared.Minimum | null;
1809
364
 
1810
365
  minimum_amount: string | null;
1811
366
 
@@ -1839,11 +394,11 @@ export interface InvoiceFetchUpcomingResponse {
1839
394
  */
1840
395
  scheduled_issue_at: string | null;
1841
396
 
1842
- shipping_address: InvoiceFetchUpcomingResponse.ShippingAddress | null;
397
+ shipping_address: Shared.Address | null;
1843
398
 
1844
399
  status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
1845
400
 
1846
- subscription: InvoiceFetchUpcomingResponse.Subscription | null;
401
+ subscription: Shared.SubscriptionMinified | null;
1847
402
 
1848
403
  /**
1849
404
  * The total before any discounts and minimums are applied.
@@ -1910,20 +465,6 @@ export namespace InvoiceFetchUpcomingResponse {
1910
465
  previously_attempted_at: string | null;
1911
466
  }
1912
467
 
1913
- export interface BillingAddress {
1914
- city: string | null;
1915
-
1916
- country: string | null;
1917
-
1918
- line1: string | null;
1919
-
1920
- line2: string | null;
1921
-
1922
- postal_code: string | null;
1923
-
1924
- state: string | null;
1925
- }
1926
-
1927
468
  export interface CreditNote {
1928
469
  id: string;
1929
470
 
@@ -1947,12 +488,6 @@ export namespace InvoiceFetchUpcomingResponse {
1947
488
  voided_at: string | null;
1948
489
  }
1949
490
 
1950
- export interface Customer {
1951
- id: string;
1952
-
1953
- external_customer_id: string | null;
1954
- }
1955
-
1956
491
  export interface CustomerBalanceTransaction {
1957
492
  /**
1958
493
  * A unique id for this transaction.
@@ -1980,7 +515,7 @@ export namespace InvoiceFetchUpcomingResponse {
1980
515
  */
1981
516
  created_at: string;
1982
517
 
1983
- credit_note: CustomerBalanceTransaction.CreditNote | null;
518
+ credit_note: Shared.CreditNoteTiny | null;
1984
519
 
1985
520
  /**
1986
521
  * An optional description provided for manual customer balance adjustments.
@@ -1993,7 +528,7 @@ export namespace InvoiceFetchUpcomingResponse {
1993
528
  */
1994
529
  ending_balance: string;
1995
530
 
1996
- invoice: CustomerBalanceTransaction.Invoice | null;
531
+ invoice: Shared.InvoiceTiny | null;
1997
532
 
1998
533
  /**
1999
534
  * The original value of the customer's balance prior to the transaction, in the
@@ -2004,286 +539,6 @@ export namespace InvoiceFetchUpcomingResponse {
2004
539
  type: 'increment' | 'decrement';
2005
540
  }
2006
541
 
2007
- export namespace CustomerBalanceTransaction {
2008
- export interface CreditNote {
2009
- /**
2010
- * The id of the Credit note
2011
- */
2012
- id: string;
2013
- }
2014
-
2015
- export interface Invoice {
2016
- /**
2017
- * The Invoice id
2018
- */
2019
- id: string;
2020
- }
2021
- }
2022
-
2023
- /**
2024
- * Tax IDs are commonly required to be displayed on customer invoices, which are
2025
- * added to the headers of invoices.
2026
- *
2027
- * ### Supported Tax ID Countries and Types
2028
- *
2029
- * | Country | Type | Description |
2030
- * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
2031
- * | Andorra | `ad_nrt` | Andorran NRT Number |
2032
- * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
2033
- * | Australia | `au_abn` | Australian Business Number (AU ABN) |
2034
- * | Australia | `au_arn` | Australian Taxation Office Reference Number |
2035
- * | Austria | `eu_vat` | European VAT Number |
2036
- * | Bahrain | `bh_vat` | Bahraini VAT Number |
2037
- * | Belgium | `eu_vat` | European VAT Number |
2038
- * | Bolivia | `bo_tin` | Bolivian Tax ID |
2039
- * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
2040
- * | Brazil | `br_cpf` | Brazilian CPF Number |
2041
- * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
2042
- * | Bulgaria | `eu_vat` | European VAT Number |
2043
- * | Canada | `ca_bn` | Canadian BN |
2044
- * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
2045
- * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
2046
- * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
2047
- * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
2048
- * | Canada | `ca_qst` | Canadian QST Number (Québec) |
2049
- * | Chile | `cl_tin` | Chilean TIN |
2050
- * | China | `cn_tin` | Chinese Tax ID |
2051
- * | Colombia | `co_nit` | Colombian NIT Number |
2052
- * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
2053
- * | Croatia | `eu_vat` | European VAT Number |
2054
- * | Cyprus | `eu_vat` | European VAT Number |
2055
- * | Czech Republic | `eu_vat` | European VAT Number |
2056
- * | Denmark | `eu_vat` | European VAT Number |
2057
- * | Dominican Republic | `do_rcn` | Dominican RCN Number |
2058
- * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
2059
- * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
2060
- * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
2061
- * | Estonia | `eu_vat` | European VAT Number |
2062
- * | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
2063
- * | Finland | `eu_vat` | European VAT Number |
2064
- * | France | `eu_vat` | European VAT Number |
2065
- * | Georgia | `ge_vat` | Georgian VAT |
2066
- * | Germany | `eu_vat` | European VAT Number |
2067
- * | Greece | `eu_vat` | European VAT Number |
2068
- * | Hong Kong | `hk_br` | Hong Kong BR Number |
2069
- * | Hungary | `eu_vat` | European VAT Number |
2070
- * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
2071
- * | Iceland | `is_vat` | Icelandic VAT |
2072
- * | India | `in_gst` | Indian GST Number |
2073
- * | Indonesia | `id_npwp` | Indonesian NPWP Number |
2074
- * | Ireland | `eu_vat` | European VAT Number |
2075
- * | Israel | `il_vat` | Israel VAT |
2076
- * | Italy | `eu_vat` | European VAT Number |
2077
- * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
2078
- * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
2079
- * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
2080
- * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
2081
- * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
2082
- * | Latvia | `eu_vat` | European VAT Number |
2083
- * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
2084
- * | Lithuania | `eu_vat` | European VAT Number |
2085
- * | Luxembourg | `eu_vat` | European VAT Number |
2086
- * | Malaysia | `my_frp` | Malaysian FRP Number |
2087
- * | Malaysia | `my_itn` | Malaysian ITN |
2088
- * | Malaysia | `my_sst` | Malaysian SST Number |
2089
- * | Malta | `eu_vat ` | European VAT Number |
2090
- * | Mexico | `mx_rfc` | Mexican RFC Number |
2091
- * | Netherlands | `eu_vat` | European VAT Number |
2092
- * | New Zealand | `nz_gst` | New Zealand GST Number |
2093
- * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
2094
- * | Norway | `no_vat` | Norwegian VAT Number |
2095
- * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
2096
- * | Oman | `om_vat` | Omani VAT Number |
2097
- * | Peru | `pe_ruc` | Peruvian RUC Number |
2098
- * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
2099
- * | Poland | `eu_vat` | European VAT Number |
2100
- * | Portugal | `eu_vat` | European VAT Number |
2101
- * | Romania | `eu_vat` | European VAT Number |
2102
- * | Romania | `ro_tin` | Romanian Tax ID Number |
2103
- * | Russia | `ru_inn` | Russian INN |
2104
- * | Russia | `ru_kpp` | Russian KPP |
2105
- * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
2106
- * | Serbia | `rs_pib` | Serbian PIB Number |
2107
- * | Singapore | `sg_gst` | Singaporean GST |
2108
- * | Singapore | `sg_uen` | Singaporean UEN |
2109
- * | Slovakia | `eu_vat` | European VAT Number |
2110
- * | Slovenia | `eu_vat` | European VAT Number |
2111
- * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
2112
- * | South Africa | `za_vat` | South African VAT Number |
2113
- * | South Korea | `kr_brn` | Korean BRN |
2114
- * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
2115
- * | Spain | `eu_vat` | European VAT Number |
2116
- * | Sweden | `eu_vat` | European VAT Number |
2117
- * | Switzerland | `ch_vat` | Switzerland VAT Number |
2118
- * | Taiwan | `tw_vat` | Taiwanese VAT |
2119
- * | Thailand | `th_vat` | Thai VAT |
2120
- * | Turkey | `tr_tin` | Turkish Tax Identification Number |
2121
- * | Ukraine | `ua_vat` | Ukrainian VAT |
2122
- * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
2123
- * | United Kingdom | `eu_vat` | Northern Ireland VAT Number |
2124
- * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
2125
- * | United States | `us_ein` | United States EIN |
2126
- * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
2127
- * | Venezuela | `ve_rif` | Venezuelan RIF Number |
2128
- * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
2129
- */
2130
- export interface CustomerTaxID {
2131
- country:
2132
- | 'AD'
2133
- | 'AE'
2134
- | 'AR'
2135
- | 'AT'
2136
- | 'AU'
2137
- | 'BE'
2138
- | 'BG'
2139
- | 'BH'
2140
- | 'BO'
2141
- | 'BR'
2142
- | 'CA'
2143
- | 'CH'
2144
- | 'CL'
2145
- | 'CN'
2146
- | 'CO'
2147
- | 'CR'
2148
- | 'CY'
2149
- | 'CZ'
2150
- | 'DE'
2151
- | 'DK'
2152
- | 'EE'
2153
- | 'DO'
2154
- | 'EC'
2155
- | 'EG'
2156
- | 'ES'
2157
- | 'EU'
2158
- | 'FI'
2159
- | 'FR'
2160
- | 'GB'
2161
- | 'GE'
2162
- | 'GR'
2163
- | 'HK'
2164
- | 'HR'
2165
- | 'HU'
2166
- | 'ID'
2167
- | 'IE'
2168
- | 'IL'
2169
- | 'IN'
2170
- | 'IS'
2171
- | 'IT'
2172
- | 'JP'
2173
- | 'KE'
2174
- | 'KR'
2175
- | 'KZ'
2176
- | 'LI'
2177
- | 'LT'
2178
- | 'LU'
2179
- | 'LV'
2180
- | 'MT'
2181
- | 'MX'
2182
- | 'MY'
2183
- | 'NG'
2184
- | 'NL'
2185
- | 'NO'
2186
- | 'NZ'
2187
- | 'OM'
2188
- | 'PE'
2189
- | 'PH'
2190
- | 'PL'
2191
- | 'PT'
2192
- | 'RO'
2193
- | 'RS'
2194
- | 'RU'
2195
- | 'SA'
2196
- | 'SE'
2197
- | 'SG'
2198
- | 'SI'
2199
- | 'SK'
2200
- | 'SV'
2201
- | 'TH'
2202
- | 'TR'
2203
- | 'TW'
2204
- | 'UA'
2205
- | 'US'
2206
- | 'UY'
2207
- | 'VE'
2208
- | 'VN'
2209
- | 'ZA';
2210
-
2211
- type:
2212
- | 'ad_nrt'
2213
- | 'ae_trn'
2214
- | 'ar_cuit'
2215
- | 'eu_vat'
2216
- | 'au_abn'
2217
- | 'au_arn'
2218
- | 'bg_uic'
2219
- | 'bh_vat'
2220
- | 'bo_tin'
2221
- | 'br_cnpj'
2222
- | 'br_cpf'
2223
- | 'ca_bn'
2224
- | 'ca_gst_hst'
2225
- | 'ca_pst_bc'
2226
- | 'ca_pst_mb'
2227
- | 'ca_pst_sk'
2228
- | 'ca_qst'
2229
- | 'ch_vat'
2230
- | 'cl_tin'
2231
- | 'cn_tin'
2232
- | 'co_nit'
2233
- | 'cr_tin'
2234
- | 'do_rcn'
2235
- | 'ec_ruc'
2236
- | 'eg_tin'
2237
- | 'es_cif'
2238
- | 'eu_oss_vat'
2239
- | 'gb_vat'
2240
- | 'ge_vat'
2241
- | 'hk_br'
2242
- | 'hu_tin'
2243
- | 'id_npwp'
2244
- | 'il_vat'
2245
- | 'in_gst'
2246
- | 'is_vat'
2247
- | 'jp_cn'
2248
- | 'jp_rn'
2249
- | 'jp_trn'
2250
- | 'ke_pin'
2251
- | 'kr_brn'
2252
- | 'kz_bin'
2253
- | 'li_uid'
2254
- | 'mx_rfc'
2255
- | 'my_frp'
2256
- | 'my_itn'
2257
- | 'my_sst'
2258
- | 'ng_tin'
2259
- | 'no_vat'
2260
- | 'no_voec'
2261
- | 'nz_gst'
2262
- | 'om_vat'
2263
- | 'pe_ruc'
2264
- | 'ph_tin'
2265
- | 'ro_tin'
2266
- | 'rs_pib'
2267
- | 'ru_inn'
2268
- | 'ru_kpp'
2269
- | 'sa_vat'
2270
- | 'sg_gst'
2271
- | 'sg_uen'
2272
- | 'si_tin'
2273
- | 'sv_nit'
2274
- | 'th_vat'
2275
- | 'tr_tin'
2276
- | 'tw_vat'
2277
- | 'ua_vat'
2278
- | 'us_ein'
2279
- | 'uy_ruc'
2280
- | 've_rif'
2281
- | 'vn_tin'
2282
- | 'za_vat';
2283
-
2284
- value: string;
2285
- }
2286
-
2287
542
  export interface LineItem {
2288
543
  /**
2289
544
  * A unique ID for this line item.
@@ -2302,11 +557,11 @@ export namespace InvoiceFetchUpcomingResponse {
2302
557
  * discounts -> minimums -> maximums).
2303
558
  */
2304
559
  adjustments: Array<
2305
- | LineItem.MonetaryUsageDiscountAdjustment
2306
- | LineItem.MonetaryAmountDiscountAdjustment
2307
- | LineItem.MonetaryPercentageDiscountAdjustment
2308
- | LineItem.MonetaryMinimumAdjustment
2309
- | LineItem.MonetaryMaximumAdjustment
560
+ | Shared.MonetaryUsageDiscountAdjustment
561
+ | Shared.MonetaryAmountDiscountAdjustment
562
+ | Shared.MonetaryPercentageDiscountAdjustment
563
+ | Shared.MonetaryMinimumAdjustment
564
+ | Shared.MonetaryMaximumAdjustment
2310
565
  >;
2311
566
 
2312
567
  /**
@@ -2342,7 +597,7 @@ export namespace InvoiceFetchUpcomingResponse {
2342
597
  /**
2343
598
  * @deprecated This field is deprecated in favor of `adjustments`.
2344
599
  */
2345
- maximum: LineItem.Maximum | null;
600
+ maximum: Shared.Maximum | null;
2346
601
 
2347
602
  /**
2348
603
  * @deprecated This field is deprecated in favor of `adjustments`.
@@ -2352,7 +607,7 @@ export namespace InvoiceFetchUpcomingResponse {
2352
607
  /**
2353
608
  * @deprecated This field is deprecated in favor of `adjustments`.
2354
609
  */
2355
- minimum: LineItem.Minimum | null;
610
+ minimum: Shared.Minimum | null;
2356
611
 
2357
612
  /**
2358
613
  * @deprecated This field is deprecated in favor of `adjustments`.
@@ -2381,7 +636,7 @@ export namespace InvoiceFetchUpcomingResponse {
2381
636
  * For more on the types of prices, see
2382
637
  * [the core concepts documentation](/core-concepts#plan-and-price)
2383
638
  */
2384
- price: PricesAPI.Price;
639
+ price: Shared.Price;
2385
640
 
2386
641
  /**
2387
642
  * Either the fixed fee quantity or the usage during the service period.
@@ -2397,7 +652,7 @@ export namespace InvoiceFetchUpcomingResponse {
2397
652
  * For complex pricing structures, the line item can be broken down further in
2398
653
  * `sub_line_items`.
2399
654
  */
2400
- sub_line_items: Array<LineItem.MatrixSubLineItem | LineItem.TierSubLineItem | LineItem.OtherSubLineItem>;
655
+ sub_line_items: Array<Shared.MatrixSubLineItem | Shared.TierSubLineItem | Shared.OtherSubLineItem>;
2401
656
 
2402
657
  /**
2403
658
  * The line amount before before any adjustments.
@@ -2408,7 +663,7 @@ export namespace InvoiceFetchUpcomingResponse {
2408
663
  * An array of tax rates and their incurred tax amounts. Empty if no tax
2409
664
  * integration is configured.
2410
665
  */
2411
- tax_amounts: Array<LineItem.TaxAmount>;
666
+ tax_amounts: Array<Shared.TaxAmount>;
2412
667
 
2413
668
  /**
2414
669
  * A list of customer ids that were used to calculate the usage for this line item.
@@ -2416,566 +671,6 @@ export namespace InvoiceFetchUpcomingResponse {
2416
671
  usage_customer_ids: Array<string> | null;
2417
672
  }
2418
673
 
2419
- export namespace LineItem {
2420
- export interface MonetaryUsageDiscountAdjustment {
2421
- id: string;
2422
-
2423
- adjustment_type: 'usage_discount';
2424
-
2425
- /**
2426
- * The value applied by an adjustment.
2427
- */
2428
- amount: string;
2429
-
2430
- /**
2431
- * @deprecated The price IDs that this adjustment applies to.
2432
- */
2433
- applies_to_price_ids: Array<string>;
2434
-
2435
- /**
2436
- * The filters that determine which prices to apply this adjustment to.
2437
- */
2438
- filters: Array<MonetaryUsageDiscountAdjustment.Filter>;
2439
-
2440
- /**
2441
- * True for adjustments that apply to an entire invocice, false for adjustments
2442
- * that apply to only one price.
2443
- */
2444
- is_invoice_level: boolean;
2445
-
2446
- /**
2447
- * The reason for the adjustment.
2448
- */
2449
- reason: string | null;
2450
-
2451
- /**
2452
- * The number of usage units by which to discount the price this adjustment applies
2453
- * to in a given billing period.
2454
- */
2455
- usage_discount: number;
2456
- }
2457
-
2458
- export namespace MonetaryUsageDiscountAdjustment {
2459
- export interface Filter {
2460
- /**
2461
- * The property of the price to filter on.
2462
- */
2463
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2464
-
2465
- /**
2466
- * Should prices that match the filter be included or excluded.
2467
- */
2468
- operator: 'includes' | 'excludes';
2469
-
2470
- /**
2471
- * The IDs or values that match this filter.
2472
- */
2473
- values: Array<string>;
2474
- }
2475
- }
2476
-
2477
- export interface MonetaryAmountDiscountAdjustment {
2478
- id: string;
2479
-
2480
- adjustment_type: 'amount_discount';
2481
-
2482
- /**
2483
- * The value applied by an adjustment.
2484
- */
2485
- amount: string;
2486
-
2487
- /**
2488
- * The amount by which to discount the prices this adjustment applies to in a given
2489
- * billing period.
2490
- */
2491
- amount_discount: string;
2492
-
2493
- /**
2494
- * @deprecated The price IDs that this adjustment applies to.
2495
- */
2496
- applies_to_price_ids: Array<string>;
2497
-
2498
- /**
2499
- * The filters that determine which prices to apply this adjustment to.
2500
- */
2501
- filters: Array<MonetaryAmountDiscountAdjustment.Filter>;
2502
-
2503
- /**
2504
- * True for adjustments that apply to an entire invocice, false for adjustments
2505
- * that apply to only one price.
2506
- */
2507
- is_invoice_level: boolean;
2508
-
2509
- /**
2510
- * The reason for the adjustment.
2511
- */
2512
- reason: string | null;
2513
- }
2514
-
2515
- export namespace MonetaryAmountDiscountAdjustment {
2516
- export interface Filter {
2517
- /**
2518
- * The property of the price to filter on.
2519
- */
2520
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2521
-
2522
- /**
2523
- * Should prices that match the filter be included or excluded.
2524
- */
2525
- operator: 'includes' | 'excludes';
2526
-
2527
- /**
2528
- * The IDs or values that match this filter.
2529
- */
2530
- values: Array<string>;
2531
- }
2532
- }
2533
-
2534
- export interface MonetaryPercentageDiscountAdjustment {
2535
- id: string;
2536
-
2537
- adjustment_type: 'percentage_discount';
2538
-
2539
- /**
2540
- * The value applied by an adjustment.
2541
- */
2542
- amount: string;
2543
-
2544
- /**
2545
- * @deprecated The price IDs that this adjustment applies to.
2546
- */
2547
- applies_to_price_ids: Array<string>;
2548
-
2549
- /**
2550
- * The filters that determine which prices to apply this adjustment to.
2551
- */
2552
- filters: Array<MonetaryPercentageDiscountAdjustment.Filter>;
2553
-
2554
- /**
2555
- * True for adjustments that apply to an entire invocice, false for adjustments
2556
- * that apply to only one price.
2557
- */
2558
- is_invoice_level: boolean;
2559
-
2560
- /**
2561
- * The percentage (as a value between 0 and 1) by which to discount the price
2562
- * intervals this adjustment applies to in a given billing period.
2563
- */
2564
- percentage_discount: number;
2565
-
2566
- /**
2567
- * The reason for the adjustment.
2568
- */
2569
- reason: string | null;
2570
- }
2571
-
2572
- export namespace MonetaryPercentageDiscountAdjustment {
2573
- export interface Filter {
2574
- /**
2575
- * The property of the price to filter on.
2576
- */
2577
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2578
-
2579
- /**
2580
- * Should prices that match the filter be included or excluded.
2581
- */
2582
- operator: 'includes' | 'excludes';
2583
-
2584
- /**
2585
- * The IDs or values that match this filter.
2586
- */
2587
- values: Array<string>;
2588
- }
2589
- }
2590
-
2591
- export interface MonetaryMinimumAdjustment {
2592
- id: string;
2593
-
2594
- adjustment_type: 'minimum';
2595
-
2596
- /**
2597
- * The value applied by an adjustment.
2598
- */
2599
- amount: string;
2600
-
2601
- /**
2602
- * @deprecated The price IDs that this adjustment applies to.
2603
- */
2604
- applies_to_price_ids: Array<string>;
2605
-
2606
- /**
2607
- * The filters that determine which prices to apply this adjustment to.
2608
- */
2609
- filters: Array<MonetaryMinimumAdjustment.Filter>;
2610
-
2611
- /**
2612
- * True for adjustments that apply to an entire invocice, false for adjustments
2613
- * that apply to only one price.
2614
- */
2615
- is_invoice_level: boolean;
2616
-
2617
- /**
2618
- * The item ID that revenue from this minimum will be attributed to.
2619
- */
2620
- item_id: string;
2621
-
2622
- /**
2623
- * The minimum amount to charge in a given billing period for the prices this
2624
- * adjustment applies to.
2625
- */
2626
- minimum_amount: string;
2627
-
2628
- /**
2629
- * The reason for the adjustment.
2630
- */
2631
- reason: string | null;
2632
- }
2633
-
2634
- export namespace MonetaryMinimumAdjustment {
2635
- export interface Filter {
2636
- /**
2637
- * The property of the price to filter on.
2638
- */
2639
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2640
-
2641
- /**
2642
- * Should prices that match the filter be included or excluded.
2643
- */
2644
- operator: 'includes' | 'excludes';
2645
-
2646
- /**
2647
- * The IDs or values that match this filter.
2648
- */
2649
- values: Array<string>;
2650
- }
2651
- }
2652
-
2653
- export interface MonetaryMaximumAdjustment {
2654
- id: string;
2655
-
2656
- adjustment_type: 'maximum';
2657
-
2658
- /**
2659
- * The value applied by an adjustment.
2660
- */
2661
- amount: string;
2662
-
2663
- /**
2664
- * @deprecated The price IDs that this adjustment applies to.
2665
- */
2666
- applies_to_price_ids: Array<string>;
2667
-
2668
- /**
2669
- * The filters that determine which prices to apply this adjustment to.
2670
- */
2671
- filters: Array<MonetaryMaximumAdjustment.Filter>;
2672
-
2673
- /**
2674
- * True for adjustments that apply to an entire invocice, false for adjustments
2675
- * that apply to only one price.
2676
- */
2677
- is_invoice_level: boolean;
2678
-
2679
- /**
2680
- * The maximum amount to charge in a given billing period for the prices this
2681
- * adjustment applies to.
2682
- */
2683
- maximum_amount: string;
2684
-
2685
- /**
2686
- * The reason for the adjustment.
2687
- */
2688
- reason: string | null;
2689
- }
2690
-
2691
- export namespace MonetaryMaximumAdjustment {
2692
- export interface Filter {
2693
- /**
2694
- * The property of the price to filter on.
2695
- */
2696
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2697
-
2698
- /**
2699
- * Should prices that match the filter be included or excluded.
2700
- */
2701
- operator: 'includes' | 'excludes';
2702
-
2703
- /**
2704
- * The IDs or values that match this filter.
2705
- */
2706
- values: Array<string>;
2707
- }
2708
- }
2709
-
2710
- /**
2711
- * @deprecated This field is deprecated in favor of `adjustments`.
2712
- */
2713
- export interface Maximum {
2714
- /**
2715
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
2716
- * phase maximums, this can be a subset of prices.
2717
- */
2718
- applies_to_price_ids: Array<string>;
2719
-
2720
- /**
2721
- * The filters that determine which prices to apply this maximum to.
2722
- */
2723
- filters: Array<Maximum.Filter>;
2724
-
2725
- /**
2726
- * Maximum amount applied
2727
- */
2728
- maximum_amount: string;
2729
- }
2730
-
2731
- export namespace Maximum {
2732
- export interface Filter {
2733
- /**
2734
- * The property of the price to filter on.
2735
- */
2736
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2737
-
2738
- /**
2739
- * Should prices that match the filter be included or excluded.
2740
- */
2741
- operator: 'includes' | 'excludes';
2742
-
2743
- /**
2744
- * The IDs or values that match this filter.
2745
- */
2746
- values: Array<string>;
2747
- }
2748
- }
2749
-
2750
- /**
2751
- * @deprecated This field is deprecated in favor of `adjustments`.
2752
- */
2753
- export interface Minimum {
2754
- /**
2755
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
2756
- * phase minimums, this can be a subset of prices.
2757
- */
2758
- applies_to_price_ids: Array<string>;
2759
-
2760
- /**
2761
- * The filters that determine which prices to apply this minimum to.
2762
- */
2763
- filters: Array<Minimum.Filter>;
2764
-
2765
- /**
2766
- * Minimum amount applied
2767
- */
2768
- minimum_amount: string;
2769
- }
2770
-
2771
- export namespace Minimum {
2772
- export interface Filter {
2773
- /**
2774
- * The property of the price to filter on.
2775
- */
2776
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2777
-
2778
- /**
2779
- * Should prices that match the filter be included or excluded.
2780
- */
2781
- operator: 'includes' | 'excludes';
2782
-
2783
- /**
2784
- * The IDs or values that match this filter.
2785
- */
2786
- values: Array<string>;
2787
- }
2788
- }
2789
-
2790
- export interface MatrixSubLineItem {
2791
- /**
2792
- * The total amount for this sub line item.
2793
- */
2794
- amount: string;
2795
-
2796
- grouping: MatrixSubLineItem.Grouping | null;
2797
-
2798
- matrix_config: MatrixSubLineItem.MatrixConfig;
2799
-
2800
- name: string;
2801
-
2802
- quantity: number;
2803
-
2804
- type: 'matrix';
2805
- }
2806
-
2807
- export namespace MatrixSubLineItem {
2808
- export interface Grouping {
2809
- key: string;
2810
-
2811
- /**
2812
- * No value indicates the default group
2813
- */
2814
- value: string | null;
2815
- }
2816
-
2817
- export interface MatrixConfig {
2818
- /**
2819
- * The ordered dimension values for this line item.
2820
- */
2821
- dimension_values: Array<string | null>;
2822
- }
2823
- }
2824
-
2825
- export interface TierSubLineItem {
2826
- /**
2827
- * The total amount for this sub line item.
2828
- */
2829
- amount: string;
2830
-
2831
- grouping: TierSubLineItem.Grouping | null;
2832
-
2833
- name: string;
2834
-
2835
- quantity: number;
2836
-
2837
- tier_config: TierSubLineItem.TierConfig;
2838
-
2839
- type: 'tier';
2840
- }
2841
-
2842
- export namespace TierSubLineItem {
2843
- export interface Grouping {
2844
- key: string;
2845
-
2846
- /**
2847
- * No value indicates the default group
2848
- */
2849
- value: string | null;
2850
- }
2851
-
2852
- export interface TierConfig {
2853
- first_unit: number;
2854
-
2855
- last_unit: number | null;
2856
-
2857
- unit_amount: string;
2858
- }
2859
- }
2860
-
2861
- export interface OtherSubLineItem {
2862
- /**
2863
- * The total amount for this sub line item.
2864
- */
2865
- amount: string;
2866
-
2867
- grouping: OtherSubLineItem.Grouping | null;
2868
-
2869
- name: string;
2870
-
2871
- quantity: number;
2872
-
2873
- type: "'null'";
2874
- }
2875
-
2876
- export namespace OtherSubLineItem {
2877
- export interface Grouping {
2878
- key: string;
2879
-
2880
- /**
2881
- * No value indicates the default group
2882
- */
2883
- value: string | null;
2884
- }
2885
- }
2886
-
2887
- export interface TaxAmount {
2888
- /**
2889
- * The amount of additional tax incurred by this tax rate.
2890
- */
2891
- amount: string;
2892
-
2893
- /**
2894
- * The human-readable description of the applied tax rate.
2895
- */
2896
- tax_rate_description: string;
2897
-
2898
- /**
2899
- * The tax rate percentage, out of 100.
2900
- */
2901
- tax_rate_percentage: string | null;
2902
- }
2903
- }
2904
-
2905
- export interface Maximum {
2906
- /**
2907
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
2908
- * phase maximums, this can be a subset of prices.
2909
- */
2910
- applies_to_price_ids: Array<string>;
2911
-
2912
- /**
2913
- * The filters that determine which prices to apply this maximum to.
2914
- */
2915
- filters: Array<Maximum.Filter>;
2916
-
2917
- /**
2918
- * Maximum amount applied
2919
- */
2920
- maximum_amount: string;
2921
- }
2922
-
2923
- export namespace Maximum {
2924
- export interface Filter {
2925
- /**
2926
- * The property of the price to filter on.
2927
- */
2928
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2929
-
2930
- /**
2931
- * Should prices that match the filter be included or excluded.
2932
- */
2933
- operator: 'includes' | 'excludes';
2934
-
2935
- /**
2936
- * The IDs or values that match this filter.
2937
- */
2938
- values: Array<string>;
2939
- }
2940
- }
2941
-
2942
- export interface Minimum {
2943
- /**
2944
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
2945
- * phase minimums, this can be a subset of prices.
2946
- */
2947
- applies_to_price_ids: Array<string>;
2948
-
2949
- /**
2950
- * The filters that determine which prices to apply this minimum to.
2951
- */
2952
- filters: Array<Minimum.Filter>;
2953
-
2954
- /**
2955
- * Minimum amount applied
2956
- */
2957
- minimum_amount: string;
2958
- }
2959
-
2960
- export namespace Minimum {
2961
- export interface Filter {
2962
- /**
2963
- * The property of the price to filter on.
2964
- */
2965
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2966
-
2967
- /**
2968
- * Should prices that match the filter be included or excluded.
2969
- */
2970
- operator: 'includes' | 'excludes';
2971
-
2972
- /**
2973
- * The IDs or values that match this filter.
2974
- */
2975
- values: Array<string>;
2976
- }
2977
- }
2978
-
2979
674
  export interface PaymentAttempt {
2980
675
  /**
2981
676
  * The ID of the payment attempt.
@@ -3007,24 +702,6 @@ export namespace InvoiceFetchUpcomingResponse {
3007
702
  */
3008
703
  succeeded: boolean;
3009
704
  }
3010
-
3011
- export interface ShippingAddress {
3012
- city: string | null;
3013
-
3014
- country: string | null;
3015
-
3016
- line1: string | null;
3017
-
3018
- line2: string | null;
3019
-
3020
- postal_code: string | null;
3021
-
3022
- state: string | null;
3023
- }
3024
-
3025
- export interface Subscription {
3026
- id: string;
3027
- }
3028
705
  }
3029
706
 
3030
707
  export interface InvoiceCreateParams {
@@ -3113,16 +790,7 @@ export namespace InvoiceCreateParams {
3113
790
  */
3114
791
  start_date: string;
3115
792
 
3116
- unit_config: LineItem.UnitConfig;
3117
- }
3118
-
3119
- export namespace LineItem {
3120
- export interface UnitConfig {
3121
- /**
3122
- * Rate per unit of usage
3123
- */
3124
- unit_amount: string;
3125
- }
793
+ unit_config: Shared.UnitConfig;
3126
794
  }
3127
795
  }
3128
796
 
@@ -3209,13 +877,9 @@ export interface InvoiceMarkPaidParams {
3209
877
  notes?: string | null;
3210
878
  }
3211
879
 
3212
- Invoices.InvoicesPage = InvoicesPage;
3213
-
3214
880
  export declare namespace Invoices {
3215
881
  export {
3216
- type Invoice as Invoice,
3217
882
  type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
3218
- InvoicesPage as InvoicesPage,
3219
883
  type InvoiceCreateParams as InvoiceCreateParams,
3220
884
  type InvoiceUpdateParams as InvoiceUpdateParams,
3221
885
  type InvoiceListParams as InvoiceListParams,
@@ -3224,3 +888,5 @@ export declare namespace Invoices {
3224
888
  type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
3225
889
  };
3226
890
  }
891
+
892
+ export { InvoicesPage };