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
@@ -1,13 +1,13 @@
1
1
  import { APIResource } from "../resource.js";
2
2
  import * as Core from "../core.js";
3
3
  import * as Shared from "./shared.js";
4
- import * as PricesAPI from "./prices/prices.js";
5
- import { Page, type PageParams } from "../pagination.js";
4
+ import { InvoicesPage } from "./shared.js";
5
+ import { type PageParams } from "../pagination.js";
6
6
  export declare class Invoices extends APIResource {
7
7
  /**
8
8
  * This endpoint is used to create a one-off invoice for a customer.
9
9
  */
10
- create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
10
+ create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
11
11
  /**
12
12
  * This endpoint allows you to update the `metadata` property on an invoice. If you
13
13
  * pass null for the metadata value, it will clear any existing metadata for that
@@ -15,7 +15,7 @@ export declare class Invoices extends APIResource {
15
15
  *
16
16
  * `metadata` can be modified regardless of invoice state.
17
17
  */
18
- update(invoiceId: string, body: InvoiceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
18
+ update(invoiceId: string, body: InvoiceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
19
19
  /**
20
20
  * This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an
21
21
  * account in a list format.
@@ -31,13 +31,13 @@ export declare class Invoices extends APIResource {
31
31
  * values for each draft invoice, which may not always be up-to-date since Orb
32
32
  * regularly refreshes invoices asynchronously.
33
33
  */
34
- list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
35
- list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
34
+ list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Shared.Invoice>;
35
+ list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Shared.Invoice>;
36
36
  /**
37
37
  * This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an
38
38
  * identifier.
39
39
  */
40
- fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
40
+ fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
41
41
  /**
42
42
  * This endpoint can be used to fetch the upcoming
43
43
  * [invoice](/core-concepts#invoice) for the current billing period given a
@@ -52,18 +52,18 @@ export declare class Invoices extends APIResource {
52
52
  * sending emails, auto-collecting payment, syncing the invoice to external
53
53
  * providers, etc).
54
54
  */
55
- issue(invoiceId: string, body?: InvoiceIssueParams, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
56
- issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
55
+ issue(invoiceId: string, body?: InvoiceIssueParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
56
+ issue(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
57
57
  /**
58
58
  * This endpoint allows an invoice's status to be set the `paid` status. This can
59
59
  * only be done to invoices that are in the `issued` status.
60
60
  */
61
- markPaid(invoiceId: string, body: InvoiceMarkPaidParams, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
61
+ markPaid(invoiceId: string, body: InvoiceMarkPaidParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
62
62
  /**
63
63
  * This endpoint collects payment for an invoice using the customer's default
64
64
  * payment method. This action can only be taken on invoices with status "issued".
65
65
  */
66
- pay(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
66
+ pay(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
67
67
  /**
68
68
  * This endpoint allows an invoice's status to be set the `void` status. This can
69
69
  * only be done to invoices that are in the `issued` status.
@@ -77,1071 +77,7 @@ export declare class Invoices extends APIResource {
77
77
  * paid, the credit block will be voided. If the invoice was created due to a
78
78
  * top-up, the top-up will be disabled.
79
79
  */
80
- void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
81
- }
82
- export declare class InvoicesPage extends Page<Invoice> {
83
- }
84
- /**
85
- * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity,
86
- * representing the request for payment for a single subscription. This includes a
87
- * set of line items, which correspond to prices in the subscription's plan and can
88
- * represent fixed recurring fees or usage-based fees. They are generated at the
89
- * end of a billing period, or as the result of an action, such as a cancellation.
90
- */
91
- export interface Invoice {
92
- id: string;
93
- /**
94
- * This is the final amount required to be charged to the customer and reflects the
95
- * application of the customer balance to the `total` of the invoice.
96
- */
97
- amount_due: string;
98
- auto_collection: Invoice.AutoCollection;
99
- billing_address: Invoice.BillingAddress | null;
100
- /**
101
- * The creation time of the resource in Orb.
102
- */
103
- created_at: string;
104
- /**
105
- * A list of credit notes associated with the invoice
106
- */
107
- credit_notes: Array<Invoice.CreditNote>;
108
- /**
109
- * An ISO 4217 currency string or `credits`
110
- */
111
- currency: string;
112
- customer: Invoice.Customer;
113
- customer_balance_transactions: Array<Invoice.CustomerBalanceTransaction>;
114
- /**
115
- * Tax IDs are commonly required to be displayed on customer invoices, which are
116
- * added to the headers of invoices.
117
- *
118
- * ### Supported Tax ID Countries and Types
119
- *
120
- * | Country | Type | Description |
121
- * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
122
- * | Andorra | `ad_nrt` | Andorran NRT Number |
123
- * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
124
- * | Australia | `au_abn` | Australian Business Number (AU ABN) |
125
- * | Australia | `au_arn` | Australian Taxation Office Reference Number |
126
- * | Austria | `eu_vat` | European VAT Number |
127
- * | Bahrain | `bh_vat` | Bahraini VAT Number |
128
- * | Belgium | `eu_vat` | European VAT Number |
129
- * | Bolivia | `bo_tin` | Bolivian Tax ID |
130
- * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
131
- * | Brazil | `br_cpf` | Brazilian CPF Number |
132
- * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
133
- * | Bulgaria | `eu_vat` | European VAT Number |
134
- * | Canada | `ca_bn` | Canadian BN |
135
- * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
136
- * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
137
- * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
138
- * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
139
- * | Canada | `ca_qst` | Canadian QST Number (Québec) |
140
- * | Chile | `cl_tin` | Chilean TIN |
141
- * | China | `cn_tin` | Chinese Tax ID |
142
- * | Colombia | `co_nit` | Colombian NIT Number |
143
- * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
144
- * | Croatia | `eu_vat` | European VAT Number |
145
- * | Cyprus | `eu_vat` | European VAT Number |
146
- * | Czech Republic | `eu_vat` | European VAT Number |
147
- * | Denmark | `eu_vat` | European VAT Number |
148
- * | Dominican Republic | `do_rcn` | Dominican RCN Number |
149
- * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
150
- * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
151
- * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
152
- * | Estonia | `eu_vat` | European VAT Number |
153
- * | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
154
- * | Finland | `eu_vat` | European VAT Number |
155
- * | France | `eu_vat` | European VAT Number |
156
- * | Georgia | `ge_vat` | Georgian VAT |
157
- * | Germany | `eu_vat` | European VAT Number |
158
- * | Greece | `eu_vat` | European VAT Number |
159
- * | Hong Kong | `hk_br` | Hong Kong BR Number |
160
- * | Hungary | `eu_vat` | European VAT Number |
161
- * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
162
- * | Iceland | `is_vat` | Icelandic VAT |
163
- * | India | `in_gst` | Indian GST Number |
164
- * | Indonesia | `id_npwp` | Indonesian NPWP Number |
165
- * | Ireland | `eu_vat` | European VAT Number |
166
- * | Israel | `il_vat` | Israel VAT |
167
- * | Italy | `eu_vat` | European VAT Number |
168
- * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
169
- * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
170
- * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
171
- * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
172
- * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
173
- * | Latvia | `eu_vat` | European VAT Number |
174
- * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
175
- * | Lithuania | `eu_vat` | European VAT Number |
176
- * | Luxembourg | `eu_vat` | European VAT Number |
177
- * | Malaysia | `my_frp` | Malaysian FRP Number |
178
- * | Malaysia | `my_itn` | Malaysian ITN |
179
- * | Malaysia | `my_sst` | Malaysian SST Number |
180
- * | Malta | `eu_vat ` | European VAT Number |
181
- * | Mexico | `mx_rfc` | Mexican RFC Number |
182
- * | Netherlands | `eu_vat` | European VAT Number |
183
- * | New Zealand | `nz_gst` | New Zealand GST Number |
184
- * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
185
- * | Norway | `no_vat` | Norwegian VAT Number |
186
- * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
187
- * | Oman | `om_vat` | Omani VAT Number |
188
- * | Peru | `pe_ruc` | Peruvian RUC Number |
189
- * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
190
- * | Poland | `eu_vat` | European VAT Number |
191
- * | Portugal | `eu_vat` | European VAT Number |
192
- * | Romania | `eu_vat` | European VAT Number |
193
- * | Romania | `ro_tin` | Romanian Tax ID Number |
194
- * | Russia | `ru_inn` | Russian INN |
195
- * | Russia | `ru_kpp` | Russian KPP |
196
- * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
197
- * | Serbia | `rs_pib` | Serbian PIB Number |
198
- * | Singapore | `sg_gst` | Singaporean GST |
199
- * | Singapore | `sg_uen` | Singaporean UEN |
200
- * | Slovakia | `eu_vat` | European VAT Number |
201
- * | Slovenia | `eu_vat` | European VAT Number |
202
- * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
203
- * | South Africa | `za_vat` | South African VAT Number |
204
- * | South Korea | `kr_brn` | Korean BRN |
205
- * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
206
- * | Spain | `eu_vat` | European VAT Number |
207
- * | Sweden | `eu_vat` | European VAT Number |
208
- * | Switzerland | `ch_vat` | Switzerland VAT Number |
209
- * | Taiwan | `tw_vat` | Taiwanese VAT |
210
- * | Thailand | `th_vat` | Thai VAT |
211
- * | Turkey | `tr_tin` | Turkish Tax Identification Number |
212
- * | Ukraine | `ua_vat` | Ukrainian VAT |
213
- * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
214
- * | United Kingdom | `eu_vat` | Northern Ireland VAT Number |
215
- * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
216
- * | United States | `us_ein` | United States EIN |
217
- * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
218
- * | Venezuela | `ve_rif` | Venezuelan RIF Number |
219
- * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
220
- */
221
- customer_tax_id: Invoice.CustomerTaxID | null;
222
- /**
223
- * @deprecated This field is deprecated in favor of `discounts`. If a `discounts`
224
- * list is provided, the first discount in the list will be returned. If the list
225
- * is empty, `None` will be returned.
226
- */
227
- discount: unknown;
228
- discounts: Array<Shared.InvoiceLevelDiscount>;
229
- /**
230
- * When the invoice payment is due. The due date is null if the invoice is not yet
231
- * finalized.
232
- */
233
- due_date: string | null;
234
- /**
235
- * If the invoice has a status of `draft`, this will be the time that the invoice
236
- * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
237
- * true, the invoice will automatically begin issuing at this time.
238
- */
239
- eligible_to_issue_at: string | null;
240
- /**
241
- * A URL for the customer-facing invoice portal. This URL expires 30 days after the
242
- * invoice's due date, or 60 days after being re-generated through the UI.
243
- */
244
- hosted_invoice_url: string | null;
245
- /**
246
- * The scheduled date of the invoice
247
- */
248
- invoice_date: string;
249
- /**
250
- * Automatically generated invoice number to help track and reconcile invoices.
251
- * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
252
- * account or customer.
253
- */
254
- invoice_number: string;
255
- /**
256
- * The link to download the PDF representation of the `Invoice`.
257
- */
258
- invoice_pdf: string | null;
259
- invoice_source: 'subscription' | 'partial' | 'one_off';
260
- /**
261
- * If the invoice failed to issue, this will be the last time it failed to issue
262
- * (even if it is now in a different state.)
263
- */
264
- issue_failed_at: string | null;
265
- /**
266
- * If the invoice has been issued, this will be the time it transitioned to
267
- * `issued` (even if it is now in a different state.)
268
- */
269
- issued_at: string | null;
270
- /**
271
- * The breakdown of prices in this invoice.
272
- */
273
- line_items: Array<Invoice.LineItem>;
274
- maximum: Invoice.Maximum | null;
275
- maximum_amount: string | null;
276
- /**
277
- * Free-form text which is available on the invoice PDF and the Orb invoice portal.
278
- */
279
- memo: string | null;
280
- /**
281
- * User specified key-value pairs for the resource. If not present, this defaults
282
- * to an empty dictionary. Individual keys can be removed by setting the value to
283
- * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
284
- * `null`.
285
- */
286
- metadata: Record<string, string>;
287
- minimum: Invoice.Minimum | null;
288
- minimum_amount: string | null;
289
- /**
290
- * If the invoice has a status of `paid`, this gives a timestamp when the invoice
291
- * was paid.
292
- */
293
- paid_at: string | null;
294
- /**
295
- * A list of payment attempts associated with the invoice
296
- */
297
- payment_attempts: Array<Invoice.PaymentAttempt>;
298
- /**
299
- * If payment was attempted on this invoice but failed, this will be the time of
300
- * the most recent attempt.
301
- */
302
- payment_failed_at: string | null;
303
- /**
304
- * If payment was attempted on this invoice, this will be the start time of the
305
- * most recent attempt. This field is especially useful for delayed-notification
306
- * payment mechanisms (like bank transfers), where payment can take 3 days or more.
307
- */
308
- payment_started_at: string | null;
309
- /**
310
- * If the invoice is in draft, this timestamp will reflect when the invoice is
311
- * scheduled to be issued.
312
- */
313
- scheduled_issue_at: string | null;
314
- shipping_address: Invoice.ShippingAddress | null;
315
- status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
316
- subscription: Invoice.Subscription | null;
317
- /**
318
- * The total before any discounts and minimums are applied.
319
- */
320
- subtotal: string;
321
- /**
322
- * If the invoice failed to sync, this will be the last time an external invoicing
323
- * provider sync was attempted. This field will always be `null` for invoices using
324
- * Orb Invoicing.
325
- */
326
- sync_failed_at: string | null;
327
- /**
328
- * The total after any minimums and discounts have been applied.
329
- */
330
- total: string;
331
- /**
332
- * If the invoice has a status of `void`, this gives a timestamp when the invoice
333
- * was voided.
334
- */
335
- voided_at: string | null;
336
- /**
337
- * This is true if the invoice will be automatically issued in the future, and
338
- * false otherwise.
339
- */
340
- will_auto_issue: boolean;
341
- }
342
- export declare namespace Invoice {
343
- interface AutoCollection {
344
- /**
345
- * True only if auto-collection is enabled for this invoice.
346
- */
347
- enabled: boolean | null;
348
- /**
349
- * If the invoice is scheduled for auto-collection, this field will reflect when
350
- * the next attempt will occur. If dunning has been exhausted, or auto-collection
351
- * is not enabled for this invoice, this field will be `null`.
352
- */
353
- next_attempt_at: string | null;
354
- /**
355
- * Number of auto-collection payment attempts.
356
- */
357
- num_attempts: number | null;
358
- /**
359
- * If Orb has ever attempted payment auto-collection for this invoice, this field
360
- * will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
361
- * this can be used to tell whether the invoice is currently in dunning (that is,
362
- * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
363
- * if dunning has been exhausted (`previously_attempted_at` is non-null, but
364
- * `next_attempt_time` is null).
365
- */
366
- previously_attempted_at: string | null;
367
- }
368
- interface BillingAddress {
369
- city: string | null;
370
- country: string | null;
371
- line1: string | null;
372
- line2: string | null;
373
- postal_code: string | null;
374
- state: string | null;
375
- }
376
- interface CreditNote {
377
- id: string;
378
- credit_note_number: string;
379
- /**
380
- * An optional memo supplied on the credit note.
381
- */
382
- memo: string | null;
383
- reason: string;
384
- total: string;
385
- type: string;
386
- /**
387
- * If the credit note has a status of `void`, this gives a timestamp when the
388
- * credit note was voided.
389
- */
390
- voided_at: string | null;
391
- }
392
- interface Customer {
393
- id: string;
394
- external_customer_id: string | null;
395
- }
396
- interface CustomerBalanceTransaction {
397
- /**
398
- * A unique id for this transaction.
399
- */
400
- id: string;
401
- action: 'applied_to_invoice' | 'manual_adjustment' | 'prorated_refund' | 'revert_prorated_refund' | 'return_from_voiding' | 'credit_note_applied' | 'credit_note_voided' | 'overpayment_refund' | 'external_payment';
402
- /**
403
- * The value of the amount changed in the transaction.
404
- */
405
- amount: string;
406
- /**
407
- * The creation time of this transaction.
408
- */
409
- created_at: string;
410
- credit_note: CustomerBalanceTransaction.CreditNote | null;
411
- /**
412
- * An optional description provided for manual customer balance adjustments.
413
- */
414
- description: string | null;
415
- /**
416
- * The new value of the customer's balance prior to the transaction, in the
417
- * customer's currency.
418
- */
419
- ending_balance: string;
420
- invoice: CustomerBalanceTransaction.Invoice | null;
421
- /**
422
- * The original value of the customer's balance prior to the transaction, in the
423
- * customer's currency.
424
- */
425
- starting_balance: string;
426
- type: 'increment' | 'decrement';
427
- }
428
- namespace CustomerBalanceTransaction {
429
- interface CreditNote {
430
- /**
431
- * The id of the Credit note
432
- */
433
- id: string;
434
- }
435
- interface Invoice {
436
- /**
437
- * The Invoice id
438
- */
439
- id: string;
440
- }
441
- }
442
- /**
443
- * Tax IDs are commonly required to be displayed on customer invoices, which are
444
- * added to the headers of invoices.
445
- *
446
- * ### Supported Tax ID Countries and Types
447
- *
448
- * | Country | Type | Description |
449
- * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
450
- * | Andorra | `ad_nrt` | Andorran NRT Number |
451
- * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
452
- * | Australia | `au_abn` | Australian Business Number (AU ABN) |
453
- * | Australia | `au_arn` | Australian Taxation Office Reference Number |
454
- * | Austria | `eu_vat` | European VAT Number |
455
- * | Bahrain | `bh_vat` | Bahraini VAT Number |
456
- * | Belgium | `eu_vat` | European VAT Number |
457
- * | Bolivia | `bo_tin` | Bolivian Tax ID |
458
- * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
459
- * | Brazil | `br_cpf` | Brazilian CPF Number |
460
- * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
461
- * | Bulgaria | `eu_vat` | European VAT Number |
462
- * | Canada | `ca_bn` | Canadian BN |
463
- * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
464
- * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
465
- * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
466
- * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
467
- * | Canada | `ca_qst` | Canadian QST Number (Québec) |
468
- * | Chile | `cl_tin` | Chilean TIN |
469
- * | China | `cn_tin` | Chinese Tax ID |
470
- * | Colombia | `co_nit` | Colombian NIT Number |
471
- * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
472
- * | Croatia | `eu_vat` | European VAT Number |
473
- * | Cyprus | `eu_vat` | European VAT Number |
474
- * | Czech Republic | `eu_vat` | European VAT Number |
475
- * | Denmark | `eu_vat` | European VAT Number |
476
- * | Dominican Republic | `do_rcn` | Dominican RCN Number |
477
- * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
478
- * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
479
- * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
480
- * | Estonia | `eu_vat` | European VAT Number |
481
- * | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
482
- * | Finland | `eu_vat` | European VAT Number |
483
- * | France | `eu_vat` | European VAT Number |
484
- * | Georgia | `ge_vat` | Georgian VAT |
485
- * | Germany | `eu_vat` | European VAT Number |
486
- * | Greece | `eu_vat` | European VAT Number |
487
- * | Hong Kong | `hk_br` | Hong Kong BR Number |
488
- * | Hungary | `eu_vat` | European VAT Number |
489
- * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
490
- * | Iceland | `is_vat` | Icelandic VAT |
491
- * | India | `in_gst` | Indian GST Number |
492
- * | Indonesia | `id_npwp` | Indonesian NPWP Number |
493
- * | Ireland | `eu_vat` | European VAT Number |
494
- * | Israel | `il_vat` | Israel VAT |
495
- * | Italy | `eu_vat` | European VAT Number |
496
- * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
497
- * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
498
- * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
499
- * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
500
- * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
501
- * | Latvia | `eu_vat` | European VAT Number |
502
- * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
503
- * | Lithuania | `eu_vat` | European VAT Number |
504
- * | Luxembourg | `eu_vat` | European VAT Number |
505
- * | Malaysia | `my_frp` | Malaysian FRP Number |
506
- * | Malaysia | `my_itn` | Malaysian ITN |
507
- * | Malaysia | `my_sst` | Malaysian SST Number |
508
- * | Malta | `eu_vat ` | European VAT Number |
509
- * | Mexico | `mx_rfc` | Mexican RFC Number |
510
- * | Netherlands | `eu_vat` | European VAT Number |
511
- * | New Zealand | `nz_gst` | New Zealand GST Number |
512
- * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
513
- * | Norway | `no_vat` | Norwegian VAT Number |
514
- * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
515
- * | Oman | `om_vat` | Omani VAT Number |
516
- * | Peru | `pe_ruc` | Peruvian RUC Number |
517
- * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
518
- * | Poland | `eu_vat` | European VAT Number |
519
- * | Portugal | `eu_vat` | European VAT Number |
520
- * | Romania | `eu_vat` | European VAT Number |
521
- * | Romania | `ro_tin` | Romanian Tax ID Number |
522
- * | Russia | `ru_inn` | Russian INN |
523
- * | Russia | `ru_kpp` | Russian KPP |
524
- * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
525
- * | Serbia | `rs_pib` | Serbian PIB Number |
526
- * | Singapore | `sg_gst` | Singaporean GST |
527
- * | Singapore | `sg_uen` | Singaporean UEN |
528
- * | Slovakia | `eu_vat` | European VAT Number |
529
- * | Slovenia | `eu_vat` | European VAT Number |
530
- * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
531
- * | South Africa | `za_vat` | South African VAT Number |
532
- * | South Korea | `kr_brn` | Korean BRN |
533
- * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
534
- * | Spain | `eu_vat` | European VAT Number |
535
- * | Sweden | `eu_vat` | European VAT Number |
536
- * | Switzerland | `ch_vat` | Switzerland VAT Number |
537
- * | Taiwan | `tw_vat` | Taiwanese VAT |
538
- * | Thailand | `th_vat` | Thai VAT |
539
- * | Turkey | `tr_tin` | Turkish Tax Identification Number |
540
- * | Ukraine | `ua_vat` | Ukrainian VAT |
541
- * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
542
- * | United Kingdom | `eu_vat` | Northern Ireland VAT Number |
543
- * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
544
- * | United States | `us_ein` | United States EIN |
545
- * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
546
- * | Venezuela | `ve_rif` | Venezuelan RIF Number |
547
- * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
548
- */
549
- interface CustomerTaxID {
550
- country: 'AD' | 'AE' | 'AR' | 'AT' | 'AU' | 'BE' | 'BG' | 'BH' | 'BO' | 'BR' | 'CA' | 'CH' | 'CL' | 'CN' | 'CO' | 'CR' | 'CY' | 'CZ' | 'DE' | 'DK' | 'EE' | 'DO' | 'EC' | 'EG' | 'ES' | 'EU' | 'FI' | 'FR' | 'GB' | 'GE' | 'GR' | 'HK' | 'HR' | 'HU' | 'ID' | 'IE' | 'IL' | 'IN' | 'IS' | 'IT' | 'JP' | 'KE' | 'KR' | 'KZ' | 'LI' | 'LT' | 'LU' | 'LV' | 'MT' | 'MX' | 'MY' | 'NG' | 'NL' | 'NO' | 'NZ' | 'OM' | 'PE' | 'PH' | 'PL' | 'PT' | 'RO' | 'RS' | 'RU' | 'SA' | 'SE' | 'SG' | 'SI' | 'SK' | 'SV' | 'TH' | 'TR' | 'TW' | 'UA' | 'US' | 'UY' | 'VE' | 'VN' | 'ZA';
551
- type: 'ad_nrt' | 'ae_trn' | 'ar_cuit' | 'eu_vat' | 'au_abn' | 'au_arn' | 'bg_uic' | 'bh_vat' | 'bo_tin' | 'br_cnpj' | 'br_cpf' | 'ca_bn' | 'ca_gst_hst' | 'ca_pst_bc' | 'ca_pst_mb' | 'ca_pst_sk' | 'ca_qst' | 'ch_vat' | 'cl_tin' | 'cn_tin' | 'co_nit' | 'cr_tin' | 'do_rcn' | 'ec_ruc' | 'eg_tin' | 'es_cif' | 'eu_oss_vat' | 'gb_vat' | 'ge_vat' | 'hk_br' | 'hu_tin' | 'id_npwp' | 'il_vat' | 'in_gst' | 'is_vat' | 'jp_cn' | 'jp_rn' | 'jp_trn' | 'ke_pin' | 'kr_brn' | 'kz_bin' | 'li_uid' | 'mx_rfc' | 'my_frp' | 'my_itn' | 'my_sst' | 'ng_tin' | 'no_vat' | 'no_voec' | 'nz_gst' | 'om_vat' | 'pe_ruc' | 'ph_tin' | 'ro_tin' | 'rs_pib' | 'ru_inn' | 'ru_kpp' | 'sa_vat' | 'sg_gst' | 'sg_uen' | 'si_tin' | 'sv_nit' | 'th_vat' | 'tr_tin' | 'tw_vat' | 'ua_vat' | 'us_ein' | 'uy_ruc' | 've_rif' | 'vn_tin' | 'za_vat';
552
- value: string;
553
- }
554
- interface LineItem {
555
- /**
556
- * A unique ID for this line item.
557
- */
558
- id: string;
559
- /**
560
- * The line amount after any adjustments and before overage conversion, credits and
561
- * partial invoicing.
562
- */
563
- adjusted_subtotal: string;
564
- /**
565
- * All adjustments applied to the line item in the order they were applied based on
566
- * invoice calculations (ie. usage discounts -> amount discounts -> percentage
567
- * discounts -> minimums -> maximums).
568
- */
569
- adjustments: Array<LineItem.MonetaryUsageDiscountAdjustment | LineItem.MonetaryAmountDiscountAdjustment | LineItem.MonetaryPercentageDiscountAdjustment | LineItem.MonetaryMinimumAdjustment | LineItem.MonetaryMaximumAdjustment>;
570
- /**
571
- * The final amount for a line item after all adjustments and pre paid credits have
572
- * been applied.
573
- */
574
- amount: string;
575
- /**
576
- * The number of prepaid credits applied.
577
- */
578
- credits_applied: string;
579
- discount: Shared.Discount | null;
580
- /**
581
- * The end date of the range of time applied for this line item's price.
582
- */
583
- end_date: string;
584
- /**
585
- * An additional filter that was used to calculate the usage for this line item.
586
- */
587
- filter: string | null;
588
- /**
589
- * [DEPRECATED] For configured prices that are split by a grouping key, this will
590
- * be populated with the key and a value. The `amount` and `subtotal` will be the
591
- * values for this particular grouping.
592
- */
593
- grouping: string | null;
594
- /**
595
- * @deprecated This field is deprecated in favor of `adjustments`.
596
- */
597
- maximum: LineItem.Maximum | null;
598
- /**
599
- * @deprecated This field is deprecated in favor of `adjustments`.
600
- */
601
- maximum_amount: string | null;
602
- /**
603
- * @deprecated This field is deprecated in favor of `adjustments`.
604
- */
605
- minimum: LineItem.Minimum | null;
606
- /**
607
- * @deprecated This field is deprecated in favor of `adjustments`.
608
- */
609
- minimum_amount: string | null;
610
- /**
611
- * The name of the price associated with this line item.
612
- */
613
- name: string;
614
- /**
615
- * Any amount applied from a partial invoice
616
- */
617
- partially_invoiced_amount: string;
618
- /**
619
- * The Price resource represents a price that can be billed on a subscription,
620
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
621
- * take a quantity and determine an amount to bill.
622
- *
623
- * Orb supports a few different pricing models out of the box. Each of these models
624
- * is serialized differently in a given Price object. The model_type field
625
- * determines the key for the configuration object that is present.
626
- *
627
- * For more on the types of prices, see
628
- * [the core concepts documentation](/core-concepts#plan-and-price)
629
- */
630
- price: PricesAPI.Price;
631
- /**
632
- * Either the fixed fee quantity or the usage during the service period.
633
- */
634
- quantity: number;
635
- /**
636
- * The start date of the range of time applied for this line item's price.
637
- */
638
- start_date: string;
639
- /**
640
- * For complex pricing structures, the line item can be broken down further in
641
- * `sub_line_items`.
642
- */
643
- sub_line_items: Array<LineItem.MatrixSubLineItem | LineItem.TierSubLineItem | LineItem.OtherSubLineItem>;
644
- /**
645
- * The line amount before before any adjustments.
646
- */
647
- subtotal: string;
648
- /**
649
- * An array of tax rates and their incurred tax amounts. Empty if no tax
650
- * integration is configured.
651
- */
652
- tax_amounts: Array<LineItem.TaxAmount>;
653
- /**
654
- * A list of customer ids that were used to calculate the usage for this line item.
655
- */
656
- usage_customer_ids: Array<string> | null;
657
- }
658
- namespace LineItem {
659
- interface MonetaryUsageDiscountAdjustment {
660
- id: string;
661
- adjustment_type: 'usage_discount';
662
- /**
663
- * The value applied by an adjustment.
664
- */
665
- amount: string;
666
- /**
667
- * @deprecated The price IDs that this adjustment applies to.
668
- */
669
- applies_to_price_ids: Array<string>;
670
- /**
671
- * The filters that determine which prices to apply this adjustment to.
672
- */
673
- filters: Array<MonetaryUsageDiscountAdjustment.Filter>;
674
- /**
675
- * True for adjustments that apply to an entire invocice, false for adjustments
676
- * that apply to only one price.
677
- */
678
- is_invoice_level: boolean;
679
- /**
680
- * The reason for the adjustment.
681
- */
682
- reason: string | null;
683
- /**
684
- * The number of usage units by which to discount the price this adjustment applies
685
- * to in a given billing period.
686
- */
687
- usage_discount: number;
688
- }
689
- namespace MonetaryUsageDiscountAdjustment {
690
- interface Filter {
691
- /**
692
- * The property of the price to filter on.
693
- */
694
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
695
- /**
696
- * Should prices that match the filter be included or excluded.
697
- */
698
- operator: 'includes' | 'excludes';
699
- /**
700
- * The IDs or values that match this filter.
701
- */
702
- values: Array<string>;
703
- }
704
- }
705
- interface MonetaryAmountDiscountAdjustment {
706
- id: string;
707
- adjustment_type: 'amount_discount';
708
- /**
709
- * The value applied by an adjustment.
710
- */
711
- amount: string;
712
- /**
713
- * The amount by which to discount the prices this adjustment applies to in a given
714
- * billing period.
715
- */
716
- amount_discount: string;
717
- /**
718
- * @deprecated The price IDs that this adjustment applies to.
719
- */
720
- applies_to_price_ids: Array<string>;
721
- /**
722
- * The filters that determine which prices to apply this adjustment to.
723
- */
724
- filters: Array<MonetaryAmountDiscountAdjustment.Filter>;
725
- /**
726
- * True for adjustments that apply to an entire invocice, false for adjustments
727
- * that apply to only one price.
728
- */
729
- is_invoice_level: boolean;
730
- /**
731
- * The reason for the adjustment.
732
- */
733
- reason: string | null;
734
- }
735
- namespace MonetaryAmountDiscountAdjustment {
736
- interface Filter {
737
- /**
738
- * The property of the price to filter on.
739
- */
740
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
741
- /**
742
- * Should prices that match the filter be included or excluded.
743
- */
744
- operator: 'includes' | 'excludes';
745
- /**
746
- * The IDs or values that match this filter.
747
- */
748
- values: Array<string>;
749
- }
750
- }
751
- interface MonetaryPercentageDiscountAdjustment {
752
- id: string;
753
- adjustment_type: 'percentage_discount';
754
- /**
755
- * The value applied by an adjustment.
756
- */
757
- amount: string;
758
- /**
759
- * @deprecated The price IDs that this adjustment applies to.
760
- */
761
- applies_to_price_ids: Array<string>;
762
- /**
763
- * The filters that determine which prices to apply this adjustment to.
764
- */
765
- filters: Array<MonetaryPercentageDiscountAdjustment.Filter>;
766
- /**
767
- * True for adjustments that apply to an entire invocice, false for adjustments
768
- * that apply to only one price.
769
- */
770
- is_invoice_level: boolean;
771
- /**
772
- * The percentage (as a value between 0 and 1) by which to discount the price
773
- * intervals this adjustment applies to in a given billing period.
774
- */
775
- percentage_discount: number;
776
- /**
777
- * The reason for the adjustment.
778
- */
779
- reason: string | null;
780
- }
781
- namespace MonetaryPercentageDiscountAdjustment {
782
- interface Filter {
783
- /**
784
- * The property of the price to filter on.
785
- */
786
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
787
- /**
788
- * Should prices that match the filter be included or excluded.
789
- */
790
- operator: 'includes' | 'excludes';
791
- /**
792
- * The IDs or values that match this filter.
793
- */
794
- values: Array<string>;
795
- }
796
- }
797
- interface MonetaryMinimumAdjustment {
798
- id: string;
799
- adjustment_type: 'minimum';
800
- /**
801
- * The value applied by an adjustment.
802
- */
803
- amount: string;
804
- /**
805
- * @deprecated The price IDs that this adjustment applies to.
806
- */
807
- applies_to_price_ids: Array<string>;
808
- /**
809
- * The filters that determine which prices to apply this adjustment to.
810
- */
811
- filters: Array<MonetaryMinimumAdjustment.Filter>;
812
- /**
813
- * True for adjustments that apply to an entire invocice, false for adjustments
814
- * that apply to only one price.
815
- */
816
- is_invoice_level: boolean;
817
- /**
818
- * The item ID that revenue from this minimum will be attributed to.
819
- */
820
- item_id: string;
821
- /**
822
- * The minimum amount to charge in a given billing period for the prices this
823
- * adjustment applies to.
824
- */
825
- minimum_amount: string;
826
- /**
827
- * The reason for the adjustment.
828
- */
829
- reason: string | null;
830
- }
831
- namespace MonetaryMinimumAdjustment {
832
- interface Filter {
833
- /**
834
- * The property of the price to filter on.
835
- */
836
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
837
- /**
838
- * Should prices that match the filter be included or excluded.
839
- */
840
- operator: 'includes' | 'excludes';
841
- /**
842
- * The IDs or values that match this filter.
843
- */
844
- values: Array<string>;
845
- }
846
- }
847
- interface MonetaryMaximumAdjustment {
848
- id: string;
849
- adjustment_type: 'maximum';
850
- /**
851
- * The value applied by an adjustment.
852
- */
853
- amount: string;
854
- /**
855
- * @deprecated The price IDs that this adjustment applies to.
856
- */
857
- applies_to_price_ids: Array<string>;
858
- /**
859
- * The filters that determine which prices to apply this adjustment to.
860
- */
861
- filters: Array<MonetaryMaximumAdjustment.Filter>;
862
- /**
863
- * True for adjustments that apply to an entire invocice, false for adjustments
864
- * that apply to only one price.
865
- */
866
- is_invoice_level: boolean;
867
- /**
868
- * The maximum amount to charge in a given billing period for the prices this
869
- * adjustment applies to.
870
- */
871
- maximum_amount: string;
872
- /**
873
- * The reason for the adjustment.
874
- */
875
- reason: string | null;
876
- }
877
- namespace MonetaryMaximumAdjustment {
878
- interface Filter {
879
- /**
880
- * The property of the price to filter on.
881
- */
882
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
883
- /**
884
- * Should prices that match the filter be included or excluded.
885
- */
886
- operator: 'includes' | 'excludes';
887
- /**
888
- * The IDs or values that match this filter.
889
- */
890
- values: Array<string>;
891
- }
892
- }
893
- /**
894
- * @deprecated This field is deprecated in favor of `adjustments`.
895
- */
896
- interface Maximum {
897
- /**
898
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
899
- * phase maximums, this can be a subset of prices.
900
- */
901
- applies_to_price_ids: Array<string>;
902
- /**
903
- * The filters that determine which prices to apply this maximum to.
904
- */
905
- filters: Array<Maximum.Filter>;
906
- /**
907
- * Maximum amount applied
908
- */
909
- maximum_amount: string;
910
- }
911
- namespace Maximum {
912
- interface Filter {
913
- /**
914
- * The property of the price to filter on.
915
- */
916
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
917
- /**
918
- * Should prices that match the filter be included or excluded.
919
- */
920
- operator: 'includes' | 'excludes';
921
- /**
922
- * The IDs or values that match this filter.
923
- */
924
- values: Array<string>;
925
- }
926
- }
927
- /**
928
- * @deprecated This field is deprecated in favor of `adjustments`.
929
- */
930
- interface Minimum {
931
- /**
932
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
933
- * phase minimums, this can be a subset of prices.
934
- */
935
- applies_to_price_ids: Array<string>;
936
- /**
937
- * The filters that determine which prices to apply this minimum to.
938
- */
939
- filters: Array<Minimum.Filter>;
940
- /**
941
- * Minimum amount applied
942
- */
943
- minimum_amount: string;
944
- }
945
- namespace Minimum {
946
- interface Filter {
947
- /**
948
- * The property of the price to filter on.
949
- */
950
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
951
- /**
952
- * Should prices that match the filter be included or excluded.
953
- */
954
- operator: 'includes' | 'excludes';
955
- /**
956
- * The IDs or values that match this filter.
957
- */
958
- values: Array<string>;
959
- }
960
- }
961
- interface MatrixSubLineItem {
962
- /**
963
- * The total amount for this sub line item.
964
- */
965
- amount: string;
966
- grouping: MatrixSubLineItem.Grouping | null;
967
- matrix_config: MatrixSubLineItem.MatrixConfig;
968
- name: string;
969
- quantity: number;
970
- type: 'matrix';
971
- }
972
- namespace MatrixSubLineItem {
973
- interface Grouping {
974
- key: string;
975
- /**
976
- * No value indicates the default group
977
- */
978
- value: string | null;
979
- }
980
- interface MatrixConfig {
981
- /**
982
- * The ordered dimension values for this line item.
983
- */
984
- dimension_values: Array<string | null>;
985
- }
986
- }
987
- interface TierSubLineItem {
988
- /**
989
- * The total amount for this sub line item.
990
- */
991
- amount: string;
992
- grouping: TierSubLineItem.Grouping | null;
993
- name: string;
994
- quantity: number;
995
- tier_config: TierSubLineItem.TierConfig;
996
- type: 'tier';
997
- }
998
- namespace TierSubLineItem {
999
- interface Grouping {
1000
- key: string;
1001
- /**
1002
- * No value indicates the default group
1003
- */
1004
- value: string | null;
1005
- }
1006
- interface TierConfig {
1007
- first_unit: number;
1008
- last_unit: number | null;
1009
- unit_amount: string;
1010
- }
1011
- }
1012
- interface OtherSubLineItem {
1013
- /**
1014
- * The total amount for this sub line item.
1015
- */
1016
- amount: string;
1017
- grouping: OtherSubLineItem.Grouping | null;
1018
- name: string;
1019
- quantity: number;
1020
- type: "'null'";
1021
- }
1022
- namespace OtherSubLineItem {
1023
- interface Grouping {
1024
- key: string;
1025
- /**
1026
- * No value indicates the default group
1027
- */
1028
- value: string | null;
1029
- }
1030
- }
1031
- interface TaxAmount {
1032
- /**
1033
- * The amount of additional tax incurred by this tax rate.
1034
- */
1035
- amount: string;
1036
- /**
1037
- * The human-readable description of the applied tax rate.
1038
- */
1039
- tax_rate_description: string;
1040
- /**
1041
- * The tax rate percentage, out of 100.
1042
- */
1043
- tax_rate_percentage: string | null;
1044
- }
1045
- }
1046
- interface Maximum {
1047
- /**
1048
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
1049
- * phase maximums, this can be a subset of prices.
1050
- */
1051
- applies_to_price_ids: Array<string>;
1052
- /**
1053
- * The filters that determine which prices to apply this maximum to.
1054
- */
1055
- filters: Array<Maximum.Filter>;
1056
- /**
1057
- * Maximum amount applied
1058
- */
1059
- maximum_amount: string;
1060
- }
1061
- namespace Maximum {
1062
- interface Filter {
1063
- /**
1064
- * The property of the price to filter on.
1065
- */
1066
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1067
- /**
1068
- * Should prices that match the filter be included or excluded.
1069
- */
1070
- operator: 'includes' | 'excludes';
1071
- /**
1072
- * The IDs or values that match this filter.
1073
- */
1074
- values: Array<string>;
1075
- }
1076
- }
1077
- interface Minimum {
1078
- /**
1079
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
1080
- * phase minimums, this can be a subset of prices.
1081
- */
1082
- applies_to_price_ids: Array<string>;
1083
- /**
1084
- * The filters that determine which prices to apply this minimum to.
1085
- */
1086
- filters: Array<Minimum.Filter>;
1087
- /**
1088
- * Minimum amount applied
1089
- */
1090
- minimum_amount: string;
1091
- }
1092
- namespace Minimum {
1093
- interface Filter {
1094
- /**
1095
- * The property of the price to filter on.
1096
- */
1097
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1098
- /**
1099
- * Should prices that match the filter be included or excluded.
1100
- */
1101
- operator: 'includes' | 'excludes';
1102
- /**
1103
- * The IDs or values that match this filter.
1104
- */
1105
- values: Array<string>;
1106
- }
1107
- }
1108
- interface PaymentAttempt {
1109
- /**
1110
- * The ID of the payment attempt.
1111
- */
1112
- id: string;
1113
- /**
1114
- * The amount of the payment attempt.
1115
- */
1116
- amount: string;
1117
- /**
1118
- * The time at which the payment attempt was created.
1119
- */
1120
- created_at: string;
1121
- /**
1122
- * The payment provider that attempted to collect the payment.
1123
- */
1124
- payment_provider: 'stripe' | null;
1125
- /**
1126
- * The ID of the payment attempt in the payment provider.
1127
- */
1128
- payment_provider_id: string | null;
1129
- /**
1130
- * Whether the payment attempt succeeded.
1131
- */
1132
- succeeded: boolean;
1133
- }
1134
- interface ShippingAddress {
1135
- city: string | null;
1136
- country: string | null;
1137
- line1: string | null;
1138
- line2: string | null;
1139
- postal_code: string | null;
1140
- state: string | null;
1141
- }
1142
- interface Subscription {
1143
- id: string;
1144
- }
80
+ void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Invoice>;
1145
81
  }
1146
82
  export interface InvoiceFetchUpcomingResponse {
1147
83
  id: string;
@@ -1151,7 +87,7 @@ export interface InvoiceFetchUpcomingResponse {
1151
87
  */
1152
88
  amount_due: string;
1153
89
  auto_collection: InvoiceFetchUpcomingResponse.AutoCollection;
1154
- billing_address: InvoiceFetchUpcomingResponse.BillingAddress | null;
90
+ billing_address: Shared.Address | null;
1155
91
  /**
1156
92
  * The creation time of the resource in Orb.
1157
93
  */
@@ -1164,7 +100,7 @@ export interface InvoiceFetchUpcomingResponse {
1164
100
  * An ISO 4217 currency string or `credits`
1165
101
  */
1166
102
  currency: string;
1167
- customer: InvoiceFetchUpcomingResponse.Customer;
103
+ customer: Shared.CustomerMinified;
1168
104
  customer_balance_transactions: Array<InvoiceFetchUpcomingResponse.CustomerBalanceTransaction>;
1169
105
  /**
1170
106
  * Tax IDs are commonly required to be displayed on customer invoices, which are
@@ -1273,7 +209,7 @@ export interface InvoiceFetchUpcomingResponse {
1273
209
  * | Venezuela | `ve_rif` | Venezuelan RIF Number |
1274
210
  * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
1275
211
  */
1276
- customer_tax_id: InvoiceFetchUpcomingResponse.CustomerTaxID | null;
212
+ customer_tax_id: Shared.CustomerTaxID | null;
1277
213
  /**
1278
214
  * @deprecated This field is deprecated in favor of `discounts`. If a `discounts`
1279
215
  * list is provided, the first discount in the list will be returned. If the list
@@ -1322,7 +258,7 @@ export interface InvoiceFetchUpcomingResponse {
1322
258
  * The breakdown of prices in this invoice.
1323
259
  */
1324
260
  line_items: Array<InvoiceFetchUpcomingResponse.LineItem>;
1325
- maximum: InvoiceFetchUpcomingResponse.Maximum | null;
261
+ maximum: Shared.Maximum | null;
1326
262
  maximum_amount: string | null;
1327
263
  /**
1328
264
  * Free-form text which is available on the invoice PDF and the Orb invoice portal.
@@ -1335,7 +271,7 @@ export interface InvoiceFetchUpcomingResponse {
1335
271
  * `null`.
1336
272
  */
1337
273
  metadata: Record<string, string>;
1338
- minimum: InvoiceFetchUpcomingResponse.Minimum | null;
274
+ minimum: Shared.Minimum | null;
1339
275
  minimum_amount: string | null;
1340
276
  /**
1341
277
  * If the invoice has a status of `paid`, this gives a timestamp when the invoice
@@ -1362,9 +298,9 @@ export interface InvoiceFetchUpcomingResponse {
1362
298
  * scheduled to be issued.
1363
299
  */
1364
300
  scheduled_issue_at: string | null;
1365
- shipping_address: InvoiceFetchUpcomingResponse.ShippingAddress | null;
301
+ shipping_address: Shared.Address | null;
1366
302
  status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
1367
- subscription: InvoiceFetchUpcomingResponse.Subscription | null;
303
+ subscription: Shared.SubscriptionMinified | null;
1368
304
  /**
1369
305
  * The total before any discounts and minimums are applied.
1370
306
  */
@@ -1420,14 +356,6 @@ export declare namespace InvoiceFetchUpcomingResponse {
1420
356
  */
1421
357
  previously_attempted_at: string | null;
1422
358
  }
1423
- interface BillingAddress {
1424
- city: string | null;
1425
- country: string | null;
1426
- line1: string | null;
1427
- line2: string | null;
1428
- postal_code: string | null;
1429
- state: string | null;
1430
- }
1431
359
  interface CreditNote {
1432
360
  id: string;
1433
361
  credit_note_number: string;
@@ -1444,10 +372,6 @@ export declare namespace InvoiceFetchUpcomingResponse {
1444
372
  */
1445
373
  voided_at: string | null;
1446
374
  }
1447
- interface Customer {
1448
- id: string;
1449
- external_customer_id: string | null;
1450
- }
1451
375
  interface CustomerBalanceTransaction {
1452
376
  /**
1453
377
  * A unique id for this transaction.
@@ -1462,7 +386,7 @@ export declare namespace InvoiceFetchUpcomingResponse {
1462
386
  * The creation time of this transaction.
1463
387
  */
1464
388
  created_at: string;
1465
- credit_note: CustomerBalanceTransaction.CreditNote | null;
389
+ credit_note: Shared.CreditNoteTiny | null;
1466
390
  /**
1467
391
  * An optional description provided for manual customer balance adjustments.
1468
392
  */
@@ -1472,7 +396,7 @@ export declare namespace InvoiceFetchUpcomingResponse {
1472
396
  * customer's currency.
1473
397
  */
1474
398
  ending_balance: string;
1475
- invoice: CustomerBalanceTransaction.Invoice | null;
399
+ invoice: Shared.InvoiceTiny | null;
1476
400
  /**
1477
401
  * The original value of the customer's balance prior to the transaction, in the
1478
402
  * customer's currency.
@@ -1480,132 +404,6 @@ export declare namespace InvoiceFetchUpcomingResponse {
1480
404
  starting_balance: string;
1481
405
  type: 'increment' | 'decrement';
1482
406
  }
1483
- namespace CustomerBalanceTransaction {
1484
- interface CreditNote {
1485
- /**
1486
- * The id of the Credit note
1487
- */
1488
- id: string;
1489
- }
1490
- interface Invoice {
1491
- /**
1492
- * The Invoice id
1493
- */
1494
- id: string;
1495
- }
1496
- }
1497
- /**
1498
- * Tax IDs are commonly required to be displayed on customer invoices, which are
1499
- * added to the headers of invoices.
1500
- *
1501
- * ### Supported Tax ID Countries and Types
1502
- *
1503
- * | Country | Type | Description |
1504
- * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
1505
- * | Andorra | `ad_nrt` | Andorran NRT Number |
1506
- * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
1507
- * | Australia | `au_abn` | Australian Business Number (AU ABN) |
1508
- * | Australia | `au_arn` | Australian Taxation Office Reference Number |
1509
- * | Austria | `eu_vat` | European VAT Number |
1510
- * | Bahrain | `bh_vat` | Bahraini VAT Number |
1511
- * | Belgium | `eu_vat` | European VAT Number |
1512
- * | Bolivia | `bo_tin` | Bolivian Tax ID |
1513
- * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
1514
- * | Brazil | `br_cpf` | Brazilian CPF Number |
1515
- * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
1516
- * | Bulgaria | `eu_vat` | European VAT Number |
1517
- * | Canada | `ca_bn` | Canadian BN |
1518
- * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
1519
- * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
1520
- * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
1521
- * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
1522
- * | Canada | `ca_qst` | Canadian QST Number (Québec) |
1523
- * | Chile | `cl_tin` | Chilean TIN |
1524
- * | China | `cn_tin` | Chinese Tax ID |
1525
- * | Colombia | `co_nit` | Colombian NIT Number |
1526
- * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
1527
- * | Croatia | `eu_vat` | European VAT Number |
1528
- * | Cyprus | `eu_vat` | European VAT Number |
1529
- * | Czech Republic | `eu_vat` | European VAT Number |
1530
- * | Denmark | `eu_vat` | European VAT Number |
1531
- * | Dominican Republic | `do_rcn` | Dominican RCN Number |
1532
- * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
1533
- * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
1534
- * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
1535
- * | Estonia | `eu_vat` | European VAT Number |
1536
- * | EU | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
1537
- * | Finland | `eu_vat` | European VAT Number |
1538
- * | France | `eu_vat` | European VAT Number |
1539
- * | Georgia | `ge_vat` | Georgian VAT |
1540
- * | Germany | `eu_vat` | European VAT Number |
1541
- * | Greece | `eu_vat` | European VAT Number |
1542
- * | Hong Kong | `hk_br` | Hong Kong BR Number |
1543
- * | Hungary | `eu_vat` | European VAT Number |
1544
- * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
1545
- * | Iceland | `is_vat` | Icelandic VAT |
1546
- * | India | `in_gst` | Indian GST Number |
1547
- * | Indonesia | `id_npwp` | Indonesian NPWP Number |
1548
- * | Ireland | `eu_vat` | European VAT Number |
1549
- * | Israel | `il_vat` | Israel VAT |
1550
- * | Italy | `eu_vat` | European VAT Number |
1551
- * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
1552
- * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
1553
- * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
1554
- * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
1555
- * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
1556
- * | Latvia | `eu_vat` | European VAT Number |
1557
- * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
1558
- * | Lithuania | `eu_vat` | European VAT Number |
1559
- * | Luxembourg | `eu_vat` | European VAT Number |
1560
- * | Malaysia | `my_frp` | Malaysian FRP Number |
1561
- * | Malaysia | `my_itn` | Malaysian ITN |
1562
- * | Malaysia | `my_sst` | Malaysian SST Number |
1563
- * | Malta | `eu_vat ` | European VAT Number |
1564
- * | Mexico | `mx_rfc` | Mexican RFC Number |
1565
- * | Netherlands | `eu_vat` | European VAT Number |
1566
- * | New Zealand | `nz_gst` | New Zealand GST Number |
1567
- * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
1568
- * | Norway | `no_vat` | Norwegian VAT Number |
1569
- * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
1570
- * | Oman | `om_vat` | Omani VAT Number |
1571
- * | Peru | `pe_ruc` | Peruvian RUC Number |
1572
- * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
1573
- * | Poland | `eu_vat` | European VAT Number |
1574
- * | Portugal | `eu_vat` | European VAT Number |
1575
- * | Romania | `eu_vat` | European VAT Number |
1576
- * | Romania | `ro_tin` | Romanian Tax ID Number |
1577
- * | Russia | `ru_inn` | Russian INN |
1578
- * | Russia | `ru_kpp` | Russian KPP |
1579
- * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
1580
- * | Serbia | `rs_pib` | Serbian PIB Number |
1581
- * | Singapore | `sg_gst` | Singaporean GST |
1582
- * | Singapore | `sg_uen` | Singaporean UEN |
1583
- * | Slovakia | `eu_vat` | European VAT Number |
1584
- * | Slovenia | `eu_vat` | European VAT Number |
1585
- * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
1586
- * | South Africa | `za_vat` | South African VAT Number |
1587
- * | South Korea | `kr_brn` | Korean BRN |
1588
- * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
1589
- * | Spain | `eu_vat` | European VAT Number |
1590
- * | Sweden | `eu_vat` | European VAT Number |
1591
- * | Switzerland | `ch_vat` | Switzerland VAT Number |
1592
- * | Taiwan | `tw_vat` | Taiwanese VAT |
1593
- * | Thailand | `th_vat` | Thai VAT |
1594
- * | Turkey | `tr_tin` | Turkish Tax Identification Number |
1595
- * | Ukraine | `ua_vat` | Ukrainian VAT |
1596
- * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
1597
- * | United Kingdom | `eu_vat` | Northern Ireland VAT Number |
1598
- * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
1599
- * | United States | `us_ein` | United States EIN |
1600
- * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
1601
- * | Venezuela | `ve_rif` | Venezuelan RIF Number |
1602
- * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
1603
- */
1604
- interface CustomerTaxID {
1605
- country: 'AD' | 'AE' | 'AR' | 'AT' | 'AU' | 'BE' | 'BG' | 'BH' | 'BO' | 'BR' | 'CA' | 'CH' | 'CL' | 'CN' | 'CO' | 'CR' | 'CY' | 'CZ' | 'DE' | 'DK' | 'EE' | 'DO' | 'EC' | 'EG' | 'ES' | 'EU' | 'FI' | 'FR' | 'GB' | 'GE' | 'GR' | 'HK' | 'HR' | 'HU' | 'ID' | 'IE' | 'IL' | 'IN' | 'IS' | 'IT' | 'JP' | 'KE' | 'KR' | 'KZ' | 'LI' | 'LT' | 'LU' | 'LV' | 'MT' | 'MX' | 'MY' | 'NG' | 'NL' | 'NO' | 'NZ' | 'OM' | 'PE' | 'PH' | 'PL' | 'PT' | 'RO' | 'RS' | 'RU' | 'SA' | 'SE' | 'SG' | 'SI' | 'SK' | 'SV' | 'TH' | 'TR' | 'TW' | 'UA' | 'US' | 'UY' | 'VE' | 'VN' | 'ZA';
1606
- type: 'ad_nrt' | 'ae_trn' | 'ar_cuit' | 'eu_vat' | 'au_abn' | 'au_arn' | 'bg_uic' | 'bh_vat' | 'bo_tin' | 'br_cnpj' | 'br_cpf' | 'ca_bn' | 'ca_gst_hst' | 'ca_pst_bc' | 'ca_pst_mb' | 'ca_pst_sk' | 'ca_qst' | 'ch_vat' | 'cl_tin' | 'cn_tin' | 'co_nit' | 'cr_tin' | 'do_rcn' | 'ec_ruc' | 'eg_tin' | 'es_cif' | 'eu_oss_vat' | 'gb_vat' | 'ge_vat' | 'hk_br' | 'hu_tin' | 'id_npwp' | 'il_vat' | 'in_gst' | 'is_vat' | 'jp_cn' | 'jp_rn' | 'jp_trn' | 'ke_pin' | 'kr_brn' | 'kz_bin' | 'li_uid' | 'mx_rfc' | 'my_frp' | 'my_itn' | 'my_sst' | 'ng_tin' | 'no_vat' | 'no_voec' | 'nz_gst' | 'om_vat' | 'pe_ruc' | 'ph_tin' | 'ro_tin' | 'rs_pib' | 'ru_inn' | 'ru_kpp' | 'sa_vat' | 'sg_gst' | 'sg_uen' | 'si_tin' | 'sv_nit' | 'th_vat' | 'tr_tin' | 'tw_vat' | 'ua_vat' | 'us_ein' | 'uy_ruc' | 've_rif' | 'vn_tin' | 'za_vat';
1607
- value: string;
1608
- }
1609
407
  interface LineItem {
1610
408
  /**
1611
409
  * A unique ID for this line item.
@@ -1621,7 +419,7 @@ export declare namespace InvoiceFetchUpcomingResponse {
1621
419
  * invoice calculations (ie. usage discounts -> amount discounts -> percentage
1622
420
  * discounts -> minimums -> maximums).
1623
421
  */
1624
- adjustments: Array<LineItem.MonetaryUsageDiscountAdjustment | LineItem.MonetaryAmountDiscountAdjustment | LineItem.MonetaryPercentageDiscountAdjustment | LineItem.MonetaryMinimumAdjustment | LineItem.MonetaryMaximumAdjustment>;
422
+ adjustments: Array<Shared.MonetaryUsageDiscountAdjustment | Shared.MonetaryAmountDiscountAdjustment | Shared.MonetaryPercentageDiscountAdjustment | Shared.MonetaryMinimumAdjustment | Shared.MonetaryMaximumAdjustment>;
1625
423
  /**
1626
424
  * The final amount for a line item after all adjustments and pre paid credits have
1627
425
  * been applied.
@@ -1649,7 +447,7 @@ export declare namespace InvoiceFetchUpcomingResponse {
1649
447
  /**
1650
448
  * @deprecated This field is deprecated in favor of `adjustments`.
1651
449
  */
1652
- maximum: LineItem.Maximum | null;
450
+ maximum: Shared.Maximum | null;
1653
451
  /**
1654
452
  * @deprecated This field is deprecated in favor of `adjustments`.
1655
453
  */
@@ -1657,7 +455,7 @@ export declare namespace InvoiceFetchUpcomingResponse {
1657
455
  /**
1658
456
  * @deprecated This field is deprecated in favor of `adjustments`.
1659
457
  */
1660
- minimum: LineItem.Minimum | null;
458
+ minimum: Shared.Minimum | null;
1661
459
  /**
1662
460
  * @deprecated This field is deprecated in favor of `adjustments`.
1663
461
  */
@@ -1682,7 +480,7 @@ export declare namespace InvoiceFetchUpcomingResponse {
1682
480
  * For more on the types of prices, see
1683
481
  * [the core concepts documentation](/core-concepts#plan-and-price)
1684
482
  */
1685
- price: PricesAPI.Price;
483
+ price: Shared.Price;
1686
484
  /**
1687
485
  * Either the fixed fee quantity or the usage during the service period.
1688
486
  */
@@ -1695,7 +493,7 @@ export declare namespace InvoiceFetchUpcomingResponse {
1695
493
  * For complex pricing structures, the line item can be broken down further in
1696
494
  * `sub_line_items`.
1697
495
  */
1698
- sub_line_items: Array<LineItem.MatrixSubLineItem | LineItem.TierSubLineItem | LineItem.OtherSubLineItem>;
496
+ sub_line_items: Array<Shared.MatrixSubLineItem | Shared.TierSubLineItem | Shared.OtherSubLineItem>;
1699
497
  /**
1700
498
  * The line amount before before any adjustments.
1701
499
  */
@@ -1704,462 +502,12 @@ export declare namespace InvoiceFetchUpcomingResponse {
1704
502
  * An array of tax rates and their incurred tax amounts. Empty if no tax
1705
503
  * integration is configured.
1706
504
  */
1707
- tax_amounts: Array<LineItem.TaxAmount>;
505
+ tax_amounts: Array<Shared.TaxAmount>;
1708
506
  /**
1709
507
  * A list of customer ids that were used to calculate the usage for this line item.
1710
508
  */
1711
509
  usage_customer_ids: Array<string> | null;
1712
510
  }
1713
- namespace LineItem {
1714
- interface MonetaryUsageDiscountAdjustment {
1715
- id: string;
1716
- adjustment_type: 'usage_discount';
1717
- /**
1718
- * The value applied by an adjustment.
1719
- */
1720
- amount: string;
1721
- /**
1722
- * @deprecated The price IDs that this adjustment applies to.
1723
- */
1724
- applies_to_price_ids: Array<string>;
1725
- /**
1726
- * The filters that determine which prices to apply this adjustment to.
1727
- */
1728
- filters: Array<MonetaryUsageDiscountAdjustment.Filter>;
1729
- /**
1730
- * True for adjustments that apply to an entire invocice, false for adjustments
1731
- * that apply to only one price.
1732
- */
1733
- is_invoice_level: boolean;
1734
- /**
1735
- * The reason for the adjustment.
1736
- */
1737
- reason: string | null;
1738
- /**
1739
- * The number of usage units by which to discount the price this adjustment applies
1740
- * to in a given billing period.
1741
- */
1742
- usage_discount: number;
1743
- }
1744
- namespace MonetaryUsageDiscountAdjustment {
1745
- interface Filter {
1746
- /**
1747
- * The property of the price to filter on.
1748
- */
1749
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1750
- /**
1751
- * Should prices that match the filter be included or excluded.
1752
- */
1753
- operator: 'includes' | 'excludes';
1754
- /**
1755
- * The IDs or values that match this filter.
1756
- */
1757
- values: Array<string>;
1758
- }
1759
- }
1760
- interface MonetaryAmountDiscountAdjustment {
1761
- id: string;
1762
- adjustment_type: 'amount_discount';
1763
- /**
1764
- * The value applied by an adjustment.
1765
- */
1766
- amount: string;
1767
- /**
1768
- * The amount by which to discount the prices this adjustment applies to in a given
1769
- * billing period.
1770
- */
1771
- amount_discount: string;
1772
- /**
1773
- * @deprecated The price IDs that this adjustment applies to.
1774
- */
1775
- applies_to_price_ids: Array<string>;
1776
- /**
1777
- * The filters that determine which prices to apply this adjustment to.
1778
- */
1779
- filters: Array<MonetaryAmountDiscountAdjustment.Filter>;
1780
- /**
1781
- * True for adjustments that apply to an entire invocice, false for adjustments
1782
- * that apply to only one price.
1783
- */
1784
- is_invoice_level: boolean;
1785
- /**
1786
- * The reason for the adjustment.
1787
- */
1788
- reason: string | null;
1789
- }
1790
- namespace MonetaryAmountDiscountAdjustment {
1791
- interface Filter {
1792
- /**
1793
- * The property of the price to filter on.
1794
- */
1795
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1796
- /**
1797
- * Should prices that match the filter be included or excluded.
1798
- */
1799
- operator: 'includes' | 'excludes';
1800
- /**
1801
- * The IDs or values that match this filter.
1802
- */
1803
- values: Array<string>;
1804
- }
1805
- }
1806
- interface MonetaryPercentageDiscountAdjustment {
1807
- id: string;
1808
- adjustment_type: 'percentage_discount';
1809
- /**
1810
- * The value applied by an adjustment.
1811
- */
1812
- amount: string;
1813
- /**
1814
- * @deprecated The price IDs that this adjustment applies to.
1815
- */
1816
- applies_to_price_ids: Array<string>;
1817
- /**
1818
- * The filters that determine which prices to apply this adjustment to.
1819
- */
1820
- filters: Array<MonetaryPercentageDiscountAdjustment.Filter>;
1821
- /**
1822
- * True for adjustments that apply to an entire invocice, false for adjustments
1823
- * that apply to only one price.
1824
- */
1825
- is_invoice_level: boolean;
1826
- /**
1827
- * The percentage (as a value between 0 and 1) by which to discount the price
1828
- * intervals this adjustment applies to in a given billing period.
1829
- */
1830
- percentage_discount: number;
1831
- /**
1832
- * The reason for the adjustment.
1833
- */
1834
- reason: string | null;
1835
- }
1836
- namespace MonetaryPercentageDiscountAdjustment {
1837
- interface Filter {
1838
- /**
1839
- * The property of the price to filter on.
1840
- */
1841
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1842
- /**
1843
- * Should prices that match the filter be included or excluded.
1844
- */
1845
- operator: 'includes' | 'excludes';
1846
- /**
1847
- * The IDs or values that match this filter.
1848
- */
1849
- values: Array<string>;
1850
- }
1851
- }
1852
- interface MonetaryMinimumAdjustment {
1853
- id: string;
1854
- adjustment_type: 'minimum';
1855
- /**
1856
- * The value applied by an adjustment.
1857
- */
1858
- amount: string;
1859
- /**
1860
- * @deprecated The price IDs that this adjustment applies to.
1861
- */
1862
- applies_to_price_ids: Array<string>;
1863
- /**
1864
- * The filters that determine which prices to apply this adjustment to.
1865
- */
1866
- filters: Array<MonetaryMinimumAdjustment.Filter>;
1867
- /**
1868
- * True for adjustments that apply to an entire invocice, false for adjustments
1869
- * that apply to only one price.
1870
- */
1871
- is_invoice_level: boolean;
1872
- /**
1873
- * The item ID that revenue from this minimum will be attributed to.
1874
- */
1875
- item_id: string;
1876
- /**
1877
- * The minimum amount to charge in a given billing period for the prices this
1878
- * adjustment applies to.
1879
- */
1880
- minimum_amount: string;
1881
- /**
1882
- * The reason for the adjustment.
1883
- */
1884
- reason: string | null;
1885
- }
1886
- namespace MonetaryMinimumAdjustment {
1887
- interface Filter {
1888
- /**
1889
- * The property of the price to filter on.
1890
- */
1891
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1892
- /**
1893
- * Should prices that match the filter be included or excluded.
1894
- */
1895
- operator: 'includes' | 'excludes';
1896
- /**
1897
- * The IDs or values that match this filter.
1898
- */
1899
- values: Array<string>;
1900
- }
1901
- }
1902
- interface MonetaryMaximumAdjustment {
1903
- id: string;
1904
- adjustment_type: 'maximum';
1905
- /**
1906
- * The value applied by an adjustment.
1907
- */
1908
- amount: string;
1909
- /**
1910
- * @deprecated The price IDs that this adjustment applies to.
1911
- */
1912
- applies_to_price_ids: Array<string>;
1913
- /**
1914
- * The filters that determine which prices to apply this adjustment to.
1915
- */
1916
- filters: Array<MonetaryMaximumAdjustment.Filter>;
1917
- /**
1918
- * True for adjustments that apply to an entire invocice, false for adjustments
1919
- * that apply to only one price.
1920
- */
1921
- is_invoice_level: boolean;
1922
- /**
1923
- * The maximum amount to charge in a given billing period for the prices this
1924
- * adjustment applies to.
1925
- */
1926
- maximum_amount: string;
1927
- /**
1928
- * The reason for the adjustment.
1929
- */
1930
- reason: string | null;
1931
- }
1932
- namespace MonetaryMaximumAdjustment {
1933
- interface Filter {
1934
- /**
1935
- * The property of the price to filter on.
1936
- */
1937
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1938
- /**
1939
- * Should prices that match the filter be included or excluded.
1940
- */
1941
- operator: 'includes' | 'excludes';
1942
- /**
1943
- * The IDs or values that match this filter.
1944
- */
1945
- values: Array<string>;
1946
- }
1947
- }
1948
- /**
1949
- * @deprecated This field is deprecated in favor of `adjustments`.
1950
- */
1951
- interface Maximum {
1952
- /**
1953
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
1954
- * phase maximums, this can be a subset of prices.
1955
- */
1956
- applies_to_price_ids: Array<string>;
1957
- /**
1958
- * The filters that determine which prices to apply this maximum to.
1959
- */
1960
- filters: Array<Maximum.Filter>;
1961
- /**
1962
- * Maximum amount applied
1963
- */
1964
- maximum_amount: string;
1965
- }
1966
- namespace Maximum {
1967
- interface Filter {
1968
- /**
1969
- * The property of the price to filter on.
1970
- */
1971
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
1972
- /**
1973
- * Should prices that match the filter be included or excluded.
1974
- */
1975
- operator: 'includes' | 'excludes';
1976
- /**
1977
- * The IDs or values that match this filter.
1978
- */
1979
- values: Array<string>;
1980
- }
1981
- }
1982
- /**
1983
- * @deprecated This field is deprecated in favor of `adjustments`.
1984
- */
1985
- interface Minimum {
1986
- /**
1987
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
1988
- * phase minimums, this can be a subset of prices.
1989
- */
1990
- applies_to_price_ids: Array<string>;
1991
- /**
1992
- * The filters that determine which prices to apply this minimum to.
1993
- */
1994
- filters: Array<Minimum.Filter>;
1995
- /**
1996
- * Minimum amount applied
1997
- */
1998
- minimum_amount: string;
1999
- }
2000
- namespace Minimum {
2001
- interface Filter {
2002
- /**
2003
- * The property of the price to filter on.
2004
- */
2005
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2006
- /**
2007
- * Should prices that match the filter be included or excluded.
2008
- */
2009
- operator: 'includes' | 'excludes';
2010
- /**
2011
- * The IDs or values that match this filter.
2012
- */
2013
- values: Array<string>;
2014
- }
2015
- }
2016
- interface MatrixSubLineItem {
2017
- /**
2018
- * The total amount for this sub line item.
2019
- */
2020
- amount: string;
2021
- grouping: MatrixSubLineItem.Grouping | null;
2022
- matrix_config: MatrixSubLineItem.MatrixConfig;
2023
- name: string;
2024
- quantity: number;
2025
- type: 'matrix';
2026
- }
2027
- namespace MatrixSubLineItem {
2028
- interface Grouping {
2029
- key: string;
2030
- /**
2031
- * No value indicates the default group
2032
- */
2033
- value: string | null;
2034
- }
2035
- interface MatrixConfig {
2036
- /**
2037
- * The ordered dimension values for this line item.
2038
- */
2039
- dimension_values: Array<string | null>;
2040
- }
2041
- }
2042
- interface TierSubLineItem {
2043
- /**
2044
- * The total amount for this sub line item.
2045
- */
2046
- amount: string;
2047
- grouping: TierSubLineItem.Grouping | null;
2048
- name: string;
2049
- quantity: number;
2050
- tier_config: TierSubLineItem.TierConfig;
2051
- type: 'tier';
2052
- }
2053
- namespace TierSubLineItem {
2054
- interface Grouping {
2055
- key: string;
2056
- /**
2057
- * No value indicates the default group
2058
- */
2059
- value: string | null;
2060
- }
2061
- interface TierConfig {
2062
- first_unit: number;
2063
- last_unit: number | null;
2064
- unit_amount: string;
2065
- }
2066
- }
2067
- interface OtherSubLineItem {
2068
- /**
2069
- * The total amount for this sub line item.
2070
- */
2071
- amount: string;
2072
- grouping: OtherSubLineItem.Grouping | null;
2073
- name: string;
2074
- quantity: number;
2075
- type: "'null'";
2076
- }
2077
- namespace OtherSubLineItem {
2078
- interface Grouping {
2079
- key: string;
2080
- /**
2081
- * No value indicates the default group
2082
- */
2083
- value: string | null;
2084
- }
2085
- }
2086
- interface TaxAmount {
2087
- /**
2088
- * The amount of additional tax incurred by this tax rate.
2089
- */
2090
- amount: string;
2091
- /**
2092
- * The human-readable description of the applied tax rate.
2093
- */
2094
- tax_rate_description: string;
2095
- /**
2096
- * The tax rate percentage, out of 100.
2097
- */
2098
- tax_rate_percentage: string | null;
2099
- }
2100
- }
2101
- interface Maximum {
2102
- /**
2103
- * @deprecated List of price_ids that this maximum amount applies to. For plan/plan
2104
- * phase maximums, this can be a subset of prices.
2105
- */
2106
- applies_to_price_ids: Array<string>;
2107
- /**
2108
- * The filters that determine which prices to apply this maximum to.
2109
- */
2110
- filters: Array<Maximum.Filter>;
2111
- /**
2112
- * Maximum amount applied
2113
- */
2114
- maximum_amount: string;
2115
- }
2116
- namespace Maximum {
2117
- interface Filter {
2118
- /**
2119
- * The property of the price to filter on.
2120
- */
2121
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2122
- /**
2123
- * Should prices that match the filter be included or excluded.
2124
- */
2125
- operator: 'includes' | 'excludes';
2126
- /**
2127
- * The IDs or values that match this filter.
2128
- */
2129
- values: Array<string>;
2130
- }
2131
- }
2132
- interface Minimum {
2133
- /**
2134
- * @deprecated List of price_ids that this minimum amount applies to. For plan/plan
2135
- * phase minimums, this can be a subset of prices.
2136
- */
2137
- applies_to_price_ids: Array<string>;
2138
- /**
2139
- * The filters that determine which prices to apply this minimum to.
2140
- */
2141
- filters: Array<Minimum.Filter>;
2142
- /**
2143
- * Minimum amount applied
2144
- */
2145
- minimum_amount: string;
2146
- }
2147
- namespace Minimum {
2148
- interface Filter {
2149
- /**
2150
- * The property of the price to filter on.
2151
- */
2152
- field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
2153
- /**
2154
- * Should prices that match the filter be included or excluded.
2155
- */
2156
- operator: 'includes' | 'excludes';
2157
- /**
2158
- * The IDs or values that match this filter.
2159
- */
2160
- values: Array<string>;
2161
- }
2162
- }
2163
511
  interface PaymentAttempt {
2164
512
  /**
2165
513
  * The ID of the payment attempt.
@@ -2186,17 +534,6 @@ export declare namespace InvoiceFetchUpcomingResponse {
2186
534
  */
2187
535
  succeeded: boolean;
2188
536
  }
2189
- interface ShippingAddress {
2190
- city: string | null;
2191
- country: string | null;
2192
- line1: string | null;
2193
- line2: string | null;
2194
- postal_code: string | null;
2195
- state: string | null;
2196
- }
2197
- interface Subscription {
2198
- id: string;
2199
- }
2200
537
  }
2201
538
  export interface InvoiceCreateParams {
2202
539
  /**
@@ -2268,15 +605,7 @@ export declare namespace InvoiceCreateParams {
2268
605
  * A date string to specify the line item's start date in the customer's timezone.
2269
606
  */
2270
607
  start_date: string;
2271
- unit_config: LineItem.UnitConfig;
2272
- }
2273
- namespace LineItem {
2274
- interface UnitConfig {
2275
- /**
2276
- * Rate per unit of usage
2277
- */
2278
- unit_amount: string;
2279
- }
608
+ unit_config: Shared.UnitConfig;
2280
609
  }
2281
610
  }
2282
611
  export interface InvoiceUpdateParams {
@@ -2340,6 +669,7 @@ export interface InvoiceMarkPaidParams {
2340
669
  notes?: string | null;
2341
670
  }
2342
671
  export declare namespace Invoices {
2343
- export { type Invoice as Invoice, type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse, InvoicesPage as InvoicesPage, type InvoiceCreateParams as InvoiceCreateParams, type InvoiceUpdateParams as InvoiceUpdateParams, type InvoiceListParams as InvoiceListParams, type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams, type InvoiceIssueParams as InvoiceIssueParams, type InvoiceMarkPaidParams as InvoiceMarkPaidParams, };
672
+ export { type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse, type InvoiceCreateParams as InvoiceCreateParams, type InvoiceUpdateParams as InvoiceUpdateParams, type InvoiceListParams as InvoiceListParams, type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams, type InvoiceIssueParams as InvoiceIssueParams, type InvoiceMarkPaidParams as InvoiceMarkPaidParams, };
2344
673
  }
674
+ export { InvoicesPage };
2345
675
  //# sourceMappingURL=invoices.d.ts.map