orb-billing 1.22.0 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/core.d.ts.map +1 -1
  3. package/core.js +8 -10
  4. package/core.js.map +1 -1
  5. package/core.mjs +8 -10
  6. package/core.mjs.map +1 -1
  7. package/index.d.mts +2 -2
  8. package/index.d.ts +2 -2
  9. package/index.d.ts.map +1 -1
  10. package/index.js +4 -0
  11. package/index.js.map +1 -1
  12. package/index.mjs +4 -0
  13. package/index.mjs.map +1 -1
  14. package/package.json +3 -1
  15. package/resources/coupons/coupons.d.ts +60 -2
  16. package/resources/coupons/coupons.d.ts.map +1 -1
  17. package/resources/coupons/coupons.js.map +1 -1
  18. package/resources/coupons/coupons.mjs.map +1 -1
  19. package/resources/credit-notes.d.ts +57 -5
  20. package/resources/credit-notes.d.ts.map +1 -1
  21. package/resources/credit-notes.js.map +1 -1
  22. package/resources/credit-notes.mjs.map +1 -1
  23. package/resources/customers/balance-transactions.d.ts +2 -2
  24. package/resources/customers/balance-transactions.d.ts.map +1 -1
  25. package/resources/customers/balance-transactions.js.map +1 -1
  26. package/resources/customers/balance-transactions.mjs.map +1 -1
  27. package/resources/customers/customers.d.ts +696 -8
  28. package/resources/customers/customers.d.ts.map +1 -1
  29. package/resources/customers/customers.js.map +1 -1
  30. package/resources/customers/customers.mjs.map +1 -1
  31. package/resources/customers/usage.d.ts +74 -58
  32. package/resources/customers/usage.d.ts.map +1 -1
  33. package/resources/customers/usage.js +14 -14
  34. package/resources/customers/usage.js.map +1 -1
  35. package/resources/customers/usage.mjs +14 -14
  36. package/resources/customers/usage.mjs.map +1 -1
  37. package/resources/events/events.d.ts +40 -40
  38. package/resources/events/events.js +40 -40
  39. package/resources/events/events.mjs +40 -40
  40. package/resources/index.d.ts +4 -3
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js +19 -4
  43. package/resources/index.js.map +1 -1
  44. package/resources/index.mjs +2 -1
  45. package/resources/index.mjs.map +1 -1
  46. package/resources/invoice-line-items.d.ts +2 -2
  47. package/resources/invoice-line-items.d.ts.map +1 -1
  48. package/resources/invoices.d.ts +358 -71
  49. package/resources/invoices.d.ts.map +1 -1
  50. package/resources/invoices.js.map +1 -1
  51. package/resources/invoices.mjs.map +1 -1
  52. package/resources/plans/plans.d.ts +648 -4
  53. package/resources/plans/plans.d.ts.map +1 -1
  54. package/resources/plans/plans.js.map +1 -1
  55. package/resources/plans/plans.mjs.map +1 -1
  56. package/resources/prices/index.d.ts +1 -1
  57. package/resources/prices/index.d.ts.map +1 -1
  58. package/resources/prices/index.js +3 -3
  59. package/resources/prices/index.js.map +1 -1
  60. package/resources/prices/index.mjs +1 -1
  61. package/resources/prices/index.mjs.map +1 -1
  62. package/resources/prices/prices.d.ts +56 -83
  63. package/resources/prices/prices.d.ts.map +1 -1
  64. package/resources/prices/prices.js.map +1 -1
  65. package/resources/prices/prices.mjs.map +1 -1
  66. package/resources/shared.d.ts +62 -0
  67. package/resources/shared.d.ts.map +1 -0
  68. package/resources/shared.js +4 -0
  69. package/resources/shared.js.map +1 -0
  70. package/resources/shared.mjs +3 -0
  71. package/resources/shared.mjs.map +1 -0
  72. package/resources/subscriptions.d.ts +1084 -241
  73. package/resources/subscriptions.d.ts.map +1 -1
  74. package/resources/subscriptions.js.map +1 -1
  75. package/resources/subscriptions.mjs.map +1 -1
  76. package/src/_shims/index.d.ts +1 -1
  77. package/src/_shims/index.mjs +1 -1
  78. package/src/core.ts +8 -12
  79. package/src/index.ts +8 -3
  80. package/src/resources/coupons/coupons.ts +82 -8
  81. package/src/resources/coupons/subscriptions.ts +7 -7
  82. package/src/resources/credit-notes.ts +86 -10
  83. package/src/resources/customers/balance-transactions.ts +23 -7
  84. package/src/resources/customers/costs.ts +5 -5
  85. package/src/resources/customers/credits/credits.ts +6 -6
  86. package/src/resources/customers/credits/ledger.ts +5 -5
  87. package/src/resources/customers/customers.ts +1153 -21
  88. package/src/resources/customers/usage.ts +83 -65
  89. package/src/resources/events/backfills.ts +5 -5
  90. package/src/resources/events/events.ts +45 -45
  91. package/src/resources/index.ts +3 -3
  92. package/src/resources/invoice-line-items.ts +6 -6
  93. package/src/resources/invoices.ts +604 -97
  94. package/src/resources/items.ts +5 -5
  95. package/src/resources/metrics.ts +5 -5
  96. package/src/resources/plans/external-plan-id.ts +5 -5
  97. package/src/resources/plans/plans.ts +817 -11
  98. package/src/resources/prices/external-price-id.ts +3 -3
  99. package/src/resources/prices/index.ts +1 -1
  100. package/src/resources/prices/prices.ts +73 -106
  101. package/src/resources/shared.ts +84 -0
  102. package/src/resources/subscriptions.ts +1299 -287
  103. package/src/resources/top-level.ts +3 -3
  104. package/src/version.ts +1 -1
  105. package/version.d.ts +1 -1
  106. package/version.js +1 -1
  107. package/version.mjs +1 -1
@@ -1,11 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from "../ling/core";
4
- import { APIResource } from "../ling/resource";
5
- import { isRequestOptions } from "../ling/core";
6
- import * as InvoicesAPI from "../ling/resources/invoices";
7
- import * as PricesAPI from "../ling/resources/prices/prices";
8
- import { Page, type PageParams } from "../ling/pagination";
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import { isRequestOptions } from "../core";
6
+ import * as InvoicesAPI from "./invoices";
7
+ import * as Shared from "./shared";
8
+ import * as PricesAPI from "./prices/prices";
9
+ import { Page, type PageParams } from "../pagination";
9
10
 
10
11
  export class Invoices extends APIResource {
11
12
  /**
@@ -145,11 +146,97 @@ export interface Invoice {
145
146
 
146
147
  customer_balance_transactions: Array<Invoice.CustomerBalanceTransaction>;
147
148
 
149
+ /**
150
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
151
+ * added to the headers of invoices.
152
+ *
153
+ * ### Supported Tax ID Countries and Types
154
+ *
155
+ * | Country | Type | Description |
156
+ * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
157
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
158
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
159
+ * | Austria | `eu_vat` | European VAT number |
160
+ * | Belgium | `eu_vat` | European VAT number |
161
+ * | Brazil | `br_cnpj` | Brazilian CNPJ number |
162
+ * | Brazil | `br_cpf` | Brazilian CPF number |
163
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
164
+ * | Bulgaria | `eu_vat` | European VAT number |
165
+ * | Canada | `ca_bn` | Canadian BN |
166
+ * | Canada | `ca_gst_hst` | Canadian GST/HST number |
167
+ * | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) |
168
+ * | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) |
169
+ * | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) |
170
+ * | Canada | `ca_qst` | Canadian QST number (Québec) |
171
+ * | Chile | `cl_tin` | Chilean TIN |
172
+ * | Croatia | `eu_vat` | European VAT number |
173
+ * | Cyprus | `eu_vat` | European VAT number |
174
+ * | Czech Republic | `eu_vat` | European VAT number |
175
+ * | Denmark | `eu_vat` | European VAT number |
176
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
177
+ * | Estonia | `eu_vat` | European VAT number |
178
+ * | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme |
179
+ * | Finland | `eu_vat` | European VAT number |
180
+ * | France | `eu_vat` | European VAT number |
181
+ * | Georgia | `ge_vat` | Georgian VAT |
182
+ * | Germany | `eu_vat` | European VAT number |
183
+ * | Greece | `eu_vat` | European VAT number |
184
+ * | Hong Kong | `hk_br` | Hong Kong BR number |
185
+ * | Hungary | `eu_vat` | European VAT number |
186
+ * | Hungary | `hu_tin` | Hungary tax number (adószám) |
187
+ * | Iceland | `is_vat` | Icelandic VAT |
188
+ * | India | `in_gst` | Indian GST number |
189
+ * | Indonesia | `id_npwp` | Indonesian NPWP number |
190
+ * | Ireland | `eu_vat` | European VAT number |
191
+ * | Israel | `il_vat` | Israel VAT |
192
+ * | Italy | `eu_vat` | European VAT number |
193
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
194
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
195
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
196
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
197
+ * | Latvia | `eu_vat` | European VAT number |
198
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID number |
199
+ * | Lithuania | `eu_vat` | European VAT number |
200
+ * | Luxembourg | `eu_vat` | European VAT number |
201
+ * | Malaysia | `my_frp` | Malaysian FRP number |
202
+ * | Malaysia | `my_itn` | Malaysian ITN |
203
+ * | Malaysia | `my_sst` | Malaysian SST number |
204
+ * | Malta | `eu_vat ` | European VAT number |
205
+ * | Mexico | `mx_rfc` | Mexican RFC number |
206
+ * | Netherlands | `eu_vat` | European VAT number |
207
+ * | New Zealand | `nz_gst` | New Zealand GST number |
208
+ * | Norway | `no_vat` | Norwegian VAT number |
209
+ * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
210
+ * | Poland | `eu_vat` | European VAT number |
211
+ * | Portugal | `eu_vat` | European VAT number |
212
+ * | Romania | `eu_vat` | European VAT number |
213
+ * | Russia | `ru_inn` | Russian INN |
214
+ * | Russia | `ru_kpp` | Russian KPP |
215
+ * | Saudi Arabia | `sg_gst` | Singaporean GST |
216
+ * | Singapore | `sg_uen` | Singaporean UEN |
217
+ * | Slovakia | `eu_vat` | European VAT number |
218
+ * | Slovenia | `eu_vat` | European VAT number |
219
+ * | Slovenia | `si_tin` | Slovenia tax number (davčna številka) |
220
+ * | South Africa | `za_vat` | South African VAT number |
221
+ * | South Korea | `kr_brn` | Korean BRN |
222
+ * | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) |
223
+ * | Spain | `eu_vat` | European VAT number |
224
+ * | Sweden | `eu_vat` | European VAT number |
225
+ * | Switzerland | `ch_vat` | Switzerland VAT number |
226
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
227
+ * | Thailand | `th_vat` | Thai VAT |
228
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
229
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
230
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
231
+ * | United Kingdom | `eu_vat` | Northern Ireland VAT number |
232
+ * | United Kingdom | `gb_vat` | United Kingdom VAT number |
233
+ * | United States | `us_ein` | United States EIN |
234
+ */
148
235
  customer_tax_id: Invoice.CustomerTaxID | null;
149
236
 
150
- discount: InvoiceDiscount | null;
237
+ discount: Shared.Discount | null;
151
238
 
152
- discounts: Array<InvoiceDiscount>;
239
+ discounts: Array<Shared.Discount>;
153
240
 
154
241
  /**
155
242
  * When the invoice payment is due.
@@ -347,7 +434,15 @@ export namespace Invoice {
347
434
  */
348
435
  id: string;
349
436
 
350
- action: 'applied_to_invoice' | 'prorated_refund' | 'manual_adjustment';
437
+ action:
438
+ | 'applied_to_invoice'
439
+ | 'manual_adjustment'
440
+ | 'prorated_refund'
441
+ | 'revert_prorated_refund'
442
+ | 'return_from_voiding'
443
+ | 'credit_note_applied'
444
+ | 'credit_note_voided'
445
+ | 'overpayment_refund';
351
446
 
352
447
  /**
353
448
  * The value of the amount changed in the transaction.
@@ -399,10 +494,207 @@ export namespace Invoice {
399
494
  }
400
495
  }
401
496
 
497
+ /**
498
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
499
+ * added to the headers of invoices.
500
+ *
501
+ * ### Supported Tax ID Countries and Types
502
+ *
503
+ * | Country | Type | Description |
504
+ * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
505
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
506
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
507
+ * | Austria | `eu_vat` | European VAT number |
508
+ * | Belgium | `eu_vat` | European VAT number |
509
+ * | Brazil | `br_cnpj` | Brazilian CNPJ number |
510
+ * | Brazil | `br_cpf` | Brazilian CPF number |
511
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
512
+ * | Bulgaria | `eu_vat` | European VAT number |
513
+ * | Canada | `ca_bn` | Canadian BN |
514
+ * | Canada | `ca_gst_hst` | Canadian GST/HST number |
515
+ * | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) |
516
+ * | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) |
517
+ * | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) |
518
+ * | Canada | `ca_qst` | Canadian QST number (Québec) |
519
+ * | Chile | `cl_tin` | Chilean TIN |
520
+ * | Croatia | `eu_vat` | European VAT number |
521
+ * | Cyprus | `eu_vat` | European VAT number |
522
+ * | Czech Republic | `eu_vat` | European VAT number |
523
+ * | Denmark | `eu_vat` | European VAT number |
524
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
525
+ * | Estonia | `eu_vat` | European VAT number |
526
+ * | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme |
527
+ * | Finland | `eu_vat` | European VAT number |
528
+ * | France | `eu_vat` | European VAT number |
529
+ * | Georgia | `ge_vat` | Georgian VAT |
530
+ * | Germany | `eu_vat` | European VAT number |
531
+ * | Greece | `eu_vat` | European VAT number |
532
+ * | Hong Kong | `hk_br` | Hong Kong BR number |
533
+ * | Hungary | `eu_vat` | European VAT number |
534
+ * | Hungary | `hu_tin` | Hungary tax number (adószám) |
535
+ * | Iceland | `is_vat` | Icelandic VAT |
536
+ * | India | `in_gst` | Indian GST number |
537
+ * | Indonesia | `id_npwp` | Indonesian NPWP number |
538
+ * | Ireland | `eu_vat` | European VAT number |
539
+ * | Israel | `il_vat` | Israel VAT |
540
+ * | Italy | `eu_vat` | European VAT number |
541
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
542
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
543
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
544
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
545
+ * | Latvia | `eu_vat` | European VAT number |
546
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID number |
547
+ * | Lithuania | `eu_vat` | European VAT number |
548
+ * | Luxembourg | `eu_vat` | European VAT number |
549
+ * | Malaysia | `my_frp` | Malaysian FRP number |
550
+ * | Malaysia | `my_itn` | Malaysian ITN |
551
+ * | Malaysia | `my_sst` | Malaysian SST number |
552
+ * | Malta | `eu_vat ` | European VAT number |
553
+ * | Mexico | `mx_rfc` | Mexican RFC number |
554
+ * | Netherlands | `eu_vat` | European VAT number |
555
+ * | New Zealand | `nz_gst` | New Zealand GST number |
556
+ * | Norway | `no_vat` | Norwegian VAT number |
557
+ * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
558
+ * | Poland | `eu_vat` | European VAT number |
559
+ * | Portugal | `eu_vat` | European VAT number |
560
+ * | Romania | `eu_vat` | European VAT number |
561
+ * | Russia | `ru_inn` | Russian INN |
562
+ * | Russia | `ru_kpp` | Russian KPP |
563
+ * | Saudi Arabia | `sg_gst` | Singaporean GST |
564
+ * | Singapore | `sg_uen` | Singaporean UEN |
565
+ * | Slovakia | `eu_vat` | European VAT number |
566
+ * | Slovenia | `eu_vat` | European VAT number |
567
+ * | Slovenia | `si_tin` | Slovenia tax number (davčna številka) |
568
+ * | South Africa | `za_vat` | South African VAT number |
569
+ * | South Korea | `kr_brn` | Korean BRN |
570
+ * | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) |
571
+ * | Spain | `eu_vat` | European VAT number |
572
+ * | Sweden | `eu_vat` | European VAT number |
573
+ * | Switzerland | `ch_vat` | Switzerland VAT number |
574
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
575
+ * | Thailand | `th_vat` | Thai VAT |
576
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
577
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
578
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
579
+ * | United Kingdom | `eu_vat` | Northern Ireland VAT number |
580
+ * | United Kingdom | `gb_vat` | United Kingdom VAT number |
581
+ * | United States | `us_ein` | United States EIN |
582
+ */
402
583
  export interface CustomerTaxID {
403
- country: string;
404
-
405
- type: string;
584
+ country:
585
+ | 'AE'
586
+ | 'AT'
587
+ | 'AU'
588
+ | 'BE'
589
+ | 'BG'
590
+ | 'BR'
591
+ | 'CA'
592
+ | 'CH'
593
+ | 'CL'
594
+ | 'CY'
595
+ | 'CZ'
596
+ | 'DE'
597
+ | 'DK'
598
+ | 'EE'
599
+ | 'EG'
600
+ | 'ES'
601
+ | 'EU'
602
+ | 'FI'
603
+ | 'FR'
604
+ | 'GB'
605
+ | 'GE'
606
+ | 'GR'
607
+ | 'HK'
608
+ | 'HR'
609
+ | 'HU'
610
+ | 'ID'
611
+ | 'IE'
612
+ | 'IL'
613
+ | 'IN'
614
+ | 'IS'
615
+ | 'IT'
616
+ | 'JP'
617
+ | 'KE'
618
+ | 'KR'
619
+ | 'LI'
620
+ | 'LT'
621
+ | 'LU'
622
+ | 'LV'
623
+ | 'MT'
624
+ | 'MX'
625
+ | 'MY'
626
+ | 'NL'
627
+ | 'NO'
628
+ | 'NZ'
629
+ | 'PH'
630
+ | 'PL'
631
+ | 'PT'
632
+ | 'RO'
633
+ | 'RU'
634
+ | 'SA'
635
+ | 'SE'
636
+ | 'SG'
637
+ | 'SI'
638
+ | 'SK'
639
+ | 'TH'
640
+ | 'TR'
641
+ | 'TW'
642
+ | 'UA'
643
+ | 'US'
644
+ | 'ZA';
645
+
646
+ type:
647
+ | 'ae_trn'
648
+ | 'eu_vat'
649
+ | 'au_abn'
650
+ | 'au_arn'
651
+ | 'bg_uic'
652
+ | 'br_cnpj'
653
+ | 'br_cpf'
654
+ | 'ca_bn'
655
+ | 'ca_gst_hst'
656
+ | 'ca_pst_bc'
657
+ | 'ca_pst_mb'
658
+ | 'ca_pst_sk'
659
+ | 'ca_qst'
660
+ | 'ch_vat'
661
+ | 'cl_tin'
662
+ | 'eg_tin'
663
+ | 'es_cif'
664
+ | 'eu_oss_vat'
665
+ | 'gb_vat'
666
+ | 'ge_vat'
667
+ | 'hk_br'
668
+ | 'hu_tin'
669
+ | 'id_npwp'
670
+ | 'il_vat'
671
+ | 'in_gst'
672
+ | 'is_vat'
673
+ | 'jp_cn'
674
+ | 'jp_rn'
675
+ | 'jp_trn'
676
+ | 'ke_pin'
677
+ | 'kr_brn'
678
+ | 'li_uid'
679
+ | 'mx_rfc'
680
+ | 'my_frp'
681
+ | 'my_itn'
682
+ | 'my_sst'
683
+ | 'no_vat'
684
+ | 'nz_gst'
685
+ | 'ph_tin'
686
+ | 'ru_inn'
687
+ | 'ru_kpp'
688
+ | 'sa_vat'
689
+ | 'sg_gst'
690
+ | 'sg_uen'
691
+ | 'si_tin'
692
+ | 'th_vat'
693
+ | 'tr_tin'
694
+ | 'tw_vat'
695
+ | 'ua_vat'
696
+ | 'us_ein'
697
+ | 'za_vat';
406
698
 
407
699
  value: string;
408
700
  }
@@ -418,7 +710,7 @@ export namespace Invoice {
418
710
  */
419
711
  amount: string;
420
712
 
421
- discount: InvoicesAPI.InvoiceDiscount | null;
713
+ discount: Shared.Discount | null;
422
714
 
423
715
  /**
424
716
  * The end date of the range of time applied for this line item's price.
@@ -892,81 +1184,6 @@ export namespace Invoice {
892
1184
  }
893
1185
  }
894
1186
 
895
- export type InvoiceDiscount =
896
- | InvoiceDiscount.PercentageDiscount
897
- | InvoiceDiscount.TrialDiscount
898
- | InvoiceDiscount.UsageDiscount
899
- | InvoiceDiscount.AmountDiscount;
900
-
901
- export namespace InvoiceDiscount {
902
- export interface PercentageDiscount {
903
- /**
904
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
905
- * this can be a subset of prices.
906
- */
907
- applies_to_price_ids: Array<string>;
908
-
909
- discount_type: 'percentage';
910
-
911
- /**
912
- * Only available if discount_type is `percentage`.This is a number between 0
913
- * and 1.
914
- */
915
- percentage_discount: number;
916
- }
917
-
918
- export interface TrialDiscount {
919
- /**
920
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
921
- * this can be a subset of prices.
922
- */
923
- applies_to_price_ids: Array<string>;
924
-
925
- discount_type: 'trial';
926
-
927
- /**
928
- * Only available if discount_type is `trial`
929
- */
930
- trial_amount_discount?: string | null;
931
-
932
- /**
933
- * Only available if discount_type is `trial`
934
- */
935
- trial_percentage_discount?: number | null;
936
- }
937
-
938
- export interface UsageDiscount {
939
- /**
940
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
941
- * this can be a subset of prices.
942
- */
943
- applies_to_price_ids: Array<string>;
944
-
945
- discount_type: 'usage';
946
-
947
- /**
948
- * Only available if discount_type is `usage`. Number of usage units that this
949
- * discount is for
950
- */
951
- usage_discount: number;
952
- }
953
-
954
- export interface AmountDiscount {
955
- /**
956
- * Only available if discount_type is `amount`.
957
- */
958
- amount_discount: string;
959
-
960
- /**
961
- * List of price_ids that this discount applies to. For plan/plan phase discounts,
962
- * this can be a subset of prices.
963
- */
964
- applies_to_price_ids: Array<string>;
965
-
966
- discount_type: 'amount';
967
- }
968
- }
969
-
970
1187
  export interface InvoiceFetchUpcomingResponse {
971
1188
  id: string;
972
1189
 
@@ -999,11 +1216,97 @@ export interface InvoiceFetchUpcomingResponse {
999
1216
 
1000
1217
  customer_balance_transactions: Array<InvoiceFetchUpcomingResponse.CustomerBalanceTransaction>;
1001
1218
 
1219
+ /**
1220
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
1221
+ * added to the headers of invoices.
1222
+ *
1223
+ * ### Supported Tax ID Countries and Types
1224
+ *
1225
+ * | Country | Type | Description |
1226
+ * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
1227
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
1228
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
1229
+ * | Austria | `eu_vat` | European VAT number |
1230
+ * | Belgium | `eu_vat` | European VAT number |
1231
+ * | Brazil | `br_cnpj` | Brazilian CNPJ number |
1232
+ * | Brazil | `br_cpf` | Brazilian CPF number |
1233
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
1234
+ * | Bulgaria | `eu_vat` | European VAT number |
1235
+ * | Canada | `ca_bn` | Canadian BN |
1236
+ * | Canada | `ca_gst_hst` | Canadian GST/HST number |
1237
+ * | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) |
1238
+ * | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) |
1239
+ * | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) |
1240
+ * | Canada | `ca_qst` | Canadian QST number (Québec) |
1241
+ * | Chile | `cl_tin` | Chilean TIN |
1242
+ * | Croatia | `eu_vat` | European VAT number |
1243
+ * | Cyprus | `eu_vat` | European VAT number |
1244
+ * | Czech Republic | `eu_vat` | European VAT number |
1245
+ * | Denmark | `eu_vat` | European VAT number |
1246
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
1247
+ * | Estonia | `eu_vat` | European VAT number |
1248
+ * | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme |
1249
+ * | Finland | `eu_vat` | European VAT number |
1250
+ * | France | `eu_vat` | European VAT number |
1251
+ * | Georgia | `ge_vat` | Georgian VAT |
1252
+ * | Germany | `eu_vat` | European VAT number |
1253
+ * | Greece | `eu_vat` | European VAT number |
1254
+ * | Hong Kong | `hk_br` | Hong Kong BR number |
1255
+ * | Hungary | `eu_vat` | European VAT number |
1256
+ * | Hungary | `hu_tin` | Hungary tax number (adószám) |
1257
+ * | Iceland | `is_vat` | Icelandic VAT |
1258
+ * | India | `in_gst` | Indian GST number |
1259
+ * | Indonesia | `id_npwp` | Indonesian NPWP number |
1260
+ * | Ireland | `eu_vat` | European VAT number |
1261
+ * | Israel | `il_vat` | Israel VAT |
1262
+ * | Italy | `eu_vat` | European VAT number |
1263
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
1264
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
1265
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
1266
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
1267
+ * | Latvia | `eu_vat` | European VAT number |
1268
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID number |
1269
+ * | Lithuania | `eu_vat` | European VAT number |
1270
+ * | Luxembourg | `eu_vat` | European VAT number |
1271
+ * | Malaysia | `my_frp` | Malaysian FRP number |
1272
+ * | Malaysia | `my_itn` | Malaysian ITN |
1273
+ * | Malaysia | `my_sst` | Malaysian SST number |
1274
+ * | Malta | `eu_vat ` | European VAT number |
1275
+ * | Mexico | `mx_rfc` | Mexican RFC number |
1276
+ * | Netherlands | `eu_vat` | European VAT number |
1277
+ * | New Zealand | `nz_gst` | New Zealand GST number |
1278
+ * | Norway | `no_vat` | Norwegian VAT number |
1279
+ * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
1280
+ * | Poland | `eu_vat` | European VAT number |
1281
+ * | Portugal | `eu_vat` | European VAT number |
1282
+ * | Romania | `eu_vat` | European VAT number |
1283
+ * | Russia | `ru_inn` | Russian INN |
1284
+ * | Russia | `ru_kpp` | Russian KPP |
1285
+ * | Saudi Arabia | `sg_gst` | Singaporean GST |
1286
+ * | Singapore | `sg_uen` | Singaporean UEN |
1287
+ * | Slovakia | `eu_vat` | European VAT number |
1288
+ * | Slovenia | `eu_vat` | European VAT number |
1289
+ * | Slovenia | `si_tin` | Slovenia tax number (davčna številka) |
1290
+ * | South Africa | `za_vat` | South African VAT number |
1291
+ * | South Korea | `kr_brn` | Korean BRN |
1292
+ * | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) |
1293
+ * | Spain | `eu_vat` | European VAT number |
1294
+ * | Sweden | `eu_vat` | European VAT number |
1295
+ * | Switzerland | `ch_vat` | Switzerland VAT number |
1296
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
1297
+ * | Thailand | `th_vat` | Thai VAT |
1298
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
1299
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
1300
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
1301
+ * | United Kingdom | `eu_vat` | Northern Ireland VAT number |
1302
+ * | United Kingdom | `gb_vat` | United Kingdom VAT number |
1303
+ * | United States | `us_ein` | United States EIN |
1304
+ */
1002
1305
  customer_tax_id: InvoiceFetchUpcomingResponse.CustomerTaxID | null;
1003
1306
 
1004
- discount: InvoiceDiscount | null;
1307
+ discount: Shared.Discount | null;
1005
1308
 
1006
- discounts: Array<InvoiceDiscount>;
1309
+ discounts: Array<Shared.Discount>;
1007
1310
 
1008
1311
  /**
1009
1312
  * When the invoice payment is due.
@@ -1201,7 +1504,15 @@ export namespace InvoiceFetchUpcomingResponse {
1201
1504
  */
1202
1505
  id: string;
1203
1506
 
1204
- action: 'applied_to_invoice' | 'prorated_refund' | 'manual_adjustment';
1507
+ action:
1508
+ | 'applied_to_invoice'
1509
+ | 'manual_adjustment'
1510
+ | 'prorated_refund'
1511
+ | 'revert_prorated_refund'
1512
+ | 'return_from_voiding'
1513
+ | 'credit_note_applied'
1514
+ | 'credit_note_voided'
1515
+ | 'overpayment_refund';
1205
1516
 
1206
1517
  /**
1207
1518
  * The value of the amount changed in the transaction.
@@ -1253,10 +1564,207 @@ export namespace InvoiceFetchUpcomingResponse {
1253
1564
  }
1254
1565
  }
1255
1566
 
1567
+ /**
1568
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
1569
+ * added to the headers of invoices.
1570
+ *
1571
+ * ### Supported Tax ID Countries and Types
1572
+ *
1573
+ * | Country | Type | Description |
1574
+ * | -------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
1575
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
1576
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
1577
+ * | Austria | `eu_vat` | European VAT number |
1578
+ * | Belgium | `eu_vat` | European VAT number |
1579
+ * | Brazil | `br_cnpj` | Brazilian CNPJ number |
1580
+ * | Brazil | `br_cpf` | Brazilian CPF number |
1581
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
1582
+ * | Bulgaria | `eu_vat` | European VAT number |
1583
+ * | Canada | `ca_bn` | Canadian BN |
1584
+ * | Canada | `ca_gst_hst` | Canadian GST/HST number |
1585
+ * | Canada | `ca_pst_bc` | Canadian PST number (British Columbia) |
1586
+ * | Canada | `ca_pst_mb` | Canadian PST number (Manitoba) |
1587
+ * | Canada | `ca_pst_sk` | Canadian PST number (Saskatchewan) |
1588
+ * | Canada | `ca_qst` | Canadian QST number (Québec) |
1589
+ * | Chile | `cl_tin` | Chilean TIN |
1590
+ * | Croatia | `eu_vat` | European VAT number |
1591
+ * | Cyprus | `eu_vat` | European VAT number |
1592
+ * | Czech Republic | `eu_vat` | European VAT number |
1593
+ * | Denmark | `eu_vat` | European VAT number |
1594
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
1595
+ * | Estonia | `eu_vat` | European VAT number |
1596
+ * | EU | `eu_oss_vat` | European One Stop Shop VAT number for non-Union scheme |
1597
+ * | Finland | `eu_vat` | European VAT number |
1598
+ * | France | `eu_vat` | European VAT number |
1599
+ * | Georgia | `ge_vat` | Georgian VAT |
1600
+ * | Germany | `eu_vat` | European VAT number |
1601
+ * | Greece | `eu_vat` | European VAT number |
1602
+ * | Hong Kong | `hk_br` | Hong Kong BR number |
1603
+ * | Hungary | `eu_vat` | European VAT number |
1604
+ * | Hungary | `hu_tin` | Hungary tax number (adószám) |
1605
+ * | Iceland | `is_vat` | Icelandic VAT |
1606
+ * | India | `in_gst` | Indian GST number |
1607
+ * | Indonesia | `id_npwp` | Indonesian NPWP number |
1608
+ * | Ireland | `eu_vat` | European VAT number |
1609
+ * | Israel | `il_vat` | Israel VAT |
1610
+ * | Italy | `eu_vat` | European VAT number |
1611
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
1612
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
1613
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
1614
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
1615
+ * | Latvia | `eu_vat` | European VAT number |
1616
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID number |
1617
+ * | Lithuania | `eu_vat` | European VAT number |
1618
+ * | Luxembourg | `eu_vat` | European VAT number |
1619
+ * | Malaysia | `my_frp` | Malaysian FRP number |
1620
+ * | Malaysia | `my_itn` | Malaysian ITN |
1621
+ * | Malaysia | `my_sst` | Malaysian SST number |
1622
+ * | Malta | `eu_vat ` | European VAT number |
1623
+ * | Mexico | `mx_rfc` | Mexican RFC number |
1624
+ * | Netherlands | `eu_vat` | European VAT number |
1625
+ * | New Zealand | `nz_gst` | New Zealand GST number |
1626
+ * | Norway | `no_vat` | Norwegian VAT number |
1627
+ * | Philippines | `ph_tin ` | Philippines Tax Identification Number |
1628
+ * | Poland | `eu_vat` | European VAT number |
1629
+ * | Portugal | `eu_vat` | European VAT number |
1630
+ * | Romania | `eu_vat` | European VAT number |
1631
+ * | Russia | `ru_inn` | Russian INN |
1632
+ * | Russia | `ru_kpp` | Russian KPP |
1633
+ * | Saudi Arabia | `sg_gst` | Singaporean GST |
1634
+ * | Singapore | `sg_uen` | Singaporean UEN |
1635
+ * | Slovakia | `eu_vat` | European VAT number |
1636
+ * | Slovenia | `eu_vat` | European VAT number |
1637
+ * | Slovenia | `si_tin` | Slovenia tax number (davčna številka) |
1638
+ * | South Africa | `za_vat` | South African VAT number |
1639
+ * | South Korea | `kr_brn` | Korean BRN |
1640
+ * | Spain | `es_cif` | Spanish NIF number (previously Spanish CIF number) |
1641
+ * | Spain | `eu_vat` | European VAT number |
1642
+ * | Sweden | `eu_vat` | European VAT number |
1643
+ * | Switzerland | `ch_vat` | Switzerland VAT number |
1644
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
1645
+ * | Thailand | `th_vat` | Thai VAT |
1646
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
1647
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
1648
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
1649
+ * | United Kingdom | `eu_vat` | Northern Ireland VAT number |
1650
+ * | United Kingdom | `gb_vat` | United Kingdom VAT number |
1651
+ * | United States | `us_ein` | United States EIN |
1652
+ */
1256
1653
  export interface CustomerTaxID {
1257
- country: string;
1258
-
1259
- type: string;
1654
+ country:
1655
+ | 'AE'
1656
+ | 'AT'
1657
+ | 'AU'
1658
+ | 'BE'
1659
+ | 'BG'
1660
+ | 'BR'
1661
+ | 'CA'
1662
+ | 'CH'
1663
+ | 'CL'
1664
+ | 'CY'
1665
+ | 'CZ'
1666
+ | 'DE'
1667
+ | 'DK'
1668
+ | 'EE'
1669
+ | 'EG'
1670
+ | 'ES'
1671
+ | 'EU'
1672
+ | 'FI'
1673
+ | 'FR'
1674
+ | 'GB'
1675
+ | 'GE'
1676
+ | 'GR'
1677
+ | 'HK'
1678
+ | 'HR'
1679
+ | 'HU'
1680
+ | 'ID'
1681
+ | 'IE'
1682
+ | 'IL'
1683
+ | 'IN'
1684
+ | 'IS'
1685
+ | 'IT'
1686
+ | 'JP'
1687
+ | 'KE'
1688
+ | 'KR'
1689
+ | 'LI'
1690
+ | 'LT'
1691
+ | 'LU'
1692
+ | 'LV'
1693
+ | 'MT'
1694
+ | 'MX'
1695
+ | 'MY'
1696
+ | 'NL'
1697
+ | 'NO'
1698
+ | 'NZ'
1699
+ | 'PH'
1700
+ | 'PL'
1701
+ | 'PT'
1702
+ | 'RO'
1703
+ | 'RU'
1704
+ | 'SA'
1705
+ | 'SE'
1706
+ | 'SG'
1707
+ | 'SI'
1708
+ | 'SK'
1709
+ | 'TH'
1710
+ | 'TR'
1711
+ | 'TW'
1712
+ | 'UA'
1713
+ | 'US'
1714
+ | 'ZA';
1715
+
1716
+ type:
1717
+ | 'ae_trn'
1718
+ | 'eu_vat'
1719
+ | 'au_abn'
1720
+ | 'au_arn'
1721
+ | 'bg_uic'
1722
+ | 'br_cnpj'
1723
+ | 'br_cpf'
1724
+ | 'ca_bn'
1725
+ | 'ca_gst_hst'
1726
+ | 'ca_pst_bc'
1727
+ | 'ca_pst_mb'
1728
+ | 'ca_pst_sk'
1729
+ | 'ca_qst'
1730
+ | 'ch_vat'
1731
+ | 'cl_tin'
1732
+ | 'eg_tin'
1733
+ | 'es_cif'
1734
+ | 'eu_oss_vat'
1735
+ | 'gb_vat'
1736
+ | 'ge_vat'
1737
+ | 'hk_br'
1738
+ | 'hu_tin'
1739
+ | 'id_npwp'
1740
+ | 'il_vat'
1741
+ | 'in_gst'
1742
+ | 'is_vat'
1743
+ | 'jp_cn'
1744
+ | 'jp_rn'
1745
+ | 'jp_trn'
1746
+ | 'ke_pin'
1747
+ | 'kr_brn'
1748
+ | 'li_uid'
1749
+ | 'mx_rfc'
1750
+ | 'my_frp'
1751
+ | 'my_itn'
1752
+ | 'my_sst'
1753
+ | 'no_vat'
1754
+ | 'nz_gst'
1755
+ | 'ph_tin'
1756
+ | 'ru_inn'
1757
+ | 'ru_kpp'
1758
+ | 'sa_vat'
1759
+ | 'sg_gst'
1760
+ | 'sg_uen'
1761
+ | 'si_tin'
1762
+ | 'th_vat'
1763
+ | 'tr_tin'
1764
+ | 'tw_vat'
1765
+ | 'ua_vat'
1766
+ | 'us_ein'
1767
+ | 'za_vat';
1260
1768
 
1261
1769
  value: string;
1262
1770
  }
@@ -1272,7 +1780,7 @@ export namespace InvoiceFetchUpcomingResponse {
1272
1780
  */
1273
1781
  amount: string;
1274
1782
 
1275
- discount: InvoicesAPI.InvoiceDiscount | null;
1783
+ discount: Shared.Discount | null;
1276
1784
 
1277
1785
  /**
1278
1786
  * The end date of the range of time applied for this line item's price.
@@ -1868,7 +2376,7 @@ export interface InvoiceListParams extends PageParams {
1868
2376
 
1869
2377
  is_recurring?: boolean | null;
1870
2378
 
1871
- status?: 'draft' | 'issued' | 'paid' | 'synced' | 'void' | null;
2379
+ 'status[]'?: Array<'draft' | 'issued' | 'paid' | 'synced' | 'void'> | null;
1872
2380
 
1873
2381
  subscription_id?: string | null;
1874
2382
  }
@@ -1896,7 +2404,6 @@ export interface InvoiceMarkPaidParams {
1896
2404
 
1897
2405
  export namespace Invoices {
1898
2406
  export import Invoice = InvoicesAPI.Invoice;
1899
- export import InvoiceDiscount = InvoicesAPI.InvoiceDiscount;
1900
2407
  export import InvoiceFetchUpcomingResponse = InvoicesAPI.InvoiceFetchUpcomingResponse;
1901
2408
  export import InvoicesPage = InvoicesAPI.InvoicesPage;
1902
2409
  export import InvoiceCreateParams = InvoicesAPI.InvoiceCreateParams;