@openmeter/client 1.0.0-beta-19a1f6bdbcd5 → 1.0.0-beta-d512c81f78a3

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.
@@ -147,26 +147,6 @@ export interface AppStripeCreateCustomerPortalSessionOptions {
147
147
  * "mesh", "kic", or "\_".
148
148
  */
149
149
  export type CreateLabels = Record<string, string>;
150
- /** The tax config for Stripe. */
151
- export interface TaxConfigStripe {
152
- /** Product [tax code](https://docs.stripe.com/tax/tax-codes). */
153
- code: string;
154
- }
155
- /** External invoicing tax config. */
156
- export interface TaxConfigExternalInvoicing {
157
- /** The tax code should be interpreted by the external invoicing provider. */
158
- code: string;
159
- }
160
- /**
161
- * Discounts applicable to flat fee charges.
162
- *
163
- * This is the same as `ProductCatalog.Discounts` but without the `usage` field,
164
- * which is not applicable to flat fee charges.
165
- */
166
- export interface ChargeFlatFeeDiscounts {
167
- /** Percentage discount applied to the price (0–100). */
168
- percentage?: number;
169
- }
170
150
  /** Free price. */
171
151
  export interface PriceFree {
172
152
  /** The type of the price. */
@@ -188,6 +168,74 @@ export interface RateCardBooleanEntitlement {
188
168
  /** The type of the entitlement template. */
189
169
  type: 'boolean';
190
170
  }
171
+ /** The tax config for Stripe. */
172
+ export interface TaxConfigStripe {
173
+ /** Product [tax code](https://docs.stripe.com/tax/tax-codes). */
174
+ code: string;
175
+ }
176
+ /** External invoicing tax config. */
177
+ export interface TaxConfigExternalInvoicing {
178
+ /** The tax code should be interpreted by the external invoicing provider. */
179
+ code: string;
180
+ }
181
+ /** External identifiers assigned to an invoice by third-party systems. */
182
+ export interface InvoiceExternalReferences {
183
+ /** The ID assigned by the external invoicing app (e.g. Stripe invoice ID). */
184
+ invoicingId?: string;
185
+ /** The ID assigned by the external payment app (e.g. Stripe payment intent ID). */
186
+ paymentId?: string;
187
+ }
188
+ /** Details about an available invoice action including the resulting state. */
189
+ export interface InvoiceAvailableActionDetails {
190
+ /** The extended status the invoice will transition to after performing this action. */
191
+ resultingState: string;
192
+ }
193
+ /**
194
+ * Invoice-level invoicing settings.
195
+ *
196
+ * A subset of BillingWorkflowInvoicingSettings limited to fields that are
197
+ * meaningful per-invoice. progressive_billing is omitted as it is a gather-time /
198
+ * profile-level decision.
199
+ */
200
+ export interface InvoiceWorkflowInvoicingSettings {
201
+ /** Whether to automatically issue the invoice after the draft_period has passed. */
202
+ autoAdvance: boolean;
203
+ /** The period for the invoice to be kept in draft status for manual reviews. */
204
+ draftPeriod: string;
205
+ /** The period after which the invoice is considered overdue if not paid. */
206
+ dueAfter?: string;
207
+ }
208
+ /**
209
+ * Payment settings for a billing workflow when the collection method is charge
210
+ * automatically.
211
+ */
212
+ export interface WorkflowPaymentChargeAutomaticallySettings {
213
+ /** The collection method for the invoice. */
214
+ collectionMethod: 'charge_automatically';
215
+ }
216
+ /**
217
+ * Payment settings for a billing workflow when the collection method is send
218
+ * invoice.
219
+ */
220
+ export interface WorkflowPaymentSendInvoiceSettings {
221
+ /** The collection method for the invoice. */
222
+ collectionMethod: 'send_invoice';
223
+ /**
224
+ * The period after which the invoice is due. With some payment solutions it's only
225
+ * applicable for manual collection method.
226
+ */
227
+ dueAfter: string;
228
+ }
229
+ /**
230
+ * Discounts applicable to flat fee charges.
231
+ *
232
+ * This is the same as `ProductCatalog.Discounts` but without the `usage` field,
233
+ * which is not applicable to flat fee charges.
234
+ */
235
+ export interface ChargeFlatFeeDiscounts {
236
+ /** Percentage discount applied to the price (0–100). */
237
+ percentage?: number;
238
+ }
191
239
  /**
192
240
  * Labels store metadata of an entity that can be used for filtering an entity list
193
241
  * or for searching across entity types.
@@ -242,54 +290,6 @@ export interface WorkflowCollectionAlignmentSubscription {
242
290
  /** The type of alignment. */
243
291
  type: 'subscription';
244
292
  }
245
- /**
246
- * Payment settings for a billing workflow when the collection method is charge
247
- * automatically.
248
- */
249
- export interface WorkflowPaymentChargeAutomaticallySettings {
250
- /** The collection method for the invoice. */
251
- collectionMethod: 'charge_automatically';
252
- }
253
- /**
254
- * Payment settings for a billing workflow when the collection method is send
255
- * invoice.
256
- */
257
- export interface WorkflowPaymentSendInvoiceSettings {
258
- /** The collection method for the invoice. */
259
- collectionMethod: 'send_invoice';
260
- /**
261
- * The period after which the invoice is due. With some payment solutions it's only
262
- * applicable for manual collection method.
263
- */
264
- dueAfter: string;
265
- }
266
- /** External identifiers assigned to an invoice by third-party systems. */
267
- export interface InvoiceExternalReferences {
268
- /** The ID assigned by the external invoicing app (e.g. Stripe invoice ID). */
269
- invoicingId?: string;
270
- /** The ID assigned by the external payment app (e.g. Stripe payment intent ID). */
271
- paymentId?: string;
272
- }
273
- /** Details about an available invoice action including the resulting state. */
274
- export interface InvoiceAvailableActionDetails {
275
- /** The extended status the invoice will transition to after performing this action. */
276
- resultingState: string;
277
- }
278
- /**
279
- * Invoice-level invoicing settings.
280
- *
281
- * A subset of BillingWorkflowInvoicingSettings limited to fields that are
282
- * meaningful per-invoice. progressive_billing is omitted as it is a gather-time /
283
- * profile-level decision.
284
- */
285
- export interface InvoiceWorkflowInvoicingSettings {
286
- /** Whether to automatically issue the invoice after the draft_period has passed. */
287
- autoAdvance: boolean;
288
- /** The period for the invoice to be kept in draft status for manual reviews. */
289
- draftPeriod: string;
290
- /** The period after which the invoice is considered overdue if not paid. */
291
- dueAfter?: string;
292
- }
293
293
  /** External identifiers for an invoice line item assigned by third-party systems. */
294
294
  export interface InvoiceLineExternalReferences {
295
295
  /** The ID assigned by the external invoicing app. */
@@ -575,11 +575,6 @@ export interface CreateCurrencyCustomRequest {
575
575
  thousandSeparator: string;
576
576
  code: string;
577
577
  }
578
- /** Monetary amount in a specific currency. */
579
- export interface CurrencyAmount {
580
- amount: string;
581
- currency: string;
582
- }
583
578
  /** Flat price. */
584
579
  export interface PriceFlat {
585
580
  /** The type of the price. */
@@ -587,6 +582,28 @@ export interface PriceFlat {
587
582
  /** The amount of the flat price. */
588
583
  amount: string;
589
584
  }
585
+ /**
586
+ * Unit price.
587
+ *
588
+ * Charges a fixed rate per billing unit. When UnitConfig is present on the object,
589
+ * billing units are the converted quantities (e.g. GB instead of bytes).
590
+ */
591
+ export interface PriceUnit {
592
+ /** The type of the price. */
593
+ type: 'unit';
594
+ /** The amount of the unit price. */
595
+ amount: string;
596
+ }
597
+ /**
598
+ * Spend commitments for a usage-based price. The customer is committed to spend at
599
+ * least the minimum amount and at most the maximum amount.
600
+ */
601
+ export interface SpendCommitments {
602
+ /** The customer is committed to spend at least the amount. */
603
+ minimumAmount?: string;
604
+ /** The customer is limited to spend at most the amount. */
605
+ maximumAmount?: string;
606
+ }
590
607
  /** Discount configuration for a rate card. */
591
608
  export interface RateCardDiscounts {
592
609
  /** Percentage discount applied to the price (0–100). */
@@ -617,27 +634,56 @@ export interface Totals {
617
634
  /** The final total value of the resource after taxes, discounts and commitments. */
618
635
  total: string;
619
636
  }
620
- /**
621
- * Unit price.
622
- *
623
- * Charges a fixed rate per billing unit. When UnitConfig is present on the object,
624
- * billing units are the converted quantities (e.g. GB instead of bytes).
625
- */
626
- export interface PriceUnit {
627
- /** The type of the price. */
628
- type: 'unit';
629
- /** The amount of the unit price. */
637
+ /** A credit allocation applied to a charge realization detailed line. */
638
+ export interface ChargeRealizationDetailedLineCreditApplied {
639
+ /** The monetary amount credited. */
630
640
  amount: string;
641
+ /** Human-readable description of the credit allocation. */
642
+ description?: string;
643
+ /** The ID of the credit realization (allocation) this credit was applied from. */
644
+ creditRealizationId: string;
631
645
  }
632
- /**
633
- * Spend commitments for a usage-based price. The customer is committed to spend at
634
- * least the minimum amount and at most the maximum amount.
635
- */
636
- export interface SpendCommitments {
637
- /** The customer is committed to spend at least the amount. */
638
- minimumAmount?: string;
639
- /** The customer is limited to spend at most the amount. */
640
- maximumAmount?: string;
646
+ /** A discount applied to a charge realization detailed line. */
647
+ export interface ChargeRealizationAmountDiscount {
648
+ /** The amount of the discount applied to the charge. */
649
+ amount: string;
650
+ /** The reason for the discount applied to the charge. */
651
+ reason: string;
652
+ /** Optional human-readable description of the discount. */
653
+ description?: string;
654
+ /**
655
+ * The discount amount applied to the charge, rounded to the nearest cent (or
656
+ * currency equivalent) and adjusted to compensate for rounding errors across
657
+ * multiple discounted detail lines.
658
+ */
659
+ roundingAmount?: string;
660
+ /** Unique reference ID of the discount applied to the charge. */
661
+ childUniqueReferenceId: string;
662
+ }
663
+ /** A fixed per-unit cost amount. */
664
+ export interface FeatureManualUnitCost {
665
+ /** The type discriminator for manual unit cost. */
666
+ type: 'manual';
667
+ /** Fixed per-unit cost amount in USD. */
668
+ amount: string;
669
+ }
670
+ /** Resolved per-token pricing from the LLM cost database. */
671
+ export interface FeatureLlmUnitCostPricing {
672
+ /** Cost per input token in USD. */
673
+ inputPerToken: string;
674
+ /** Cost per output token in USD. */
675
+ outputPerToken: string;
676
+ /** Cost per cache read token in USD. */
677
+ cacheReadPerToken?: string;
678
+ /** Cost per reasoning token in USD. */
679
+ reasoningPerToken?: string;
680
+ /** Cost per cache write token in USD. */
681
+ cacheWritePerToken?: string;
682
+ }
683
+ /** Monetary amount in a specific currency. */
684
+ export interface CurrencyAmount {
685
+ amount: string;
686
+ currency: string;
641
687
  }
642
688
  /** A credit allocation applied to an invoice line item. */
643
689
  export interface InvoiceLineCreditsApplied {
@@ -692,26 +738,6 @@ export interface UpdateDiscounts {
692
738
  */
693
739
  usage?: string;
694
740
  }
695
- /** A fixed per-unit cost amount. */
696
- export interface FeatureManualUnitCost {
697
- /** The type discriminator for manual unit cost. */
698
- type: 'manual';
699
- /** Fixed per-unit cost amount in USD. */
700
- amount: string;
701
- }
702
- /** Resolved per-token pricing from the LLM cost database. */
703
- export interface FeatureLlmUnitCostPricing {
704
- /** Cost per input token in USD. */
705
- inputPerToken: string;
706
- /** Cost per output token in USD. */
707
- outputPerToken: string;
708
- /** Cost per cache read token in USD. */
709
- cacheReadPerToken?: string;
710
- /** Cost per reasoning token in USD. */
711
- reasoningPerToken?: string;
712
- /** Cost per cache write token in USD. */
713
- cacheWritePerToken?: string;
714
- }
715
741
  /** Token pricing for an LLM model, denominated per token. */
716
742
  export interface LlmCostModelPricing {
717
743
  /** Input price per token (USD). */
@@ -802,9 +828,17 @@ export interface CreditGrantInvoiceReference {
802
828
  id: string;
803
829
  };
804
830
  }
805
- /** Customer reference. */
806
- export interface BillingCustomerReference {
807
- /** The ID of the customer. */
831
+ /** A cost basis pinned to a custom-currency pair for the subscription. */
832
+ export interface SubscriptionCostBasisPin {
833
+ /** The managed custom currency ID. */
834
+ customCurrencyId: string;
835
+ /** The fiat currency in which the subscription is invoiced. */
836
+ invoiceCurrency: string;
837
+ /** The pinned cost basis resource ID. */
838
+ costBasisId: string;
839
+ }
840
+ /** Feature reference. */
841
+ export interface FeatureReference {
808
842
  id: string;
809
843
  }
810
844
  /**
@@ -814,6 +848,13 @@ export interface BillingCustomerReference {
814
848
  export interface SubscriptionReference {
815
849
  /** The ID of the subscription. */
816
850
  id: string;
851
+ /**
852
+ * The display name of the subscription.
853
+ *
854
+ * Only populated where the referencing endpoint documents a `subscription` expand
855
+ * that resolves it.
856
+ */
857
+ name?: string;
817
858
  /** The phase of the subscription. */
818
859
  phase: {
819
860
  id: string;
@@ -822,28 +863,19 @@ export interface SubscriptionReference {
822
863
  };
823
864
  };
824
865
  }
825
- /** A cost basis pinned to a custom-currency pair for the subscription. */
826
- export interface SubscriptionCostBasisPin {
827
- /** The managed custom currency ID. */
828
- customCurrencyId: string;
829
- /** The fiat currency in which the subscription is invoiced. */
830
- invoiceCurrency: string;
831
- /** The pinned cost basis resource ID. */
832
- costBasisId: string;
866
+ /** App reference. */
867
+ export interface AppReference {
868
+ /** The ID of the app. */
869
+ id: string;
833
870
  }
834
- /** Feature reference. */
835
- export interface FeatureReference {
871
+ /** ChargeRealizationInvoice reference. */
872
+ export interface ChargeRealizationInvoiceReference {
836
873
  id: string;
837
874
  }
838
875
  /** Addon reference. */
839
876
  export interface AddonReference {
840
877
  id: string;
841
878
  }
842
- /** App reference. */
843
- export interface AppReference {
844
- /** The ID of the app. */
845
- id: string;
846
- }
847
879
  /** Reference to a charge associated with an invoice line. */
848
880
  export interface ChargeReference {
849
881
  /** Unique identifier for the charge. */
@@ -853,6 +885,41 @@ export interface ChargeReference {
853
885
  export interface UpdateResourceReference {
854
886
  id: string;
855
887
  }
888
+ /** Customer reference. */
889
+ export interface BillingCustomerReference {
890
+ /** The ID of the customer. */
891
+ id: string;
892
+ /**
893
+ * The display name of the customer.
894
+ *
895
+ * Only populated where the referencing endpoint documents a `customer` expand that
896
+ * resolves it.
897
+ */
898
+ name?: string;
899
+ }
900
+ /**
901
+ * The feature associated with a charge.
902
+ *
903
+ * `key` is always present and is set at charge creation time. `id` and `name` are
904
+ * only resolved with the `feature` expand, since resolving them requires an
905
+ * additional lookup against the feature catalog.
906
+ */
907
+ export interface ChargeFeature {
908
+ /** The ID of the feature. */
909
+ id: string;
910
+ /**
911
+ * The key of the feature.
912
+ *
913
+ * Requires the `feature` expand.
914
+ */
915
+ key?: string;
916
+ /**
917
+ * The display name of the feature.
918
+ *
919
+ * Requires the `feature` expand.
920
+ */
921
+ name?: string;
922
+ }
856
923
  /** Metering event following the CloudEvents specification. */
857
924
  export interface Event {
858
925
  /** Identifies the event. */
@@ -1732,22 +1799,6 @@ export interface GetCreditBalanceParamsFilter {
1732
1799
  */
1733
1800
  featureKey?: StringFieldFilter;
1734
1801
  }
1735
- /** Filter options for listing charges. */
1736
- export interface ListChargesParamsFilter {
1737
- /**
1738
- * Filter charges by status.
1739
- *
1740
- * Supported statuses are:
1741
- *
1742
- * - `created`
1743
- * - `active`
1744
- * - `final`
1745
- * - `deleted`
1746
- *
1747
- * If omitted, all statuses are returned except for `deleted`.
1748
- */
1749
- status?: StringFieldFilterExact;
1750
- }
1751
1802
  /** Filter options for listing plans. */
1752
1803
  export interface ListPlansParamsFilter {
1753
1804
  key?: StringFieldFilter;
@@ -1766,11 +1817,6 @@ export interface VoidCreditGrantRequest {
1766
1817
  */
1767
1818
  paymentAdjustment: 'none';
1768
1819
  }
1769
- /** The proration configuration of the rate card. */
1770
- export interface RateCardProrationConfiguration {
1771
- /** The proration mode of the rate card. */
1772
- mode: 'no_proration' | 'prorate_prices';
1773
- }
1774
1820
  /** The pro-rating configuration of a subscription. */
1775
1821
  export interface SubscriptionProRatingConfig {
1776
1822
  /** Whether pro-rating is enabled. */
@@ -1778,6 +1824,51 @@ export interface SubscriptionProRatingConfig {
1778
1824
  /** How pro-rating is calculated when enabled. */
1779
1825
  mode: 'no_proration' | 'prorate_prices';
1780
1826
  }
1827
+ /** The proration configuration of the rate card. */
1828
+ export interface RateCardProrationConfiguration {
1829
+ /** The proration mode of the rate card. */
1830
+ mode: 'no_proration' | 'prorate_prices';
1831
+ }
1832
+ /** Subscription create request. */
1833
+ export interface SubscriptionCreate {
1834
+ labels?: Labels;
1835
+ /**
1836
+ * Settlement mode for billing.
1837
+ *
1838
+ * Values:
1839
+ *
1840
+ * - `credit_then_invoice`: Credits are applied first, then any remainder is
1841
+ * invoiced.
1842
+ * - `credit_only`: Usage is settled exclusively against credits.
1843
+ */
1844
+ settlementMode?: 'credit_then_invoice' | 'credit_only';
1845
+ /** The customer to create the subscription for. */
1846
+ customer: {
1847
+ id?: string;
1848
+ key?: string;
1849
+ };
1850
+ /** The plan reference of the subscription. */
1851
+ plan: {
1852
+ id?: string;
1853
+ key?: string;
1854
+ version?: number;
1855
+ };
1856
+ /**
1857
+ * A billing anchor is the fixed point in time that determines the subscription's
1858
+ * recurring billing cycle. It affects when charges occur and how prorations are
1859
+ * calculated. Common anchors:
1860
+ *
1861
+ * - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
1862
+ * - Subscription anniversary (day customer signed up)
1863
+ * - Custom date (customer-specified day)
1864
+ *
1865
+ * If not provided, the subscription will be created with the subscription's
1866
+ * creation time as the billing anchor.
1867
+ */
1868
+ billingAnchor?: Date;
1869
+ /** Controls how custom-currency cost bases are selected for the subscription. */
1870
+ costBasisMode: 'dynamic' | 'pinned';
1871
+ }
1781
1872
  /**
1782
1873
  * Unit conversion configuration.
1783
1874
  *
@@ -1836,45 +1927,67 @@ export interface UnitConfig {
1836
1927
  */
1837
1928
  displayUnit?: string;
1838
1929
  }
1839
- /** Subscription create request. */
1840
- export interface SubscriptionCreate {
1841
- labels?: Labels;
1842
- /**
1843
- * Settlement mode for billing.
1844
- *
1845
- * Values:
1846
- *
1847
- * - `credit_then_invoice`: Credits are applied first, then any remainder is
1848
- * invoiced.
1849
- * - `credit_only`: Usage is settled exclusively against credits.
1850
- */
1851
- settlementMode?: 'credit_then_invoice' | 'credit_only';
1852
- /** The customer to create the subscription for. */
1853
- customer: {
1854
- id?: string;
1855
- key?: string;
1856
- };
1857
- /** The plan reference of the subscription. */
1858
- plan: {
1859
- id?: string;
1860
- key?: string;
1861
- version?: number;
1862
- };
1930
+ /**
1931
+ * Identity stores the details required to identify an entity for tax purposes in a
1932
+ * specific country.
1933
+ */
1934
+ export interface PartyTaxIdentity {
1935
+ /** Normalized tax identification code shown on the original identity document. */
1936
+ code?: string;
1937
+ }
1938
+ /**
1939
+ * Identity stores the details required to identify an entity for tax purposes in a
1940
+ * specific country.
1941
+ */
1942
+ export interface UpdateBillingPartyTaxIdentity {
1943
+ /** Normalized tax identification code shown on the original identity document. */
1944
+ code?: string;
1945
+ }
1946
+ /**
1947
+ * A validation issue found during invoice processing.
1948
+ *
1949
+ * Converges on the same structure used by plan and subscription validation errors:
1950
+ * a machine-readable `code`, a human-readable `message`, optional structured
1951
+ * `attributes`, plus a `severity` and optional `field` path.
1952
+ */
1953
+ export interface InvoiceValidationIssue {
1954
+ /** Machine-readable error code. */
1955
+ code: string;
1956
+ /** Human-readable description of the error. */
1957
+ message: string;
1958
+ /** Additional structured context. */
1959
+ attributes?: Record<string, unknown>;
1960
+ /** Severity of the validation issue. */
1961
+ severity: 'critical' | 'warning';
1863
1962
  /**
1864
- * A billing anchor is the fixed point in time that determines the subscription's
1865
- * recurring billing cycle. It affects when charges occur and how prorations are
1866
- * calculated. Common anchors:
1867
- *
1868
- * - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
1869
- * - Subscription anniversary (day customer signed up)
1870
- * - Custom date (customer-specified day)
1963
+ * JSON path to the field that caused this validation issue, if applicable.
1871
1964
  *
1872
- * If not provided, the subscription will be created with the subscription's
1873
- * creation time as the billing anchor.
1965
+ * For example: `lines/0/rate_card/price`.
1874
1966
  */
1875
- billingAnchor?: Date;
1876
- /** Controls how custom-currency cost bases are selected for the subscription. */
1877
- costBasisMode: 'dynamic' | 'pinned';
1967
+ field?: string;
1968
+ }
1969
+ /**
1970
+ * The set of state-transition actions available for an invoice in its current
1971
+ * status.
1972
+ *
1973
+ * A field is present only when that action is permitted from the current state.
1974
+ */
1975
+ export interface InvoiceAvailableActions {
1976
+ /** Advance the invoice to the next workflow step. */
1977
+ advance?: InvoiceAvailableActionDetails;
1978
+ /** Approve the invoice for issuance. */
1979
+ approve?: InvoiceAvailableActionDetails;
1980
+ /** Delete the invoice. */
1981
+ delete?: InvoiceAvailableActionDetails;
1982
+ /** Retry a failed workflow step. */
1983
+ retry?: InvoiceAvailableActionDetails;
1984
+ /** Snapshot the current usage quantities. */
1985
+ snapshotQuantities?: InvoiceAvailableActionDetails;
1986
+ }
1987
+ /** Payment state of a charge realization. */
1988
+ export interface ChargeRealizationPayment {
1989
+ /** The settlement status of the payment. */
1990
+ status: 'authorized' | 'settled';
1878
1991
  }
1879
1992
  /** Mapping of app types to tax codes. */
1880
1993
  export interface TaxCodeAppMapping {
@@ -1974,22 +2087,6 @@ export interface UpdateAppExternalInvoicingRequest {
1974
2087
  */
1975
2088
  enableIssuingSyncHook: boolean;
1976
2089
  }
1977
- /**
1978
- * Identity stores the details required to identify an entity for tax purposes in a
1979
- * specific country.
1980
- */
1981
- export interface PartyTaxIdentity {
1982
- /** Normalized tax identification code shown on the original identity document. */
1983
- code?: string;
1984
- }
1985
- /**
1986
- * Identity stores the details required to identify an entity for tax purposes in a
1987
- * specific country.
1988
- */
1989
- export interface UpdateBillingPartyTaxIdentity {
1990
- /** Normalized tax identification code shown on the original identity document. */
1991
- code?: string;
1992
- }
1993
2090
  /** Invoice settings for a billing workflow. */
1994
2091
  export interface WorkflowInvoicingSettings {
1995
2092
  /** Whether to automatically issue the invoice after the draftPeriod has passed. */
@@ -2001,47 +2098,6 @@ export interface WorkflowInvoicingSettings {
2001
2098
  /** Controls how subscription-ending shortened service periods are billed. */
2002
2099
  subscriptionEndProrationMode: 'bill_full_period' | 'bill_actual_period';
2003
2100
  }
2004
- /**
2005
- * A validation issue found during invoice processing.
2006
- *
2007
- * Converges on the same structure used by plan and subscription validation errors:
2008
- * a machine-readable `code`, a human-readable `message`, optional structured
2009
- * `attributes`, plus a `severity` and optional `field` path.
2010
- */
2011
- export interface InvoiceValidationIssue {
2012
- /** Machine-readable error code. */
2013
- code: string;
2014
- /** Human-readable description of the error. */
2015
- message: string;
2016
- /** Additional structured context. */
2017
- attributes?: Record<string, unknown>;
2018
- /** Severity of the validation issue. */
2019
- severity: 'critical' | 'warning';
2020
- /**
2021
- * JSON path to the field that caused this validation issue, if applicable.
2022
- *
2023
- * For example: `lines/0/rate_card/price`.
2024
- */
2025
- field?: string;
2026
- }
2027
- /**
2028
- * The set of state-transition actions available for an invoice in its current
2029
- * status.
2030
- *
2031
- * A field is present only when that action is permitted from the current state.
2032
- */
2033
- export interface InvoiceAvailableActions {
2034
- /** Advance the invoice to the next workflow step. */
2035
- advance?: InvoiceAvailableActionDetails;
2036
- /** Approve the invoice for issuance. */
2037
- approve?: InvoiceAvailableActionDetails;
2038
- /** Delete the invoice. */
2039
- delete?: InvoiceAvailableActionDetails;
2040
- /** Retry a failed workflow step. */
2041
- retry?: InvoiceAvailableActionDetails;
2042
- /** Snapshot the current usage quantities. */
2043
- snapshotQuantities?: InvoiceAvailableActionDetails;
2044
- }
2045
2101
  /** A monetary amount discount applied to an invoice line item. */
2046
2102
  export interface InvoiceLineAmountDiscount {
2047
2103
  /** Unique identifier for the discount. */
@@ -2245,26 +2301,11 @@ export interface CreditTransaction {
2245
2301
  };
2246
2302
  }
2247
2303
  /**
2248
- * The totals of a charge.
2304
+ * A price tier used in graduated and volume pricing.
2249
2305
  *
2250
- * RealTime is only expanded when the `real_time_usage` expand is used.
2251
- */
2252
- export interface ChargeTotals {
2253
- /** The amount of the charge already booked to the internal accounting system. */
2254
- booked: Totals;
2255
- /**
2256
- * The realtime amount of the charge.
2257
- *
2258
- * Requires the `realtime_usage` expand.
2259
- */
2260
- realtime?: Totals;
2261
- }
2262
- /**
2263
- * A price tier used in graduated and volume pricing.
2264
- *
2265
- * At least one price component (flat_price or unit_price) must be set. When
2266
- * UnitConfig is present on the containing resource, up_to_amount is expressed in
2267
- * converted billing units.
2306
+ * At least one price component (flat_price or unit_price) must be set. When
2307
+ * UnitConfig is present on the containing resource, up_to_amount is expressed in
2308
+ * converted billing units.
2268
2309
  */
2269
2310
  export interface PriceTier {
2270
2311
  /**
@@ -2278,22 +2319,22 @@ export interface PriceTier {
2278
2319
  unitPrice?: PriceUnit;
2279
2320
  }
2280
2321
  /**
2281
- * A price tier used in graduated and volume pricing.
2322
+ * The totals of a charge.
2282
2323
  *
2283
- * At least one price component (flat_price or unit_price) must be set. When
2284
- * UnitConfig is present on the containing resource, up_to_amount is expressed in
2285
- * converted billing units.
2324
+ * `realtime` is only populated when the `real_time_usage` expand is used.
2286
2325
  */
2287
- export interface UpdatePriceTier {
2326
+ export interface ChargeTotals {
2327
+ /** The amount of the charge already booked to the internal accounting system. */
2328
+ booked: Totals;
2288
2329
  /**
2289
- * Up to and including this quantity will be contained in the tier. If undefined,
2290
- * the tier is open-ended (the last tier).
2330
+ * The realtime amount of the charge, i.e. the whole usage rated at the charge's
2331
+ * price for its full service period, ignoring what has already been booked to a
2332
+ * realization. This differs from the `usage` of a realization with type
2333
+ * `outstanding`, which only covers the quantity not yet booked.
2334
+ *
2335
+ * Requires the `real_time_usage` expand.
2291
2336
  */
2292
- upToAmount?: string;
2293
- /** The flat price component of the tier. Charged once when the tier is entered. */
2294
- flatPrice?: UpdatePriceFlat;
2295
- /** The unit price component of the tier. Charged per billing unit within the tier. */
2296
- unitPrice?: UpdatePriceUnit;
2337
+ realtime?: Totals;
2297
2338
  }
2298
2339
  /**
2299
2340
  * LLM cost lookup configuration. Each dimension (provider, model, token type) can
@@ -2341,6 +2382,24 @@ export interface FeatureLlmUnitCost {
2341
2382
  */
2342
2383
  pricing?: FeatureLlmUnitCostPricing;
2343
2384
  }
2385
+ /**
2386
+ * A price tier used in graduated and volume pricing.
2387
+ *
2388
+ * At least one price component (flat_price or unit_price) must be set. When
2389
+ * UnitConfig is present on the containing resource, up_to_amount is expressed in
2390
+ * converted billing units.
2391
+ */
2392
+ export interface UpdatePriceTier {
2393
+ /**
2394
+ * Up to and including this quantity will be contained in the tier. If undefined,
2395
+ * the tier is open-ended (the last tier).
2396
+ */
2397
+ upToAmount?: string;
2398
+ /** The flat price component of the tier. Charged once when the tier is entered. */
2399
+ flatPrice?: UpdatePriceFlat;
2400
+ /** The unit price component of the tier. Charged per billing unit within the tier. */
2401
+ unitPrice?: UpdatePriceUnit;
2402
+ }
2344
2403
  /**
2345
2404
  * An LLM cost price record, representing the cost per token for a specific model
2346
2405
  * from a specific provider.
@@ -2452,6 +2511,11 @@ export interface CreditGrantTaxConfig {
2452
2511
  /** Tax code applied to the invoice line item. */
2453
2512
  taxCode?: TaxCodeReference;
2454
2513
  }
2514
+ /** The tax config of the rate card. */
2515
+ export interface RateCardTaxConfig {
2516
+ behavior?: 'inclusive' | 'exclusive';
2517
+ code: TaxCodeReference;
2518
+ }
2455
2519
  /** Set of provider specific tax configs. */
2456
2520
  export interface TaxConfig {
2457
2521
  /**
@@ -2476,11 +2540,6 @@ export interface TaxConfig {
2476
2540
  */
2477
2541
  taxCode?: TaxCodeReference;
2478
2542
  }
2479
- /** The tax config of the rate card. */
2480
- export interface RateCardTaxConfig {
2481
- behavior?: 'inclusive' | 'exclusive';
2482
- code: TaxCodeReference;
2483
- }
2484
2543
  /**
2485
2544
  * Organization-level default tax code references.
2486
2545
  *
@@ -2504,6 +2563,27 @@ export interface UpdateOrganizationDefaultTaxCodesRequest {
2504
2563
  /** Default tax code for credit grants. */
2505
2564
  creditGrantTaxCode?: TaxCodeReference;
2506
2565
  }
2566
+ /**
2567
+ * BillingInvoiceWorkflowAppsReferences represents the references (id) to the apps
2568
+ * used by a billing profile
2569
+ */
2570
+ export interface InvoiceWorkflowAppsReferences {
2571
+ /** The tax app used for this workflow */
2572
+ tax: AppReference;
2573
+ /** The invoicing app used for this workflow */
2574
+ invoicing: AppReference;
2575
+ /** The payment app used for this workflow */
2576
+ payment: AppReference;
2577
+ }
2578
+ /** References to the applications used by a billing profile. */
2579
+ export interface ProfileAppReferences {
2580
+ /** The tax app used for this workflow. */
2581
+ tax: AppReference;
2582
+ /** The invoicing app used for this workflow. */
2583
+ invoicing: AppReference;
2584
+ /** The payment app used for this workflow. */
2585
+ payment: AppReference;
2586
+ }
2507
2587
  /**
2508
2588
  * PlanAddon represents an association between a plan and an add-on, controlling
2509
2589
  * which add-ons are available for purchase within a plan.
@@ -2568,27 +2648,6 @@ export interface CreatePlanAddonRequest {
2568
2648
  */
2569
2649
  maxQuantity?: number;
2570
2650
  }
2571
- /** References to the applications used by a billing profile. */
2572
- export interface ProfileAppReferences {
2573
- /** The tax app used for this workflow. */
2574
- tax: AppReference;
2575
- /** The invoicing app used for this workflow. */
2576
- invoicing: AppReference;
2577
- /** The payment app used for this workflow. */
2578
- payment: AppReference;
2579
- }
2580
- /**
2581
- * BillingInvoiceWorkflowAppsReferences represents the references (id) to the apps
2582
- * used by a billing profile
2583
- */
2584
- export interface InvoiceWorkflowAppsReferences {
2585
- /** The tax app used for this workflow */
2586
- tax: AppReference;
2587
- /** The invoicing app used for this workflow */
2588
- invoicing: AppReference;
2589
- /** The payment app used for this workflow */
2590
- payment: AppReference;
2591
- }
2592
2651
  /** The tax config of the rate card. */
2593
2652
  export interface UpdateRateCardTaxConfig {
2594
2653
  behavior?: 'inclusive' | 'exclusive';
@@ -2613,6 +2672,44 @@ export interface ListEventsParamsFilter {
2613
2672
  /** Filter events by the time the event was stored. */
2614
2673
  storedAt?: DateTimeFieldFilter;
2615
2674
  }
2675
+ /** Filter options for listing charges. */
2676
+ export interface ListChargesParamsFilter {
2677
+ /**
2678
+ * Filter charges by status.
2679
+ *
2680
+ * Supported statuses are:
2681
+ *
2682
+ * - `created`
2683
+ * - `active`
2684
+ * - `final`
2685
+ * - `deleted`
2686
+ *
2687
+ * If omitted, all statuses are returned except for `deleted`.
2688
+ */
2689
+ status?: StringFieldFilterExact;
2690
+ /** Filter charges by the ID of their associated feature. */
2691
+ featureId?: UlidFieldFilter;
2692
+ /** Filter charges by the key of their associated feature. */
2693
+ featureKey?: StringFieldFilterExact;
2694
+ /**
2695
+ * Filter charges by the start of their service period.
2696
+ *
2697
+ * Combine with `service_period_to` to match charges whose service period falls
2698
+ * within a given window: `filter[service_period_from][gte]=<from>` together with
2699
+ * `filter[service_period_to][lt]=<to>` returns charges whose service period lies
2700
+ * within `[from, to)`.
2701
+ */
2702
+ servicePeriodFrom?: DateTimeFieldFilter;
2703
+ /**
2704
+ * Filter charges by the end of their service period.
2705
+ *
2706
+ * Combine with `service_period_from` to match charges whose service period falls
2707
+ * within a given window: `filter[service_period_from][gte]=<from>` together with
2708
+ * `filter[service_period_to][lt]=<to>` returns charges whose service period lies
2709
+ * within `[from, to)`.
2710
+ */
2711
+ servicePeriodTo?: DateTimeFieldFilter;
2712
+ }
2616
2713
  /** Filter options for listing invoices. */
2617
2714
  export interface ListInvoicesParamsFilter {
2618
2715
  /** Filter by invoice status. */
@@ -2677,6 +2774,61 @@ export interface MeterQueryResult {
2677
2774
  /** The usage data. If no data is available, an empty array is returned. */
2678
2775
  data: MeterQueryRow[];
2679
2776
  }
2777
+ /** A detailed line produced by a flat fee charge's realization run. */
2778
+ export interface ChargeRealizationDetailedLineFlatFee {
2779
+ id: string;
2780
+ /** An ISO-8601 timestamp representation of entity creation date. */
2781
+ createdAt: Date;
2782
+ /** An ISO-8601 timestamp representation of entity last update date. */
2783
+ updatedAt: Date;
2784
+ /** An ISO-8601 timestamp representation of entity deletion date. */
2785
+ deletedAt?: Date;
2786
+ /** The type of the charge the realization belongs to. */
2787
+ type: 'flat_fee';
2788
+ /** The service period covered by this detailed line. */
2789
+ servicePeriod: ClosedPeriod;
2790
+ /** Aggregated financial totals for the detailed line. */
2791
+ totals: Totals;
2792
+ /** The cost category of this detailed line. */
2793
+ category: 'regular' | 'commitment';
2794
+ /** Credits applied to this detailed line. */
2795
+ creditsApplied?: ChargeRealizationDetailedLineCreditApplied[];
2796
+ /** The unit price of the detailed line. */
2797
+ unitPrice: string;
2798
+ /** The amount discounts applied to the detailed line. */
2799
+ amountDiscounts: ChargeRealizationAmountDiscount[];
2800
+ }
2801
+ /** A detailed line produced by a usage-based charge's realization run. */
2802
+ export interface ChargeRealizationDetailedLineUsageBased {
2803
+ id: string;
2804
+ /** An ISO-8601 timestamp representation of entity creation date. */
2805
+ createdAt: Date;
2806
+ /** An ISO-8601 timestamp representation of entity last update date. */
2807
+ updatedAt: Date;
2808
+ /** An ISO-8601 timestamp representation of entity deletion date. */
2809
+ deletedAt?: Date;
2810
+ /** The type of the charge the realization belongs to. */
2811
+ type: 'usage_based';
2812
+ /** The service period covered by this detailed line. */
2813
+ servicePeriod: ClosedPeriod;
2814
+ /** Aggregated financial totals for the detailed line. */
2815
+ totals: Totals;
2816
+ /** The cost category of this detailed line. */
2817
+ category: 'regular' | 'commitment';
2818
+ /** Credits applied to this detailed line. */
2819
+ creditsApplied?: ChargeRealizationDetailedLineCreditApplied[];
2820
+ /** The unit price of the detailed line. */
2821
+ unitPrice: string;
2822
+ /** The amount discounts applied to the detailed line. */
2823
+ amountDiscounts: ChargeRealizationAmountDiscount[];
2824
+ /** The quantity of the detailed line. */
2825
+ quantity: string;
2826
+ /**
2827
+ * The ID of a prior realization run this detailed line corrects. Only set if the
2828
+ * detailed line's totals are negative.
2829
+ */
2830
+ correctsRunId?: string;
2831
+ }
2680
2832
  /** Describes custom currency. */
2681
2833
  export interface CurrencyCustom {
2682
2834
  /** The type of the currency. */
@@ -2962,6 +3114,33 @@ export interface ChargeFlatFeeSystemIntent {
2962
3114
  */
2963
3115
  deletedAt?: Date;
2964
3116
  }
3117
+ /** Detailed status information for a standard invoice. */
3118
+ export interface InvoiceStatusDetails {
3119
+ /** Whether the invoice is immutable (i.e. cannot be modified or deleted). */
3120
+ immutable: boolean;
3121
+ /** Whether the invoice is in a failed state. */
3122
+ failed: boolean;
3123
+ /**
3124
+ * Fine-grained internal status string providing additional workflow detail beyond
3125
+ * the top-level status enum.
3126
+ */
3127
+ extendedStatus: string;
3128
+ /** The set of state-transition actions currently available for this invoice. */
3129
+ availableActions: InvoiceAvailableActions;
3130
+ }
3131
+ /**
3132
+ * Invoice-level snapshot of the workflow configuration.
3133
+ *
3134
+ * Contains only the settings that are meaningful for an already-created invoice:
3135
+ * invoicing behaviour and payment settings. Collection alignment and tax policy
3136
+ * are gather-time / profile-wide concerns and are not included.
3137
+ */
3138
+ export interface InvoiceWorkflow {
3139
+ /** Invoicing settings for this invoice. */
3140
+ invoicing?: InvoiceWorkflowInvoicingSettings;
3141
+ /** Payment settings for this invoice. */
3142
+ payment?: WorkflowPaymentSettings;
3143
+ }
2965
3144
  /** Request for canceling a subscription. */
2966
3145
  export interface SubscriptionCancel {
2967
3146
  /** If not provided the subscription is canceled immediately. */
@@ -3107,33 +3286,6 @@ export interface AppCatalogItem {
3107
3286
  /** Available install methods of the app. */
3108
3287
  installMethods: ('with_oauth2' | 'with_api_key' | 'no_credentials_required')[];
3109
3288
  }
3110
- /**
3111
- * Invoice-level snapshot of the workflow configuration.
3112
- *
3113
- * Contains only the settings that are meaningful for an already-created invoice:
3114
- * invoicing behaviour and payment settings. Collection alignment and tax policy
3115
- * are gather-time / profile-wide concerns and are not included.
3116
- */
3117
- export interface InvoiceWorkflow {
3118
- /** Invoicing settings for this invoice. */
3119
- invoicing?: InvoiceWorkflowInvoicingSettings;
3120
- /** Payment settings for this invoice. */
3121
- payment?: WorkflowPaymentSettings;
3122
- }
3123
- /** Detailed status information for a standard invoice. */
3124
- export interface InvoiceStatusDetails {
3125
- /** Whether the invoice is immutable (i.e. cannot be modified or deleted). */
3126
- immutable: boolean;
3127
- /** Whether the invoice is in a failed state. */
3128
- failed: boolean;
3129
- /**
3130
- * Fine-grained internal status string providing additional workflow detail beyond
3131
- * the top-level status enum.
3132
- */
3133
- extendedStatus: string;
3134
- /** The set of state-transition actions currently available for this invoice. */
3135
- availableActions: InvoiceAvailableActions;
3136
- }
3137
3289
  /** Discounts applied to an invoice line item. */
3138
3290
  export interface InvoiceLineDiscounts {
3139
3291
  /** Monetary amount discounts (e.g. from maximum spend commitments). */
@@ -3433,12 +3585,12 @@ export interface CreateChargeFlatFeeRequest {
3433
3585
  paymentTerm: PricePaymentTerm;
3434
3586
  /** The discounts applied to the charge. */
3435
3587
  discounts?: ChargeFlatFeeDiscounts;
3436
- /** The feature ID associated with the charge. */
3437
- featureId?: string;
3438
3588
  /** The proration configuration of the charge. */
3439
3589
  prorationConfiguration: RateCardProrationConfiguration;
3440
3590
  /** The amount before proration of the charge. */
3441
3591
  amountBeforeProration: CurrencyAmount;
3592
+ /** A reference to the feature associated with the charge, when applicable. */
3593
+ feature?: FeatureReference;
3442
3594
  /** The full, unprorated service period of the charge. */
3443
3595
  fullServicePeriod?: ClosedPeriod;
3444
3596
  /** The billing period the charge belongs to. */
@@ -3507,22 +3659,6 @@ export interface CustomerPagePaginatedResponse {
3507
3659
  data: Customer[];
3508
3660
  meta: PaginatedMeta;
3509
3661
  }
3510
- /** Party represents a person or business entity. */
3511
- export interface Party {
3512
- /** Unique identifier for the party. */
3513
- id?: string;
3514
- /** An optional unique key of the party. */
3515
- key?: string;
3516
- /** Legal name or representation of the party. */
3517
- name?: string;
3518
- /**
3519
- * The entity's legal identification used for tax purposes. They may have other
3520
- * numbers, but we're only interested in those valid for tax purposes.
3521
- */
3522
- taxId?: PartyTaxIdentity;
3523
- /** Address for where information should be sent if needed. */
3524
- addresses?: PartyAddresses;
3525
- }
3526
3662
  /**
3527
3663
  * Snapshot of the supplier's information at the time the invoice was issued.
3528
3664
  *
@@ -3543,6 +3679,22 @@ export interface Supplier {
3543
3679
  /** Unique identifier for the party. */
3544
3680
  id?: string;
3545
3681
  }
3682
+ /** Party represents a person or business entity. */
3683
+ export interface Party {
3684
+ /** Unique identifier for the party. */
3685
+ id?: string;
3686
+ /** An optional unique key of the party. */
3687
+ key?: string;
3688
+ /** Legal name or representation of the party. */
3689
+ name?: string;
3690
+ /**
3691
+ * The entity's legal identification used for tax purposes. They may have other
3692
+ * numbers, but we're only interested in those valid for tax purposes.
3693
+ */
3694
+ taxId?: PartyTaxIdentity;
3695
+ /** Address for where information should be sent if needed. */
3696
+ addresses?: PartyAddresses;
3697
+ }
3546
3698
  /**
3547
3699
  * Snapshot of the supplier's information at the time the invoice was issued.
3548
3700
  *
@@ -3656,85 +3808,21 @@ export interface AppStripeCreateCheckoutSessionRequestOptions {
3656
3808
  /** Configuration for collecting tax IDs during checkout. */
3657
3809
  taxIdCollection?: AppStripeCreateCheckoutSessionTaxIdCollection;
3658
3810
  }
3659
- /** A flat fee charge for a customer. */
3660
- export interface ChargeFlatFee {
3661
- id: string;
3662
- /**
3663
- * Display name of the resource.
3664
- *
3665
- * Between 1 and 256 characters.
3666
- */
3667
- name: string;
3811
+ /** Snapshot of the billing workflow configuration captured at invoice creation. */
3812
+ export interface InvoiceWorkflowSettings {
3813
+ /** The apps that will be used to orchestrate the invoice's workflow. */
3814
+ apps?: InvoiceWorkflowAppsReferences;
3815
+ /** The billing profile that was the source of this workflow snapshot. */
3816
+ sourceBillingProfile: ProfileReference;
3668
3817
  /**
3669
- * Optional description of the resource.
3818
+ * The workflow configuration that was active when the invoice was created.
3670
3819
  *
3671
- * Maximum 1024 characters.
3672
- */
3673
- description?: string;
3674
- labels?: Labels;
3675
- /** An ISO-8601 timestamp representation of entity creation date. */
3676
- createdAt: Date;
3677
- /** An ISO-8601 timestamp representation of entity last update date. */
3678
- updatedAt: Date;
3679
- /** An ISO-8601 timestamp representation of entity deletion date. */
3680
- deletedAt?: Date;
3681
- /** The type of the charge. */
3682
- type: 'flat_fee';
3683
- /** The customer owning the charge. */
3684
- customer: BillingCustomerReference;
3685
- /**
3686
- * Indicates whether the charge lifecycle is controlled by OpenMeter or manually
3687
- * overridden by the API user.
3688
- */
3689
- lifecycleController: 'system' | 'manual';
3690
- /**
3691
- * The subscription that originated the charge, when the charge was created from a
3692
- * subscription item.
3693
- */
3694
- subscription?: SubscriptionReference;
3695
- /** The currency of the charge. */
3696
- currency: string;
3697
- /** The lifecycle status of the charge. */
3698
- status: 'created' | 'active' | 'final' | 'deleted';
3699
- /** The timestamp when the charge is intended to be invoiced. */
3700
- invoiceAt: Date;
3701
- /** The effective service period covered by the charge. */
3702
- servicePeriod: ClosedPeriod;
3703
- /** The full, unprorated service period of the charge. */
3704
- fullServicePeriod: ClosedPeriod;
3705
- /** The billing period the charge belongs to. */
3706
- billingPeriod: ClosedPeriod;
3707
- /**
3708
- * The earliest time when the charge should be advanced again by background
3709
- * processing.
3710
- */
3711
- advanceAfter?: Date;
3712
- /** Unique reference ID of the charge. */
3713
- uniqueReferenceId?: string;
3714
- /** Settlement mode of the charge. */
3715
- settlementMode: 'credit_then_invoice' | 'credit_only';
3716
- /** Tax configuration of the charge. */
3717
- taxConfig?: TaxConfig;
3718
- /** Payment term of the flat fee charge. */
3719
- paymentTerm: PricePaymentTerm;
3720
- /** The discounts applied to the charge. */
3721
- discounts?: ChargeFlatFeeDiscounts;
3722
- /** The feature associated with the charge, when applicable. */
3723
- featureKey?: string;
3724
- /** The feature ID associated with the charge. */
3725
- featureId?: string;
3726
- /** The proration configuration of the charge. */
3727
- prorationConfiguration: RateCardProrationConfiguration;
3728
- /** The amount after proration of the charge. */
3729
- amountAfterProration: CurrencyAmount;
3730
- /** The price of the charge. */
3731
- price: PriceFlat;
3732
- /**
3733
- * Current intent from the system lifecycle controller for a charge that has an
3734
- * active manual override. The top-level charge fields remain the effective
3735
- * customer-facing intent.
3820
+ * Only the fields that are meaningful at the per-invoice level are included:
3821
+ * invoicing behaviour (auto-advance, draft period) and payment settings
3822
+ * (collection method, due date). Profile-wide settings such as collection
3823
+ * alignment, progressive billing, and tax policy are omitted.
3736
3824
  */
3737
- systemIntent?: ChargeFlatFeeSystemIntent;
3825
+ workflow: InvoiceWorkflow;
3738
3826
  }
3739
3827
  /** Page paginated response. */
3740
3828
  export interface TaxCodePagePaginatedResponse {
@@ -4004,22 +4092,6 @@ export interface InstalledAppExternalInvoicing {
4004
4092
  /** Default capabilities of the installed app. */
4005
4093
  defaultForCapabilityTypes: ('report_usage' | 'report_events' | 'calculate_tax' | 'invoice_customers' | 'collect_payments')[];
4006
4094
  }
4007
- /** Snapshot of the billing workflow configuration captured at invoice creation. */
4008
- export interface InvoiceWorkflowSettings {
4009
- /** The apps that will be used to orchestrate the invoice's workflow. */
4010
- apps?: InvoiceWorkflowAppsReferences;
4011
- /** The billing profile that was the source of this workflow snapshot. */
4012
- sourceBillingProfile: ProfileReference;
4013
- /**
4014
- * The workflow configuration that was active when the invoice was created.
4015
- *
4016
- * Only the fields that are meaningful at the per-invoice level are included:
4017
- * invoicing behaviour (auto-advance, draft period) and payment settings
4018
- * (collection method, due date). Profile-wide settings such as collection
4019
- * alignment, progressive billing, and tax policy are omitted.
4020
- */
4021
- workflow: InvoiceWorkflow;
4022
- }
4023
4095
  /**
4024
4096
  * A detailed (child) sub-line belonging to a parent invoice line.
4025
4097
  *
@@ -4276,6 +4348,83 @@ export interface WorkflowCollectionSettings {
4276
4348
  */
4277
4349
  interval: string;
4278
4350
  }
4351
+ /**
4352
+ * The invoice a charge realization was booked to, embedded as a header.
4353
+ *
4354
+ * Matches the standard invoice entity, except that it carries no `customer`
4355
+ * snapshot (the charge context already identifies the customer) and `lines` are
4356
+ * never populated (the realization itself is the line-level breakdown). The shared
4357
+ * invoice contract stays untouched: this model exists so the charges API can slim
4358
+ * the embedding without loosening the invoices API.
4359
+ */
4360
+ export interface ChargeRealizationInvoice {
4361
+ id: string;
4362
+ /**
4363
+ * Optional description of the resource.
4364
+ *
4365
+ * Maximum 1024 characters.
4366
+ */
4367
+ description?: string;
4368
+ labels?: Labels;
4369
+ /** An ISO-8601 timestamp representation of entity creation date. */
4370
+ createdAt: Date;
4371
+ /** An ISO-8601 timestamp representation of entity last update date. */
4372
+ updatedAt: Date;
4373
+ /** An ISO-8601 timestamp representation of entity deletion date. */
4374
+ deletedAt?: Date;
4375
+ /** Human-readable invoice number generated by the invoicing app. */
4376
+ number: string;
4377
+ /** Three-letter ISO 4217 currency code for the invoice. */
4378
+ currency: string;
4379
+ /**
4380
+ * Snapshot of the supplier's contact information at the time the invoice was
4381
+ * issued.
4382
+ */
4383
+ supplier: Supplier;
4384
+ /** Aggregated financial totals for the invoice. */
4385
+ totals: Totals;
4386
+ /**
4387
+ * The service period covered by this invoice.
4388
+ *
4389
+ * For flat fee the service period can be empty which means `from` will be equals
4390
+ * to `to`. In other cases those fields will be filled with the actual service
4391
+ * period.
4392
+ */
4393
+ servicePeriod: ClosedPeriod;
4394
+ /**
4395
+ * Validation issues found during invoice processing.
4396
+ *
4397
+ * Present only when there are one or more validation findings. An empty list is
4398
+ * omitted.
4399
+ */
4400
+ validationIssues?: InvoiceValidationIssue[];
4401
+ /** External identifiers assigned to this invoice by third-party systems. */
4402
+ externalReferences?: InvoiceExternalReferences;
4403
+ /** Discriminator field identifying this as a standard invoice. */
4404
+ type: 'standard';
4405
+ /** Current lifecycle status of the invoice. */
4406
+ status: 'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided';
4407
+ /** Detailed status information including available actions and workflow state. */
4408
+ statusDetails: InvoiceStatusDetails;
4409
+ /** Timestamp when the invoice was issued to the customer. */
4410
+ issuedAt?: Date;
4411
+ /**
4412
+ * Timestamp until which the invoice remains in draft state.
4413
+ *
4414
+ * The invoice advances automatically once this time is reached.
4415
+ */
4416
+ draftUntil?: Date;
4417
+ /** Timestamp when usage quantities were last snapshotted for this invoice. */
4418
+ quantitySnapshottedAt?: Date;
4419
+ /** Timestamp when collection was initiated for this invoice. */
4420
+ collectionAt?: Date;
4421
+ /** Timestamp when payment is due. */
4422
+ dueAt?: Date;
4423
+ /** Timestamp when the invoice was sent to the customer. */
4424
+ sentToCustomerAt?: Date;
4425
+ /** Workflow configuration snapshot captured at invoice creation time. */
4426
+ workflow: InvoiceWorkflowSettings;
4427
+ }
4279
4428
  /** Response of the entitlement access query. */
4280
4429
  export interface EntitlementAccessQueryResponse {
4281
4430
  /** Access evaluation results, one entry per resolved customer. */
@@ -4288,6 +4437,83 @@ export interface EntitlementAccessQueryResponse {
4288
4437
  */
4289
4438
  meta: CursorMeta;
4290
4439
  }
4440
+ /** A rate card defines the pricing and entitlement of a feature or service. */
4441
+ export interface RateCard {
4442
+ /**
4443
+ * Display name of the resource.
4444
+ *
4445
+ * Between 1 and 256 characters.
4446
+ */
4447
+ name: string;
4448
+ /**
4449
+ * Optional description of the resource.
4450
+ *
4451
+ * Maximum 1024 characters.
4452
+ */
4453
+ description?: string;
4454
+ labels?: Labels;
4455
+ key: string;
4456
+ /** The feature associated with the rate card. */
4457
+ feature?: FeatureReference;
4458
+ /**
4459
+ * Overrides the containing plan or add-on currency for this rate card. When
4460
+ * omitted, the containing resource currency applies.
4461
+ */
4462
+ currency?: BillingCurrencyCode;
4463
+ /**
4464
+ * The billing cadence of the rate card. When null, the charge is one-time
4465
+ * (non-recurring). Only valid for flat prices.
4466
+ */
4467
+ billingCadence?: string;
4468
+ /** The price of the rate card. */
4469
+ price: Price;
4470
+ /**
4471
+ * Unit conversion configuration for the rate card.
4472
+ *
4473
+ * Synthesized on read for plans authored with v1 dynamic or package prices:
4474
+ * dynamic prices map to a unit price with a multiply unit config, and package
4475
+ * prices map to a unit price with a divide unit config.
4476
+ *
4477
+ * Accepted on create and update only when the UnitConfig feature is enabled on the
4478
+ * deployment; otherwise rejected.
4479
+ */
4480
+ unitConfig?: UnitConfig;
4481
+ /**
4482
+ * The payment term of the rate card. In advance payment term can only be used for
4483
+ * flat prices.
4484
+ */
4485
+ paymentTerm: PricePaymentTerm;
4486
+ /**
4487
+ * Spend commitments for this rate card. Only applicable to usage-based prices
4488
+ * (unit, graduated, volume).
4489
+ */
4490
+ commitments?: SpendCommitments;
4491
+ /** The discounts of the rate card. */
4492
+ discounts?: RateCardDiscounts;
4493
+ /** The tax config of the rate card. */
4494
+ taxConfig?: RateCardTaxConfig;
4495
+ /**
4496
+ * The entitlement template granted to subscribers of a plan or addon containing
4497
+ * this rate card. Requires `feature` to be set.
4498
+ */
4499
+ entitlement?: RateCardEntitlement;
4500
+ }
4501
+ /** Rate card configuration snapshot for a usage-based invoice line. */
4502
+ export interface InvoiceLineRateCard {
4503
+ /** The price definition used to calculate charges for this line. */
4504
+ price: Price;
4505
+ /** Tax configuration snapshot for this line. */
4506
+ taxConfig?: RateCardTaxConfig;
4507
+ /** The feature key associated with this line's rate card. */
4508
+ featureKey?: string;
4509
+ /** Discount configuration from the rate card. */
4510
+ discounts?: RateCardDiscounts;
4511
+ /**
4512
+ * Unit config snapshot applied when this line was billed, converting the raw
4513
+ * metered quantity into the billed quantity. Frozen at billing time; read-only.
4514
+ */
4515
+ unitConfig?: UnitConfig;
4516
+ }
4291
4517
  /**
4292
4518
  * Usage-based intent fields from the system lifecycle controller shadowed by a
4293
4519
  * manual override.
@@ -4316,7 +4542,12 @@ export interface ChargeUsageBasedSystemIntent {
4316
4542
  billingPeriod: ClosedPeriod;
4317
4543
  /** Discounts applied to the usage-based charge. */
4318
4544
  discounts?: RateCardDiscounts;
4319
- /** The price of the charge. */
4545
+ /**
4546
+ * The price of the charge.
4547
+ *
4548
+ * `free` prices are rejected on create: a usage-based charge always carries a
4549
+ * concrete price.
4550
+ */
4320
4551
  price: PriceUsageBased;
4321
4552
  /** Spend commitments for the charge. */
4322
4553
  commitments?: SpendCommitments;
@@ -4368,9 +4599,12 @@ export interface CreateChargeUsageBasedRequest {
4368
4599
  taxConfig?: TaxConfig;
4369
4600
  /** Discounts applied to the usage-based charge. */
4370
4601
  discounts?: RateCardDiscounts;
4371
- /** The feature ID associated with the charge. */
4372
- featureId: string;
4373
- /** The price of the charge. */
4602
+ /**
4603
+ * The price of the charge.
4604
+ *
4605
+ * `free` prices are rejected on create: a usage-based charge always carries a
4606
+ * concrete price.
4607
+ */
4374
4608
  price: PriceUsageBased;
4375
4609
  /** Spend commitments for the charge. */
4376
4610
  commitments?: SpendCommitments;
@@ -4385,87 +4619,17 @@ export interface CreateChargeUsageBasedRequest {
4385
4619
  * deployment; otherwise rejected.
4386
4620
  */
4387
4621
  unitConfig?: UnitConfig;
4622
+ /** A reference to the feature associated with the charge. */
4623
+ feature: FeatureReference;
4388
4624
  /** The full, unprorated service period of the charge. */
4389
4625
  fullServicePeriod?: ClosedPeriod;
4390
4626
  /** The billing period the charge belongs to. */
4391
4627
  billingPeriod?: ClosedPeriod;
4392
4628
  }
4393
- /** A rate card defines the pricing and entitlement of a feature or service. */
4394
- export interface RateCard {
4395
- /**
4396
- * Display name of the resource.
4397
- *
4398
- * Between 1 and 256 characters.
4399
- */
4400
- name: string;
4401
- /**
4402
- * Optional description of the resource.
4403
- *
4404
- * Maximum 1024 characters.
4405
- */
4406
- description?: string;
4407
- labels?: Labels;
4408
- key: string;
4409
- /** The feature associated with the rate card. */
4410
- feature?: FeatureReference;
4411
- /**
4412
- * Overrides the containing plan or add-on currency for this rate card. When
4413
- * omitted, the containing resource currency applies.
4414
- */
4415
- currency?: BillingCurrencyCode;
4416
- /**
4417
- * The billing cadence of the rate card. When null, the charge is one-time
4418
- * (non-recurring). Only valid for flat prices.
4419
- */
4420
- billingCadence?: string;
4421
- /** The price of the rate card. */
4422
- price: Price;
4423
- /**
4424
- * Unit conversion configuration for the rate card.
4425
- *
4426
- * Synthesized on read for plans authored with v1 dynamic or package prices:
4427
- * dynamic prices map to a unit price with a multiply unit config, and package
4428
- * prices map to a unit price with a divide unit config.
4429
- *
4430
- * Accepted on create and update only when the UnitConfig feature is enabled on the
4431
- * deployment; otherwise rejected.
4432
- */
4433
- unitConfig?: UnitConfig;
4434
- /**
4435
- * The payment term of the rate card. In advance payment term can only be used for
4436
- * flat prices.
4437
- */
4438
- paymentTerm: PricePaymentTerm;
4439
- /**
4440
- * Spend commitments for this rate card. Only applicable to usage-based prices
4441
- * (unit, graduated, volume).
4442
- */
4443
- commitments?: SpendCommitments;
4444
- /** The discounts of the rate card. */
4445
- discounts?: RateCardDiscounts;
4446
- /** The tax config of the rate card. */
4447
- taxConfig?: RateCardTaxConfig;
4448
- /**
4449
- * The entitlement template granted to subscribers of a plan or addon containing
4450
- * this rate card. Requires `feature` to be set.
4451
- */
4452
- entitlement?: RateCardEntitlement;
4453
- }
4454
- /** Rate card configuration snapshot for a usage-based invoice line. */
4455
- export interface InvoiceLineRateCard {
4456
- /** The price definition used to calculate charges for this line. */
4457
- price: Price;
4458
- /** Tax configuration snapshot for this line. */
4459
- taxConfig?: RateCardTaxConfig;
4460
- /** The feature key associated with this line's rate card. */
4461
- featureKey?: string;
4462
- /** Discount configuration from the rate card. */
4463
- discounts?: RateCardDiscounts;
4464
- /**
4465
- * Unit config snapshot applied when this line was billed, converting the raw
4466
- * metered quantity into the billed quantity. Frozen at billing time; read-only.
4467
- */
4468
- unitConfig?: UnitConfig;
4629
+ /** Page paginated response. */
4630
+ export interface FeaturePagePaginatedResponse {
4631
+ data: Feature[];
4632
+ meta: PaginatedMeta;
4469
4633
  }
4470
4634
  /** Rate card configuration snapshot for a usage-based invoice line. */
4471
4635
  export interface UpdateInvoiceLineRateCard {
@@ -4478,11 +4642,6 @@ export interface UpdateInvoiceLineRateCard {
4478
4642
  /** Discount configuration from the rate card. */
4479
4643
  discounts?: UpdateDiscounts;
4480
4644
  }
4481
- /** Page paginated response. */
4482
- export interface FeaturePagePaginatedResponse {
4483
- data: Feature[];
4484
- meta: PaginatedMeta;
4485
- }
4486
4645
  /** Billing workflow settings. */
4487
4646
  export interface Workflow {
4488
4647
  /** The collection settings for this workflow */
@@ -4508,95 +4667,6 @@ export interface ProfileApps {
4508
4667
  /** The payment app used for this workflow. */
4509
4668
  payment: App;
4510
4669
  }
4511
- /** A usage-based charge for a customer. */
4512
- export interface ChargeUsageBased {
4513
- id: string;
4514
- /**
4515
- * Display name of the resource.
4516
- *
4517
- * Between 1 and 256 characters.
4518
- */
4519
- name: string;
4520
- /**
4521
- * Optional description of the resource.
4522
- *
4523
- * Maximum 1024 characters.
4524
- */
4525
- description?: string;
4526
- labels?: Labels;
4527
- /** An ISO-8601 timestamp representation of entity creation date. */
4528
- createdAt: Date;
4529
- /** An ISO-8601 timestamp representation of entity last update date. */
4530
- updatedAt: Date;
4531
- /** An ISO-8601 timestamp representation of entity deletion date. */
4532
- deletedAt?: Date;
4533
- /** The type of the charge. */
4534
- type: 'usage_based';
4535
- /** The customer owning the charge. */
4536
- customer: BillingCustomerReference;
4537
- /**
4538
- * Indicates whether the charge lifecycle is controlled by OpenMeter or manually
4539
- * overridden by the API user.
4540
- */
4541
- lifecycleController: 'system' | 'manual';
4542
- /**
4543
- * The subscription that originated the charge, when the charge was created from a
4544
- * subscription item.
4545
- */
4546
- subscription?: SubscriptionReference;
4547
- /** The currency of the charge. */
4548
- currency: string;
4549
- /** The lifecycle status of the charge. */
4550
- status: 'created' | 'active' | 'final' | 'deleted';
4551
- /** The timestamp when the charge is intended to be invoiced. */
4552
- invoiceAt: Date;
4553
- /** The effective service period covered by the charge. */
4554
- servicePeriod: ClosedPeriod;
4555
- /** The full, unprorated service period of the charge. */
4556
- fullServicePeriod: ClosedPeriod;
4557
- /** The billing period the charge belongs to. */
4558
- billingPeriod: ClosedPeriod;
4559
- /**
4560
- * The earliest time when the charge should be advanced again by background
4561
- * processing.
4562
- */
4563
- advanceAfter?: Date;
4564
- /** Unique reference ID of the charge. */
4565
- uniqueReferenceId?: string;
4566
- /** Settlement mode of the charge. */
4567
- settlementMode: 'credit_then_invoice' | 'credit_only';
4568
- /** Tax configuration of the charge. */
4569
- taxConfig?: TaxConfig;
4570
- /** Discounts applied to the usage-based charge. */
4571
- discounts?: RateCardDiscounts;
4572
- /** The feature associated with the charge. */
4573
- featureKey: string;
4574
- /** The feature ID associated with the charge. */
4575
- featureId: string;
4576
- /** Aggregated booked and realtime totals for the charge. */
4577
- totals: ChargeTotals;
4578
- /** The price of the charge. */
4579
- price: PriceUsageBased;
4580
- /** Spend commitments for the charge. */
4581
- commitments?: SpendCommitments;
4582
- /**
4583
- * Unit conversion configuration for the charge.
4584
- *
4585
- * Synthesized on read for charges created from v1 dynamic or package prices:
4586
- * dynamic prices map to a unit price with a multiply unit config, and package
4587
- * prices map to a unit price with a divide unit config.
4588
- *
4589
- * Accepted on create only when the UnitConfig feature is enabled on the
4590
- * deployment; otherwise rejected.
4591
- */
4592
- unitConfig?: UnitConfig;
4593
- /**
4594
- * Current intent from the system lifecycle controller for a charge that has an
4595
- * active manual override. The top-level charge fields remain the effective
4596
- * customer-facing intent.
4597
- */
4598
- systemIntent?: ChargeUsageBasedSystemIntent;
4599
- }
4600
4670
  /** A subscription item pins a rate card to a cadence within a subscription phase. */
4601
4671
  export interface SubscriptionItem {
4602
4672
  /** The unique identifier of the subscription item instance. */
@@ -4962,6 +5032,66 @@ export interface UpsertBillingProfileRequest {
4962
5032
  /** Whether this is the default profile. */
4963
5033
  default: boolean;
4964
5034
  }
5035
+ /**
5036
+ * A realization run of a charge.
5037
+ *
5038
+ * `totals` and `detailed_lines` are only populated with the `realization.totals`
5039
+ * and `realization.detailed_lines` expands, respectively, since computing them
5040
+ * requires re-deriving the run's rated breakdown. `invoice` is an ID reference
5041
+ * unless the `realization.invoice` expand is used, which resolves it to the
5042
+ * invoice header of the run's booked line: the invoice entity without its `lines`
5043
+ * and without the `customer` snapshot (the charge itself already identifies the
5044
+ * customer).
5045
+ */
5046
+ export interface ChargeRealization {
5047
+ /**
5048
+ * The ID of the realization run. Not present on `outstanding` entries, which are
5049
+ * projections rather than persisted runs.
5050
+ */
5051
+ id?: string;
5052
+ /**
5053
+ * The ID of the invoice line this realization was booked to, when the realization
5054
+ * has been invoiced.
5055
+ */
5056
+ lineId?: string;
5057
+ /** The reference of the invoice related to the realization. */
5058
+ invoice?: ChargeRealizationInvoiceOrReference;
5059
+ /** The type of the realization run. */
5060
+ type: 'final_realization' | 'partial_invoice' | 'outstanding' | 'voided';
5061
+ /** The service period covered by this realization run. */
5062
+ servicePeriod: ClosedPeriod;
5063
+ /**
5064
+ * The metered usage quantity this realization run accounts for. Only present on
5065
+ * usage-based charges; flat fees are not metered, so their realizations carry no
5066
+ * usage.
5067
+ *
5068
+ * Booked entries report a signed delta: a negative value states a downward usage
5069
+ * correction (or a voided run that snapshotted behind its live neighbors) instead
5070
+ * of masking it as zero.
5071
+ *
5072
+ * On an `outstanding` entry this is `0` unless the `real_time_usage` expand is
5073
+ * applied, in which case it is the not-yet-booked remainder of the live metering
5074
+ * read (never negative).
5075
+ */
5076
+ usage?: string;
5077
+ /**
5078
+ * The payment state of the realization, when the charge requires a fiat
5079
+ * transaction to settle.
5080
+ */
5081
+ payment?: ChargeRealizationPayment;
5082
+ /**
5083
+ * Financial totals for the realization run, including credit allocations.
5084
+ *
5085
+ * Requires the `realization.totals` expand.
5086
+ */
5087
+ totals?: Totals;
5088
+ /**
5089
+ * The detailed (rated) lines produced by the realization run.
5090
+ *
5091
+ * Requires the `realization.detailed_lines` expand.
5092
+ */
5093
+ detailedLines?: ChargeRealizationDetailedLine[];
5094
+ }
4965
5095
  /**
4966
5096
  * A subscription phase groups the rate cards in effect for a segment of the
4967
5097
  * subscription's lifetime. Analogous to plan phases.
@@ -5188,11 +5318,6 @@ export interface ProfilePagePaginatedResponse {
5188
5318
  data: Profile[];
5189
5319
  meta: PaginatedMeta;
5190
5320
  }
5191
- /** Page paginated response. */
5192
- export interface ChargePagePaginatedResponse {
5193
- data: Charge[];
5194
- meta: PaginatedMeta;
5195
- }
5196
5321
  /** Subscription. */
5197
5322
  export interface Subscription {
5198
5323
  id: string;
@@ -5413,11 +5538,213 @@ export interface SubscriptionChangeResponse {
5413
5538
  /** The new state of the subscription after the change. */
5414
5539
  next: Subscription;
5415
5540
  }
5541
+ /** A flat fee charge for a customer. */
5542
+ export interface ChargeFlatFee {
5543
+ id: string;
5544
+ /**
5545
+ * Display name of the resource.
5546
+ *
5547
+ * Between 1 and 256 characters.
5548
+ */
5549
+ name: string;
5550
+ /**
5551
+ * Optional description of the resource.
5552
+ *
5553
+ * Maximum 1024 characters.
5554
+ */
5555
+ description?: string;
5556
+ labels?: Labels;
5557
+ /** An ISO-8601 timestamp representation of entity creation date. */
5558
+ createdAt: Date;
5559
+ /** An ISO-8601 timestamp representation of entity last update date. */
5560
+ updatedAt: Date;
5561
+ /** An ISO-8601 timestamp representation of entity deletion date. */
5562
+ deletedAt?: Date;
5563
+ /** The type of the charge. */
5564
+ type: 'flat_fee';
5565
+ /**
5566
+ * The customer owning the charge.
5567
+ *
5568
+ * By default, only the `id` of the customer is returned. For more details use the
5569
+ * `customer` expand.
5570
+ */
5571
+ customer: CustomerOrReference;
5572
+ /**
5573
+ * Indicates whether the charge lifecycle is controlled by the system or manually
5574
+ * overridden by the API user.
5575
+ */
5576
+ lifecycleController: 'system' | 'manual';
5577
+ /**
5578
+ * The subscription that originated the charge, when the charge was created from a
5579
+ * subscription item.
5580
+ *
5581
+ * By default, only the `id`, `phase.id`, `phase.item.id` of the subscription is
5582
+ * returned. For more details use the `subscription` expand.
5583
+ */
5584
+ subscription?: SubscriptionOrReference;
5585
+ /** The currency of the charge. */
5586
+ currency: string;
5587
+ /** The lifecycle status of the charge. */
5588
+ status: 'created' | 'active' | 'final' | 'deleted';
5589
+ /** The timestamp when the charge is intended to be invoiced. */
5590
+ invoiceAt: Date;
5591
+ /** The effective service period covered by the charge. */
5592
+ servicePeriod: ClosedPeriod;
5593
+ /** The full, unprorated service period of the charge. */
5594
+ fullServicePeriod: ClosedPeriod;
5595
+ /** The billing period the charge belongs to. */
5596
+ billingPeriod: ClosedPeriod;
5597
+ /**
5598
+ * The earliest time when the charge should be advanced again by background
5599
+ * processing.
5600
+ */
5601
+ advanceAfter?: Date;
5602
+ /** Unique reference ID of the charge. */
5603
+ uniqueReferenceId?: string;
5604
+ /** Settlement mode of the charge. */
5605
+ settlementMode: 'credit_then_invoice' | 'credit_only';
5606
+ /** Tax configuration of the charge. */
5607
+ taxConfig?: TaxConfig;
5608
+ /** The realization runs of the charge, sorted by `created_at`. */
5609
+ realizations: ChargeRealization[];
5610
+ /** Payment term of the flat fee charge. */
5611
+ paymentTerm: PricePaymentTerm;
5612
+ /** The discounts applied to the charge. */
5613
+ discounts?: ChargeFlatFeeDiscounts;
5614
+ /** The feature associated with the charge, when applicable. */
5615
+ feature?: FeatureOrReference;
5616
+ /** The proration configuration of the charge. */
5617
+ prorationConfiguration: RateCardProrationConfiguration;
5618
+ /** The amount after proration of the charge. */
5619
+ amountAfterProration: CurrencyAmount;
5620
+ /** The price of the charge. */
5621
+ price: PriceFlat;
5622
+ /**
5623
+ * Current intent from the system lifecycle controller for a charge that has an
5624
+ * active manual override. The top-level charge fields remain the effective
5625
+ * customer-facing intent.
5626
+ */
5627
+ systemIntent?: ChargeFlatFeeSystemIntent;
5628
+ }
5629
+ /** A usage-based charge for a customer. */
5630
+ export interface ChargeUsageBased {
5631
+ id: string;
5632
+ /**
5633
+ * Display name of the resource.
5634
+ *
5635
+ * Between 1 and 256 characters.
5636
+ */
5637
+ name: string;
5638
+ /**
5639
+ * Optional description of the resource.
5640
+ *
5641
+ * Maximum 1024 characters.
5642
+ */
5643
+ description?: string;
5644
+ labels?: Labels;
5645
+ /** An ISO-8601 timestamp representation of entity creation date. */
5646
+ createdAt: Date;
5647
+ /** An ISO-8601 timestamp representation of entity last update date. */
5648
+ updatedAt: Date;
5649
+ /** An ISO-8601 timestamp representation of entity deletion date. */
5650
+ deletedAt?: Date;
5651
+ /** The type of the charge. */
5652
+ type: 'usage_based';
5653
+ /**
5654
+ * The customer owning the charge.
5655
+ *
5656
+ * By default, only the `id` of the customer is returned. For more details use the
5657
+ * `customer` expand.
5658
+ */
5659
+ customer: CustomerOrReference;
5660
+ /**
5661
+ * Indicates whether the charge lifecycle is controlled by the system or manually
5662
+ * overridden by the API user.
5663
+ */
5664
+ lifecycleController: 'system' | 'manual';
5665
+ /**
5666
+ * The subscription that originated the charge, when the charge was created from a
5667
+ * subscription item.
5668
+ *
5669
+ * By default, only the `id`, `phase.id`, `phase.item.id` of the subscription is
5670
+ * returned. For more details use the `subscription` expand.
5671
+ */
5672
+ subscription?: SubscriptionOrReference;
5673
+ /** The currency of the charge. */
5674
+ currency: string;
5675
+ /** The lifecycle status of the charge. */
5676
+ status: 'created' | 'active' | 'final' | 'deleted';
5677
+ /** The timestamp when the charge is intended to be invoiced. */
5678
+ invoiceAt: Date;
5679
+ /** The effective service period covered by the charge. */
5680
+ servicePeriod: ClosedPeriod;
5681
+ /** The full, unprorated service period of the charge. */
5682
+ fullServicePeriod: ClosedPeriod;
5683
+ /** The billing period the charge belongs to. */
5684
+ billingPeriod: ClosedPeriod;
5685
+ /**
5686
+ * The earliest time when the charge should be advanced again by background
5687
+ * processing.
5688
+ */
5689
+ advanceAfter?: Date;
5690
+ /** Unique reference ID of the charge. */
5691
+ uniqueReferenceId?: string;
5692
+ /** Settlement mode of the charge. */
5693
+ settlementMode: 'credit_then_invoice' | 'credit_only';
5694
+ /** Tax configuration of the charge. */
5695
+ taxConfig?: TaxConfig;
5696
+ /** The realization runs of the charge, sorted by `created_at`. */
5697
+ realizations: ChargeRealization[];
5698
+ /** Discounts applied to the usage-based charge. */
5699
+ discounts?: RateCardDiscounts;
5700
+ /** The feature associated with the charge. */
5701
+ feature: FeatureOrReference;
5702
+ /** Aggregated booked and realtime totals for the charge. */
5703
+ totals: ChargeTotals;
5704
+ /**
5705
+ * The metered usage quantity of the charge for its full service period.
5706
+ *
5707
+ * Requires the `real_time_usage` expand, since it is computed live from the
5708
+ * metering store rather than stored on the charge.
5709
+ */
5710
+ usage?: string;
5711
+ /**
5712
+ * The price of the charge.
5713
+ *
5714
+ * `free` prices are rejected on create: a usage-based charge always carries a
5715
+ * concrete price.
5716
+ */
5717
+ price: PriceUsageBased;
5718
+ /** Spend commitments for the charge. */
5719
+ commitments?: SpendCommitments;
5720
+ /**
5721
+ * Unit conversion configuration for the charge.
5722
+ *
5723
+ * Synthesized on read for charges created from v1 dynamic or package prices:
5724
+ * dynamic prices map to a unit price with a multiply unit config, and package
5725
+ * prices map to a unit price with a divide unit config.
5726
+ *
5727
+ * Accepted on create only when the UnitConfig feature is enabled on the
5728
+ * deployment; otherwise rejected.
5729
+ */
5730
+ unitConfig?: UnitConfig;
5731
+ /**
5732
+ * Current intent from the system lifecycle controller for a charge that has an
5733
+ * active manual override. The top-level charge fields remain the effective
5734
+ * customer-facing intent.
5735
+ */
5736
+ systemIntent?: ChargeUsageBasedSystemIntent;
5737
+ }
5416
5738
  /** Page paginated response. */
5417
5739
  export interface InvoicePagePaginatedResponse {
5418
5740
  data: Invoice[];
5419
5741
  meta: PaginatedMeta;
5420
5742
  }
5743
+ /** Page paginated response. */
5744
+ export interface ChargePagePaginatedResponse {
5745
+ data: Charge[];
5746
+ meta: PaginatedMeta;
5747
+ }
5421
5748
  /**
5422
5749
  * Filters on the given string field value by either exact or fuzzy match. All
5423
5750
  * properties are optional; provide exactly one to specify the comparison.
@@ -5476,6 +5803,8 @@ export type DateTimeFieldFilter = Date | {
5476
5803
  gt?: Date;
5477
5804
  gte?: Date;
5478
5805
  };
5806
+ /** Payment settings for a billing workflow. */
5807
+ export type WorkflowPaymentSettings = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettings;
5479
5808
  /**
5480
5809
  * Subscription edit timing defined when the changes should take effect. If the
5481
5810
  * provided configuration is not supported by the subscription, an error will be
@@ -5485,8 +5814,6 @@ export type SubscriptionEditTiming = 'immediate' | 'next_billing_cycle' | Date;
5485
5814
  /** Request to install an app from the catalog. */
5486
5815
  export type InstallAppRequest = InstallAppStripeWithApiKey | InstallAppSandbox | InstallAppExternalInvoicing;
5487
5816
  /** Payment settings for a billing workflow. */
5488
- export type WorkflowPaymentSettings = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettings;
5489
- /** Payment settings for a billing workflow. */
5490
5817
  export type UpdateBillingWorkflowPaymentSettings = UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettings;
5491
5818
  /** A parameter that failed validation. */
5492
5819
  export type InvalidParameter = InvalidParameterStandard | InvalidParameterMinimumLength | InvalidParameterMaximumLength | InvalidParameterChoiceItem | InvalidParameterDependentItem;
@@ -5502,8 +5829,20 @@ export type UpdateAppRequest = UpdateAppStripeRequest | UpdateAppSandboxRequest
5502
5829
  * dynamic LLM cost lookup.
5503
5830
  */
5504
5831
  export type FeatureUnitCost = FeatureManualUnitCost | FeatureLlmUnitCost;
5832
+ /**
5833
+ * A detailed (child) line type of a charge realization run.
5834
+ *
5835
+ * This is distinct from an invoice's own detailed lines: it represents the
5836
+ * rated/priced breakdown produced by the realization run itself, before that
5837
+ * breakdown is (or is not yet) reflected on an invoice line. Credit-then-invoice
5838
+ * runs include credit allocations in these lines, while credits-only runs keep the
5839
+ * gross rated detail.
5840
+ */
5841
+ export type ChargeRealizationDetailedLine = ChargeRealizationDetailedLineFlatFee | ChargeRealizationDetailedLineUsageBased;
5505
5842
  /** Fiat or custom currency. */
5506
5843
  export type Currency = CurrencyFiat | CurrencyCustom;
5844
+ /** Customer or reference. */
5845
+ export type CustomerOrReference = Customer | CustomerReference;
5507
5846
  /**
5508
5847
  * The alignment for collecting the pending line items into an invoice.
5509
5848
  *
@@ -5512,6 +5851,8 @@ export type Currency = CurrencyFiat | CurrencyCustom;
5512
5851
  * arrears items).
5513
5852
  */
5514
5853
  export type WorkflowCollectionAlignment = WorkflowCollectionAlignmentSubscription | WorkflowCollectionAlignmentAnchored;
5854
+ /** Price. */
5855
+ export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
5515
5856
  /**
5516
5857
  * Usage-based price types for a rate card or charge.
5517
5858
  *
@@ -5520,17 +5861,17 @@ export type WorkflowCollectionAlignment = WorkflowCollectionAlignmentSubscriptio
5520
5861
  */
5521
5862
  export type PriceUsageBased = PriceUnit | PriceGraduated | PriceVolume;
5522
5863
  /** Price. */
5523
- export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
5524
- /** Price. */
5525
5864
  export type UpdatePrice = UpdatePriceFree | UpdatePriceFlat | UpdatePriceUnit | UpdatePriceGraduated | UpdatePriceVolume;
5526
5865
  /** Installed application. */
5527
5866
  export type App = AppStripe | AppSandbox | AppExternalInvoicing;
5528
5867
  /** Response of the app install. */
5529
5868
  export type BillingInstallAppResponse = InstalledAppStripe | InstalledAppSandbox | InstalledAppExternalInvoicing;
5869
+ /** Feature or reference. */
5870
+ export type FeatureOrReference = Feature | FeatureReference;
5871
+ /** ChargeRealizationInvoice or reference. */
5872
+ export type ChargeRealizationInvoiceOrReference = ChargeRealizationInvoice | ChargeRealizationInvoiceReference;
5530
5873
  /** Customer charge. */
5531
5874
  export type CreateChargeRequest = CreateChargeFlatFeeRequest | CreateChargeUsageBasedRequest;
5532
- /** Customer charge. */
5533
- export type Charge = ChargeFlatFee | ChargeUsageBased;
5534
5875
  /**
5535
5876
  * A top-level line item on an invoice.
5536
5877
  *
@@ -5547,6 +5888,8 @@ export type InvoiceLine = InvoiceStandardLine;
5547
5888
  * present.
5548
5889
  */
5549
5890
  export type UpdateInvoiceLine = UpdateInvoiceStandardLine;
5891
+ /** Subscription or reference. */
5892
+ export type SubscriptionOrReference = Subscription | SubscriptionReference;
5550
5893
  /**
5551
5894
  * An invoice issued to a customer.
5552
5895
  *
@@ -5557,6 +5900,8 @@ export type UpdateInvoiceLine = UpdateInvoiceStandardLine;
5557
5900
  export type Invoice = InvoiceStandard;
5558
5901
  /** UpdateInvoiceRequest update request. */
5559
5902
  export type UpdateInvoiceRequest = UpdateInvoiceStandardRequest;
5903
+ /** Customer charge. */
5904
+ export type Charge = ChargeFlatFee | ChargeUsageBased;
5560
5905
  /**
5561
5906
  * Sort query.
5562
5907
  *
@@ -5586,19 +5931,6 @@ export interface BaseErrorInput {
5586
5931
  instance: string;
5587
5932
  [key: string]: unknown;
5588
5933
  }
5589
- /**
5590
- * Payment settings for a billing workflow when the collection method is send
5591
- * invoice.
5592
- */
5593
- export interface WorkflowPaymentSendInvoiceSettingsInput {
5594
- /** The collection method for the invoice. */
5595
- collectionMethod: 'send_invoice';
5596
- /**
5597
- * The period after which the invoice is due. With some payment solutions it's only
5598
- * applicable for manual collection method.
5599
- */
5600
- dueAfter?: string;
5601
- }
5602
5934
  /**
5603
5935
  * Invoice-level invoicing settings.
5604
5936
  *
@@ -5614,6 +5946,19 @@ export interface InvoiceWorkflowInvoicingSettingsInput {
5614
5946
  /** The period after which the invoice is considered overdue if not paid. */
5615
5947
  dueAfter?: string;
5616
5948
  }
5949
+ /**
5950
+ * Payment settings for a billing workflow when the collection method is send
5951
+ * invoice.
5952
+ */
5953
+ export interface WorkflowPaymentSendInvoiceSettingsInput {
5954
+ /** The collection method for the invoice. */
5955
+ collectionMethod: 'send_invoice';
5956
+ /**
5957
+ * The period after which the invoice is due. With some payment solutions it's only
5958
+ * applicable for manual collection method.
5959
+ */
5960
+ dueAfter?: string;
5961
+ }
5617
5962
  /**
5618
5963
  * Invoice-level invoicing settings.
5619
5964
  *
@@ -5823,6 +6168,46 @@ export interface VoidCreditGrantRequestInput {
5823
6168
  */
5824
6169
  paymentAdjustment?: 'none';
5825
6170
  }
6171
+ /** Subscription create request. */
6172
+ export interface SubscriptionCreateInput {
6173
+ labels?: Labels;
6174
+ /**
6175
+ * Settlement mode for billing.
6176
+ *
6177
+ * Values:
6178
+ *
6179
+ * - `credit_then_invoice`: Credits are applied first, then any remainder is
6180
+ * invoiced.
6181
+ * - `credit_only`: Usage is settled exclusively against credits.
6182
+ */
6183
+ settlementMode?: 'credit_then_invoice' | 'credit_only';
6184
+ /** The customer to create the subscription for. */
6185
+ customer: {
6186
+ id?: string;
6187
+ key?: string;
6188
+ };
6189
+ /** The plan reference of the subscription. */
6190
+ plan: {
6191
+ id?: string;
6192
+ key?: string;
6193
+ version?: number;
6194
+ };
6195
+ /**
6196
+ * A billing anchor is the fixed point in time that determines the subscription's
6197
+ * recurring billing cycle. It affects when charges occur and how prorations are
6198
+ * calculated. Common anchors:
6199
+ *
6200
+ * - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
6201
+ * - Subscription anniversary (day customer signed up)
6202
+ * - Custom date (customer-specified day)
6203
+ *
6204
+ * If not provided, the subscription will be created with the subscription's
6205
+ * creation time as the billing anchor.
6206
+ */
6207
+ billingAnchor?: Date;
6208
+ /** Controls how custom-currency cost bases are selected for the subscription. */
6209
+ costBasisMode?: 'dynamic' | 'pinned';
6210
+ }
5826
6211
  /**
5827
6212
  * Unit conversion configuration.
5828
6213
  *
@@ -5862,64 +6247,24 @@ export interface UnitConfigInput {
5862
6247
  /**
5863
6248
  * The rounding mode applied to the converted quantity for invoicing.
5864
6249
  *
5865
- * Defaults to none (no rounding). Entitlement checks always use the precise
5866
- * (unrounded) value.
5867
- */
5868
- rounding?: 'ceiling' | 'floor' | 'half_up' | 'none';
5869
- /**
5870
- * The number of decimal places to retain after rounding.
5871
- *
5872
- * Only meaningful when rounding is not "none". Defaults to 0 (round to whole
5873
- * numbers).
5874
- */
5875
- precision?: number;
5876
- /**
5877
- * A human-readable label for the converted unit shown on invoices and in the
5878
- * customer portal (e.g., "GB", "hours", "M tokens").
5879
- *
5880
- * Optional. When omitted, no unit label is rendered.
5881
- */
5882
- displayUnit?: string;
5883
- }
5884
- /** Subscription create request. */
5885
- export interface SubscriptionCreateInput {
5886
- labels?: Labels;
5887
- /**
5888
- * Settlement mode for billing.
5889
- *
5890
- * Values:
5891
- *
5892
- * - `credit_then_invoice`: Credits are applied first, then any remainder is
5893
- * invoiced.
5894
- * - `credit_only`: Usage is settled exclusively against credits.
6250
+ * Defaults to none (no rounding). Entitlement checks always use the precise
6251
+ * (unrounded) value.
5895
6252
  */
5896
- settlementMode?: 'credit_then_invoice' | 'credit_only';
5897
- /** The customer to create the subscription for. */
5898
- customer: {
5899
- id?: string;
5900
- key?: string;
5901
- };
5902
- /** The plan reference of the subscription. */
5903
- plan: {
5904
- id?: string;
5905
- key?: string;
5906
- version?: number;
5907
- };
6253
+ rounding?: 'ceiling' | 'floor' | 'half_up' | 'none';
5908
6254
  /**
5909
- * A billing anchor is the fixed point in time that determines the subscription's
5910
- * recurring billing cycle. It affects when charges occur and how prorations are
5911
- * calculated. Common anchors:
6255
+ * The number of decimal places to retain after rounding.
5912
6256
  *
5913
- * - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
5914
- * - Subscription anniversary (day customer signed up)
5915
- * - Custom date (customer-specified day)
6257
+ * Only meaningful when rounding is not "none". Defaults to 0 (round to whole
6258
+ * numbers).
6259
+ */
6260
+ precision?: number;
6261
+ /**
6262
+ * A human-readable label for the converted unit shown on invoices and in the
6263
+ * customer portal (e.g., "GB", "hours", "M tokens").
5916
6264
  *
5917
- * If not provided, the subscription will be created with the subscription's
5918
- * creation time as the billing anchor.
6265
+ * Optional. When omitted, no unit label is rendered.
5919
6266
  */
5920
- billingAnchor?: Date;
5921
- /** Controls how custom-currency cost bases are selected for the subscription. */
5922
- costBasisMode?: 'dynamic' | 'pinned';
6267
+ displayUnit?: string;
5923
6268
  }
5924
6269
  /** Invoice settings for a billing workflow. */
5925
6270
  export interface WorkflowInvoicingSettingsInput {
@@ -5957,6 +6302,19 @@ export interface IngestedEventInput {
5957
6302
  /** The validation errors of the ingested event. */
5958
6303
  validationErrors?: IngestedEventValidationError[];
5959
6304
  }
6305
+ /**
6306
+ * Invoice-level snapshot of the workflow configuration.
6307
+ *
6308
+ * Contains only the settings that are meaningful for an already-created invoice:
6309
+ * invoicing behaviour and payment settings. Collection alignment and tax policy
6310
+ * are gather-time / profile-wide concerns and are not included.
6311
+ */
6312
+ export interface InvoiceWorkflowInput {
6313
+ /** Invoicing settings for this invoice. */
6314
+ invoicing?: InvoiceWorkflowInvoicingSettingsInput;
6315
+ /** Payment settings for this invoice. */
6316
+ payment?: WorkflowPaymentSettingsInput;
6317
+ }
5960
6318
  /** Request for canceling a subscription. */
5961
6319
  export interface SubscriptionCancelInput {
5962
6320
  /** If not provided the subscription is canceled immediately. */
@@ -6008,19 +6366,6 @@ export interface SubscriptionChangeInput {
6008
6366
  */
6009
6367
  timing: SubscriptionEditTiming;
6010
6368
  }
6011
- /**
6012
- * Invoice-level snapshot of the workflow configuration.
6013
- *
6014
- * Contains only the settings that are meaningful for an already-created invoice:
6015
- * invoicing behaviour and payment settings. Collection alignment and tax policy
6016
- * are gather-time / profile-wide concerns and are not included.
6017
- */
6018
- export interface InvoiceWorkflowInput {
6019
- /** Invoicing settings for this invoice. */
6020
- invoicing?: InvoiceWorkflowInvoicingSettingsInput;
6021
- /** Payment settings for this invoice. */
6022
- payment?: WorkflowPaymentSettingsInput;
6023
- }
6024
6369
  /**
6025
6370
  * Invoice-level snapshot of the workflow configuration.
6026
6371
  *
@@ -6423,16 +6768,16 @@ export interface WorkflowCollectionSettingsInput {
6423
6768
  interval?: string;
6424
6769
  }
6425
6770
  /**
6426
- * Usage-based intent fields from the system lifecycle controller shadowed by a
6427
- * manual override.
6771
+ * The invoice a charge realization was booked to, embedded as a header.
6772
+ *
6773
+ * Matches the standard invoice entity, except that it carries no `customer`
6774
+ * snapshot (the charge context already identifies the customer) and `lines` are
6775
+ * never populated (the realization itself is the line-level breakdown). The shared
6776
+ * invoice contract stays untouched: this model exists so the charges API can slim
6777
+ * the embedding without loosening the invoices API.
6428
6778
  */
6429
- export interface ChargeUsageBasedSystemIntentInput {
6430
- /**
6431
- * Display name of the resource.
6432
- *
6433
- * Between 1 and 256 characters.
6434
- */
6435
- name: string;
6779
+ export interface ChargeRealizationInvoiceInput {
6780
+ id: string;
6436
6781
  /**
6437
6782
  * Optional description of the resource.
6438
6783
  *
@@ -6440,89 +6785,64 @@ export interface ChargeUsageBasedSystemIntentInput {
6440
6785
  */
6441
6786
  description?: string;
6442
6787
  labels?: Labels;
6443
- /** The timestamp when the charge is intended to be invoiced. */
6444
- invoiceAt: Date;
6445
- /** The effective service period covered by the charge. */
6446
- servicePeriod: ClosedPeriod;
6447
- /** The full, unprorated service period of the charge. */
6448
- fullServicePeriod: ClosedPeriod;
6449
- /** The billing period the charge belongs to. */
6450
- billingPeriod: ClosedPeriod;
6451
- /** Discounts applied to the usage-based charge. */
6452
- discounts?: RateCardDiscounts;
6453
- /** The price of the charge. */
6454
- price: PriceUsageBased;
6455
- /** Spend commitments for the charge. */
6456
- commitments?: SpendCommitments;
6457
- /**
6458
- * Unit conversion configuration for the charge.
6459
- *
6460
- * Synthesized on read for charges created from v1 dynamic or package prices:
6461
- * dynamic prices map to a unit price with a multiply unit config, and package
6462
- * prices map to a unit price with a divide unit config.
6463
- *
6464
- * Accepted on create only when the UnitConfig feature is enabled on the
6465
- * deployment; otherwise rejected.
6466
- */
6467
- unitConfig?: UnitConfigInput;
6468
- /**
6469
- * The timestamp when the system lifecycle controller intent was deleted. The
6470
- * effective charge can remain visible while a manual override is active.
6471
- */
6788
+ /** An ISO-8601 timestamp representation of entity creation date. */
6789
+ createdAt: Date;
6790
+ /** An ISO-8601 timestamp representation of entity last update date. */
6791
+ updatedAt: Date;
6792
+ /** An ISO-8601 timestamp representation of entity deletion date. */
6472
6793
  deletedAt?: Date;
6473
- }
6474
- /** Usage-based charge create request. */
6475
- export interface CreateChargeUsageBasedRequestInput {
6794
+ /** Human-readable invoice number generated by the invoicing app. */
6795
+ number: string;
6796
+ /** Three-letter ISO 4217 currency code for the invoice. */
6797
+ currency: string;
6476
6798
  /**
6477
- * Display name of the resource.
6478
- *
6479
- * Between 1 and 256 characters.
6799
+ * Snapshot of the supplier's contact information at the time the invoice was
6800
+ * issued.
6480
6801
  */
6481
- name: string;
6802
+ supplier: Supplier;
6803
+ /** Aggregated financial totals for the invoice. */
6804
+ totals: Totals;
6482
6805
  /**
6483
- * Optional description of the resource.
6806
+ * The service period covered by this invoice.
6484
6807
  *
6485
- * Maximum 1024 characters.
6808
+ * For flat fee the service period can be empty which means `from` will be equals
6809
+ * to `to`. In other cases those fields will be filled with the actual service
6810
+ * period.
6486
6811
  */
6487
- description?: string;
6488
- labels?: Labels;
6489
- /** The type of the charge. */
6490
- type: 'usage_based';
6491
- /** The currency of the charge. */
6492
- currency: string;
6493
- /** The timestamp when the charge is intended to be invoiced. */
6494
- invoiceAt: Date;
6495
- /** The effective service period covered by the charge. */
6496
6812
  servicePeriod: ClosedPeriod;
6497
- /** Unique reference ID of the charge. */
6498
- uniqueReferenceId?: string;
6499
- /** Settlement mode of the charge. */
6500
- settlementMode: 'credit_then_invoice' | 'credit_only';
6501
- /** Tax configuration of the charge. */
6502
- taxConfig?: TaxConfig;
6503
- /** Discounts applied to the usage-based charge. */
6504
- discounts?: RateCardDiscounts;
6505
- /** The feature ID associated with the charge. */
6506
- featureId: string;
6507
- /** The price of the charge. */
6508
- price: PriceUsageBased;
6509
- /** Spend commitments for the charge. */
6510
- commitments?: SpendCommitments;
6511
6813
  /**
6512
- * Unit conversion configuration for the charge.
6814
+ * Validation issues found during invoice processing.
6513
6815
  *
6514
- * Synthesized on read for charges created from v1 dynamic or package prices:
6515
- * dynamic prices map to a unit price with a multiply unit config, and package
6516
- * prices map to a unit price with a divide unit config.
6816
+ * Present only when there are one or more validation findings. An empty list is
6817
+ * omitted.
6818
+ */
6819
+ validationIssues?: InvoiceValidationIssue[];
6820
+ /** External identifiers assigned to this invoice by third-party systems. */
6821
+ externalReferences?: InvoiceExternalReferences;
6822
+ /** Discriminator field identifying this as a standard invoice. */
6823
+ type: 'standard';
6824
+ /** Current lifecycle status of the invoice. */
6825
+ status: 'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided';
6826
+ /** Detailed status information including available actions and workflow state. */
6827
+ statusDetails: InvoiceStatusDetails;
6828
+ /** Timestamp when the invoice was issued to the customer. */
6829
+ issuedAt?: Date;
6830
+ /**
6831
+ * Timestamp until which the invoice remains in draft state.
6517
6832
  *
6518
- * Accepted on create only when the UnitConfig feature is enabled on the
6519
- * deployment; otherwise rejected.
6833
+ * The invoice advances automatically once this time is reached.
6520
6834
  */
6521
- unitConfig?: UnitConfigInput;
6522
- /** The full, unprorated service period of the charge. */
6523
- fullServicePeriod?: ClosedPeriod;
6524
- /** The billing period the charge belongs to. */
6525
- billingPeriod?: ClosedPeriod;
6835
+ draftUntil?: Date;
6836
+ /** Timestamp when usage quantities were last snapshotted for this invoice. */
6837
+ quantitySnapshottedAt?: Date;
6838
+ /** Timestamp when collection was initiated for this invoice. */
6839
+ collectionAt?: Date;
6840
+ /** Timestamp when payment is due. */
6841
+ dueAt?: Date;
6842
+ /** Timestamp when the invoice was sent to the customer. */
6843
+ sentToCustomerAt?: Date;
6844
+ /** Workflow configuration snapshot captured at invoice creation time. */
6845
+ workflow: InvoiceWorkflowSettingsInput;
6526
6846
  }
6527
6847
  /** A rate card defines the pricing and entitlement of a feature or service. */
6528
6848
  export interface RateCardInput {
@@ -6601,20 +6921,11 @@ export interface InvoiceLineRateCardInput {
6601
6921
  */
6602
6922
  unitConfig?: UnitConfigInput;
6603
6923
  }
6604
- /** Billing workflow settings. */
6605
- export interface WorkflowInput {
6606
- /** The collection settings for this workflow */
6607
- collection?: WorkflowCollectionSettingsInput;
6608
- /** The invoicing settings for this workflow */
6609
- invoicing?: WorkflowInvoicingSettingsInput;
6610
- /** The payment settings for this workflow */
6611
- payment?: WorkflowPaymentSettingsInput;
6612
- /** The tax settings for this workflow */
6613
- tax?: WorkflowTaxSettingsInput;
6614
- }
6615
- /** A usage-based charge for a customer. */
6616
- export interface ChargeUsageBasedInput {
6617
- id: string;
6924
+ /**
6925
+ * Usage-based intent fields from the system lifecycle controller shadowed by a
6926
+ * manual override.
6927
+ */
6928
+ export interface ChargeUsageBasedSystemIntentInput {
6618
6929
  /**
6619
6930
  * Display name of the resource.
6620
6931
  *
@@ -6628,43 +6939,65 @@ export interface ChargeUsageBasedInput {
6628
6939
  */
6629
6940
  description?: string;
6630
6941
  labels?: Labels;
6631
- /** An ISO-8601 timestamp representation of entity creation date. */
6632
- createdAt: Date;
6633
- /** An ISO-8601 timestamp representation of entity last update date. */
6634
- updatedAt: Date;
6635
- /** An ISO-8601 timestamp representation of entity deletion date. */
6942
+ /** The timestamp when the charge is intended to be invoiced. */
6943
+ invoiceAt: Date;
6944
+ /** The effective service period covered by the charge. */
6945
+ servicePeriod: ClosedPeriod;
6946
+ /** The full, unprorated service period of the charge. */
6947
+ fullServicePeriod: ClosedPeriod;
6948
+ /** The billing period the charge belongs to. */
6949
+ billingPeriod: ClosedPeriod;
6950
+ /** Discounts applied to the usage-based charge. */
6951
+ discounts?: RateCardDiscounts;
6952
+ /**
6953
+ * The price of the charge.
6954
+ *
6955
+ * `free` prices are rejected on create: a usage-based charge always carries a
6956
+ * concrete price.
6957
+ */
6958
+ price: PriceUsageBased;
6959
+ /** Spend commitments for the charge. */
6960
+ commitments?: SpendCommitments;
6961
+ /**
6962
+ * Unit conversion configuration for the charge.
6963
+ *
6964
+ * Synthesized on read for charges created from v1 dynamic or package prices:
6965
+ * dynamic prices map to a unit price with a multiply unit config, and package
6966
+ * prices map to a unit price with a divide unit config.
6967
+ *
6968
+ * Accepted on create only when the UnitConfig feature is enabled on the
6969
+ * deployment; otherwise rejected.
6970
+ */
6971
+ unitConfig?: UnitConfigInput;
6972
+ /**
6973
+ * The timestamp when the system lifecycle controller intent was deleted. The
6974
+ * effective charge can remain visible while a manual override is active.
6975
+ */
6636
6976
  deletedAt?: Date;
6637
- /** The type of the charge. */
6638
- type: 'usage_based';
6639
- /** The customer owning the charge. */
6640
- customer: BillingCustomerReference;
6977
+ }
6978
+ /** Usage-based charge create request. */
6979
+ export interface CreateChargeUsageBasedRequestInput {
6641
6980
  /**
6642
- * Indicates whether the charge lifecycle is controlled by OpenMeter or manually
6643
- * overridden by the API user.
6981
+ * Display name of the resource.
6982
+ *
6983
+ * Between 1 and 256 characters.
6644
6984
  */
6645
- lifecycleController: 'system' | 'manual';
6985
+ name: string;
6646
6986
  /**
6647
- * The subscription that originated the charge, when the charge was created from a
6648
- * subscription item.
6987
+ * Optional description of the resource.
6988
+ *
6989
+ * Maximum 1024 characters.
6649
6990
  */
6650
- subscription?: SubscriptionReference;
6991
+ description?: string;
6992
+ labels?: Labels;
6993
+ /** The type of the charge. */
6994
+ type: 'usage_based';
6651
6995
  /** The currency of the charge. */
6652
6996
  currency: string;
6653
- /** The lifecycle status of the charge. */
6654
- status: 'created' | 'active' | 'final' | 'deleted';
6655
6997
  /** The timestamp when the charge is intended to be invoiced. */
6656
6998
  invoiceAt: Date;
6657
6999
  /** The effective service period covered by the charge. */
6658
7000
  servicePeriod: ClosedPeriod;
6659
- /** The full, unprorated service period of the charge. */
6660
- fullServicePeriod: ClosedPeriod;
6661
- /** The billing period the charge belongs to. */
6662
- billingPeriod: ClosedPeriod;
6663
- /**
6664
- * The earliest time when the charge should be advanced again by background
6665
- * processing.
6666
- */
6667
- advanceAfter?: Date;
6668
7001
  /** Unique reference ID of the charge. */
6669
7002
  uniqueReferenceId?: string;
6670
7003
  /** Settlement mode of the charge. */
@@ -6673,13 +7006,12 @@ export interface ChargeUsageBasedInput {
6673
7006
  taxConfig?: TaxConfig;
6674
7007
  /** Discounts applied to the usage-based charge. */
6675
7008
  discounts?: RateCardDiscounts;
6676
- /** The feature associated with the charge. */
6677
- featureKey: string;
6678
- /** The feature ID associated with the charge. */
6679
- featureId: string;
6680
- /** Aggregated booked and realtime totals for the charge. */
6681
- totals: ChargeTotals;
6682
- /** The price of the charge. */
7009
+ /**
7010
+ * The price of the charge.
7011
+ *
7012
+ * `free` prices are rejected on create: a usage-based charge always carries a
7013
+ * concrete price.
7014
+ */
6683
7015
  price: PriceUsageBased;
6684
7016
  /** Spend commitments for the charge. */
6685
7017
  commitments?: SpendCommitments;
@@ -6694,12 +7026,23 @@ export interface ChargeUsageBasedInput {
6694
7026
  * deployment; otherwise rejected.
6695
7027
  */
6696
7028
  unitConfig?: UnitConfigInput;
6697
- /**
6698
- * Current intent from the system lifecycle controller for a charge that has an
6699
- * active manual override. The top-level charge fields remain the effective
6700
- * customer-facing intent.
6701
- */
6702
- systemIntent?: ChargeUsageBasedSystemIntentInput;
7029
+ /** A reference to the feature associated with the charge. */
7030
+ feature: FeatureReference;
7031
+ /** The full, unprorated service period of the charge. */
7032
+ fullServicePeriod?: ClosedPeriod;
7033
+ /** The billing period the charge belongs to. */
7034
+ billingPeriod?: ClosedPeriod;
7035
+ }
7036
+ /** Billing workflow settings. */
7037
+ export interface WorkflowInput {
7038
+ /** The collection settings for this workflow */
7039
+ collection?: WorkflowCollectionSettingsInput;
7040
+ /** The invoicing settings for this workflow */
7041
+ invoicing?: WorkflowInvoicingSettingsInput;
7042
+ /** The payment settings for this workflow */
7043
+ payment?: WorkflowPaymentSettingsInput;
7044
+ /** The tax settings for this workflow */
7045
+ tax?: WorkflowTaxSettingsInput;
6703
7046
  }
6704
7047
  /** A subscription item pins a rate card to a cadence within a subscription phase. */
6705
7048
  export interface SubscriptionItemInput {
@@ -7024,6 +7367,66 @@ export interface UpsertBillingProfileRequestInput {
7024
7367
  /** Whether this is the default profile. */
7025
7368
  default: boolean;
7026
7369
  }
7370
+ /**
7371
+ * A realization run of a charge.
7372
+ *
7373
+ * `totals` and `detailed_lines` are only populated with the `realization.totals`
7374
+ * and `realization.detailed_lines` expands, respectively, since computing them
7375
+ * requires re-deriving the run's rated breakdown. `invoice` is an ID reference
7376
+ * unless the `realization.invoice` expand is used, which resolves it to the
7377
+ * invoice header of the run's booked line: the invoice entity without its `lines`
7378
+ * and without the `customer` snapshot (the charge itself already identifies the
7379
+ * customer).
7380
+ */
7381
+ export interface ChargeRealizationInput {
7382
+ /**
7383
+ * The ID of the realization run. Not present on `outstanding` entries, which are
7384
+ * projections rather than persisted runs.
7385
+ */
7386
+ id?: string;
7387
+ /**
7388
+ * The ID of the invoice line this realization was booked to, when the realization
7389
+ * has been invoiced.
7390
+ */
7391
+ lineId?: string;
7392
+ /** The reference of the invoice related to the realization. */
7393
+ invoice?: ChargeRealizationInvoiceOrReferenceInput;
7394
+ /** The type of the realization run. */
7395
+ type: 'final_realization' | 'partial_invoice' | 'outstanding' | 'voided';
7396
+ /** The service period covered by this realization run. */
7397
+ servicePeriod: ClosedPeriod;
7398
+ /**
7399
+ * The metered usage quantity this realization run accounts for. Only present on
7400
+ * usage-based charges; flat fees are not metered, so their realizations carry no
7401
+ * usage.
7402
+ *
7403
+ * Booked entries report a signed delta: a negative value states a downward usage
7404
+ * correction (or a voided run that snapshotted behind its live neighbors) instead
7405
+ * of masking it as zero.
7406
+ *
7407
+ * On an `outstanding` entry this is `0` unless the `real_time_usage` expand is
7408
+ * applied, in which case it is the not-yet-booked remainder of the live metering
7409
+ * read (never negative).
7410
+ */
7411
+ usage?: string;
7412
+ /**
7413
+ * The payment state of the realization, when the charge requires a fiat
7414
+ * transaction to settle.
7415
+ */
7416
+ payment?: ChargeRealizationPayment;
7417
+ /**
7418
+ * Financial totals for the realization run, including credit allocations.
7419
+ *
7420
+ * Requires the `realization.totals` expand.
7421
+ */
7422
+ totals?: Totals;
7423
+ /**
7424
+ * The detailed (rated) lines produced by the realization run.
7425
+ *
7426
+ * Requires the `realization.detailed_lines` expand.
7427
+ */
7428
+ detailedLines?: ChargeRealizationDetailedLine[];
7429
+ }
7027
7430
  /**
7028
7431
  * A subscription phase groups the rate cards in effect for a segment of the
7029
7432
  * subscription's lifetime. Analogous to plan phases.
@@ -7250,11 +7653,6 @@ export interface ProfilePagePaginatedResponseInput {
7250
7653
  data: ProfileInput[];
7251
7654
  meta: PaginatedMeta;
7252
7655
  }
7253
- /** Page paginated response. */
7254
- export interface ChargePagePaginatedResponseInput {
7255
- data: ChargeInput[];
7256
- meta: PaginatedMeta;
7257
- }
7258
7656
  /** Subscription. */
7259
7657
  export interface SubscriptionInput {
7260
7658
  id: string;
@@ -7475,11 +7873,213 @@ export interface SubscriptionChangeResponseInput {
7475
7873
  /** The new state of the subscription after the change. */
7476
7874
  next: SubscriptionInput;
7477
7875
  }
7876
+ /** A flat fee charge for a customer. */
7877
+ export interface ChargeFlatFeeInput {
7878
+ id: string;
7879
+ /**
7880
+ * Display name of the resource.
7881
+ *
7882
+ * Between 1 and 256 characters.
7883
+ */
7884
+ name: string;
7885
+ /**
7886
+ * Optional description of the resource.
7887
+ *
7888
+ * Maximum 1024 characters.
7889
+ */
7890
+ description?: string;
7891
+ labels?: Labels;
7892
+ /** An ISO-8601 timestamp representation of entity creation date. */
7893
+ createdAt: Date;
7894
+ /** An ISO-8601 timestamp representation of entity last update date. */
7895
+ updatedAt: Date;
7896
+ /** An ISO-8601 timestamp representation of entity deletion date. */
7897
+ deletedAt?: Date;
7898
+ /** The type of the charge. */
7899
+ type: 'flat_fee';
7900
+ /**
7901
+ * The customer owning the charge.
7902
+ *
7903
+ * By default, only the `id` of the customer is returned. For more details use the
7904
+ * `customer` expand.
7905
+ */
7906
+ customer: CustomerOrReference;
7907
+ /**
7908
+ * Indicates whether the charge lifecycle is controlled by the system or manually
7909
+ * overridden by the API user.
7910
+ */
7911
+ lifecycleController: 'system' | 'manual';
7912
+ /**
7913
+ * The subscription that originated the charge, when the charge was created from a
7914
+ * subscription item.
7915
+ *
7916
+ * By default, only the `id`, `phase.id`, `phase.item.id` of the subscription is
7917
+ * returned. For more details use the `subscription` expand.
7918
+ */
7919
+ subscription?: SubscriptionOrReferenceInput;
7920
+ /** The currency of the charge. */
7921
+ currency: string;
7922
+ /** The lifecycle status of the charge. */
7923
+ status: 'created' | 'active' | 'final' | 'deleted';
7924
+ /** The timestamp when the charge is intended to be invoiced. */
7925
+ invoiceAt: Date;
7926
+ /** The effective service period covered by the charge. */
7927
+ servicePeriod: ClosedPeriod;
7928
+ /** The full, unprorated service period of the charge. */
7929
+ fullServicePeriod: ClosedPeriod;
7930
+ /** The billing period the charge belongs to. */
7931
+ billingPeriod: ClosedPeriod;
7932
+ /**
7933
+ * The earliest time when the charge should be advanced again by background
7934
+ * processing.
7935
+ */
7936
+ advanceAfter?: Date;
7937
+ /** Unique reference ID of the charge. */
7938
+ uniqueReferenceId?: string;
7939
+ /** Settlement mode of the charge. */
7940
+ settlementMode: 'credit_then_invoice' | 'credit_only';
7941
+ /** Tax configuration of the charge. */
7942
+ taxConfig?: TaxConfig;
7943
+ /** The realization runs of the charge, sorted by `created_at`. */
7944
+ realizations: ChargeRealizationInput[];
7945
+ /** Payment term of the flat fee charge. */
7946
+ paymentTerm: PricePaymentTerm;
7947
+ /** The discounts applied to the charge. */
7948
+ discounts?: ChargeFlatFeeDiscounts;
7949
+ /** The feature associated with the charge, when applicable. */
7950
+ feature?: FeatureOrReference;
7951
+ /** The proration configuration of the charge. */
7952
+ prorationConfiguration: RateCardProrationConfiguration;
7953
+ /** The amount after proration of the charge. */
7954
+ amountAfterProration: CurrencyAmount;
7955
+ /** The price of the charge. */
7956
+ price: PriceFlat;
7957
+ /**
7958
+ * Current intent from the system lifecycle controller for a charge that has an
7959
+ * active manual override. The top-level charge fields remain the effective
7960
+ * customer-facing intent.
7961
+ */
7962
+ systemIntent?: ChargeFlatFeeSystemIntent;
7963
+ }
7964
+ /** A usage-based charge for a customer. */
7965
+ export interface ChargeUsageBasedInput {
7966
+ id: string;
7967
+ /**
7968
+ * Display name of the resource.
7969
+ *
7970
+ * Between 1 and 256 characters.
7971
+ */
7972
+ name: string;
7973
+ /**
7974
+ * Optional description of the resource.
7975
+ *
7976
+ * Maximum 1024 characters.
7977
+ */
7978
+ description?: string;
7979
+ labels?: Labels;
7980
+ /** An ISO-8601 timestamp representation of entity creation date. */
7981
+ createdAt: Date;
7982
+ /** An ISO-8601 timestamp representation of entity last update date. */
7983
+ updatedAt: Date;
7984
+ /** An ISO-8601 timestamp representation of entity deletion date. */
7985
+ deletedAt?: Date;
7986
+ /** The type of the charge. */
7987
+ type: 'usage_based';
7988
+ /**
7989
+ * The customer owning the charge.
7990
+ *
7991
+ * By default, only the `id` of the customer is returned. For more details use the
7992
+ * `customer` expand.
7993
+ */
7994
+ customer: CustomerOrReference;
7995
+ /**
7996
+ * Indicates whether the charge lifecycle is controlled by the system or manually
7997
+ * overridden by the API user.
7998
+ */
7999
+ lifecycleController: 'system' | 'manual';
8000
+ /**
8001
+ * The subscription that originated the charge, when the charge was created from a
8002
+ * subscription item.
8003
+ *
8004
+ * By default, only the `id`, `phase.id`, `phase.item.id` of the subscription is
8005
+ * returned. For more details use the `subscription` expand.
8006
+ */
8007
+ subscription?: SubscriptionOrReferenceInput;
8008
+ /** The currency of the charge. */
8009
+ currency: string;
8010
+ /** The lifecycle status of the charge. */
8011
+ status: 'created' | 'active' | 'final' | 'deleted';
8012
+ /** The timestamp when the charge is intended to be invoiced. */
8013
+ invoiceAt: Date;
8014
+ /** The effective service period covered by the charge. */
8015
+ servicePeriod: ClosedPeriod;
8016
+ /** The full, unprorated service period of the charge. */
8017
+ fullServicePeriod: ClosedPeriod;
8018
+ /** The billing period the charge belongs to. */
8019
+ billingPeriod: ClosedPeriod;
8020
+ /**
8021
+ * The earliest time when the charge should be advanced again by background
8022
+ * processing.
8023
+ */
8024
+ advanceAfter?: Date;
8025
+ /** Unique reference ID of the charge. */
8026
+ uniqueReferenceId?: string;
8027
+ /** Settlement mode of the charge. */
8028
+ settlementMode: 'credit_then_invoice' | 'credit_only';
8029
+ /** Tax configuration of the charge. */
8030
+ taxConfig?: TaxConfig;
8031
+ /** The realization runs of the charge, sorted by `created_at`. */
8032
+ realizations: ChargeRealizationInput[];
8033
+ /** Discounts applied to the usage-based charge. */
8034
+ discounts?: RateCardDiscounts;
8035
+ /** The feature associated with the charge. */
8036
+ feature: FeatureOrReference;
8037
+ /** Aggregated booked and realtime totals for the charge. */
8038
+ totals: ChargeTotals;
8039
+ /**
8040
+ * The metered usage quantity of the charge for its full service period.
8041
+ *
8042
+ * Requires the `real_time_usage` expand, since it is computed live from the
8043
+ * metering store rather than stored on the charge.
8044
+ */
8045
+ usage?: string;
8046
+ /**
8047
+ * The price of the charge.
8048
+ *
8049
+ * `free` prices are rejected on create: a usage-based charge always carries a
8050
+ * concrete price.
8051
+ */
8052
+ price: PriceUsageBased;
8053
+ /** Spend commitments for the charge. */
8054
+ commitments?: SpendCommitments;
8055
+ /**
8056
+ * Unit conversion configuration for the charge.
8057
+ *
8058
+ * Synthesized on read for charges created from v1 dynamic or package prices:
8059
+ * dynamic prices map to a unit price with a multiply unit config, and package
8060
+ * prices map to a unit price with a divide unit config.
8061
+ *
8062
+ * Accepted on create only when the UnitConfig feature is enabled on the
8063
+ * deployment; otherwise rejected.
8064
+ */
8065
+ unitConfig?: UnitConfigInput;
8066
+ /**
8067
+ * Current intent from the system lifecycle controller for a charge that has an
8068
+ * active manual override. The top-level charge fields remain the effective
8069
+ * customer-facing intent.
8070
+ */
8071
+ systemIntent?: ChargeUsageBasedSystemIntentInput;
8072
+ }
7478
8073
  /** Page paginated response. */
7479
8074
  export interface InvoicePagePaginatedResponseInput {
7480
8075
  data: InvoiceInput[];
7481
8076
  meta: PaginatedMeta;
7482
8077
  }
8078
+ /** Page paginated response. */
8079
+ export interface ChargePagePaginatedResponseInput {
8080
+ data: ChargeInput[];
8081
+ meta: PaginatedMeta;
8082
+ }
7483
8083
  /** Payment settings for a billing workflow. */
7484
8084
  export type WorkflowPaymentSettingsInput = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettingsInput;
7485
8085
  /** Payment settings for a billing workflow. */
@@ -7489,10 +8089,10 @@ export type UpdateBillingWorkflowPaymentSettingsInput = UpdateBillingWorkflowPay
7489
8089
  * rate card itself, so it is omitted here.
7490
8090
  */
7491
8091
  export type RateCardEntitlementInput = RateCardMeteredEntitlementInput | RateCardStaticEntitlement | RateCardBooleanEntitlement;
8092
+ /** ChargeRealizationInvoice or reference. */
8093
+ export type ChargeRealizationInvoiceOrReferenceInput = ChargeRealizationInvoiceInput | ChargeRealizationInvoiceReference;
7492
8094
  /** Customer charge. */
7493
8095
  export type CreateChargeRequestInput = CreateChargeFlatFeeRequest | CreateChargeUsageBasedRequestInput;
7494
- /** Customer charge. */
7495
- export type ChargeInput = ChargeFlatFee | ChargeUsageBasedInput;
7496
8096
  /**
7497
8097
  * A top-level line item on an invoice.
7498
8098
  *
@@ -7501,6 +8101,8 @@ export type ChargeInput = ChargeFlatFee | ChargeUsageBasedInput;
7501
8101
  * present.
7502
8102
  */
7503
8103
  export type InvoiceLineInput = InvoiceStandardLineInput;
8104
+ /** Subscription or reference. */
8105
+ export type SubscriptionOrReferenceInput = SubscriptionInput | SubscriptionReference;
7504
8106
  /**
7505
8107
  * An invoice issued to a customer.
7506
8108
  *
@@ -7511,3 +8113,5 @@ export type InvoiceLineInput = InvoiceStandardLineInput;
7511
8113
  export type InvoiceInput = InvoiceStandardInput;
7512
8114
  /** UpdateInvoiceRequest update request. */
7513
8115
  export type UpdateInvoiceRequestInput = UpdateInvoiceStandardRequestInput;
8116
+ /** Customer charge. */
8117
+ export type ChargeInput = ChargeFlatFeeInput | ChargeUsageBasedInput;