orb-billing 5.48.0 → 5.76.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 (205) hide show
  1. package/CHANGELOG.md +249 -0
  2. package/core.js +2 -2
  3. package/core.js.map +1 -1
  4. package/core.mjs +2 -2
  5. package/core.mjs.map +1 -1
  6. package/index.d.ts.map +1 -1
  7. package/index.js +11 -0
  8. package/index.js.map +1 -1
  9. package/index.mjs +11 -0
  10. package/index.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/alerts.d.ts +140 -3
  13. package/resources/alerts.d.ts.map +1 -1
  14. package/resources/alerts.js.map +1 -1
  15. package/resources/alerts.mjs.map +1 -1
  16. package/resources/beta/beta.d.ts +738 -7570
  17. package/resources/beta/beta.d.ts.map +1 -1
  18. package/resources/beta/beta.js.map +1 -1
  19. package/resources/beta/beta.mjs.map +1 -1
  20. package/resources/beta/external-plan-id.d.ts +664 -7572
  21. package/resources/beta/external-plan-id.d.ts.map +1 -1
  22. package/resources/coupons/coupons.d.ts +29 -0
  23. package/resources/coupons/coupons.d.ts.map +1 -1
  24. package/resources/coupons/coupons.js +21 -0
  25. package/resources/coupons/coupons.js.map +1 -1
  26. package/resources/coupons/coupons.mjs +21 -0
  27. package/resources/coupons/coupons.mjs.map +1 -1
  28. package/resources/coupons/subscriptions.d.ts +10 -0
  29. package/resources/coupons/subscriptions.d.ts.map +1 -1
  30. package/resources/coupons/subscriptions.js.map +1 -1
  31. package/resources/coupons/subscriptions.mjs.map +1 -1
  32. package/resources/credit-blocks.d.ts +138 -7
  33. package/resources/credit-blocks.d.ts.map +1 -1
  34. package/resources/credit-blocks.js +10 -7
  35. package/resources/credit-blocks.js.map +1 -1
  36. package/resources/credit-blocks.mjs +10 -7
  37. package/resources/credit-blocks.mjs.map +1 -1
  38. package/resources/credit-notes.d.ts +28 -0
  39. package/resources/credit-notes.d.ts.map +1 -1
  40. package/resources/credit-notes.js +20 -0
  41. package/resources/credit-notes.js.map +1 -1
  42. package/resources/credit-notes.mjs +20 -0
  43. package/resources/credit-notes.mjs.map +1 -1
  44. package/resources/customers/credits/credits.d.ts +129 -0
  45. package/resources/customers/credits/credits.d.ts.map +1 -1
  46. package/resources/customers/credits/credits.js.map +1 -1
  47. package/resources/customers/credits/credits.mjs.map +1 -1
  48. package/resources/customers/credits/ledger.d.ts +34 -20
  49. package/resources/customers/credits/ledger.d.ts.map +1 -1
  50. package/resources/customers/credits/ledger.js +28 -14
  51. package/resources/customers/credits/ledger.js.map +1 -1
  52. package/resources/customers/credits/ledger.mjs +28 -14
  53. package/resources/customers/credits/ledger.mjs.map +1 -1
  54. package/resources/customers/customers.d.ts +89 -6
  55. package/resources/customers/customers.d.ts.map +1 -1
  56. package/resources/customers/customers.js.map +1 -1
  57. package/resources/customers/customers.mjs.map +1 -1
  58. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +35 -1
  59. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -1
  60. package/resources/dimensional-price-groups/dimensional-price-groups.js +26 -0
  61. package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -1
  62. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +26 -0
  63. package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -1
  64. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +16 -0
  65. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
  66. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +16 -0
  67. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -1
  68. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +16 -0
  69. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -1
  70. package/resources/events/backfills.d.ts +37 -0
  71. package/resources/events/backfills.d.ts.map +1 -1
  72. package/resources/events/backfills.js +29 -0
  73. package/resources/events/backfills.js.map +1 -1
  74. package/resources/events/backfills.mjs +29 -0
  75. package/resources/events/backfills.mjs.map +1 -1
  76. package/resources/events/events.d.ts +41 -33
  77. package/resources/events/events.d.ts.map +1 -1
  78. package/resources/events/events.js +39 -31
  79. package/resources/events/events.js.map +1 -1
  80. package/resources/events/events.mjs +39 -31
  81. package/resources/events/events.mjs.map +1 -1
  82. package/resources/events/volume.d.ts +7 -0
  83. package/resources/events/volume.d.ts.map +1 -1
  84. package/resources/events/volume.js +7 -0
  85. package/resources/events/volume.js.map +1 -1
  86. package/resources/events/volume.mjs +7 -0
  87. package/resources/events/volume.mjs.map +1 -1
  88. package/resources/invoice-line-items.d.ts +89 -1
  89. package/resources/invoice-line-items.d.ts.map +1 -1
  90. package/resources/invoice-line-items.js +12 -0
  91. package/resources/invoice-line-items.js.map +1 -1
  92. package/resources/invoice-line-items.mjs +12 -0
  93. package/resources/invoice-line-items.mjs.map +1 -1
  94. package/resources/invoices.d.ts +200 -12
  95. package/resources/invoices.d.ts.map +1 -1
  96. package/resources/invoices.js +64 -0
  97. package/resources/invoices.js.map +1 -1
  98. package/resources/invoices.mjs +64 -0
  99. package/resources/invoices.mjs.map +1 -1
  100. package/resources/items.d.ts +30 -0
  101. package/resources/items.d.ts.map +1 -1
  102. package/resources/items.js +22 -0
  103. package/resources/items.js.map +1 -1
  104. package/resources/items.mjs +22 -0
  105. package/resources/items.mjs.map +1 -1
  106. package/resources/licenses/external-licenses.d.ts +13 -1
  107. package/resources/licenses/external-licenses.d.ts.map +1 -1
  108. package/resources/licenses/external-licenses.js +12 -0
  109. package/resources/licenses/external-licenses.js.map +1 -1
  110. package/resources/licenses/external-licenses.mjs +12 -0
  111. package/resources/licenses/external-licenses.mjs.map +1 -1
  112. package/resources/licenses/licenses.d.ts +44 -0
  113. package/resources/licenses/licenses.d.ts.map +1 -1
  114. package/resources/licenses/licenses.js +44 -0
  115. package/resources/licenses/licenses.js.map +1 -1
  116. package/resources/licenses/licenses.mjs +44 -0
  117. package/resources/licenses/licenses.mjs.map +1 -1
  118. package/resources/licenses/usage.d.ts +17 -2
  119. package/resources/licenses/usage.d.ts.map +1 -1
  120. package/resources/licenses/usage.js +8 -0
  121. package/resources/licenses/usage.js.map +1 -1
  122. package/resources/licenses/usage.mjs +8 -0
  123. package/resources/licenses/usage.mjs.map +1 -1
  124. package/resources/metrics.d.ts +42 -5
  125. package/resources/metrics.d.ts.map +1 -1
  126. package/resources/metrics.js +27 -2
  127. package/resources/metrics.js.map +1 -1
  128. package/resources/metrics.mjs +27 -2
  129. package/resources/metrics.mjs.map +1 -1
  130. package/resources/plans/external-plan-id.d.ts +6 -2
  131. package/resources/plans/external-plan-id.d.ts.map +1 -1
  132. package/resources/plans/external-plan-id.js +2 -2
  133. package/resources/plans/external-plan-id.mjs +2 -2
  134. package/resources/plans/migrations.d.ts +42 -0
  135. package/resources/plans/migrations.d.ts.map +1 -1
  136. package/resources/plans/migrations.js.map +1 -1
  137. package/resources/plans/migrations.mjs.map +1 -1
  138. package/resources/plans/plans.d.ts +382 -3754
  139. package/resources/plans/plans.d.ts.map +1 -1
  140. package/resources/plans/plans.js +2 -2
  141. package/resources/plans/plans.js.map +1 -1
  142. package/resources/plans/plans.mjs +2 -2
  143. package/resources/plans/plans.mjs.map +1 -1
  144. package/resources/prices/external-price-id.d.ts +14 -0
  145. package/resources/prices/external-price-id.d.ts.map +1 -1
  146. package/resources/prices/external-price-id.js +14 -0
  147. package/resources/prices/external-price-id.js.map +1 -1
  148. package/resources/prices/external-price-id.mjs +14 -0
  149. package/resources/prices/external-price-id.mjs.map +1 -1
  150. package/resources/prices/prices.d.ts +1632 -393
  151. package/resources/prices/prices.d.ts.map +1 -1
  152. package/resources/prices/prices.js +46 -0
  153. package/resources/prices/prices.js.map +1 -1
  154. package/resources/prices/prices.mjs +46 -0
  155. package/resources/prices/prices.mjs.map +1 -1
  156. package/resources/shared.d.ts +922 -52
  157. package/resources/shared.d.ts.map +1 -1
  158. package/resources/shared.js.map +1 -1
  159. package/resources/shared.mjs.map +1 -1
  160. package/resources/subscription-changes.d.ts +72 -1
  161. package/resources/subscription-changes.d.ts.map +1 -1
  162. package/resources/subscription-changes.js.map +1 -1
  163. package/resources/subscription-changes.mjs.map +1 -1
  164. package/resources/subscriptions.d.ts +3075 -464
  165. package/resources/subscriptions.d.ts.map +1 -1
  166. package/resources/subscriptions.js +111 -0
  167. package/resources/subscriptions.js.map +1 -1
  168. package/resources/subscriptions.mjs +111 -0
  169. package/resources/subscriptions.mjs.map +1 -1
  170. package/src/core.ts +2 -2
  171. package/src/index.ts +12 -0
  172. package/src/resources/alerts.ts +161 -3
  173. package/src/resources/beta/beta.ts +828 -8988
  174. package/src/resources/beta/external-plan-id.ts +745 -8997
  175. package/src/resources/coupons/coupons.ts +29 -0
  176. package/src/resources/coupons/subscriptions.ts +10 -0
  177. package/src/resources/credit-blocks.ts +166 -7
  178. package/src/resources/credit-notes.ts +28 -0
  179. package/src/resources/customers/credits/credits.ts +157 -0
  180. package/src/resources/customers/credits/ledger.ts +34 -20
  181. package/src/resources/customers/customers.ts +99 -6
  182. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +35 -1
  183. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +16 -0
  184. package/src/resources/events/backfills.ts +37 -0
  185. package/src/resources/events/events.ts +41 -33
  186. package/src/resources/events/volume.ts +7 -0
  187. package/src/resources/invoice-line-items.ts +104 -0
  188. package/src/resources/invoices.ts +215 -11
  189. package/src/resources/items.ts +30 -0
  190. package/src/resources/licenses/external-licenses.ts +13 -1
  191. package/src/resources/licenses/licenses.ts +44 -0
  192. package/src/resources/licenses/usage.ts +17 -2
  193. package/src/resources/metrics.ts +43 -5
  194. package/src/resources/plans/external-plan-id.ts +7 -2
  195. package/src/resources/plans/migrations.ts +42 -0
  196. package/src/resources/plans/plans.ts +456 -4482
  197. package/src/resources/prices/external-price-id.ts +14 -0
  198. package/src/resources/prices/prices.ts +1743 -264
  199. package/src/resources/shared.ts +1172 -50
  200. package/src/resources/subscription-changes.ts +88 -1
  201. package/src/resources/subscriptions.ts +4707 -1585
  202. package/src/version.ts +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.mjs +1 -1
@@ -206,7 +206,7 @@ export class CustomersPage extends Page<Customer> {}
206
206
  export interface AccountingProviderConfig {
207
207
  external_provider_id: string;
208
208
 
209
- provider_type: string;
209
+ provider_type: 'quickbooks' | 'netsuite';
210
210
  }
211
211
 
212
212
  export interface AddressInput {
@@ -315,7 +315,7 @@ export interface Customer {
315
315
  | 'stripe_charge'
316
316
  | 'stripe_invoice'
317
317
  | 'netsuite'
318
- | 'netsuite_ampersand'
318
+ | 'adyen'
319
319
  | null;
320
320
 
321
321
  /**
@@ -324,6 +324,12 @@ export interface Customer {
324
324
  */
325
325
  payment_provider_id: string | null;
326
326
 
327
+ /**
328
+ * Deprecated. Returns the URL of the most recent non-expired portal link, or null.
329
+ * When the account has opted into customer portal sessions, this field always
330
+ * returns null. Use POST /v1/customers/{id}/portal_sessions to mint short-lived
331
+ * portal session URLs.
332
+ */
327
333
  portal_url: string | null;
328
334
 
329
335
  shipping_address: Shared.Address | null;
@@ -386,11 +392,13 @@ export interface Customer {
386
392
  * | Estonia | `eu_vat` | European VAT Number |
387
393
  * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
388
394
  * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
395
+ * | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
389
396
  * | Finland | `eu_vat` | European VAT Number |
390
397
  * | France | `eu_vat` | European VAT Number |
391
398
  * | Georgia | `ge_vat` | Georgian VAT |
392
399
  * | Germany | `de_stn` | German Tax Number (Steuernummer) |
393
400
  * | Germany | `eu_vat` | European VAT Number |
401
+ * | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
394
402
  * | Greece | `eu_vat` | European VAT Number |
395
403
  * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
396
404
  * | Hong Kong | `hk_br` | Hong Kong BR Number |
@@ -402,6 +410,7 @@ export interface Customer {
402
410
  * | Ireland | `eu_vat` | European VAT Number |
403
411
  * | Israel | `il_vat` | Israel VAT |
404
412
  * | Italy | `eu_vat` | European VAT Number |
413
+ * | Italy | `it_cf` | Italian Codice Fiscale Number |
405
414
  * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
406
415
  * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
407
416
  * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
@@ -432,6 +441,7 @@ export interface Customer {
432
441
  * | Norway | `no_vat` | Norwegian VAT Number |
433
442
  * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
434
443
  * | Oman | `om_vat` | Omani VAT Number |
444
+ * | Paraguay | `py_ruc` | Paraguayan RUC Number |
435
445
  * | Peru | `pe_ruc` | Peruvian RUC Number |
436
446
  * | Philippines | `ph_tin` | Philippines Tax Identification Number |
437
447
  * | Poland | `eu_vat` | European VAT Number |
@@ -453,6 +463,7 @@ export interface Customer {
453
463
  * | South Korea | `kr_brn` | Korean BRN |
454
464
  * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
455
465
  * | Spain | `eu_vat` | European VAT Number |
466
+ * | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
456
467
  * | Suriname | `sr_fin` | Suriname FIN Number |
457
468
  * | Sweden | `eu_vat` | European VAT Number |
458
469
  * | Switzerland | `ch_uid` | Switzerland UID Number |
@@ -492,6 +503,15 @@ export interface Customer {
492
503
  */
493
504
  automatic_tax_enabled?: boolean | null;
494
505
 
506
+ /**
507
+ * A payment method represents a customer's stored payment instrument held with an
508
+ * external payment provider (such as Adyen or Stripe).
509
+ *
510
+ * The serialization is intentionally minimal for now; provider-pulled details
511
+ * (e.g. card display metadata) will be added over time.
512
+ */
513
+ default_payment_method?: Customer.DefaultPaymentMethod | null;
514
+
495
515
  /**
496
516
  * Payment configuration for the customer, applicable when using Orb Invoicing with
497
517
  * a supported payment provider such as Stripe.
@@ -521,10 +541,56 @@ export namespace Customer {
521
541
  export interface AccountingProvider {
522
542
  external_provider_id: string | null;
523
543
 
524
- provider_type: 'quickbooks' | 'netsuite' | 'netsuite_ampersand';
544
+ provider_type: 'quickbooks' | 'netsuite';
525
545
  }
526
546
  }
527
547
 
548
+ /**
549
+ * A payment method represents a customer's stored payment instrument held with an
550
+ * external payment provider (such as Adyen or Stripe).
551
+ *
552
+ * The serialization is intentionally minimal for now; provider-pulled details
553
+ * (e.g. card display metadata) will be added over time.
554
+ */
555
+ export interface DefaultPaymentMethod {
556
+ /**
557
+ * The Orb-assigned unique identifier for the payment method.
558
+ */
559
+ id: string;
560
+
561
+ /**
562
+ * The time at which the payment method was created.
563
+ */
564
+ created_at: string;
565
+
566
+ /**
567
+ * The ID of the Orb customer this payment method is attached to.
568
+ */
569
+ customer_id: string;
570
+
571
+ /**
572
+ * Whether this is the customer's default payment method.
573
+ */
574
+ default: boolean;
575
+
576
+ /**
577
+ * The identifier of this payment method in the external payment provider.
578
+ */
579
+ external_payment_method_id: string;
580
+
581
+ /**
582
+ * The type of the underlying payment instrument, e.g. `card` or `us_bank_account`.
583
+ */
584
+ payment_method_type: 'card' | 'us_bank_account' | 'link' | 'amazon_pay' | 'crypto';
585
+
586
+ /**
587
+ * The external payment provider this method belongs to, derived from the linked
588
+ * payment gateway connection (e.g. `adyen` or `stripe`). Null if the connection
589
+ * has been removed.
590
+ */
591
+ provider_type: string | null;
592
+ }
593
+
528
594
  /**
529
595
  * Payment configuration for the customer, applicable when using Orb Invoicing with
530
596
  * a supported payment provider such as Stripe.
@@ -711,7 +777,7 @@ export interface CustomerCreateParams {
711
777
  | 'stripe_charge'
712
778
  | 'stripe_invoice'
713
779
  | 'netsuite'
714
- | 'netsuite_ampersand'
780
+ | 'adyen'
715
781
  | null;
716
782
 
717
783
  /**
@@ -791,11 +857,13 @@ export interface CustomerCreateParams {
791
857
  * | Estonia | `eu_vat` | European VAT Number |
792
858
  * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
793
859
  * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
860
+ * | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
794
861
  * | Finland | `eu_vat` | European VAT Number |
795
862
  * | France | `eu_vat` | European VAT Number |
796
863
  * | Georgia | `ge_vat` | Georgian VAT |
797
864
  * | Germany | `de_stn` | German Tax Number (Steuernummer) |
798
865
  * | Germany | `eu_vat` | European VAT Number |
866
+ * | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
799
867
  * | Greece | `eu_vat` | European VAT Number |
800
868
  * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
801
869
  * | Hong Kong | `hk_br` | Hong Kong BR Number |
@@ -807,6 +875,7 @@ export interface CustomerCreateParams {
807
875
  * | Ireland | `eu_vat` | European VAT Number |
808
876
  * | Israel | `il_vat` | Israel VAT |
809
877
  * | Italy | `eu_vat` | European VAT Number |
878
+ * | Italy | `it_cf` | Italian Codice Fiscale Number |
810
879
  * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
811
880
  * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
812
881
  * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
@@ -837,6 +906,7 @@ export interface CustomerCreateParams {
837
906
  * | Norway | `no_vat` | Norwegian VAT Number |
838
907
  * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
839
908
  * | Oman | `om_vat` | Omani VAT Number |
909
+ * | Paraguay | `py_ruc` | Paraguayan RUC Number |
840
910
  * | Peru | `pe_ruc` | Peruvian RUC Number |
841
911
  * | Philippines | `ph_tin` | Philippines Tax Identification Number |
842
912
  * | Poland | `eu_vat` | European VAT Number |
@@ -858,6 +928,7 @@ export interface CustomerCreateParams {
858
928
  * | South Korea | `kr_brn` | Korean BRN |
859
929
  * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
860
930
  * | Spain | `eu_vat` | European VAT Number |
931
+ * | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
861
932
  * | Suriname | `sr_fin` | Suriname FIN Number |
862
933
  * | Sweden | `eu_vat` | European VAT Number |
863
934
  * | Switzerland | `ch_uid` | Switzerland UID Number |
@@ -999,6 +1070,12 @@ export interface CustomerUpdateParams {
999
1070
  */
1000
1071
  currency?: string | null;
1001
1072
 
1073
+ /**
1074
+ * The Orb ID of the payment method to set as this customer's default. Pass `null`
1075
+ * to clear the customer's default payment method.
1076
+ */
1077
+ default_payment_method_id?: string | null;
1078
+
1002
1079
  /**
1003
1080
  * A valid customer email, to be used for invoicing and notifications.
1004
1081
  */
@@ -1053,7 +1130,7 @@ export interface CustomerUpdateParams {
1053
1130
  | 'stripe_charge'
1054
1131
  | 'stripe_invoice'
1055
1132
  | 'netsuite'
1056
- | 'netsuite_ampersand'
1133
+ | 'adyen'
1057
1134
  | null;
1058
1135
 
1059
1136
  /**
@@ -1133,11 +1210,13 @@ export interface CustomerUpdateParams {
1133
1210
  * | Estonia | `eu_vat` | European VAT Number |
1134
1211
  * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
1135
1212
  * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
1213
+ * | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
1136
1214
  * | Finland | `eu_vat` | European VAT Number |
1137
1215
  * | France | `eu_vat` | European VAT Number |
1138
1216
  * | Georgia | `ge_vat` | Georgian VAT |
1139
1217
  * | Germany | `de_stn` | German Tax Number (Steuernummer) |
1140
1218
  * | Germany | `eu_vat` | European VAT Number |
1219
+ * | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
1141
1220
  * | Greece | `eu_vat` | European VAT Number |
1142
1221
  * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
1143
1222
  * | Hong Kong | `hk_br` | Hong Kong BR Number |
@@ -1149,6 +1228,7 @@ export interface CustomerUpdateParams {
1149
1228
  * | Ireland | `eu_vat` | European VAT Number |
1150
1229
  * | Israel | `il_vat` | Israel VAT |
1151
1230
  * | Italy | `eu_vat` | European VAT Number |
1231
+ * | Italy | `it_cf` | Italian Codice Fiscale Number |
1152
1232
  * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
1153
1233
  * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
1154
1234
  * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
@@ -1179,6 +1259,7 @@ export interface CustomerUpdateParams {
1179
1259
  * | Norway | `no_vat` | Norwegian VAT Number |
1180
1260
  * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
1181
1261
  * | Oman | `om_vat` | Omani VAT Number |
1262
+ * | Paraguay | `py_ruc` | Paraguayan RUC Number |
1182
1263
  * | Peru | `pe_ruc` | Peruvian RUC Number |
1183
1264
  * | Philippines | `ph_tin` | Philippines Tax Identification Number |
1184
1265
  * | Poland | `eu_vat` | European VAT Number |
@@ -1200,6 +1281,7 @@ export interface CustomerUpdateParams {
1200
1281
  * | South Korea | `kr_brn` | Korean BRN |
1201
1282
  * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
1202
1283
  * | Spain | `eu_vat` | European VAT Number |
1284
+ * | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
1203
1285
  * | Suriname | `sr_fin` | Suriname FIN Number |
1204
1286
  * | Sweden | `eu_vat` | European VAT Number |
1205
1287
  * | Switzerland | `ch_uid` | Switzerland UID Number |
@@ -1344,6 +1426,12 @@ export interface CustomerUpdateByExternalIDParams {
1344
1426
  */
1345
1427
  currency?: string | null;
1346
1428
 
1429
+ /**
1430
+ * The Orb ID of the payment method to set as this customer's default. Pass `null`
1431
+ * to clear the customer's default payment method.
1432
+ */
1433
+ default_payment_method_id?: string | null;
1434
+
1347
1435
  /**
1348
1436
  * A valid customer email, to be used for invoicing and notifications.
1349
1437
  */
@@ -1398,7 +1486,7 @@ export interface CustomerUpdateByExternalIDParams {
1398
1486
  | 'stripe_charge'
1399
1487
  | 'stripe_invoice'
1400
1488
  | 'netsuite'
1401
- | 'netsuite_ampersand'
1489
+ | 'adyen'
1402
1490
  | null;
1403
1491
 
1404
1492
  /**
@@ -1478,11 +1566,13 @@ export interface CustomerUpdateByExternalIDParams {
1478
1566
  * | Estonia | `eu_vat` | European VAT Number |
1479
1567
  * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
1480
1568
  * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
1569
+ * | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
1481
1570
  * | Finland | `eu_vat` | European VAT Number |
1482
1571
  * | France | `eu_vat` | European VAT Number |
1483
1572
  * | Georgia | `ge_vat` | Georgian VAT |
1484
1573
  * | Germany | `de_stn` | German Tax Number (Steuernummer) |
1485
1574
  * | Germany | `eu_vat` | European VAT Number |
1575
+ * | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
1486
1576
  * | Greece | `eu_vat` | European VAT Number |
1487
1577
  * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
1488
1578
  * | Hong Kong | `hk_br` | Hong Kong BR Number |
@@ -1494,6 +1584,7 @@ export interface CustomerUpdateByExternalIDParams {
1494
1584
  * | Ireland | `eu_vat` | European VAT Number |
1495
1585
  * | Israel | `il_vat` | Israel VAT |
1496
1586
  * | Italy | `eu_vat` | European VAT Number |
1587
+ * | Italy | `it_cf` | Italian Codice Fiscale Number |
1497
1588
  * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
1498
1589
  * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
1499
1590
  * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
@@ -1524,6 +1615,7 @@ export interface CustomerUpdateByExternalIDParams {
1524
1615
  * | Norway | `no_vat` | Norwegian VAT Number |
1525
1616
  * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
1526
1617
  * | Oman | `om_vat` | Omani VAT Number |
1618
+ * | Paraguay | `py_ruc` | Paraguayan RUC Number |
1527
1619
  * | Peru | `pe_ruc` | Peruvian RUC Number |
1528
1620
  * | Philippines | `ph_tin` | Philippines Tax Identification Number |
1529
1621
  * | Poland | `eu_vat` | European VAT Number |
@@ -1545,6 +1637,7 @@ export interface CustomerUpdateByExternalIDParams {
1545
1637
  * | South Korea | `kr_brn` | Korean BRN |
1546
1638
  * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
1547
1639
  * | Spain | `eu_vat` | European VAT Number |
1640
+ * | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
1548
1641
  * | Suriname | `sr_fin` | Suriname FIN Number |
1549
1642
  * | Sweden | `eu_vat` | European VAT Number |
1550
1643
  * | Switzerland | `ch_uid` | Switzerland UID Number |
@@ -24,6 +24,16 @@ export class DimensionalPriceGroups extends APIResource {
24
24
  * widgets used and we want to charge differently depending on the color of the
25
25
  * widget. We can create a price group with a dimension "color" and two prices: one
26
26
  * that charges \$10 per red widget and one that charges \$20 per blue widget.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const dimensionalPriceGroup =
31
+ * await client.dimensionalPriceGroups.create({
32
+ * billable_metric_id: 'billable_metric_id',
33
+ * dimensions: ['region', 'instance_type'],
34
+ * name: 'name',
35
+ * });
36
+ * ```
27
37
  */
28
38
  create(
29
39
  body: DimensionalPriceGroupCreateParams,
@@ -34,6 +44,14 @@ export class DimensionalPriceGroups extends APIResource {
34
44
 
35
45
  /**
36
46
  * Fetch dimensional price group
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const dimensionalPriceGroup =
51
+ * await client.dimensionalPriceGroups.retrieve(
52
+ * 'dimensional_price_group_id',
53
+ * );
54
+ * ```
37
55
  */
38
56
  retrieve(
39
57
  dimensionalPriceGroupId: string,
@@ -46,6 +64,14 @@ export class DimensionalPriceGroups extends APIResource {
46
64
  * This endpoint can be used to update the `external_dimensional_price_group_id`
47
65
  * and `metadata` of an existing dimensional price group. Other fields on a
48
66
  * dimensional price group are currently immutable.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const dimensionalPriceGroup =
71
+ * await client.dimensionalPriceGroups.update(
72
+ * 'dimensional_price_group_id',
73
+ * );
74
+ * ```
49
75
  */
50
76
  update(
51
77
  dimensionalPriceGroupId: string,
@@ -57,6 +83,14 @@ export class DimensionalPriceGroups extends APIResource {
57
83
 
58
84
  /**
59
85
  * List dimensional price groups
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * // Automatically fetches more pages as needed.
90
+ * for await (const dimensionalPriceGroup of client.dimensionalPriceGroups.list()) {
91
+ * // ...
92
+ * }
93
+ * ```
60
94
  */
61
95
  list(
62
96
  query?: DimensionalPriceGroupListParams,
@@ -81,7 +115,7 @@ export class DimensionalPriceGroupsPage extends Page<DimensionalPriceGroup> {}
81
115
 
82
116
  /**
83
117
  * A dimensional price group is used to partition the result of a billable metric
84
- * by a set of dimensions. Prices in a price group must specify the parition used
118
+ * by a set of dimensions. Prices in a price group must specify the partition used
85
119
  * to derive their usage.
86
120
  */
87
121
  export interface DimensionalPriceGroup {
@@ -7,6 +7,14 @@ import * as DimensionalPriceGroupsAPI from './dimensional-price-groups';
7
7
  export class ExternalDimensionalPriceGroupID extends APIResource {
8
8
  /**
9
9
  * Fetch dimensional price group by external ID
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const dimensionalPriceGroup =
14
+ * await client.dimensionalPriceGroups.externalDimensionalPriceGroupId.retrieve(
15
+ * 'external_dimensional_price_group_id',
16
+ * );
17
+ * ```
10
18
  */
11
19
  retrieve(
12
20
  externalDimensionalPriceGroupId: string,
@@ -22,6 +30,14 @@ export class ExternalDimensionalPriceGroupID extends APIResource {
22
30
  * This endpoint can be used to update the `external_dimensional_price_group_id`
23
31
  * and `metadata` of an existing dimensional price group. Other fields on a
24
32
  * dimensional price group are currently immutable.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const dimensionalPriceGroup =
37
+ * await client.dimensionalPriceGroups.externalDimensionalPriceGroupId.update(
38
+ * 'external_dimensional_price_group_id',
39
+ * );
40
+ * ```
25
41
  */
26
42
  update(
27
43
  externalDimensionalPriceGroupId: string,
@@ -52,6 +52,14 @@ export class Backfills extends APIResource {
52
52
  *
53
53
  * You may not have multiple backfills in a pending or pending_revert state with
54
54
  * overlapping timeframes.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const backfill = await client.events.backfills.create({
59
+ * timeframe_end: '2019-12-27T18:11:19.117Z',
60
+ * timeframe_start: '2019-12-27T18:11:19.117Z',
61
+ * });
62
+ * ```
55
63
  */
56
64
  create(body: BackfillCreateParams, options?: Core.RequestOptions): Core.APIPromise<BackfillCreateResponse> {
57
65
  return this._client.post('/events/backfills', { body, ...options });
@@ -64,6 +72,14 @@ export class Backfills extends APIResource {
64
72
  * backfill. The response also includes
65
73
  * [`pagination_metadata`](/api-reference/pagination), which lets the caller
66
74
  * retrieve the next page of results if they exist.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * // Automatically fetches more pages as needed.
79
+ * for await (const backfillListResponse of client.events.backfills.list()) {
80
+ * // ...
81
+ * }
82
+ * ```
67
83
  */
68
84
  list(
69
85
  query?: BackfillListParams,
@@ -85,6 +101,13 @@ export class Backfills extends APIResource {
85
101
  * backfill, Orb will asynchronously reflect the updated usage in invoice amounts
86
102
  * and usage graphs. Once all of the updates are complete, the backfill's status
87
103
  * will transition to `reflected`.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const response = await client.events.backfills.close(
108
+ * 'backfill_id',
109
+ * );
110
+ * ```
88
111
  */
89
112
  close(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillCloseResponse> {
90
113
  return this._client.post(`/events/backfills/${backfillId}/close`, options);
@@ -92,6 +115,13 @@ export class Backfills extends APIResource {
92
115
 
93
116
  /**
94
117
  * This endpoint is used to fetch a backfill given an identifier.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * const response = await client.events.backfills.fetch(
122
+ * 'backfill_id',
123
+ * );
124
+ * ```
95
125
  */
96
126
  fetch(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillFetchResponse> {
97
127
  return this._client.get(`/events/backfills/${backfillId}`, options);
@@ -105,6 +135,13 @@ export class Backfills extends APIResource {
105
135
  *
106
136
  * If a backfill is reverted before its closed, no usage will be updated as a
107
137
  * result of the backfill and it will immediately transition to `reverted`.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const response = await client.events.backfills.revert(
142
+ * 'backfill_id',
143
+ * );
144
+ * ```
108
145
  */
109
146
  revert(backfillId: string, options?: Core.RequestOptions): Core.APIPromise<BackfillRevertResponse> {
110
147
  return this._client.post(`/events/backfills/${backfillId}/revert`, options);
@@ -72,6 +72,15 @@ export class Events extends APIResource {
72
72
  * - By default, no more than 100 events can be amended for a single customer in a
73
73
  * 100 day period. For higher volume updates, consider using the
74
74
  * [event backfill](create-backfill) endpoint.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const event = await client.events.update('event_id', {
79
+ * event_name: 'event_name',
80
+ * properties: { foo: 'bar' },
81
+ * timestamp: '2020-12-09T16:09:53Z',
82
+ * });
83
+ * ```
75
84
  */
76
85
  update(
77
86
  eventId: string,
@@ -122,6 +131,11 @@ export class Events extends APIResource {
122
131
  * - By default, no more than 100 events can be deprecated for a single customer in
123
132
  * a 100 day period. For higher volume updates, consider using the
124
133
  * [event backfill](create-backfill) endpoint.
134
+ *
135
+ * @example
136
+ * ```ts
137
+ * const response = await client.events.deprecate('event_id');
138
+ * ```
125
139
  */
126
140
  deprecate(eventId: string, options?: Core.RequestOptions): Core.APIPromise<EventDeprecateResponse> {
127
141
  return this._client.put(`/events/${eventId}/deprecate`, options);
@@ -243,8 +257,8 @@ export class Events extends APIResource {
243
257
  * billed for in the corresponding billing period.
244
258
  *
245
259
  * In general, Orb does not expect events with future dated timestamps. In cases
246
- * where the timestamp is at least 24 hours ahead of the current time, the event
247
- * will not be accepted as a valid event, and will throw validation errors.
260
+ * where the timestamp is 5 minutes ahead of the current time, the event will not
261
+ * be accepted as a valid event, and will throw validation errors.
248
262
  *
249
263
  * ## Event validation
250
264
  *
@@ -259,9 +273,9 @@ export class Events extends APIResource {
259
273
  * - If the `external_customer_id` is specified, the customer in Orb does not need
260
274
  * to exist. Events will be attributed to any future customers with the
261
275
  * `external_customer_id` on subscription creation.
262
- * - `timestamp` must conform to ISO 8601 and represent a timestamp at most 1 hour
263
- * in the future. This timestamp should be sent in UTC timezone (no timezone
264
- * offset).
276
+ * - `timestamp` must conform to ISO 8601 and represent a timestamp at most 5
277
+ * minutes in the future. This timestamp should be sent in UTC timezone (no
278
+ * timezone offset).
265
279
  *
266
280
  * ## Idempotency and retry semantics
267
281
  *
@@ -298,39 +312,26 @@ export class Events extends APIResource {
298
312
  * request payload size, but please give us a heads up if you’re changing either of
299
313
  * these factors by an order of magnitude from initial setup.
300
314
  *
301
- * ## Testing in debug mode
302
- *
303
- * The ingestion API supports a debug mode, which returns additional verbose output
304
- * to indicate which event idempotency keys were newly ingested or duplicates from
305
- * previous requests. To enable this mode, mark `debug=true` as a query parameter.
306
- *
307
- * If `debug=true` is not specified, the response will only contain
308
- * `validation_failed`. Orb will still honor the idempotency guarantees set
309
- * [here](/events-and-metrics/event-ingestion#event-volume-and-concurrency) in all
310
- * cases.
311
- *
312
- * We strongly recommend that you only use debug mode as part of testing your
313
- * initial Orb integration. Once you're ready to switch to production, disable
314
- * debug mode to take advantage of improved performance and maximal throughput.
315
- *
316
- * #### Example: ingestion response with `debug=true`
315
+ * #### Example: ingestion response
317
316
  *
318
317
  * ```json
319
318
  * {
320
- * "debug": {
321
- * "duplicate": [],
322
- * "ingested": ["B7E83HDMfJPAunXW", "SJs5DQJ3TnwSqEZE", "8SivfDsNKwCeAXim"]
323
- * },
324
319
  * "validation_failed": []
325
320
  * }
326
321
  * ```
327
322
  *
328
- * #### Example: ingestion response with `debug=false`
329
- *
330
- * ```json
331
- * {
332
- * "validation_failed": []
333
- * }
323
+ * @example
324
+ * ```ts
325
+ * const response = await client.events.ingest({
326
+ * events: [
327
+ * {
328
+ * event_name: 'event_name',
329
+ * idempotency_key: 'idempotency_key',
330
+ * properties: { foo: 'bar' },
331
+ * timestamp: '2020-12-09T16:09:53Z',
332
+ * },
333
+ * ],
334
+ * });
334
335
  * ```
335
336
  */
336
337
  ingest(params: EventIngestParams, options?: Core.RequestOptions): Core.APIPromise<EventIngestResponse> {
@@ -354,6 +355,13 @@ export class Events extends APIResource {
354
355
  *
355
356
  * By default, Orb will not throw a `404` if no events matched, Orb will return an
356
357
  * empty array for `data` instead.
358
+ *
359
+ * @example
360
+ * ```ts
361
+ * const response = await client.events.search({
362
+ * event_ids: ['string'],
363
+ * });
364
+ * ```
357
365
  */
358
366
  search(body: EventSearchParams, options?: Core.RequestOptions): Core.APIPromise<EventSearchResponse> {
359
367
  return this._client.post('/events/search', { body, ...options });
@@ -511,8 +519,8 @@ export interface EventIngestParams {
511
519
  backfill_id?: string | null;
512
520
 
513
521
  /**
514
- * Query param: Flag to enable additional debug information in the endpoint
515
- * response
522
+ * @deprecated Query param: Pending Deprecation: Flag to enable additional debug
523
+ * information in the endpoint response
516
524
  */
517
525
  debug?: boolean;
518
526
  }
@@ -23,6 +23,13 @@ export class Volume extends APIResource {
23
23
  * where the start and end time are hour-aligned and in UTC. When a specific
24
24
  * timestamp is passed in for either start or end time, the response includes the
25
25
  * hours the timestamp falls in.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const eventVolumes = await client.events.volume.list({
30
+ * timeframe_start: '2019-12-27T18:11:19.117Z',
31
+ * });
32
+ * ```
26
33
  */
27
34
  list(query: VolumeListParams, options?: Core.RequestOptions): Core.APIPromise<EventVolumes> {
28
35
  return this._client.get('/events/volume', { query, ...options });