orb-billing 4.55.0 → 4.57.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 (34) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +29 -8
  3. package/resources/customers/balance-transactions.d.ts +2 -2
  4. package/resources/customers/balance-transactions.d.ts.map +1 -1
  5. package/resources/customers/balance-transactions.js.map +1 -1
  6. package/resources/customers/balance-transactions.mjs.map +1 -1
  7. package/resources/customers/costs.d.ts +10 -20
  8. package/resources/customers/costs.d.ts.map +1 -1
  9. package/resources/invoices.d.ts +2 -2
  10. package/resources/invoices.d.ts.map +1 -1
  11. package/resources/invoices.js.map +1 -1
  12. package/resources/invoices.mjs.map +1 -1
  13. package/resources/plans/plans.d.ts +95 -1
  14. package/resources/plans/plans.d.ts.map +1 -1
  15. package/resources/plans/plans.js.map +1 -1
  16. package/resources/plans/plans.mjs.map +1 -1
  17. package/resources/prices/prices.d.ts +174 -2
  18. package/resources/prices/prices.d.ts.map +1 -1
  19. package/resources/prices/prices.js.map +1 -1
  20. package/resources/prices/prices.mjs.map +1 -1
  21. package/resources/subscriptions.d.ts +231 -11
  22. package/resources/subscriptions.d.ts.map +1 -1
  23. package/resources/subscriptions.js.map +1 -1
  24. package/resources/subscriptions.mjs.map +1 -1
  25. package/src/resources/customers/balance-transactions.ts +4 -2
  26. package/src/resources/customers/costs.ts +12 -20
  27. package/src/resources/invoices.ts +4 -2
  28. package/src/resources/plans/plans.ts +114 -0
  29. package/src/resources/prices/prices.ts +234 -2
  30. package/src/resources/subscriptions.ts +275 -10
  31. package/src/version.ts +1 -1
  32. package/version.d.ts +1 -1
  33. package/version.js +1 -1
  34. package/version.mjs +1 -1
@@ -2436,18 +2436,13 @@ export declare namespace SubscriptionFetchCostsResponse {
2436
2436
  namespace Data {
2437
2437
  interface PerPriceCost {
2438
2438
  /**
2439
- * The Price resource represents a price that can be billed on a subscription,
2440
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
2441
- * take a quantity and determine an amount to bill.
2442
- *
2443
- * Orb supports a few different pricing models out of the box. Each of these models
2444
- * is serialized differently in a given Price object. The model_type field
2445
- * determines the key for the configuration object that is present.
2446
- *
2447
- * For more on the types of prices, see
2448
- * [the core concepts documentation](/core-concepts#plan-and-price)
2439
+ * The price object
2449
2440
  */
2450
2441
  price: PricesAPI.Price;
2442
+ /**
2443
+ * The price the cost is associated with
2444
+ */
2445
+ price_id: string;
2451
2446
  /**
2452
2447
  * Price's contributions for the timeframe, excluding any minimums and discounts.
2453
2448
  */
@@ -6522,6 +6517,10 @@ export declare namespace SubscriptionCreateParams {
6522
6517
  }
6523
6518
  }
6524
6519
  interface AddPrice {
6520
+ /**
6521
+ * The definition of a new allocation price to create and add to the subscription.
6522
+ */
6523
+ allocation_price?: AddPrice.AllocationPrice | null;
6525
6524
  /**
6526
6525
  * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
6527
6526
  * discounts for this price.
@@ -6567,6 +6566,29 @@ export declare namespace SubscriptionCreateParams {
6567
6566
  start_date?: string | null;
6568
6567
  }
6569
6568
  namespace AddPrice {
6569
+ /**
6570
+ * The definition of a new allocation price to create and add to the subscription.
6571
+ */
6572
+ interface AllocationPrice {
6573
+ /**
6574
+ * An amount of the currency to allocate to the customer at the specified cadence.
6575
+ */
6576
+ amount: string;
6577
+ /**
6578
+ * The cadence at which to allocate the amount to the customer.
6579
+ */
6580
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
6581
+ /**
6582
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
6583
+ * this price.
6584
+ */
6585
+ currency: string;
6586
+ /**
6587
+ * Whether the allocated amount should expire at the end of the cadence or roll
6588
+ * over to the next period.
6589
+ */
6590
+ expires_at_end_of_cadence: boolean;
6591
+ }
6570
6592
  interface Discount {
6571
6593
  discount_type: 'percentage' | 'usage' | 'amount';
6572
6594
  /**
@@ -8634,6 +8656,10 @@ export declare namespace SubscriptionCreateParams {
8634
8656
  * The id of the price on the plan to replace in the subscription.
8635
8657
  */
8636
8658
  replaces_price_id: string;
8659
+ /**
8660
+ * The definition of a new allocation price to create and add to the subscription.
8661
+ */
8662
+ allocation_price?: ReplacePrice.AllocationPrice | null;
8637
8663
  /**
8638
8664
  * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
8639
8665
  * discounts for the replacement price.
@@ -8667,6 +8693,29 @@ export declare namespace SubscriptionCreateParams {
8667
8693
  price_id?: string | null;
8668
8694
  }
8669
8695
  namespace ReplacePrice {
8696
+ /**
8697
+ * The definition of a new allocation price to create and add to the subscription.
8698
+ */
8699
+ interface AllocationPrice {
8700
+ /**
8701
+ * An amount of the currency to allocate to the customer at the specified cadence.
8702
+ */
8703
+ amount: string;
8704
+ /**
8705
+ * The cadence at which to allocate the amount to the customer.
8706
+ */
8707
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
8708
+ /**
8709
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
8710
+ * this price.
8711
+ */
8712
+ currency: string;
8713
+ /**
8714
+ * Whether the allocated amount should expire at the end of the cadence or roll
8715
+ * over to the next period.
8716
+ */
8717
+ expires_at_end_of_cadence: boolean;
8718
+ }
8670
8719
  interface Discount {
8671
8720
  discount_type: 'percentage' | 'usage' | 'amount';
8672
8721
  /**
@@ -10659,6 +10708,12 @@ export interface SubscriptionCancelParams {
10659
10708
  * Determines the timing of subscription cancellation
10660
10709
  */
10661
10710
  cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date';
10711
+ /**
10712
+ * If false, this request will fail if it would void an issued invoice or create a
10713
+ * credit note. Consider using this as a safety mechanism if you do not expect
10714
+ * existing invoices to be changed.
10715
+ */
10716
+ allow_invoice_credit_or_void?: boolean | null;
10662
10717
  /**
10663
10718
  * The date that the cancellation should take effect. This parameter can only be
10664
10719
  * passed if the `cancel_option` is `requested_date`.
@@ -10736,6 +10791,12 @@ export interface SubscriptionPriceIntervalsParams {
10736
10791
  * A list of adjustments to add to the subscription.
10737
10792
  */
10738
10793
  add_adjustments?: Array<SubscriptionPriceIntervalsParams.AddAdjustment>;
10794
+ /**
10795
+ * If false, this request will fail if it would void an issued invoice or create a
10796
+ * credit note. Consider using this as a safety mechanism if you do not expect
10797
+ * existing invoices to be changed.
10798
+ */
10799
+ allow_invoice_credit_or_void?: boolean | null;
10739
10800
  /**
10740
10801
  * A list of price intervals to edit on the subscription.
10741
10802
  */
@@ -10786,7 +10847,7 @@ export declare namespace SubscriptionPriceIntervalsParams {
10786
10847
  /**
10787
10848
  * The definition of a new price to create and add to the subscription.
10788
10849
  */
10789
- price?: Add.NewFloatingUnitPrice | Add.NewFloatingPackagePrice | Add.NewFloatingMatrixPrice | Add.NewFloatingMatrixWithAllocationPrice | Add.NewFloatingTieredPrice | Add.NewFloatingTieredBpsPrice | Add.NewFloatingBpsPrice | Add.NewFloatingBulkBpsPrice | Add.NewFloatingBulkPrice | Add.NewFloatingThresholdTotalAmountPrice | Add.NewFloatingTieredPackagePrice | Add.NewFloatingGroupedTieredPrice | Add.NewFloatingMaxGroupTieredPackagePrice | Add.NewFloatingTieredWithMinimumPrice | Add.NewFloatingPackageWithAllocationPrice | Add.NewFloatingTieredPackageWithMinimumPrice | Add.NewFloatingUnitWithPercentPrice | Add.NewFloatingTieredWithProrationPrice | Add.NewFloatingUnitWithProrationPrice | Add.NewFloatingGroupedAllocationPrice | Add.NewFloatingGroupedWithProratedMinimumPrice | Add.NewFloatingGroupedWithMeteredMinimumPrice | Add.NewFloatingMatrixWithDisplayNamePrice | Add.NewFloatingBulkWithProrationPrice | Add.NewFloatingGroupedTieredPackagePrice | Add.NewFloatingScalableMatrixWithUnitPricingPrice | Add.NewFloatingScalableMatrixWithTieredPricingPrice | null;
10850
+ price?: Add.NewFloatingUnitPrice | Add.NewFloatingPackagePrice | Add.NewFloatingMatrixPrice | Add.NewFloatingMatrixWithAllocationPrice | Add.NewFloatingTieredPrice | Add.NewFloatingTieredBpsPrice | Add.NewFloatingBpsPrice | Add.NewFloatingBulkBpsPrice | Add.NewFloatingBulkPrice | Add.NewFloatingThresholdTotalAmountPrice | Add.NewFloatingTieredPackagePrice | Add.NewFloatingGroupedTieredPrice | Add.NewFloatingMaxGroupTieredPackagePrice | Add.NewFloatingTieredWithMinimumPrice | Add.NewFloatingPackageWithAllocationPrice | Add.NewFloatingTieredPackageWithMinimumPrice | Add.NewFloatingUnitWithPercentPrice | Add.NewFloatingTieredWithProrationPrice | Add.NewFloatingUnitWithProrationPrice | Add.NewFloatingGroupedAllocationPrice | Add.NewFloatingGroupedWithProratedMinimumPrice | Add.NewFloatingGroupedWithMeteredMinimumPrice | Add.NewFloatingMatrixWithDisplayNamePrice | Add.NewFloatingBulkWithProrationPrice | Add.NewFloatingGroupedTieredPackagePrice | Add.NewFloatingScalableMatrixWithUnitPricingPrice | Add.NewFloatingScalableMatrixWithTieredPricingPrice | Add.NewFloatingCumulativeGroupedBulkPrice | null;
10790
10851
  /**
10791
10852
  * The id of the price to add to the subscription.
10792
10853
  */
@@ -13537,6 +13598,99 @@ export declare namespace SubscriptionPriceIntervalsParams {
13537
13598
  duration_unit: 'day' | 'month';
13538
13599
  }
13539
13600
  }
13601
+ interface NewFloatingCumulativeGroupedBulkPrice {
13602
+ /**
13603
+ * The cadence to bill for this price on.
13604
+ */
13605
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
13606
+ cumulative_grouped_bulk_config: Record<string, unknown>;
13607
+ /**
13608
+ * An ISO 4217 currency string for which this price is billed in.
13609
+ */
13610
+ currency: string;
13611
+ /**
13612
+ * The id of the item the plan will be associated with.
13613
+ */
13614
+ item_id: string;
13615
+ model_type: 'cumulative_grouped_bulk';
13616
+ /**
13617
+ * The name of the price.
13618
+ */
13619
+ name: string;
13620
+ /**
13621
+ * The id of the billable metric for the price. Only needed if the price is
13622
+ * usage-based.
13623
+ */
13624
+ billable_metric_id?: string | null;
13625
+ /**
13626
+ * If the Price represents a fixed cost, the price will be billed in-advance if
13627
+ * this is true, and in-arrears if this is false.
13628
+ */
13629
+ billed_in_advance?: boolean | null;
13630
+ /**
13631
+ * For custom cadence: specifies the duration of the billing period in days or
13632
+ * months.
13633
+ */
13634
+ billing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.BillingCycleConfiguration | null;
13635
+ /**
13636
+ * The per unit conversion rate of the price currency to the invoicing currency.
13637
+ */
13638
+ conversion_rate?: number | null;
13639
+ /**
13640
+ * An alias for the price.
13641
+ */
13642
+ external_price_id?: string | null;
13643
+ /**
13644
+ * If the Price represents a fixed cost, this represents the quantity of units
13645
+ * applied.
13646
+ */
13647
+ fixed_price_quantity?: number | null;
13648
+ /**
13649
+ * The property used to group this price on an invoice
13650
+ */
13651
+ invoice_grouping_key?: string | null;
13652
+ /**
13653
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
13654
+ * If unspecified, a single invoice is produced per billing cycle.
13655
+ */
13656
+ invoicing_cycle_configuration?: NewFloatingCumulativeGroupedBulkPrice.InvoicingCycleConfiguration | null;
13657
+ /**
13658
+ * User-specified key/value pairs for the resource. Individual keys can be removed
13659
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
13660
+ * by setting `metadata` to `null`.
13661
+ */
13662
+ metadata?: Record<string, string | null> | null;
13663
+ }
13664
+ namespace NewFloatingCumulativeGroupedBulkPrice {
13665
+ /**
13666
+ * For custom cadence: specifies the duration of the billing period in days or
13667
+ * months.
13668
+ */
13669
+ interface BillingCycleConfiguration {
13670
+ /**
13671
+ * The duration of the billing period.
13672
+ */
13673
+ duration: number;
13674
+ /**
13675
+ * The unit of billing period duration.
13676
+ */
13677
+ duration_unit: 'day' | 'month';
13678
+ }
13679
+ /**
13680
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
13681
+ * If unspecified, a single invoice is produced per billing cycle.
13682
+ */
13683
+ interface InvoicingCycleConfiguration {
13684
+ /**
13685
+ * The duration of the billing period.
13686
+ */
13687
+ duration: number;
13688
+ /**
13689
+ * The unit of billing period duration.
13690
+ */
13691
+ duration_unit: 'day' | 'month';
13692
+ }
13693
+ }
13540
13694
  }
13541
13695
  interface AddAdjustment {
13542
13696
  /**
@@ -13895,6 +14049,10 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
13895
14049
  }
13896
14050
  }
13897
14051
  interface AddPrice {
14052
+ /**
14053
+ * The definition of a new allocation price to create and add to the subscription.
14054
+ */
14055
+ allocation_price?: AddPrice.AllocationPrice | null;
13898
14056
  /**
13899
14057
  * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
13900
14058
  * discounts for this price.
@@ -13940,6 +14098,29 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
13940
14098
  start_date?: string | null;
13941
14099
  }
13942
14100
  namespace AddPrice {
14101
+ /**
14102
+ * The definition of a new allocation price to create and add to the subscription.
14103
+ */
14104
+ interface AllocationPrice {
14105
+ /**
14106
+ * An amount of the currency to allocate to the customer at the specified cadence.
14107
+ */
14108
+ amount: string;
14109
+ /**
14110
+ * The cadence at which to allocate the amount to the customer.
14111
+ */
14112
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
14113
+ /**
14114
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
14115
+ * this price.
14116
+ */
14117
+ currency: string;
14118
+ /**
14119
+ * Whether the allocated amount should expire at the end of the cadence or roll
14120
+ * over to the next period.
14121
+ */
14122
+ expires_at_end_of_cadence: boolean;
14123
+ }
13943
14124
  interface Discount {
13944
14125
  discount_type: 'percentage' | 'usage' | 'amount';
13945
14126
  /**
@@ -16007,6 +16188,10 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
16007
16188
  * The id of the price on the plan to replace in the subscription.
16008
16189
  */
16009
16190
  replaces_price_id: string;
16191
+ /**
16192
+ * The definition of a new allocation price to create and add to the subscription.
16193
+ */
16194
+ allocation_price?: ReplacePrice.AllocationPrice | null;
16010
16195
  /**
16011
16196
  * @deprecated [DEPRECATED] Use add_adjustments instead. The subscription's
16012
16197
  * discounts for the replacement price.
@@ -16040,6 +16225,29 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
16040
16225
  price_id?: string | null;
16041
16226
  }
16042
16227
  namespace ReplacePrice {
16228
+ /**
16229
+ * The definition of a new allocation price to create and add to the subscription.
16230
+ */
16231
+ interface AllocationPrice {
16232
+ /**
16233
+ * An amount of the currency to allocate to the customer at the specified cadence.
16234
+ */
16235
+ amount: string;
16236
+ /**
16237
+ * The cadence at which to allocate the amount to the customer.
16238
+ */
16239
+ cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
16240
+ /**
16241
+ * An ISO 4217 currency string or a custom pricing unit identifier in which to bill
16242
+ * this price.
16243
+ */
16244
+ currency: string;
16245
+ /**
16246
+ * Whether the allocated amount should expire at the end of the cadence or roll
16247
+ * over to the next period.
16248
+ */
16249
+ expires_at_end_of_cadence: boolean;
16250
+ }
16043
16251
  interface Discount {
16044
16252
  discount_type: 'percentage' | 'usage' | 'amount';
16045
16253
  /**
@@ -17987,6 +18195,12 @@ export declare namespace SubscriptionSchedulePlanChangeParams {
17987
18195
  }
17988
18196
  }
17989
18197
  export interface SubscriptionTriggerPhaseParams {
18198
+ /**
18199
+ * If false, this request will fail if it would void an issued invoice or create a
18200
+ * credit note. Consider using this as a safety mechanism if you do not expect
18201
+ * existing invoices to be changed.
18202
+ */
18203
+ allow_invoice_credit_or_void?: boolean | null;
17990
18204
  /**
17991
18205
  * The date on which the phase change should take effect. If not provided, defaults
17992
18206
  * to today in the customer's timezone.
@@ -18005,6 +18219,12 @@ export interface SubscriptionUpdateFixedFeeQuantityParams {
18005
18219
  */
18006
18220
  price_id: string;
18007
18221
  quantity: number;
18222
+ /**
18223
+ * If false, this request will fail if it would void an issued invoice or create a
18224
+ * credit note. Consider using this as a safety mechanism if you do not expect
18225
+ * existing invoices to be changed.
18226
+ */
18227
+ allow_invoice_credit_or_void?: boolean | null;
18008
18228
  /**
18009
18229
  * Determines when the change takes effect. Note that if `effective_date` is
18010
18230
  * specified, this defaults to `effective_date`. Otherwise, this defaults to