@openmeter/client 1.0.0-beta-5ecf67135706 → 1.0.0-beta-c817ba7663ad

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.
@@ -172,6 +172,22 @@ export interface PriceFree {
172
172
  /** The type of the price. */
173
173
  type: 'free';
174
174
  }
175
+ /** The entitlement template of a static entitlement. */
176
+ export interface RateCardStaticEntitlement {
177
+ /** The type of the entitlement template. */
178
+ type: 'static';
179
+ /**
180
+ * The entitlement config as a JSON object. Returned when checking entitlement
181
+ * access; useful for configuring fine-grained access settings implemented in your
182
+ * own system.
183
+ */
184
+ config: unknown;
185
+ }
186
+ /** The entitlement template of a boolean entitlement. */
187
+ export interface RateCardBooleanEntitlement {
188
+ /** The type of the entitlement template. */
189
+ type: 'boolean';
190
+ }
175
191
  /**
176
192
  * BillingWorkflowCollectionAlignmentSubscription specifies the alignment for
177
193
  * collecting the pending line items into an invoice.
@@ -245,22 +261,6 @@ export interface LlmCostModel {
245
261
  /** Name of the model, e.g., "GPT-4", "Claude 3.5 Sonnet". */
246
262
  name: string;
247
263
  }
248
- /** The entitlement template of a static entitlement. */
249
- export interface RateCardStaticEntitlement {
250
- /** The type of the entitlement template. */
251
- type: 'static';
252
- /**
253
- * The entitlement config as a JSON object. Returned when checking entitlement
254
- * access; useful for configuring fine-grained access settings implemented in your
255
- * own system.
256
- */
257
- config: unknown;
258
- }
259
- /** The entitlement template of a boolean entitlement. */
260
- export interface RateCardBooleanEntitlement {
261
- /** The type of the entitlement template. */
262
- type: 'boolean';
263
- }
264
264
  /** Validation errors providing detailed description of the issue. */
265
265
  export interface ProductCatalogValidationError {
266
266
  /** Machine-readable error code. */
@@ -480,6 +480,16 @@ export interface Totals {
480
480
  /** The final total value of the resource after taxes, discounts and commitments. */
481
481
  total: string;
482
482
  }
483
+ /**
484
+ * Spend commitments for a rate card. The customer is committed to spend at least
485
+ * the minimum amount and at most the maximum amount.
486
+ */
487
+ export interface SpendCommitments {
488
+ /** The customer is committed to spend at least the amount. */
489
+ minimum_amount?: string;
490
+ /** The customer is limited to spend at most the amount. */
491
+ maximum_amount?: string;
492
+ }
483
493
  /** A credit allocation applied to an invoice line item. */
484
494
  export interface InvoiceLineCreditsApplied {
485
495
  /** The monetary amount credited. */
@@ -520,16 +530,6 @@ export interface LlmCostModelPricing {
520
530
  /** Reasoning output price per token (USD). */
521
531
  reasoning_per_token?: string;
522
532
  }
523
- /**
524
- * Spend commitments for a rate card. The customer is committed to spend at least
525
- * the minimum amount and at most the maximum amount.
526
- */
527
- export interface SpendCommitments {
528
- /** The customer is committed to spend at least the amount. */
529
- minimum_amount?: string;
530
- /** The customer is limited to spend at most the amount. */
531
- maximum_amount?: string;
532
- }
533
533
  /**
534
534
  * A query filter for a numeric attribute. Operators are mutually exclusive, only
535
535
  * one operator is allowed at a time.
@@ -719,6 +719,10 @@ export interface SubscriptionReference {
719
719
  export interface AddonReference {
720
720
  id: string;
721
721
  }
722
+ /** Feature reference. */
723
+ export interface FeatureReference {
724
+ id: string;
725
+ }
722
726
  /** App reference. */
723
727
  export interface AppReference {
724
728
  /** The ID of the app. */
@@ -748,10 +752,6 @@ export interface CurrencyFiat {
748
752
  symbol?: string;
749
753
  code: string;
750
754
  }
751
- /** Feature reference. */
752
- export interface FeatureReference {
753
- id: string;
754
- }
755
755
  /** Metering event following the CloudEvents specification. */
756
756
  export interface Event {
757
757
  /** Identifies the event. */
@@ -873,6 +873,15 @@ export interface ClosedPeriod {
873
873
  */
874
874
  to: string;
875
875
  }
876
+ /** A subscription add-on event. */
877
+ export interface SubscriptionAddonTimelineSegment {
878
+ /** An ISO-8601 timestamp representation of the cadence start of the resource. */
879
+ active_from: string;
880
+ /** An ISO-8601 timestamp representation of the cadence end of the resource. */
881
+ active_to?: string;
882
+ /** The quantity of the add-on for the given period. */
883
+ quantity: number;
884
+ }
876
885
  /** Describes currency basis supported by billing system. */
877
886
  export interface CostBasis {
878
887
  id: string;
@@ -1465,13 +1474,6 @@ export interface CreateCreditGrantPurchase {
1465
1474
  */
1466
1475
  availability_policy: 'on_creation';
1467
1476
  }
1468
- /** Recurring period with an anchor and an interval. */
1469
- export interface RecurringPeriod {
1470
- /** A date-time anchor to base the recurring period on. */
1471
- anchor: string;
1472
- /** The interval duration in ISO 8601 format. */
1473
- interval: string;
1474
- }
1475
1477
  /** The entitlement template of a metered entitlement. */
1476
1478
  export interface RateCardMeteredEntitlement {
1477
1479
  /** The type of the entitlement template. */
@@ -1494,6 +1496,13 @@ export interface RateCardMeteredEntitlement {
1494
1496
  */
1495
1497
  usage_period?: string;
1496
1498
  }
1499
+ /** Recurring period with an anchor and an interval. */
1500
+ export interface RecurringPeriod {
1501
+ /** A date-time anchor to base the recurring period on. */
1502
+ anchor: string;
1503
+ /** The interval duration in ISO 8601 format. */
1504
+ interval: string;
1505
+ }
1497
1506
  /** Purchase and payment terms of the grant. */
1498
1507
  export interface CreditGrantPurchase {
1499
1508
  /** Currency of the purchase amount. */
@@ -1696,6 +1705,64 @@ export interface Subscription {
1696
1705
  */
1697
1706
  settlement_mode?: 'credit_then_invoice' | 'credit_only';
1698
1707
  }
1708
+ /**
1709
+ * Unit conversion configuration.
1710
+ *
1711
+ * Transforms raw metered quantities into billing-ready units before pricing and
1712
+ * entitlement evaluation. Applied at the rate card level so the same feature can
1713
+ * be billed in different units across plans.
1714
+ *
1715
+ * Examples:
1716
+ *
1717
+ * - Meter bytes, bill GB: operation=divide, conversionFactor=1e9,
1718
+ * rounding=ceiling, displayUnit="GB"
1719
+ * - Meter seconds, bill hours: operation=divide, conversionFactor=3600,
1720
+ * rounding=ceiling, displayUnit="hours"
1721
+ * - Cost + 20% margin: operation=multiply, conversionFactor=1.2
1722
+ * - Bill per million tokens: operation=divide, conversionFactor=1e6,
1723
+ * rounding=ceiling, displayUnit="M"
1724
+ *
1725
+ * v1 equivalents:
1726
+ *
1727
+ * - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier +
1728
+ * UnitPrice(amount=1)
1729
+ * - PackagePrice(amount, quantityPerPkg): operation=divide,
1730
+ * conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount)
1731
+ */
1732
+ export interface UnitConfig {
1733
+ /** The arithmetic operation to apply to the raw metered quantity. */
1734
+ operation: 'divide' | 'multiply';
1735
+ /**
1736
+ * The factor used in the conversion operation.
1737
+ *
1738
+ * - For `divide`: `converted = raw / conversionFactor`.
1739
+ * - For `multiply`: `converted = raw × conversionFactor`.
1740
+ *
1741
+ * Must be a positive non-zero value.
1742
+ */
1743
+ conversion_factor: string;
1744
+ /**
1745
+ * The rounding mode applied to the converted quantity for invoicing.
1746
+ *
1747
+ * Defaults to none (no rounding). Entitlement checks always use the precise
1748
+ * (unrounded) value.
1749
+ */
1750
+ rounding: 'ceiling' | 'floor' | 'half_up' | 'none';
1751
+ /**
1752
+ * The number of decimal places to retain after rounding.
1753
+ *
1754
+ * Only meaningful when rounding is not "none". Defaults to 0 (round to whole
1755
+ * numbers).
1756
+ */
1757
+ precision: number;
1758
+ /**
1759
+ * A human-readable label for the converted unit shown on invoices and in the
1760
+ * customer portal (e.g., "GB", "hours", "M tokens").
1761
+ *
1762
+ * Optional. When omitted, no unit label is rendered.
1763
+ */
1764
+ display_unit?: string;
1765
+ }
1699
1766
  /**
1700
1767
  * Available apps for billing integrations to connect with third-party services.
1701
1768
  * Apps can have various capabilities like syncing data from or to external
@@ -1867,64 +1934,6 @@ export interface CreateCurrencyCustomRequest {
1867
1934
  symbol?: string;
1868
1935
  code: string;
1869
1936
  }
1870
- /**
1871
- * Unit conversion configuration.
1872
- *
1873
- * Transforms raw metered quantities into billing-ready units before pricing and
1874
- * entitlement evaluation. Applied at the rate card level so the same feature can
1875
- * be billed in different units across plans.
1876
- *
1877
- * Examples:
1878
- *
1879
- * - Meter bytes, bill GB: operation=divide, conversionFactor=1e9,
1880
- * rounding=ceiling, displayUnit="GB"
1881
- * - Meter seconds, bill hours: operation=divide, conversionFactor=3600,
1882
- * rounding=ceiling, displayUnit="hours"
1883
- * - Cost + 20% margin: operation=multiply, conversionFactor=1.2
1884
- * - Bill per million tokens: operation=divide, conversionFactor=1e6,
1885
- * rounding=ceiling, displayUnit="M"
1886
- *
1887
- * v1 equivalents:
1888
- *
1889
- * - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier +
1890
- * UnitPrice(amount=1)
1891
- * - PackagePrice(amount, quantityPerPkg): operation=divide,
1892
- * conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount)
1893
- */
1894
- export interface UnitConfig {
1895
- /** The arithmetic operation to apply to the raw metered quantity. */
1896
- operation: 'divide' | 'multiply';
1897
- /**
1898
- * The factor used in the conversion operation.
1899
- *
1900
- * - For `divide`: `converted = raw / conversionFactor`.
1901
- * - For `multiply`: `converted = raw × conversionFactor`.
1902
- *
1903
- * Must be a positive non-zero value.
1904
- */
1905
- conversion_factor: string;
1906
- /**
1907
- * The rounding mode applied to the converted quantity for invoicing.
1908
- *
1909
- * Defaults to none (no rounding). Entitlement checks always use the precise
1910
- * (unrounded) value.
1911
- */
1912
- rounding: 'ceiling' | 'floor' | 'half_up' | 'none';
1913
- /**
1914
- * The number of decimal places to retain after rounding.
1915
- *
1916
- * Only meaningful when rounding is not "none". Defaults to 0 (round to whole
1917
- * numbers).
1918
- */
1919
- precision: number;
1920
- /**
1921
- * A human-readable label for the converted unit shown on invoices and in the
1922
- * customer portal (e.g., "GB", "hours", "M tokens").
1923
- *
1924
- * Optional. When omitted, no unit label is rendered.
1925
- */
1926
- display_unit?: string;
1927
- }
1928
1937
  /** Query to evaluate feature access for a list of customers. */
1929
1938
  export interface GovernanceQueryRequest {
1930
1939
  /**
@@ -2468,42 +2477,6 @@ export interface UpdateOrganizationDefaultTaxCodesRequest {
2468
2477
  /** Default tax code for credit grants. */
2469
2478
  credit_grant_tax_code?: TaxCodeReference;
2470
2479
  }
2471
- /** Addon purchased with a subscription. */
2472
- export interface SubscriptionAddon {
2473
- id: string;
2474
- /**
2475
- * Display name of the resource.
2476
- *
2477
- * Between 1 and 256 characters.
2478
- */
2479
- name: string;
2480
- /**
2481
- * Optional description of the resource.
2482
- *
2483
- * Maximum 1024 characters.
2484
- */
2485
- description?: string;
2486
- labels?: Labels;
2487
- /** An ISO-8601 timestamp representation of entity creation date. */
2488
- created_at: string;
2489
- /** An ISO-8601 timestamp representation of entity last update date. */
2490
- updated_at: string;
2491
- /** An ISO-8601 timestamp representation of entity deletion date. */
2492
- deleted_at?: string;
2493
- /** The add-on associated with the subscription. */
2494
- addon: AddonReference;
2495
- /** The quantity of the add-on. Always 1 for single instance add-ons. */
2496
- quantity: number;
2497
- /**
2498
- * An ISO-8601 timestamp representation of which point in time the quantity was
2499
- * resolved to.
2500
- */
2501
- quantity_at: string;
2502
- /** An ISO-8601 timestamp representation of the cadence start of the resource. */
2503
- active_from: string;
2504
- /** An ISO-8601 timestamp representation of the cadence end of the resource. */
2505
- active_to?: string;
2506
- }
2507
2480
  /**
2508
2481
  * PlanAddon represents an association between a plan and an add-on, controlling
2509
2482
  * which add-ons are available for purchase within a plan.
@@ -3018,18 +2991,54 @@ export interface SubscriptionChange {
3018
2991
  */
3019
2992
  timing: 'immediate' | 'next_billing_cycle' | string;
3020
2993
  }
3021
- /** Stripe app. */
3022
- export interface AppStripe {
3023
- id: string;
2994
+ /** SubscriptionAddon create request. */
2995
+ export interface CreateSubscriptionAddonRequest {
2996
+ labels?: Labels;
2997
+ /** The add-on associated with the subscription. */
2998
+ addon: AddonReference;
2999
+ /** The quantity of the add-on. Always 1 for single instance add-ons. */
3000
+ quantity: number;
3024
3001
  /**
3025
- * Display name of the resource.
3026
- *
3027
- * Between 1 and 256 characters.
3002
+ * The timing of the operation. After the create or update, a new entry will be
3003
+ * created in the timeline.
3028
3004
  */
3029
- name: string;
3005
+ timing: 'immediate' | 'next_billing_cycle' | string;
3006
+ }
3007
+ /**
3008
+ * Usage quantity details on an invoice line item when UnitConfig is in effect.
3009
+ *
3010
+ * Provides the full audit trail from raw meter output to the invoiced amount.
3011
+ */
3012
+ export interface InvoiceUsageQuantityDetail {
3013
+ /** The raw quantity as reported by the meter (native units). */
3014
+ raw_quantity: string;
3030
3015
  /**
3031
- * Optional description of the resource.
3032
- *
3016
+ * The precise decimal value after applying the conversion operation and factor,
3017
+ * before rounding.
3018
+ */
3019
+ converted_quantity: string;
3020
+ /** The quantity after rounding, used for pricing. */
3021
+ invoiced_quantity: string;
3022
+ /** The display unit label (e.g., "GB", "hours", "M tokens"). */
3023
+ display_unit?: string;
3024
+ /**
3025
+ * Snapshot of the UnitConfig that was in effect at billing time. Ensures
3026
+ * historical invoices reflect the config that was actually applied.
3027
+ */
3028
+ applied_unit_config: UnitConfig;
3029
+ }
3030
+ /** Stripe app. */
3031
+ export interface AppStripe {
3032
+ id: string;
3033
+ /**
3034
+ * Display name of the resource.
3035
+ *
3036
+ * Between 1 and 256 characters.
3037
+ */
3038
+ name: string;
3039
+ /**
3040
+ * Optional description of the resource.
3041
+ *
3033
3042
  * Maximum 1024 characters.
3034
3043
  */
3035
3044
  description?: string;
@@ -3252,29 +3261,6 @@ export interface InvoiceLineDiscounts {
3252
3261
  /** Usage quantity discounts (e.g. free tier usage allowances). */
3253
3262
  usage?: InvoiceLineUsageDiscount[];
3254
3263
  }
3255
- /**
3256
- * Usage quantity details on an invoice line item when UnitConfig is in effect.
3257
- *
3258
- * Provides the full audit trail from raw meter output to the invoiced amount.
3259
- */
3260
- export interface InvoiceUsageQuantityDetail {
3261
- /** The raw quantity as reported by the meter (native units). */
3262
- raw_quantity: string;
3263
- /**
3264
- * The precise decimal value after applying the conversion operation and factor,
3265
- * before rounding.
3266
- */
3267
- converted_quantity: string;
3268
- /** The quantity after rounding, used for pricing. */
3269
- invoiced_quantity: string;
3270
- /** The display unit label (e.g., "GB", "hours", "M tokens"). */
3271
- display_unit?: string;
3272
- /**
3273
- * Snapshot of the UnitConfig that was in effect at billing time. Ensures
3274
- * historical invoices reflect the config that was actually applied.
3275
- */
3276
- applied_unit_config: UnitConfig;
3277
- }
3278
3264
  /** Access status for a single feature. */
3279
3265
  export interface GovernanceFeatureAccess {
3280
3266
  /**
@@ -3538,11 +3524,6 @@ export interface WorkflowTaxSettings {
3538
3524
  default_tax_config?: TaxConfig;
3539
3525
  }
3540
3526
  /** Page paginated response. */
3541
- export interface SubscriptionAddonPagePaginatedResponse {
3542
- data: SubscriptionAddon[];
3543
- meta: PaginatedMeta;
3544
- }
3545
- /** Page paginated response. */
3546
3527
  export interface PlanAddonPagePaginatedResponse {
3547
3528
  data: PlanAddon[];
3548
3529
  meta: PaginatedMeta;
@@ -4183,17 +4164,6 @@ export interface CreateChargeUsageBasedRequest {
4183
4164
  /** The billing period the charge belongs to. */
4184
4165
  billing_period?: ClosedPeriod;
4185
4166
  }
4186
- /** Rate card configuration snapshot for a usage-based invoice line. */
4187
- export interface InvoiceLineRateCard {
4188
- /** The price definition used to calculate charges for this line. */
4189
- price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
4190
- /** Tax configuration snapshot for this line. */
4191
- tax_config?: RateCardTaxConfig;
4192
- /** The feature key associated with this line's rate card. */
4193
- feature_key?: string;
4194
- /** Discount configuration from the rate card. */
4195
- discounts?: RateCardDiscounts;
4196
- }
4197
4167
  /** A rate card defines the pricing and entitlement of a feature or service. */
4198
4168
  export interface RateCard {
4199
4169
  /**
@@ -4250,6 +4220,17 @@ export interface RateCard {
4250
4220
  */
4251
4221
  entitlement?: RateCardMeteredEntitlement | RateCardStaticEntitlement | RateCardBooleanEntitlement;
4252
4222
  }
4223
+ /** Rate card configuration snapshot for a usage-based invoice line. */
4224
+ export interface InvoiceLineRateCard {
4225
+ /** The price definition used to calculate charges for this line. */
4226
+ price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
4227
+ /** Tax configuration snapshot for this line. */
4228
+ tax_config?: RateCardTaxConfig;
4229
+ /** The feature key associated with this line's rate card. */
4230
+ feature_key?: string;
4231
+ /** Discount configuration from the rate card. */
4232
+ discounts?: RateCardDiscounts;
4233
+ }
4253
4234
  /** Page paginated response. */
4254
4235
  export interface FeaturePagePaginatedResponse {
4255
4236
  data: Feature[];
@@ -4266,69 +4247,12 @@ export interface Workflow {
4266
4247
  /** The tax settings for this workflow */
4267
4248
  tax?: WorkflowTaxSettings;
4268
4249
  }
4269
- /**
4270
- * A top-level line item on an invoice.
4271
- *
4272
- * Each line represents a single charge, typically associated with a rate card from
4273
- * a subscription. Detailed (child) lines are nested under `detailed_lines` when
4274
- * present.
4275
- */
4276
- export interface InvoiceStandardLine {
4277
- id: string;
4278
- /**
4279
- * Display name of the resource.
4280
- *
4281
- * Between 1 and 256 characters.
4282
- */
4283
- name: string;
4284
- /**
4285
- * Optional description of the resource.
4286
- *
4287
- * Maximum 1024 characters.
4288
- */
4289
- description?: string;
4290
- labels?: Labels;
4291
- /** An ISO-8601 timestamp representation of entity creation date. */
4292
- created_at: string;
4293
- /** An ISO-8601 timestamp representation of entity last update date. */
4294
- updated_at: string;
4295
- /** An ISO-8601 timestamp representation of entity deletion date. */
4296
- deleted_at?: string;
4297
- /** The type of charge this line item represents. */
4298
- type: 'standard_line';
4299
- /**
4300
- * Indicates whether this line item's lifecycle is controlled by OpenMeter or
4301
- * manually overridden by the API user.
4302
- */
4303
- lifecycle_controller: 'system' | 'manual';
4304
- /**
4305
- * The service period covered by this invoice, spanning the earliest line start to
4306
- * the latest line end across all of its lines.
4307
- *
4308
- * For an invoice with no lines the period is empty, which means `from` will be
4309
- * equal to `to`.
4310
- */
4311
- service_period: ClosedPeriod;
4312
- /** Aggregated financial totals for the line item. */
4313
- totals: Totals;
4314
- /** Discounts applied to this line item. */
4315
- discounts?: InvoiceLineDiscounts;
4316
- /** Credit applied to this line item. */
4317
- credits_applied?: InvoiceLineCreditsApplied[];
4318
- /** External identifiers for this line item assigned by third-party systems. */
4319
- external_references?: InvoiceLineExternalReferences;
4320
- /** Reference to the subscription item that generated this line. */
4321
- subscription?: SubscriptionReference;
4322
- /** The rate card configuration snapshot used to price this line item. */
4323
- rate_card: InvoiceLineRateCard;
4324
- /**
4325
- * Detailed sub-lines that this line has been broken down into.
4326
- *
4327
- * Present when line has individual details.
4328
- */
4329
- detailed_lines: InvoiceDetailedLine[];
4330
- /** Reference to the charge associated with this line item. */
4331
- charge?: ChargeReference;
4250
+ /** A rate card for a subscription add-on. */
4251
+ export interface SubscriptionAddonRateCard {
4252
+ /** The rate card. */
4253
+ rate_card: RateCard;
4254
+ /** The IDs of the subscription items that this rate card belongs to. */
4255
+ affected_subscription_item_ids: string[];
4332
4256
  }
4333
4257
  /**
4334
4258
  * The plan phase or pricing ramp allows changing a plan's rate cards over time as
@@ -4466,6 +4390,70 @@ export interface UpsertAddonRequest {
4466
4390
  /** The rate cards of the add-on. */
4467
4391
  rate_cards: RateCard[];
4468
4392
  }
4393
+ /**
4394
+ * A top-level line item on an invoice.
4395
+ *
4396
+ * Each line represents a single charge, typically associated with a rate card from
4397
+ * a subscription. Detailed (child) lines are nested under `detailed_lines` when
4398
+ * present.
4399
+ */
4400
+ export interface InvoiceStandardLine {
4401
+ id: string;
4402
+ /**
4403
+ * Display name of the resource.
4404
+ *
4405
+ * Between 1 and 256 characters.
4406
+ */
4407
+ name: string;
4408
+ /**
4409
+ * Optional description of the resource.
4410
+ *
4411
+ * Maximum 1024 characters.
4412
+ */
4413
+ description?: string;
4414
+ labels?: Labels;
4415
+ /** An ISO-8601 timestamp representation of entity creation date. */
4416
+ created_at: string;
4417
+ /** An ISO-8601 timestamp representation of entity last update date. */
4418
+ updated_at: string;
4419
+ /** An ISO-8601 timestamp representation of entity deletion date. */
4420
+ deleted_at?: string;
4421
+ /** The type of charge this line item represents. */
4422
+ type: 'standard_line';
4423
+ /**
4424
+ * Indicates whether this line item's lifecycle is controlled by OpenMeter or
4425
+ * manually overridden by the API user.
4426
+ */
4427
+ lifecycle_controller: 'system' | 'manual';
4428
+ /**
4429
+ * The service period covered by this invoice, spanning the earliest line start to
4430
+ * the latest line end across all of its lines.
4431
+ *
4432
+ * For an invoice with no lines the period is empty, which means `from` will be
4433
+ * equal to `to`.
4434
+ */
4435
+ service_period: ClosedPeriod;
4436
+ /** Aggregated financial totals for the line item. */
4437
+ totals: Totals;
4438
+ /** Discounts applied to this line item. */
4439
+ discounts?: InvoiceLineDiscounts;
4440
+ /** Credit applied to this line item. */
4441
+ credits_applied?: InvoiceLineCreditsApplied[];
4442
+ /** External identifiers for this line item assigned by third-party systems. */
4443
+ external_references?: InvoiceLineExternalReferences;
4444
+ /** Reference to the subscription item that generated this line. */
4445
+ subscription?: SubscriptionReference;
4446
+ /** The rate card configuration snapshot used to price this line item. */
4447
+ rate_card: InvoiceLineRateCard;
4448
+ /**
4449
+ * Detailed sub-lines that this line has been broken down into.
4450
+ *
4451
+ * Present when line has individual details.
4452
+ */
4453
+ detailed_lines: InvoiceDetailedLine[];
4454
+ /** Reference to the charge associated with this line item. */
4455
+ charge?: ChargeReference;
4456
+ }
4469
4457
  /**
4470
4458
  * Billing profiles contain the settings for billing and controls invoice
4471
4459
  * generation.
@@ -4560,6 +4548,51 @@ export interface ChargePagePaginatedResponse {
4560
4548
  data: (ChargeFlatFee | ChargeUsageBased)[];
4561
4549
  meta: PaginatedMeta;
4562
4550
  }
4551
+ /** Addon purchased with a subscription. */
4552
+ export interface SubscriptionAddon {
4553
+ id: string;
4554
+ labels?: Labels;
4555
+ /** An ISO-8601 timestamp representation of entity creation date. */
4556
+ created_at: string;
4557
+ /** An ISO-8601 timestamp representation of entity last update date. */
4558
+ updated_at: string;
4559
+ /** An ISO-8601 timestamp representation of entity deletion date. */
4560
+ deleted_at?: string;
4561
+ /**
4562
+ * Display name of the resource.
4563
+ *
4564
+ * Between 1 and 256 characters.
4565
+ */
4566
+ name: string;
4567
+ /**
4568
+ * Optional description of the resource.
4569
+ *
4570
+ * Maximum 1024 characters.
4571
+ */
4572
+ description?: string;
4573
+ /** The add-on associated with the subscription. */
4574
+ addon: AddonReference;
4575
+ /** The quantity of the add-on. Always 1 for single instance add-ons. */
4576
+ quantity: number;
4577
+ /**
4578
+ * An ISO-8601 timestamp representation of which point in time the quantity was
4579
+ * resolved to.
4580
+ */
4581
+ quantity_at: string;
4582
+ /** An ISO-8601 timestamp representation of the cadence start of the resource. */
4583
+ active_from: string;
4584
+ /** An ISO-8601 timestamp representation of the cadence end of the resource. */
4585
+ active_to?: string;
4586
+ /**
4587
+ * The timing of the operation. After the create or update, a new entry will be
4588
+ * created in the timeline.
4589
+ */
4590
+ timing: 'immediate' | 'next_billing_cycle' | string;
4591
+ /** The timeline of the add-on. The returned periods are sorted and continuous. */
4592
+ timeline: SubscriptionAddonTimelineSegment[];
4593
+ /** The rate cards of the add-on. */
4594
+ rate_cards: SubscriptionAddonRateCard[];
4595
+ }
4563
4596
  /** Plans provide a template for subscriptions. */
4564
4597
  export interface Plan {
4565
4598
  id: string;
@@ -4706,6 +4739,16 @@ export interface ProfilePagePaginatedResponse {
4706
4739
  data: Profile[];
4707
4740
  meta: PaginatedMeta;
4708
4741
  }
4742
+ /** Page paginated response. */
4743
+ export interface SubscriptionAddonPagePaginatedResponse {
4744
+ data: SubscriptionAddon[];
4745
+ meta: PaginatedMeta;
4746
+ }
4747
+ /** Page paginated response. */
4748
+ export interface PlanPagePaginatedResponse {
4749
+ data: Plan[];
4750
+ meta: PaginatedMeta;
4751
+ }
4709
4752
  /** A standard invoice for charges owed by the customer. */
4710
4753
  export interface InvoiceStandard {
4711
4754
  id: string;
@@ -4784,11 +4827,6 @@ export interface InvoiceStandard {
4784
4827
  */
4785
4828
  lines?: InvoiceStandardLine[];
4786
4829
  }
4787
- /** Page paginated response. */
4788
- export interface PlanPagePaginatedResponse {
4789
- data: Plan[];
4790
- meta: PaginatedMeta;
4791
- }
4792
4830
  export interface SortQueryInput {
4793
4831
  /** The attribute to sort by. */
4794
4832
  by: string;
@@ -4978,16 +5016,6 @@ export interface CreditGrantPurchaseInput {
4978
5016
  /** Current payment settlement status. */
4979
5017
  settlement_status?: 'pending' | 'authorized' | 'settled';
4980
5018
  }
4981
- export interface WorkflowInvoicingSettingsInput {
4982
- /** Whether to automatically issue the invoice after the draftPeriod has passed. */
4983
- auto_advance?: boolean;
4984
- /** The period for the invoice to be kept in draft status for manual reviews. */
4985
- draft_period?: string;
4986
- /** Should progressive billing be allowed for this workflow? */
4987
- progressive_billing?: boolean;
4988
- /** Controls how subscription-ending shortened service periods are billed. */
4989
- subscription_end_proration_mode?: 'bill_full_period' | 'bill_actual_period';
4990
- }
4991
5019
  export interface UnitConfigInput {
4992
5020
  /** The arithmetic operation to apply to the raw metered quantity. */
4993
5021
  operation: 'divide' | 'multiply';
@@ -5022,6 +5050,16 @@ export interface UnitConfigInput {
5022
5050
  */
5023
5051
  display_unit?: string;
5024
5052
  }
5053
+ export interface WorkflowInvoicingSettingsInput {
5054
+ /** Whether to automatically issue the invoice after the draftPeriod has passed. */
5055
+ auto_advance?: boolean;
5056
+ /** The period for the invoice to be kept in draft status for manual reviews. */
5057
+ draft_period?: string;
5058
+ /** Should progressive billing be allowed for this workflow? */
5059
+ progressive_billing?: boolean;
5060
+ /** Controls how subscription-ending shortened service periods are billed. */
5061
+ subscription_end_proration_mode?: 'bill_full_period' | 'bill_actual_period';
5062
+ }
5025
5063
  export interface GovernanceQueryRequestInput {
5026
5064
  /**
5027
5065
  * Whether to include credit balance availability for each resolved customer. When
@@ -5049,12 +5087,6 @@ export interface SubscriptionCancelInput {
5049
5087
  /** If not provided the subscription is canceled immediately. */
5050
5088
  timing?: 'immediate' | 'next_billing_cycle' | string;
5051
5089
  }
5052
- export interface InvoiceWorkflowInput {
5053
- /** Invoicing settings for this invoice. */
5054
- invoicing?: InvoiceWorkflowInvoicingSettingsInput;
5055
- /** Payment settings for this invoice. */
5056
- payment?: WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettingsInput;
5057
- }
5058
5090
  export interface InvoiceUsageQuantityDetailInput {
5059
5091
  /** The raw quantity as reported by the meter (native units). */
5060
5092
  raw_quantity: string;
@@ -5073,6 +5105,12 @@ export interface InvoiceUsageQuantityDetailInput {
5073
5105
  */
5074
5106
  applied_unit_config: UnitConfigInput;
5075
5107
  }
5108
+ export interface InvoiceWorkflowInput {
5109
+ /** Invoicing settings for this invoice. */
5110
+ invoicing?: InvoiceWorkflowInvoicingSettingsInput;
5111
+ /** Payment settings for this invoice. */
5112
+ payment?: WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettingsInput;
5113
+ }
5076
5114
  export interface CreateCreditGrantRequestInput {
5077
5115
  /**
5078
5116
  * Display name of the resource.
@@ -5456,62 +5494,11 @@ export interface WorkflowInput {
5456
5494
  /** The tax settings for this workflow */
5457
5495
  tax?: WorkflowTaxSettingsInput;
5458
5496
  }
5459
- export interface InvoiceStandardLineInput {
5460
- id: string;
5461
- /**
5462
- * Display name of the resource.
5463
- *
5464
- * Between 1 and 256 characters.
5465
- */
5466
- name: string;
5467
- /**
5468
- * Optional description of the resource.
5469
- *
5470
- * Maximum 1024 characters.
5471
- */
5472
- description?: string;
5473
- labels?: Labels;
5474
- /** An ISO-8601 timestamp representation of entity creation date. */
5475
- created_at: string;
5476
- /** An ISO-8601 timestamp representation of entity last update date. */
5477
- updated_at: string;
5478
- /** An ISO-8601 timestamp representation of entity deletion date. */
5479
- deleted_at?: string;
5480
- /** The type of charge this line item represents. */
5481
- type: 'standard_line';
5482
- /**
5483
- * Indicates whether this line item's lifecycle is controlled by OpenMeter or
5484
- * manually overridden by the API user.
5485
- */
5486
- lifecycle_controller: 'system' | 'manual';
5487
- /**
5488
- * The service period covered by this invoice, spanning the earliest line start to
5489
- * the latest line end across all of its lines.
5490
- *
5491
- * For an invoice with no lines the period is empty, which means `from` will be
5492
- * equal to `to`.
5493
- */
5494
- service_period: ClosedPeriod;
5495
- /** Aggregated financial totals for the line item. */
5496
- totals: Totals;
5497
- /** Discounts applied to this line item. */
5498
- discounts?: InvoiceLineDiscounts;
5499
- /** Credit applied to this line item. */
5500
- credits_applied?: InvoiceLineCreditsApplied[];
5501
- /** External identifiers for this line item assigned by third-party systems. */
5502
- external_references?: InvoiceLineExternalReferences;
5503
- /** Reference to the subscription item that generated this line. */
5504
- subscription?: SubscriptionReference;
5505
- /** The rate card configuration snapshot used to price this line item. */
5506
- rate_card: InvoiceLineRateCard;
5507
- /**
5508
- * Detailed sub-lines that this line has been broken down into.
5509
- *
5510
- * Present when line has individual details.
5511
- */
5512
- detailed_lines: InvoiceDetailedLineInput[];
5513
- /** Reference to the charge associated with this line item. */
5514
- charge?: ChargeReference;
5497
+ export interface SubscriptionAddonRateCardInput {
5498
+ /** The rate card. */
5499
+ rate_card: RateCardInput;
5500
+ /** The IDs of the subscription items that this rate card belongs to. */
5501
+ affected_subscription_item_ids: string[];
5515
5502
  }
5516
5503
  export interface PlanPhaseInput {
5517
5504
  /**
@@ -5639,6 +5626,63 @@ export interface UpsertAddonRequestInput {
5639
5626
  /** The rate cards of the add-on. */
5640
5627
  rate_cards: RateCardInput[];
5641
5628
  }
5629
+ export interface InvoiceStandardLineInput {
5630
+ id: string;
5631
+ /**
5632
+ * Display name of the resource.
5633
+ *
5634
+ * Between 1 and 256 characters.
5635
+ */
5636
+ name: string;
5637
+ /**
5638
+ * Optional description of the resource.
5639
+ *
5640
+ * Maximum 1024 characters.
5641
+ */
5642
+ description?: string;
5643
+ labels?: Labels;
5644
+ /** An ISO-8601 timestamp representation of entity creation date. */
5645
+ created_at: string;
5646
+ /** An ISO-8601 timestamp representation of entity last update date. */
5647
+ updated_at: string;
5648
+ /** An ISO-8601 timestamp representation of entity deletion date. */
5649
+ deleted_at?: string;
5650
+ /** The type of charge this line item represents. */
5651
+ type: 'standard_line';
5652
+ /**
5653
+ * Indicates whether this line item's lifecycle is controlled by OpenMeter or
5654
+ * manually overridden by the API user.
5655
+ */
5656
+ lifecycle_controller: 'system' | 'manual';
5657
+ /**
5658
+ * The service period covered by this invoice, spanning the earliest line start to
5659
+ * the latest line end across all of its lines.
5660
+ *
5661
+ * For an invoice with no lines the period is empty, which means `from` will be
5662
+ * equal to `to`.
5663
+ */
5664
+ service_period: ClosedPeriod;
5665
+ /** Aggregated financial totals for the line item. */
5666
+ totals: Totals;
5667
+ /** Discounts applied to this line item. */
5668
+ discounts?: InvoiceLineDiscounts;
5669
+ /** Credit applied to this line item. */
5670
+ credits_applied?: InvoiceLineCreditsApplied[];
5671
+ /** External identifiers for this line item assigned by third-party systems. */
5672
+ external_references?: InvoiceLineExternalReferences;
5673
+ /** Reference to the subscription item that generated this line. */
5674
+ subscription?: SubscriptionReference;
5675
+ /** The rate card configuration snapshot used to price this line item. */
5676
+ rate_card: InvoiceLineRateCard;
5677
+ /**
5678
+ * Detailed sub-lines that this line has been broken down into.
5679
+ *
5680
+ * Present when line has individual details.
5681
+ */
5682
+ detailed_lines: InvoiceDetailedLineInput[];
5683
+ /** Reference to the charge associated with this line item. */
5684
+ charge?: ChargeReference;
5685
+ }
5642
5686
  export interface ProfileInput {
5643
5687
  id: string;
5644
5688
  /**
@@ -5722,6 +5766,50 @@ export interface UpsertBillingProfileRequestInput {
5722
5766
  /** Whether this is the default profile. */
5723
5767
  default: boolean;
5724
5768
  }
5769
+ export interface SubscriptionAddonInput {
5770
+ id: string;
5771
+ labels?: Labels;
5772
+ /** An ISO-8601 timestamp representation of entity creation date. */
5773
+ created_at: string;
5774
+ /** An ISO-8601 timestamp representation of entity last update date. */
5775
+ updated_at: string;
5776
+ /** An ISO-8601 timestamp representation of entity deletion date. */
5777
+ deleted_at?: string;
5778
+ /**
5779
+ * Display name of the resource.
5780
+ *
5781
+ * Between 1 and 256 characters.
5782
+ */
5783
+ name: string;
5784
+ /**
5785
+ * Optional description of the resource.
5786
+ *
5787
+ * Maximum 1024 characters.
5788
+ */
5789
+ description?: string;
5790
+ /** The add-on associated with the subscription. */
5791
+ addon: AddonReference;
5792
+ /** The quantity of the add-on. Always 1 for single instance add-ons. */
5793
+ quantity: number;
5794
+ /**
5795
+ * An ISO-8601 timestamp representation of which point in time the quantity was
5796
+ * resolved to.
5797
+ */
5798
+ quantity_at: string;
5799
+ /** An ISO-8601 timestamp representation of the cadence start of the resource. */
5800
+ active_from: string;
5801
+ /** An ISO-8601 timestamp representation of the cadence end of the resource. */
5802
+ active_to?: string;
5803
+ /**
5804
+ * The timing of the operation. After the create or update, a new entry will be
5805
+ * created in the timeline.
5806
+ */
5807
+ timing: 'immediate' | 'next_billing_cycle' | string;
5808
+ /** The timeline of the add-on. The returned periods are sorted and continuous. */
5809
+ timeline: SubscriptionAddonTimelineSegment[];
5810
+ /** The rate cards of the add-on. */
5811
+ rate_cards: SubscriptionAddonRateCardInput[];
5812
+ }
5725
5813
  export interface PlanInput {
5726
5814
  id: string;
5727
5815
  /**
@@ -5863,6 +5951,14 @@ export interface ProfilePagePaginatedResponseInput {
5863
5951
  data: ProfileInput[];
5864
5952
  meta: PaginatedMeta;
5865
5953
  }
5954
+ export interface SubscriptionAddonPagePaginatedResponseInput {
5955
+ data: SubscriptionAddonInput[];
5956
+ meta: PaginatedMeta;
5957
+ }
5958
+ export interface PlanPagePaginatedResponseInput {
5959
+ data: PlanInput[];
5960
+ meta: PaginatedMeta;
5961
+ }
5866
5962
  export interface InvoiceStandardInput {
5867
5963
  id: string;
5868
5964
  /**
@@ -5940,8 +6036,4 @@ export interface InvoiceStandardInput {
5940
6036
  */
5941
6037
  lines?: InvoiceStandardLineInput[];
5942
6038
  }
5943
- export interface PlanPagePaginatedResponseInput {
5944
- data: PlanInput[];
5945
- meta: PaginatedMeta;
5946
- }
5947
6039
  //# sourceMappingURL=types.d.ts.map