orb-billing 6.14.0 → 6.16.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 (88) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +1 -1
  3. package/resources/beta/beta.d.mts +276 -2
  4. package/resources/beta/beta.d.mts.map +1 -1
  5. package/resources/beta/beta.d.ts +276 -2
  6. package/resources/beta/beta.d.ts.map +1 -1
  7. package/resources/beta/beta.js.map +1 -1
  8. package/resources/beta/beta.mjs.map +1 -1
  9. package/resources/beta/external-plan-id.d.mts +276 -2
  10. package/resources/beta/external-plan-id.d.mts.map +1 -1
  11. package/resources/beta/external-plan-id.d.ts +276 -2
  12. package/resources/beta/external-plan-id.d.ts.map +1 -1
  13. package/resources/customers/credits/top-ups.d.mts +14 -2
  14. package/resources/customers/credits/top-ups.d.mts.map +1 -1
  15. package/resources/customers/credits/top-ups.d.ts +14 -2
  16. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  17. package/resources/customers/credits/top-ups.js +14 -2
  18. package/resources/customers/credits/top-ups.js.map +1 -1
  19. package/resources/customers/credits/top-ups.mjs +14 -2
  20. package/resources/customers/credits/top-ups.mjs.map +1 -1
  21. package/resources/dimensional-price-groups/dimensional-price-groups.d.mts +11 -2
  22. package/resources/dimensional-price-groups/dimensional-price-groups.d.mts.map +1 -1
  23. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +11 -2
  24. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -1
  25. package/resources/dimensional-price-groups/dimensional-price-groups.js +11 -2
  26. package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -1
  27. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +11 -2
  28. package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -1
  29. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts +4 -1
  30. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts.map +1 -1
  31. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +4 -1
  32. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
  33. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +4 -1
  34. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -1
  35. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +4 -1
  36. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -1
  37. package/resources/items.d.mts +3 -1
  38. package/resources/items.d.mts.map +1 -1
  39. package/resources/items.d.ts +3 -1
  40. package/resources/items.d.ts.map +1 -1
  41. package/resources/items.js +3 -1
  42. package/resources/items.js.map +1 -1
  43. package/resources/items.mjs +3 -1
  44. package/resources/items.mjs.map +1 -1
  45. package/resources/plans/migrations.d.mts +3 -1
  46. package/resources/plans/migrations.d.mts.map +1 -1
  47. package/resources/plans/migrations.d.ts +3 -1
  48. package/resources/plans/migrations.d.ts.map +1 -1
  49. package/resources/plans/migrations.js +3 -1
  50. package/resources/plans/migrations.js.map +1 -1
  51. package/resources/plans/migrations.mjs +3 -1
  52. package/resources/plans/migrations.mjs.map +1 -1
  53. package/resources/plans/plans.d.mts +138 -1
  54. package/resources/plans/plans.d.mts.map +1 -1
  55. package/resources/plans/plans.d.ts +138 -1
  56. package/resources/plans/plans.d.ts.map +1 -1
  57. package/resources/plans/plans.js.map +1 -1
  58. package/resources/plans/plans.mjs.map +1 -1
  59. package/resources/prices/prices.d.mts +396 -3
  60. package/resources/prices/prices.d.mts.map +1 -1
  61. package/resources/prices/prices.d.ts +396 -3
  62. package/resources/prices/prices.d.ts.map +1 -1
  63. package/resources/prices/prices.js.map +1 -1
  64. package/resources/prices/prices.mjs.map +1 -1
  65. package/resources/shared.d.mts +153 -1
  66. package/resources/shared.d.mts.map +1 -1
  67. package/resources/shared.d.ts +153 -1
  68. package/resources/shared.d.ts.map +1 -1
  69. package/resources/subscriptions.d.mts +702 -23
  70. package/resources/subscriptions.d.mts.map +1 -1
  71. package/resources/subscriptions.d.ts +702 -23
  72. package/resources/subscriptions.d.ts.map +1 -1
  73. package/src/resources/beta/beta.ts +324 -0
  74. package/src/resources/beta/external-plan-id.ts +324 -0
  75. package/src/resources/customers/credits/top-ups.ts +14 -2
  76. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +11 -2
  77. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +4 -1
  78. package/src/resources/items.ts +3 -1
  79. package/src/resources/plans/migrations.ts +3 -1
  80. package/src/resources/plans/plans.ts +162 -0
  81. package/src/resources/prices/prices.ts +465 -0
  82. package/src/resources/shared.ts +194 -0
  83. package/src/resources/subscriptions.ts +931 -128
  84. package/src/version.ts +1 -1
  85. package/version.d.mts +1 -1
  86. package/version.d.ts +1 -1
  87. package/version.js +1 -1
  88. package/version.mjs +1 -1
@@ -29,7 +29,13 @@ export class TopUps extends APIResource {
29
29
  }
30
30
 
31
31
  /**
32
- * List top-ups
32
+ * This endpoint returns a list of a customer's active top-ups; a top-up that has
33
+ * been deactivated is not included. While a top-up is active, the customer's
34
+ * balance is increased by the top-up amount whenever it falls to the top-up's
35
+ * threshold.
36
+ *
37
+ * The response also includes pagination_metadata, which lets the caller retrieve
38
+ * the next page of results if they exist.
33
39
  */
34
40
  list(
35
41
  customerID: string,
@@ -91,7 +97,13 @@ export class TopUps extends APIResource {
91
97
  }
92
98
 
93
99
  /**
94
- * List top-ups by external ID
100
+ * This endpoint returns a list of a customer's active top-ups; a top-up that has
101
+ * been deactivated is not included. While a top-up is active, the customer's
102
+ * balance is increased by the top-up amount whenever it falls to the top-up's
103
+ * threshold.
104
+ *
105
+ * The response also includes pagination_metadata, which lets the caller retrieve
106
+ * the next page of results if they exist.
95
107
  */
96
108
  listByExternalID(
97
109
  externalCustomerID: string,
@@ -44,7 +44,10 @@ export class DimensionalPriceGroups extends APIResource {
44
44
  }
45
45
 
46
46
  /**
47
- * Fetch dimensional price group
47
+ * This endpoint returns a dimensional price group identified by its ID. A
48
+ * dimensional price group partitions the result of a billable metric by a set of
49
+ * dimensions, and the prices in the group specify which partition their usage is
50
+ * derived from.
48
51
  *
49
52
  * @example
50
53
  * ```ts
@@ -80,7 +83,13 @@ export class DimensionalPriceGroups extends APIResource {
80
83
  }
81
84
 
82
85
  /**
83
- * List dimensional price groups
86
+ * This endpoint returns a list of all dimensional price groups for an account. A
87
+ * dimensional price group partitions the result of a billable metric by a set of
88
+ * dimensions, and the prices in the group specify which partition their usage is
89
+ * derived from.
90
+ *
91
+ * The response also includes pagination_metadata, which lets the caller retrieve
92
+ * the next page of results if they exist.
84
93
  *
85
94
  * @example
86
95
  * ```ts
@@ -8,7 +8,10 @@ import { path } from '../../internal/utils/path';
8
8
 
9
9
  export class ExternalDimensionalPriceGroupID extends APIResource {
10
10
  /**
11
- * Fetch dimensional price group by external ID
11
+ * This endpoint returns a dimensional price group identified by the external ID
12
+ * you assigned it, rather than by its Orb ID. A dimensional price group partitions
13
+ * the result of a billable metric by a set of dimensions, and the prices in the
14
+ * group specify which partition their usage is derived from.
12
15
  *
13
16
  * @example
14
17
  * ```ts
@@ -57,7 +57,9 @@ export class Items extends APIResource {
57
57
  }
58
58
 
59
59
  /**
60
- * Archive item
60
+ * This endpoint archives an item, and cascades to archive every price for that
61
+ * item that is still active. An item that is already archived cannot be archived
62
+ * again.
61
63
  *
62
64
  * @example
63
65
  * ```ts
@@ -13,7 +13,9 @@ import { path } from '../../internal/utils/path';
13
13
  */
14
14
  export class Migrations extends APIResource {
15
15
  /**
16
- * Fetch migration
16
+ * This endpoint returns a migration for a plan, identified by its ID. A migration
17
+ * moves a plan's subscriptions onto a new version of that plan; the response
18
+ * reports the effective time it is scheduled for and its current status.
17
19
  */
18
20
  retrieve(
19
21
  migrationID: string,
@@ -459,6 +459,7 @@ export namespace PlanCreateParams {
459
459
  | Shared.NewPlanPackageWithAllocationPrice
460
460
  | Shared.NewPlanUnitWithPercentPrice
461
461
  | Shared.NewPlanMatrixWithAllocationPrice
462
+ | Price.NewPlanTieredMatrixWithAllocationPrice
462
463
  | Price.NewPlanMatrixWithThresholdDiscountsPrice
463
464
  | Price.NewPlanTieredWithProrationPrice
464
465
  | Shared.NewPlanUnitWithProrationPrice
@@ -934,6 +935,167 @@ export namespace PlanCreateParams {
934
935
  }
935
936
  }
936
937
 
938
+ export interface NewPlanTieredMatrixWithAllocationPrice {
939
+ /**
940
+ * The cadence to bill for this price on.
941
+ */
942
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
943
+
944
+ /**
945
+ * The id of the item the price will be associated with.
946
+ */
947
+ item_id: string;
948
+
949
+ /**
950
+ * The pricing model type
951
+ */
952
+ model_type: 'tiered_matrix_with_allocation';
953
+
954
+ /**
955
+ * The name of the price.
956
+ */
957
+ name: string;
958
+
959
+ /**
960
+ * Configuration for tiered_matrix_with_allocation pricing
961
+ */
962
+ tiered_matrix_with_allocation_config: NewPlanTieredMatrixWithAllocationPrice.TieredMatrixWithAllocationConfig;
963
+
964
+ /**
965
+ * The id of the billable metric for the price. Only needed if the price is
966
+ * usage-based.
967
+ */
968
+ billable_metric_id?: string | null;
969
+
970
+ /**
971
+ * If the Price represents a fixed cost, the price will be billed in-advance if
972
+ * this is true, and in-arrears if this is false.
973
+ */
974
+ billed_in_advance?: boolean | null;
975
+
976
+ /**
977
+ * For custom cadence: specifies the duration of the billing period in days or
978
+ * months.
979
+ */
980
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
981
+
982
+ /**
983
+ * The per unit conversion rate of the price currency to the invoicing currency.
984
+ */
985
+ conversion_rate?: number | null;
986
+
987
+ /**
988
+ * The configuration for the rate of the price currency to the invoicing currency.
989
+ */
990
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
991
+
992
+ /**
993
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
994
+ * price is billed.
995
+ */
996
+ currency?: string | null;
997
+
998
+ /**
999
+ * For dimensional price: specifies a price group and dimension values
1000
+ */
1001
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
1002
+
1003
+ /**
1004
+ * An alias for the price.
1005
+ */
1006
+ external_price_id?: string | null;
1007
+
1008
+ /**
1009
+ * If the Price represents a fixed cost, this represents the quantity of units
1010
+ * applied.
1011
+ */
1012
+ fixed_price_quantity?: number | null;
1013
+
1014
+ /**
1015
+ * The property used to group this price on an invoice
1016
+ */
1017
+ invoice_grouping_key?: string | null;
1018
+
1019
+ /**
1020
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
1021
+ * If unspecified, a single invoice is produced per billing cycle.
1022
+ */
1023
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
1024
+
1025
+ /**
1026
+ * The ID of the license type to associate with this price. On a usage price this
1027
+ * also marks the price as eligible to draw down from that license type's
1028
+ * allocation; a usage price created without it is billed normally. Usage prices
1029
+ * with a license type must use the `unit` model, and only draw down when their
1030
+ * currency matches the allocation's.
1031
+ */
1032
+ license_type_id?: string | null;
1033
+
1034
+ /**
1035
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1036
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1037
+ * by setting `metadata` to `null`.
1038
+ */
1039
+ metadata?: { [key: string]: string | null } | null;
1040
+
1041
+ /**
1042
+ * A transient ID that can be used to reference this price when adding adjustments
1043
+ * in the same API call.
1044
+ */
1045
+ reference_id?: string | null;
1046
+ }
1047
+
1048
+ export namespace NewPlanTieredMatrixWithAllocationPrice {
1049
+ /**
1050
+ * Configuration for tiered_matrix_with_allocation pricing
1051
+ */
1052
+ export interface TieredMatrixWithAllocationConfig {
1053
+ /**
1054
+ * Usage allocation, pooled across all matrix cells
1055
+ */
1056
+ allocation: string;
1057
+
1058
+ /**
1059
+ * Per unit rate for usage whose matrix cell has no configured tiers
1060
+ */
1061
+ default_unit_amount: string;
1062
+
1063
+ /**
1064
+ * One or two event property values to evaluate matrix cells by
1065
+ */
1066
+ dimensions: Array<string>;
1067
+
1068
+ /**
1069
+ * Graduated tiers keyed by matrix cell; usage in a cell is tiered only against its
1070
+ * own rows
1071
+ */
1072
+ tiers: Array<TieredMatrixWithAllocationConfig.Tier>;
1073
+ }
1074
+
1075
+ export namespace TieredMatrixWithAllocationConfig {
1076
+ /**
1077
+ * Configuration for a single tier scoped to one matrix cell
1078
+ */
1079
+ export interface Tier {
1080
+ /**
1081
+ * The matrix cell this tier applies to, as one or two dimension values
1082
+ */
1083
+ dimension_values: Array<string>;
1084
+
1085
+ /**
1086
+ * Exclusive tier starting value. The tier runs up to and including the next bound
1087
+ * configured for the same matrix cell.
1088
+ */
1089
+ tier_lower_bound: string;
1090
+
1091
+ /**
1092
+ * Per unit amount
1093
+ */
1094
+ unit_amount: string;
1095
+ }
1096
+ }
1097
+ }
1098
+
937
1099
  export interface NewPlanMatrixWithThresholdDiscountsPrice {
938
1100
  /**
939
1101
  * The cadence to bill for this price on.