@openmeter/sdk 1.0.0-beta.212 → 1.0.0-beta.214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cjs/src/client/addons.cjs +105 -0
  2. package/dist/cjs/src/client/addons.d.cts +152 -0
  3. package/dist/cjs/src/client/addons.js.map +1 -0
  4. package/dist/cjs/src/client/billing.cjs +11 -3
  5. package/dist/cjs/src/client/billing.d.cts +32 -59
  6. package/dist/cjs/src/client/billing.js.map +1 -1
  7. package/dist/cjs/src/client/customers.cjs +17 -0
  8. package/dist/cjs/src/client/customers.d.cts +11 -0
  9. package/dist/cjs/src/client/customers.js.map +1 -1
  10. package/dist/cjs/src/client/events.cjs +67 -20
  11. package/dist/cjs/src/client/events.d.cts +21 -5
  12. package/dist/cjs/src/client/events.js.map +1 -1
  13. package/dist/cjs/src/client/index.cjs +6 -0
  14. package/dist/cjs/src/client/index.d.cts +4 -0
  15. package/dist/cjs/src/client/index.js.map +1 -1
  16. package/dist/cjs/src/client/meters.cjs +19 -0
  17. package/dist/cjs/src/client/meters.d.cts +24 -0
  18. package/dist/cjs/src/client/meters.js.map +1 -1
  19. package/dist/cjs/src/client/notifications.d.cts +214 -36
  20. package/dist/cjs/src/client/plans.cjs +127 -50
  21. package/dist/cjs/src/client/plans.d.cts +129 -24
  22. package/dist/cjs/src/client/plans.js.map +1 -1
  23. package/dist/cjs/src/client/schemas.d.cts +1943 -1350
  24. package/dist/cjs/src/client/subscription-addons.cjs +70 -0
  25. package/dist/cjs/src/client/subscription-addons.d.cts +123 -0
  26. package/dist/cjs/src/client/subscription-addons.js.map +1 -0
  27. package/dist/cjs/src/client/subscriptions.cjs +16 -0
  28. package/dist/cjs/src/client/subscriptions.d.cts +23 -0
  29. package/dist/cjs/src/client/subscriptions.js.map +1 -1
  30. package/dist/cjs/src/portal/index.cjs +35 -6
  31. package/dist/cjs/src/portal/index.js.map +1 -1
  32. package/dist/cjs/src/zod/index.cjs +11134 -0
  33. package/dist/cjs/src/zod/index.d.cts +18506 -0
  34. package/dist/cjs/src/zod/index.js.map +1 -0
  35. package/dist/cjs/tsconfig.4615b2f8.tsbuildinfo +1 -0
  36. package/dist/cjs/tsconfig.9c445eac.tsbuildinfo +1 -0
  37. package/dist/src/client/addons.d.ts +152 -0
  38. package/dist/src/client/addons.js +101 -0
  39. package/dist/src/client/addons.js.map +1 -0
  40. package/dist/src/client/billing.d.ts +32 -59
  41. package/dist/src/client/billing.js +11 -3
  42. package/dist/src/client/billing.js.map +1 -1
  43. package/dist/src/client/customers.d.ts +11 -0
  44. package/dist/src/client/customers.js +17 -0
  45. package/dist/src/client/customers.js.map +1 -1
  46. package/dist/src/client/events.d.ts +21 -5
  47. package/dist/src/client/events.js +67 -17
  48. package/dist/src/client/events.js.map +1 -1
  49. package/dist/src/client/index.d.ts +4 -0
  50. package/dist/src/client/index.js +6 -0
  51. package/dist/src/client/index.js.map +1 -1
  52. package/dist/src/client/meters.d.ts +24 -0
  53. package/dist/src/client/meters.js +19 -0
  54. package/dist/src/client/meters.js.map +1 -1
  55. package/dist/src/client/notifications.d.ts +214 -36
  56. package/dist/src/client/plans.d.ts +129 -24
  57. package/dist/src/client/plans.js +124 -48
  58. package/dist/src/client/plans.js.map +1 -1
  59. package/dist/src/client/schemas.d.ts +1943 -1350
  60. package/dist/src/client/subscription-addons.d.ts +123 -0
  61. package/dist/src/client/subscription-addons.js +66 -0
  62. package/dist/src/client/subscription-addons.js.map +1 -0
  63. package/dist/src/client/subscriptions.d.ts +23 -0
  64. package/dist/src/client/subscriptions.js +16 -0
  65. package/dist/src/client/subscriptions.js.map +1 -1
  66. package/dist/src/portal/index.js +1 -2
  67. package/dist/src/portal/index.js.map +1 -1
  68. package/dist/src/zod/index.d.ts +18506 -0
  69. package/dist/src/zod/index.js +11108 -0
  70. package/dist/src/zod/index.js.map +1 -0
  71. package/dist/tsconfig.tsbuildinfo +1 -1
  72. package/orval.config.ts +35 -0
  73. package/package.json +30 -16
  74. package/dist/cjs/tsconfig.065c79dd.tsbuildinfo +0 -1
  75. package/dist/cjs/tsconfig.9b7a0781.tsbuildinfo +0 -1
@@ -242,7 +242,13 @@ export interface paths {
242
242
  };
243
243
  /**
244
244
  * List customer overrides
245
- * @description List customer overrides
245
+ * @description List customer overrides using the specified filters.
246
+ *
247
+ * The response will include the customer override values and the merged billing profile values.
248
+ *
249
+ * If the includeAllCustomers is set to true, the list contains all customers. This mode is
250
+ * useful for getting the current effective billing workflow settings for all users regardless
251
+ * if they have customer orverrides or not.
246
252
  */
247
253
  get: operations['listBillingProfileCustomerOverrides'];
248
254
  put?: never;
@@ -263,17 +269,29 @@ export interface paths {
263
269
  /**
264
270
  * Get a customer override
265
271
  * @description Get a customer override by customer id.
272
+ *
273
+ * The response will include the customer override values and the merged billing profile values.
274
+ *
275
+ * If the customer override is not found, the default billing profile's values are returned. This behavior
276
+ * allows for getting a merged profile regardless of the customer override existence.
266
277
  */
267
278
  get: operations['getBillingProfileCustomerOverride'];
268
279
  /**
269
280
  * Create a new or update a customer override
270
- * @description Create a new or update an existing customer override.
281
+ * @description The customer override can be used to pin a given customer to a billing profile
282
+ * different from the default one.
283
+ *
284
+ * This can be used to test the effect of different billing profiles before making them
285
+ * the default ones or have different workflow settings for example for enterprise customers.
271
286
  */
272
287
  put: operations['upsertBillingProfileCustomerOverride'];
273
288
  post?: never;
274
289
  /**
275
290
  * Delete a customer override
276
291
  * @description Delete a customer override by customer id.
292
+ *
293
+ * This will remove the customer override and the customer will be subject to the default
294
+ * billing profile's settings again.
277
295
  */
278
296
  delete: operations['deleteBillingProfileCustomerOverride'];
279
297
  options?: never;
@@ -281,6 +299,33 @@ export interface paths {
281
299
  patch?: never;
282
300
  trace?: never;
283
301
  };
302
+ '/api/v1/billing/customers/{customerId}/invoices/pending-lines': {
303
+ parameters: {
304
+ query?: never;
305
+ header?: never;
306
+ path?: never;
307
+ cookie?: never;
308
+ };
309
+ get?: never;
310
+ put?: never;
311
+ /**
312
+ * Create pending line items
313
+ * @description Create a new pending line item (charge).
314
+ *
315
+ * This call is used to create a new pending line item for the customer if required a new
316
+ * gathering invoice will be created.
317
+ *
318
+ * A new invoice will be created if:
319
+ * - there is no invoice in gathering state
320
+ * - the currency of the line item doesn't match the currency of any invoices in gathering state
321
+ */
322
+ post: operations['createPendingInvoiceLine'];
323
+ delete?: never;
324
+ options?: never;
325
+ head?: never;
326
+ patch?: never;
327
+ trace?: never;
328
+ };
284
329
  '/api/v1/billing/customers/{customerId}/invoices/simulate': {
285
330
  parameters: {
286
331
  query?: never;
@@ -314,7 +359,12 @@ export interface paths {
314
359
  };
315
360
  /**
316
361
  * List invoices
317
- * @description List invoices for a specific customer
362
+ * @description List invoices based on the specified filters.
363
+ *
364
+ * The expand option can be used to include additional information (besides the invoice header and totals)
365
+ * in the response. For example by adding the expand=lines option the invoice lines will be included in the response.
366
+ *
367
+ * Gathering invoices will always show the current usage calculated on the fly.
318
368
  */
319
369
  get: operations['listInvoices'];
320
370
  put?: never;
@@ -353,33 +403,6 @@ export interface paths {
353
403
  patch?: never;
354
404
  trace?: never;
355
405
  };
356
- '/api/v1/billing/invoices/lines': {
357
- parameters: {
358
- query?: never;
359
- header?: never;
360
- path?: never;
361
- cookie?: never;
362
- };
363
- get?: never;
364
- put?: never;
365
- /**
366
- * Create pending line items
367
- * @description Create a new pending line item (charge).
368
- *
369
- * This call is used to create a new pending line item for the customer if required a new
370
- * gathering invoice will be created.
371
- *
372
- * A new invoice will be created if:
373
- * - there is no invoice in gathering state
374
- * - the currency of the line item doesn't match the currency of any invoices in gathering state
375
- */
376
- post: operations['createPendingInvoiceLine'];
377
- delete?: never;
378
- options?: never;
379
- head?: never;
380
- patch?: never;
381
- trace?: never;
382
- };
383
406
  '/api/v1/billing/invoices/{invoiceId}': {
384
407
  parameters: {
385
408
  query?: never;
@@ -390,6 +413,8 @@ export interface paths {
390
413
  /**
391
414
  * Get an invoice
392
415
  * @description Get an invoice by ID.
416
+ *
417
+ * Gathering invoices will always show the current usage calculated on the fly.
393
418
  */
394
419
  get: operations['getInvoice'];
395
420
  /**
@@ -405,6 +430,8 @@ export interface paths {
405
430
  * @description Delete an invoice
406
431
  *
407
432
  * Only invoices that are in the draft (or earlier) status can be deleted.
433
+ *
434
+ * Invoices that are post finalization can only be voided.
408
435
  */
409
436
  delete: operations['deleteInvoice'];
410
437
  options?: never;
@@ -484,6 +511,31 @@ export interface paths {
484
511
  patch?: never;
485
512
  trace?: never;
486
513
  };
514
+ '/api/v1/billing/invoices/{invoiceId}/snapshot-quantities': {
515
+ parameters: {
516
+ query?: never;
517
+ header?: never;
518
+ path?: never;
519
+ cookie?: never;
520
+ };
521
+ get?: never;
522
+ put?: never;
523
+ /**
524
+ * Snapshot quantities for usage based line items
525
+ * @description Snapshot quantities for usage based line items.
526
+ *
527
+ * This call will snapshot the quantities for all usage based line items in the invoice.
528
+ *
529
+ * This call is only valid in `draft.waiting_for_collection` status, where the collection period
530
+ * can be skipped using this action.
531
+ */
532
+ post: operations['snapshotQuantitiesInvoiceAction'];
533
+ delete?: never;
534
+ options?: never;
535
+ head?: never;
536
+ patch?: never;
537
+ trace?: never;
538
+ };
487
539
  '/api/v1/billing/invoices/{invoiceId}/taxes/recalculate': {
488
540
  parameters: {
489
541
  query?: never;
@@ -539,7 +591,11 @@ export interface paths {
539
591
  };
540
592
  /**
541
593
  * List billing profiles
542
- * @description List all billing profiles
594
+ * @description List all billing profiles matching the specified filters.
595
+ *
596
+ * The expand option can be used to include additional information (besides the billing profile)
597
+ * in the response. For example by adding the expand=apps option the apps used by the billing profile
598
+ * will be included in the response.
543
599
  */
544
600
  get: operations['listBillingProfiles'];
545
601
  put?: never;
@@ -566,18 +622,30 @@ export interface paths {
566
622
  };
567
623
  /**
568
624
  * Get a billing profile
569
- * @description Get a billing profile by ID
625
+ * @description Get a billing profile by id.
626
+ *
627
+ * The expand option can be used to include additional information (besides the billing profile)
628
+ * in the response. For example by adding the expand=apps option the apps used by the billing profile
629
+ * will be included in the response.
570
630
  */
571
631
  get: operations['getBillingProfile'];
572
632
  /**
573
633
  * Update a billing profile
574
- * @description Update a billing profile
634
+ * @description Update a billing profile by id.
635
+ *
636
+ * The apps field cannot be updated directly, if an app change is desired a new
637
+ * profile should be created.
575
638
  */
576
639
  put: operations['updateBillingProfile'];
577
640
  post?: never;
578
641
  /**
579
642
  * Delete a billing profile
580
- * @description Delete a billing profile
643
+ * @description Delete a billing profile by id.
644
+ *
645
+ * Only such billing profiles can be deleted that are:
646
+ * - not the default one
647
+ * - not pinned to any customer using customer overrides
648
+ * - only have finalized invoices
581
649
  */
582
650
  delete: operations['deleteBillingProfile'];
583
651
  options?: never;
@@ -709,7 +777,7 @@ export interface paths {
709
777
  cookie?: never;
710
778
  };
711
779
  /**
712
- * Get entitlement value
780
+ * Get customer entitlement value
713
781
  * @description Checks customer access to a given feature (by key). All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type.
714
782
  */
715
783
  get: operations['getCustomerEntitlementValue'];
@@ -1155,7 +1223,8 @@ export interface paths {
1155
1223
  */
1156
1224
  get: operations['queryMeter'];
1157
1225
  put?: never;
1158
- post?: never;
1226
+ /** Query meter */
1227
+ post: operations['queryMeterPost'];
1159
1228
  delete?: never;
1160
1229
  options?: never;
1161
1230
  head?: never;
@@ -1350,26 +1419,6 @@ export interface paths {
1350
1419
  patch?: never;
1351
1420
  trace?: never;
1352
1421
  };
1353
- '/api/v1/notification/webhook/svix': {
1354
- parameters: {
1355
- query?: never;
1356
- header?: never;
1357
- path?: never;
1358
- cookie?: never;
1359
- };
1360
- get?: never;
1361
- put?: never;
1362
- /**
1363
- * Receive Svix operational events
1364
- * @description Callback endpoint used by Svix to notify about operational events.
1365
- */
1366
- post: operations['receiveSvixOperationalEvent'];
1367
- delete?: never;
1368
- options?: never;
1369
- head?: never;
1370
- patch?: never;
1371
- trace?: never;
1372
- };
1373
1422
  '/api/v1/plans': {
1374
1423
  parameters: {
1375
1424
  query?: never;
@@ -1683,13 +1732,13 @@ export interface paths {
1683
1732
  cookie?: never;
1684
1733
  };
1685
1734
  /**
1686
- * List entitlements
1735
+ * List subject entitlements
1687
1736
  * @description List all entitlements for a subject. For checking entitlement access, use the /value endpoint instead.
1688
1737
  */
1689
1738
  get: operations['listSubjectEntitlements'];
1690
1739
  put?: never;
1691
1740
  /**
1692
- * Create an entitlement
1741
+ * Create a subject entitlement
1693
1742
  * @description OpenMeter has three types of entitlements: metered, boolean, and static. The type property determines the type of entitlement. The underlying feature has to be compatible with the entitlement type specified in the request (e.g., a metered entitlement needs a feature associated with a meter).
1694
1743
  *
1695
1744
  * - Boolean entitlements define static feature access, e.g. "Can use SSO authentication".
@@ -1715,13 +1764,13 @@ export interface paths {
1715
1764
  cookie?: never;
1716
1765
  };
1717
1766
  /**
1718
- * List entitlement grants
1767
+ * List subject entitlement grants
1719
1768
  * @description List all grants issued for an entitlement. The entitlement can be defined either by its id or featureKey.
1720
1769
  */
1721
1770
  get: operations['listEntitlementGrants'];
1722
1771
  put?: never;
1723
1772
  /**
1724
- * Create grant
1773
+ * Create subject entitlement grant
1725
1774
  * @description Grants define a behavior of granting usage for a metered entitlement. They can have complicated recurrence and rollover rules, thanks to which you can define a wide range of access patterns with a single grant, in most cases you don't have to periodically create new grants. You can only issue grants for active metered entitlements.
1726
1775
  *
1727
1776
  * A grant defines a given amount of usage that can be consumed for the entitlement. The grant is in effect between its effective date and its expiration date. Specifying both is mandatory for new grants.
@@ -1750,7 +1799,7 @@ export interface paths {
1750
1799
  };
1751
1800
  get?: never;
1752
1801
  /**
1753
- * Override entitlement
1802
+ * Override subject entitlement
1754
1803
  * @description Overriding an entitlement creates a new entitlement from the provided inputs and soft deletes the previous entitlement for the provided subject-feature pair. If the previous entitlement is already deleted or otherwise doesnt exist, the override will fail.
1755
1804
  *
1756
1805
  * This endpoint is useful for upgrades, downgrades, or other changes to entitlements that require a new entitlement to be created with zero downtime.
@@ -1771,7 +1820,7 @@ export interface paths {
1771
1820
  cookie?: never;
1772
1821
  };
1773
1822
  /**
1774
- * Get entitlement value
1823
+ * Get subject entitlement value
1775
1824
  * @description This endpoint should be used for access checks and enforcement. All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type.
1776
1825
  *
1777
1826
  * For convenience reasons, /value works with both entitlementId and featureKey.
@@ -1793,14 +1842,14 @@ export interface paths {
1793
1842
  cookie?: never;
1794
1843
  };
1795
1844
  /**
1796
- * Get entitlement
1845
+ * Get subject entitlement
1797
1846
  * @description Get entitlement by id. For checking entitlement access, use the /value endpoint instead.
1798
1847
  */
1799
1848
  get: operations['getEntitlement'];
1800
1849
  put?: never;
1801
1850
  post?: never;
1802
1851
  /**
1803
- * Delete entitlement
1852
+ * Delete subject entitlement
1804
1853
  * @description Deleting an entitlement revokes access to the associated feature. As a single subject can only have one entitlement per featureKey, when "migrating" features you have to delete the old entitlements as well.
1805
1854
  * As access and status checks can be historical queries, deleting an entitlement populates the deletedAt timestamp. When queried for a time before that, the entitlement is still considered active, you cannot have retroactive changes to access, which is important for, among other things, auditing.
1806
1855
  */
@@ -1818,7 +1867,7 @@ export interface paths {
1818
1867
  cookie?: never;
1819
1868
  };
1820
1869
  /**
1821
- * Get entitlement history
1870
+ * Get subject entitlement history
1822
1871
  * @description Returns historical balance and usage data for the entitlement. The queried history can span accross multiple reset events.
1823
1872
  *
1824
1873
  * BurndownHistory returns a continous history of segments, where the segments are seperated by events that changed either the grant burndown priority or the usage period.
@@ -1844,7 +1893,7 @@ export interface paths {
1844
1893
  get?: never;
1845
1894
  put?: never;
1846
1895
  /**
1847
- * Reset entitlement
1896
+ * Reset subject entitlement
1848
1897
  * @description Reset marks the start of a new usage period for the entitlement and initiates grant rollover. At the start of a period usage is zerod out and grants are rolled over based on their rollover settings. It would typically be synced with the subjects billing period to enforce usage based on their subscription.
1849
1898
  *
1850
1899
  * Usage is automatically reset for metered entitlements based on their usage period, but this endpoint allows to manually reset it at any time. When doing so the period anchor of the entitlement can be changed if needed.
@@ -2175,6 +2224,11 @@ export interface components {
2175
2224
  * @description The rate cards of the add-on.
2176
2225
  */
2177
2226
  rateCards: components['schemas']['RateCard'][];
2227
+ /**
2228
+ * Validation errors
2229
+ * @description List of validation errors.
2230
+ */
2231
+ readonly validationErrors: components['schemas']['ValidationError'][] | null;
2178
2232
  };
2179
2233
  /** @description Resource create operation model. */
2180
2234
  AddonCreate: {
@@ -2566,11 +2620,20 @@ export interface components {
2566
2620
  };
2567
2621
  /** @description BillingProfileAppsCreate represents the input for creating a billing profile's apps */
2568
2622
  BillingProfileAppsCreate: {
2569
- /** @description The tax app used for this workflow */
2623
+ /**
2624
+ * @description The tax app used for this workflow
2625
+ * @example 01G65Z755AFWAKHE12NY0CQ9FH
2626
+ */
2570
2627
  tax: string;
2571
- /** @description The invoicing app used for this workflow */
2628
+ /**
2629
+ * @description The invoicing app used for this workflow
2630
+ * @example 01G65Z755AFWAKHE12NY0CQ9FH
2631
+ */
2572
2632
  invoicing: string;
2573
- /** @description The payment app used for this workflow */
2633
+ /**
2634
+ * @description The payment app used for this workflow
2635
+ * @example 01G65Z755AFWAKHE12NY0CQ9FH
2636
+ */
2574
2637
  payment: string;
2575
2638
  };
2576
2639
  /** @description ProfileAppsOrReference represents the union of ProfileApps and ProfileAppReferences
@@ -2757,6 +2820,8 @@ export interface components {
2757
2820
  invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'];
2758
2821
  /** @description The payment settings for this workflow */
2759
2822
  payment?: components['schemas']['BillingWorkflowPaymentSettings'];
2823
+ /** @description The tax settings for this workflow */
2824
+ tax?: components['schemas']['BillingWorkflowTaxSettings'];
2760
2825
  };
2761
2826
  /** @description The alignment for collecting the pending line items into an invoice.
2762
2827
  *
@@ -2787,7 +2852,7 @@ export interface components {
2787
2852
  * alignment.
2788
2853
  *
2789
2854
  * This is useful, in case of multiple subscriptions having slightly different billing periods.
2790
- * @default PT2H
2855
+ * @default PT1H
2791
2856
  * @example P1D
2792
2857
  */
2793
2858
  interval?: string;
@@ -2800,6 +2865,8 @@ export interface components {
2800
2865
  invoicing?: components['schemas']['BillingWorkflowInvoicingSettings'];
2801
2866
  /** @description The payment settings for this workflow */
2802
2867
  payment?: components['schemas']['BillingWorkflowPaymentSettings'];
2868
+ /** @description The tax settings for this workflow */
2869
+ tax?: components['schemas']['BillingWorkflowTaxSettings'];
2803
2870
  };
2804
2871
  /**
2805
2872
  * Workflow invoice settings
@@ -2821,8 +2888,9 @@ export interface components {
2821
2888
  /**
2822
2889
  * Format: ISO8601
2823
2890
  * @description The period after which the invoice is due.
2824
- * @default P1W
2825
- * @example P1D
2891
+ * With some payment solutions it's only applicable for manual collection method.
2892
+ * @default P30D
2893
+ * @example P30D
2826
2894
  */
2827
2895
  dueAfter?: string;
2828
2896
  /**
@@ -2844,6 +2912,26 @@ export interface components {
2844
2912
  */
2845
2913
  collectionMethod?: components['schemas']['CollectionMethod'];
2846
2914
  };
2915
+ /**
2916
+ * Workflow tax settings
2917
+ * @description BillingWorkflowTaxSettings represents the tax settings for a billing workflow
2918
+ */
2919
+ BillingWorkflowTaxSettings: {
2920
+ /**
2921
+ * @description Enable automatic tax calculation when tax is supported by the app.
2922
+ * For example, with Stripe Invoicing when enabled, tax is calculated via Stripe Tax.
2923
+ * @default true
2924
+ */
2925
+ enabled?: boolean;
2926
+ /**
2927
+ * @description Enforce tax calculation when tax is supported by the app.
2928
+ * When enabled, OpenMeter will not allow to create an invoice without tax calculation.
2929
+ * Enforcement is different per apps, for example, Stripe app requires customer
2930
+ * to have a tax location when starting a paid subscription.
2931
+ * @default false
2932
+ */
2933
+ enforced?: boolean;
2934
+ };
2847
2935
  /** @description Stripe CheckoutSession.custom_text */
2848
2936
  CheckoutSessionCustomTextAfterSubmitParams: {
2849
2937
  /** @description Custom text that should be displayed after the payment confirmation button. */
@@ -3114,7 +3202,7 @@ export interface components {
3114
3202
  * @description Type of the invoice.
3115
3203
  * @enum {string}
3116
3204
  */
3117
- type: 'credit_node_original_invoice';
3205
+ type: 'credit_note_original_invoice';
3118
3206
  /**
3119
3207
  * Format: date-time
3120
3208
  * @description IssueAt reflects the time the document was issued.
@@ -3200,9 +3288,6 @@ export interface components {
3200
3288
  readonly listing: components['schemas']['MarketplaceListing'];
3201
3289
  /** @description Status of the app connection. */
3202
3290
  readonly status: components['schemas']['AppStatus'];
3203
- /** @description Default for the app type
3204
- * Only one app of each type can be default. */
3205
- default: boolean;
3206
3291
  /**
3207
3292
  * @description The app's type is CustomInvoicing. (enum property replaced by openapi-typescript)
3208
3293
  * @enum {string}
@@ -3234,9 +3319,6 @@ export interface components {
3234
3319
  * @description Additional metadata for the resource.
3235
3320
  */
3236
3321
  metadata?: components['schemas']['Metadata'] | null;
3237
- /** @description Default for the app type
3238
- * Only one app of each type can be default. */
3239
- default: boolean;
3240
3322
  /**
3241
3323
  * @description The app's type is CustomInvoicing. (enum property replaced by openapi-typescript)
3242
3324
  * @enum {string}
@@ -3386,6 +3468,24 @@ export interface components {
3386
3468
  * @default USD
3387
3469
  */
3388
3470
  currency: components['schemas']['CurrencyCode'];
3471
+ /**
3472
+ * Billing cadence
3473
+ * Format: duration
3474
+ * @description The default billing cadence for subscriptions using this plan.
3475
+ * Defines how often customers are billed using ISO8601 duration format.
3476
+ * Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).
3477
+ * @example P1M
3478
+ */
3479
+ billingCadence: string;
3480
+ /**
3481
+ * Pro-rating configuration
3482
+ * @description Default pro-rating configuration for subscriptions using this plan.
3483
+ * @default {
3484
+ * "enabled": true,
3485
+ * "mode": "prorate_prices"
3486
+ * }
3487
+ */
3488
+ proRatingConfig?: components['schemas']['ProRatingConfig'];
3389
3489
  /**
3390
3490
  * Plan phases
3391
3491
  * @description The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses.
@@ -3398,6 +3498,12 @@ export interface components {
3398
3498
  /** @description Timing configuration for the change, when the change should take effect.
3399
3499
  * For changing a subscription, the accepted values depend on the subscription configuration. */
3400
3500
  timing: components['schemas']['SubscriptionTiming'];
3501
+ /**
3502
+ * Format: date-time
3503
+ * @description The billing anchor of the subscription. The provided date will be normalized according to the billing cadence to the nearest recurrence before start time. If not provided, the previous subscription billing anchor will be used.
3504
+ * @example 2023-01-01T01:01:01.001Z
3505
+ */
3506
+ billingAnchor?: Date;
3401
3507
  /** @description The custom plan description which defines the Subscription. */
3402
3508
  customPlan: components['schemas']['CustomPlanInput'];
3403
3509
  };
@@ -3418,6 +3524,12 @@ export interface components {
3418
3524
  customerId?: string;
3419
3525
  /** @description The key of the customer. Provide either the key or ID. */
3420
3526
  customerKey?: string;
3527
+ /**
3528
+ * Format: date-time
3529
+ * @description The billing anchor of the subscription. The provided date will be normalized according to the billing cadence to the nearest recurrence before start time. If not provided, the subscription start time will be used.
3530
+ * @example 2023-01-01T01:01:01.001Z
3531
+ */
3532
+ billingAnchor?: Date;
3421
3533
  };
3422
3534
  /**
3423
3535
  * @description A customer object.
@@ -5123,6 +5235,18 @@ export interface components {
5123
5235
  * @example 2023-01-01T01:01:01.001Z
5124
5236
  */
5125
5237
  draftUntil?: Date;
5238
+ /**
5239
+ * Format: date-time
5240
+ * @description The time when the quantity snapshots on the invoice lines were taken.
5241
+ * @example 2023-01-01T01:01:01.001Z
5242
+ */
5243
+ readonly quantitySnapshotedAt?: Date;
5244
+ /**
5245
+ * Format: date-time
5246
+ * @description The time when the invoice will be/has been collected.
5247
+ * @example 2023-01-01T01:01:01.001Z
5248
+ */
5249
+ readonly collectionAt?: Date;
5126
5250
  /**
5127
5251
  * Format: date-time
5128
5252
  * @description Due time of the fulfillment of the invoice (if available).
@@ -5190,31 +5314,15 @@ export interface components {
5190
5314
  readonly delete?: components['schemas']['InvoiceAvailableActionDetails'];
5191
5315
  /** @description Retry an invoice issuing step that failed. */
5192
5316
  readonly retry?: components['schemas']['InvoiceAvailableActionDetails'];
5317
+ /** @description Snapshot quantities for usage based line items. */
5318
+ readonly snapshotQuantities?: components['schemas']['InvoiceAvailableActionDetails'];
5193
5319
  /** @description Void an already issued invoice. */
5194
5320
  readonly void?: components['schemas']['InvoiceAvailableActionDetails'];
5195
5321
  /** @description Invoice a gathering invoice */
5196
5322
  readonly invoice?: components['schemas']['InvoiceAvailableActionInvoiceDetails'];
5197
5323
  };
5198
- /** @description InvoiceDocumentRef is used to describe a reference to an existing document (invoice). */
5199
- InvoiceDocumentRef: components['schemas']['CreditNoteOriginalInvoiceRef'];
5200
- /**
5201
- * @description InvoiceDocumentRefType defines the type of document that is being referenced.
5202
- * @enum {string}
5203
- */
5204
- InvoiceDocumentRefType: 'credit_node_original_invoice';
5205
- /**
5206
- * @description InvoiceExpand specifies the parts of the invoice to expand in the list output.
5207
- * @enum {string}
5208
- */
5209
- InvoiceExpand: 'lines' | 'preceding' | 'workflow.apps';
5210
- /**
5211
- * @description InvoiceFlatFeeCategory determines if the flat fee is a regular fee due to use due to a
5212
- * commitment.
5213
- * @enum {string}
5214
- */
5215
- InvoiceFlatFeeCategory: 'regular' | 'commitment';
5216
- /** @description InvoiceFlatFeeLine represents a line item that is sold to the customer as a manually added fee. */
5217
- InvoiceFlatFeeLine: {
5324
+ /** @description InvoiceDetailedLine represents a line item that is sold to the customer as a manually added fee. */
5325
+ InvoiceDetailedLine: {
5218
5326
  /**
5219
5327
  * Display name
5220
5328
  * @description Human-readable name for the resource. Between 1 and 256 characters.
@@ -5279,8 +5387,6 @@ export interface components {
5279
5387
  * @description Tax config specify the tax configuration for this line.
5280
5388
  */
5281
5389
  taxConfig?: components['schemas']['TaxConfig'];
5282
- /** @description The lines detailing the item or service sold. */
5283
- readonly children?: components['schemas']['InvoiceLine'][];
5284
5390
  /** @description Totals for this line. */
5285
5391
  readonly totals: components['schemas']['InvoiceTotals'];
5286
5392
  /** @description Period of the line item applies to for revenue recognition pruposes.
@@ -5298,10 +5404,11 @@ export interface components {
5298
5404
  /** @description Subscription are the references to the subscritpions that this line is related to. */
5299
5405
  readonly subscription?: components['schemas']['InvoiceLineSubscriptionReference'];
5300
5406
  /**
5301
- * @description Type of the line. (enum property replaced by openapi-typescript)
5407
+ * @deprecated
5408
+ * @description Type of the line.
5302
5409
  * @enum {string}
5303
5410
  */
5304
- type: 'flat_fee';
5411
+ readonly type: 'flat_fee';
5305
5412
  /**
5306
5413
  * @deprecated
5307
5414
  * @description Price of the item being sold.
@@ -5319,17 +5426,74 @@ export interface components {
5319
5426
  */
5320
5427
  quantity?: components['schemas']['Numeric'];
5321
5428
  /** @description The rate card that is used for this line. */
5322
- rateCard?: components['schemas']['InvoiceFlatFeeRateCard'];
5429
+ rateCard?: components['schemas']['InvoiceDetailedLineRateCard'];
5323
5430
  /**
5324
5431
  * @description Category of the flat fee.
5325
5432
  * @default regular
5326
5433
  */
5327
- category?: components['schemas']['InvoiceFlatFeeCategory'];
5434
+ readonly category?: components['schemas']['InvoiceDetailedLineCostCategory'];
5328
5435
  };
5329
- /** @description InvoiceFlatFeeLineReplaceUpdate represents the update model for a flat fee invoice line.
5330
- *
5331
- * This type makes ID optional to allow for creating new lines as part of the update. */
5332
- InvoiceFlatFeeLineReplaceUpdate: {
5436
+ /**
5437
+ * @description InvoiceDetailedLineCostCategory determines if the flat fee is a regular fee due to use due to a
5438
+ * commitment.
5439
+ * @enum {string}
5440
+ */
5441
+ InvoiceDetailedLineCostCategory: 'regular' | 'commitment';
5442
+ /** @description InvoiceDetailedLineRateCard represents the rate card (intent) for a flat fee line. */
5443
+ InvoiceDetailedLineRateCard: {
5444
+ /**
5445
+ * Tax config
5446
+ * @description The tax config of the rate card.
5447
+ * When undefined, the tax config of the feature or the default tax config of the plan is used.
5448
+ */
5449
+ taxConfig?: components['schemas']['TaxConfig'];
5450
+ /**
5451
+ * Price
5452
+ * @description The price of the rate card.
5453
+ * When null, the feature or service is free.
5454
+ * @example {
5455
+ * "type": "flat",
5456
+ * "amount": "100",
5457
+ * "paymentTerm": "in_arrears"
5458
+ * }
5459
+ */
5460
+ price: components['schemas']['FlatPriceWithPaymentTerm'] | null;
5461
+ /** @description Quantity of the item being sold.
5462
+ *
5463
+ * Default: 1 */
5464
+ quantity?: components['schemas']['Numeric'];
5465
+ /** @description The discounts that are applied to the line. */
5466
+ discounts?: components['schemas']['BillingDiscounts'];
5467
+ };
5468
+ /** @description InvoiceDocumentRef is used to describe a reference to an existing document (invoice). */
5469
+ InvoiceDocumentRef: components['schemas']['CreditNoteOriginalInvoiceRef'];
5470
+ /**
5471
+ * @description InvoiceDocumentRefType defines the type of document that is being referenced.
5472
+ * @enum {string}
5473
+ */
5474
+ InvoiceDocumentRefType: 'credit_note_original_invoice';
5475
+ /**
5476
+ * @description InvoiceExpand specifies the parts of the invoice to expand in the list output.
5477
+ * @enum {string}
5478
+ */
5479
+ InvoiceExpand: 'lines' | 'preceding' | 'workflow.apps';
5480
+ /**
5481
+ * InvoiceGenericDocumentRef is used to describe an existing document or a specific part of it's contents.
5482
+ * @description Omitted fields:
5483
+ * period: Tax period in which the referred document had an effect required by some tax regimes and formats.
5484
+ * stamps: Seals of approval from other organisations that may need to be listed.
5485
+ * ext: Extensions for additional codes that may be required.
5486
+ */
5487
+ InvoiceGenericDocumentRef: {
5488
+ /** @description Type of the document referenced. */
5489
+ readonly type: components['schemas']['InvoiceDocumentRefType'];
5490
+ /** @description Human readable description on why this reference is here or needs to be used. */
5491
+ readonly reason?: string;
5492
+ /** @description Additional details about the document. */
5493
+ readonly description?: string;
5494
+ };
5495
+ /** @description InvoiceUsageBasedLine represents a line item that is sold to the customer based on usage. */
5496
+ InvoiceLine: {
5333
5497
  /**
5334
5498
  * Display name
5335
5499
  * @description Human-readable name for the resource. Between 1 and 256 characters.
@@ -5346,78 +5510,56 @@ export interface components {
5346
5510
  */
5347
5511
  metadata?: components['schemas']['Metadata'] | null;
5348
5512
  /**
5349
- * @deprecated
5350
- * @description Tax config specify the tax configuration for this line.
5513
+ * Creation Time
5514
+ * Format: date-time
5515
+ * @description Timestamp of when the resource was created.
5516
+ * @example 2024-01-01T01:01:01.001Z
5351
5517
  */
5352
- taxConfig?: components['schemas']['TaxConfig'];
5353
- /** @description Period of the line item applies to for revenue recognition pruposes.
5354
- *
5355
- * Billing always treats periods as start being inclusive and end being exclusive. */
5356
- period: components['schemas']['Period'];
5518
+ readonly createdAt: Date;
5357
5519
  /**
5520
+ * Last Update Time
5358
5521
  * Format: date-time
5359
- * @description The time this line item should be invoiced.
5360
- * @example 2023-01-01T01:01:01.001Z
5522
+ * @description Timestamp of when the resource was last updated.
5523
+ * @example 2024-01-01T01:01:01.001Z
5361
5524
  */
5362
- invoiceAt: Date;
5525
+ readonly updatedAt: Date;
5363
5526
  /**
5364
- * @description Type of the line. (enum property replaced by openapi-typescript)
5365
- * @enum {string}
5527
+ * Deletion Time
5528
+ * Format: date-time
5529
+ * @description Timestamp of when the resource was permanently deleted.
5530
+ * @example 2024-01-01T01:01:01.001Z
5366
5531
  */
5367
- type: 'flat_fee';
5532
+ readonly deletedAt?: Date;
5368
5533
  /**
5369
- * @deprecated
5370
- * @description Price of the item being sold.
5371
- */
5372
- perUnitAmount?: components['schemas']['Numeric'];
5373
- /**
5374
- * @deprecated
5375
- * @description Payment term of the line.
5376
- * @default in_advance
5377
- */
5378
- paymentTerm?: components['schemas']['PricePaymentTerm'];
5379
- /**
5380
- * @deprecated
5381
- * @description Quantity of the item being sold.
5382
- */
5383
- quantity?: components['schemas']['Numeric'];
5384
- /** @description The rate card that is used for this line. */
5385
- rateCard?: components['schemas']['InvoiceFlatFeeRateCard'];
5386
- /**
5387
- * @description Category of the flat fee.
5388
- * @default regular
5389
- */
5390
- category?: components['schemas']['InvoiceFlatFeeCategory'];
5391
- /**
5392
- * @description The ID of the line.
5534
+ * @description ID of the line.
5393
5535
  * @example 01G65Z755AFWAKHE12NY0CQ9FH
5394
5536
  */
5395
- id?: string;
5396
- };
5397
- /** @description InvoiceFlatFeePendingLineCreate represents the create model for an invoice line that is sold to the customer as a manually added fee. */
5398
- InvoiceFlatFeePendingLineCreate: {
5399
- /**
5400
- * Display name
5401
- * @description Human-readable name for the resource. Between 1 and 256 characters.
5402
- */
5403
- name: string;
5404
- /**
5405
- * Description
5406
- * @description Optional description of the resource. Maximum 1024 characters.
5407
- */
5408
- description?: string;
5409
- /**
5410
- * Metadata
5411
- * @description Additional metadata for the resource.
5412
- */
5413
- metadata?: components['schemas']['Metadata'] | null;
5537
+ id: string;
5538
+ /** @description managedBy specifies if the line is manually added via the api or managed by OpenMeter. */
5539
+ readonly managedBy: components['schemas']['InvoiceLineManagedBy'];
5540
+ /** @description Status of the line.
5541
+ *
5542
+ * External calls always create valid lines, other line types are managed by the
5543
+ * billing engine of OpenMeter. */
5544
+ readonly status: components['schemas']['InvoiceLineStatus'];
5545
+ /** @description Discounts detailes applied to this line.
5546
+ *
5547
+ * New discounts can be added via the invoice's discounts API, to facilitate
5548
+ * discounts that are affecting multiple lines. */
5549
+ readonly discounts?: components['schemas']['InvoiceLineDiscounts'];
5550
+ /** @description The invoice this item belongs to. */
5551
+ invoice?: components['schemas']['InvoiceReference'];
5414
5552
  /** @description The currency of this line. */
5415
5553
  currency: components['schemas']['CurrencyCode'];
5554
+ /** @description Taxes applied to the invoice totals. */
5555
+ readonly taxes?: components['schemas']['InvoiceLineTaxItem'][];
5416
5556
  /**
5417
5557
  * @deprecated
5418
5558
  * @description Tax config specify the tax configuration for this line.
5419
5559
  */
5420
5560
  taxConfig?: components['schemas']['TaxConfig'];
5561
+ /** @description Totals for this line. */
5562
+ readonly totals: components['schemas']['InvoiceTotals'];
5421
5563
  /** @description Period of the line item applies to for revenue recognition pruposes.
5422
5564
  *
5423
5565
  * Billing always treats periods as start being inclusive and end being exclusive. */
@@ -5428,83 +5570,49 @@ export interface components {
5428
5570
  * @example 2023-01-01T01:01:01.001Z
5429
5571
  */
5430
5572
  invoiceAt: Date;
5431
- /**
5432
- * @description Type of the line. (enum property replaced by openapi-typescript)
5433
- * @enum {string}
5434
- */
5435
- type: 'flat_fee';
5573
+ /** @description External IDs of the invoice in other apps such as Stripe. */
5574
+ readonly externalIds?: components['schemas']['InvoiceLineAppExternalIds'];
5575
+ /** @description Subscription are the references to the subscritpions that this line is related to. */
5576
+ readonly subscription?: components['schemas']['InvoiceLineSubscriptionReference'];
5436
5577
  /**
5437
5578
  * @deprecated
5438
- * @description Price of the item being sold.
5579
+ * @description Type of the line.
5580
+ * @enum {string}
5439
5581
  */
5440
- perUnitAmount?: components['schemas']['Numeric'];
5582
+ readonly type: 'usage_based';
5441
5583
  /**
5442
5584
  * @deprecated
5443
- * @description Payment term of the line.
5444
- * @default in_advance
5585
+ * @description Price of the usage-based item being sold.
5445
5586
  */
5446
- paymentTerm?: components['schemas']['PricePaymentTerm'];
5587
+ price?: components['schemas']['RateCardUsageBasedPrice'];
5447
5588
  /**
5448
5589
  * @deprecated
5449
- * @description Quantity of the item being sold.
5450
- */
5451
- quantity?: components['schemas']['Numeric'];
5452
- /** @description The rate card that is used for this line. */
5453
- rateCard?: components['schemas']['InvoiceFlatFeeRateCard'];
5454
- /**
5455
- * @description Category of the flat fee.
5456
- * @default regular
5457
- */
5458
- category?: components['schemas']['InvoiceFlatFeeCategory'];
5459
- /**
5460
- * @description The customer this line item belongs to.
5461
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
5462
- */
5463
- customerId: string;
5464
- };
5465
- /** @description InvoiceFlatFeeRateCard represents the rate card (intent) for a flat fee line. */
5466
- InvoiceFlatFeeRateCard: {
5467
- /**
5468
- * Tax config
5469
- * @description The tax config of the rate card.
5470
- * When undefined, the tax config of the feature or the default tax config of the plan is used.
5471
- */
5472
- taxConfig?: components['schemas']['TaxConfig'];
5473
- /**
5474
- * Price
5475
- * @description The price of the rate card.
5476
- * When null, the feature or service is free.
5477
- * @example {
5478
- * "type": "flat",
5479
- * "amount": "100",
5480
- * "paymentTerm": "in_arrears"
5481
- * }
5590
+ * @description The feature that the usage is based on.
5482
5591
  */
5483
- price: components['schemas']['FlatPriceWithPaymentTerm'] | null;
5484
- /** @description Quantity of the item being sold.
5592
+ featureKey?: string;
5593
+ /** @description The lines detailing the item or service sold. */
5594
+ readonly children?: components['schemas']['InvoiceDetailedLine'][];
5595
+ /** @description The rate card that is used for this line.
5485
5596
  *
5486
- * Default: 1 */
5487
- quantity?: components['schemas']['Numeric'];
5488
- /** @description The discounts that are applied to the line. */
5489
- discounts?: components['schemas']['BillingDiscounts'];
5490
- };
5491
- /**
5492
- * InvoiceGenericDocumentRef is used to describe an existing document or a specific part of it's contents.
5493
- * @description Omitted fields:
5494
- * period: Tax period in which the referred document had an effect required by some tax regimes and formats.
5495
- * stamps: Seals of approval from other organisations that may need to be listed.
5496
- * ext: Extensions for additional codes that may be required.
5497
- */
5498
- InvoiceGenericDocumentRef: {
5499
- /** @description Type of the document referenced. */
5500
- readonly type: components['schemas']['InvoiceDocumentRefType'];
5501
- /** @description Human readable description on why this reference is here or needs to be used. */
5502
- readonly reason?: string;
5503
- /** @description Additional details about the document. */
5504
- readonly description?: string;
5597
+ * The rate card captures the intent of the price and discounts for the usage-based item. */
5598
+ rateCard?: components['schemas']['InvoiceUsageBasedRateCard'];
5599
+ /** @description The quantity of the item being sold.
5600
+ *
5601
+ * Any usage discounts applied previously are deducted from this quantity. */
5602
+ readonly quantity?: components['schemas']['Numeric'];
5603
+ /** @description The quantity of the item that has been metered for the period before any discounts were applied. */
5604
+ readonly meteredQuantity?: components['schemas']['Numeric'];
5605
+ /** @description The quantity of the item used before this line's period.
5606
+ *
5607
+ * It is non-zero in case of progressive billing, when this shows how much of the usage was already billed.
5608
+ *
5609
+ * Any usage discounts applied previously are deducted from this quantity. */
5610
+ readonly preLinePeriodQuantity?: components['schemas']['Numeric'];
5611
+ /** @description The metered quantity of the item used in before this line's period without any discounts applied.
5612
+ *
5613
+ * It is non-zero in case of progressive billing, when this shows how much of the usage was already billed. */
5614
+ readonly meteredPreLinePeriodQuantity?: components['schemas']['Numeric'];
5505
5615
  };
5506
- /** @description BillingInvoiceLine represents a line item that is sold to the customer based on a specific (unit) price. */
5507
- InvoiceLine: components['schemas']['InvoiceUsageBasedLine'] | components['schemas']['InvoiceFlatFeeLine'];
5508
5616
  /** @description InvoiceLineAmountDiscount represents an amount deducted from the line, and will be applied before taxes. */
5509
5617
  InvoiceLineAmountDiscount: {
5510
5618
  /**
@@ -5568,8 +5676,60 @@ export interface components {
5568
5676
  * @enum {string}
5569
5677
  */
5570
5678
  InvoiceLineManagedBy: 'subscription' | 'system' | 'manual';
5571
- /** @description InvoiceLineReplaceUpdate represents the update model for an invoice line. */
5572
- InvoiceLineReplaceUpdate: components['schemas']['InvoiceUsageBasedLineReplaceUpdate'] | components['schemas']['InvoiceFlatFeeLineReplaceUpdate'];
5679
+ /** @description InvoiceLineReplaceUpdate represents the update model for an UBP invoice line.
5680
+ *
5681
+ * This type makes ID optional to allow for creating new lines as part of the update. */
5682
+ InvoiceLineReplaceUpdate: {
5683
+ /**
5684
+ * Display name
5685
+ * @description Human-readable name for the resource. Between 1 and 256 characters.
5686
+ */
5687
+ name: string;
5688
+ /**
5689
+ * Description
5690
+ * @description Optional description of the resource. Maximum 1024 characters.
5691
+ */
5692
+ description?: string;
5693
+ /**
5694
+ * Metadata
5695
+ * @description Additional metadata for the resource.
5696
+ */
5697
+ metadata?: components['schemas']['Metadata'] | null;
5698
+ /**
5699
+ * @deprecated
5700
+ * @description Tax config specify the tax configuration for this line.
5701
+ */
5702
+ taxConfig?: components['schemas']['TaxConfig'];
5703
+ /** @description Period of the line item applies to for revenue recognition pruposes.
5704
+ *
5705
+ * Billing always treats periods as start being inclusive and end being exclusive. */
5706
+ period: components['schemas']['Period'];
5707
+ /**
5708
+ * Format: date-time
5709
+ * @description The time this line item should be invoiced.
5710
+ * @example 2023-01-01T01:01:01.001Z
5711
+ */
5712
+ invoiceAt: Date;
5713
+ /**
5714
+ * @deprecated
5715
+ * @description Price of the usage-based item being sold.
5716
+ */
5717
+ price?: components['schemas']['RateCardUsageBasedPrice'];
5718
+ /**
5719
+ * @deprecated
5720
+ * @description The feature that the usage is based on.
5721
+ */
5722
+ featureKey?: string;
5723
+ /** @description The rate card that is used for this line.
5724
+ *
5725
+ * The rate card captures the intent of the price and discounts for the usage-based item. */
5726
+ rateCard?: components['schemas']['InvoiceUsageBasedRateCard'];
5727
+ /**
5728
+ * @description The ID of the line.
5729
+ * @example 01G65Z755AFWAKHE12NY0CQ9FH
5730
+ */
5731
+ id?: string;
5732
+ };
5573
5733
  /**
5574
5734
  * @description Line status specifies the status of the line.
5575
5735
  * @enum {string}
@@ -5668,7 +5828,7 @@ export interface components {
5668
5828
  * @description InvoiceOrderBy specifies the ordering options for invoice listing.
5669
5829
  * @enum {string}
5670
5830
  */
5671
- InvoiceOrderBy: 'customer.name' | 'issuedAt' | 'status' | 'createdAt' | 'updatedAt';
5831
+ InvoiceOrderBy: 'customer.name' | 'issuedAt' | 'status' | 'createdAt' | 'updatedAt' | 'periodStart';
5672
5832
  /** @description Paginated response */
5673
5833
  InvoicePaginatedResponse: {
5674
5834
  /**
@@ -5694,8 +5854,69 @@ export interface components {
5694
5854
  /** @description The terms of payment for the invoice. */
5695
5855
  terms?: components['schemas']['PaymentTerms'];
5696
5856
  };
5697
- /** @description InvoiceLineCreate represents the create model for an invoice line. */
5698
- InvoicePendingLineCreate: components['schemas']['InvoiceUsageBasedPendingLineCreate'] | components['schemas']['InvoiceFlatFeePendingLineCreate'];
5857
+ /** @description InvoicePendingLineCreate represents the create model for an invoice line that is sold to the customer based on usage. */
5858
+ InvoicePendingLineCreate: {
5859
+ /**
5860
+ * Display name
5861
+ * @description Human-readable name for the resource. Between 1 and 256 characters.
5862
+ */
5863
+ name: string;
5864
+ /**
5865
+ * Description
5866
+ * @description Optional description of the resource. Maximum 1024 characters.
5867
+ */
5868
+ description?: string;
5869
+ /**
5870
+ * Metadata
5871
+ * @description Additional metadata for the resource.
5872
+ */
5873
+ metadata?: components['schemas']['Metadata'] | null;
5874
+ /**
5875
+ * @deprecated
5876
+ * @description Tax config specify the tax configuration for this line.
5877
+ */
5878
+ taxConfig?: components['schemas']['TaxConfig'];
5879
+ /** @description Period of the line item applies to for revenue recognition pruposes.
5880
+ *
5881
+ * Billing always treats periods as start being inclusive and end being exclusive. */
5882
+ period: components['schemas']['Period'];
5883
+ /**
5884
+ * Format: date-time
5885
+ * @description The time this line item should be invoiced.
5886
+ * @example 2023-01-01T01:01:01.001Z
5887
+ */
5888
+ invoiceAt: Date;
5889
+ /**
5890
+ * @deprecated
5891
+ * @description Price of the usage-based item being sold.
5892
+ */
5893
+ price?: components['schemas']['RateCardUsageBasedPrice'];
5894
+ /**
5895
+ * @deprecated
5896
+ * @description The feature that the usage is based on.
5897
+ */
5898
+ featureKey?: string;
5899
+ /** @description The rate card that is used for this line.
5900
+ *
5901
+ * The rate card captures the intent of the price and discounts for the usage-based item. */
5902
+ rateCard?: components['schemas']['InvoiceUsageBasedRateCard'];
5903
+ };
5904
+ /** @description InvoicePendingLineCreate represents the create model for a pending invoice line. */
5905
+ InvoicePendingLineCreateInput: {
5906
+ /** @description The currency of the lines to be created. */
5907
+ currency: components['schemas']['CurrencyCode'];
5908
+ /** @description The lines to be created. */
5909
+ lines: components['schemas']['InvoicePendingLineCreate'][];
5910
+ };
5911
+ /** @description InvoicePendingLineCreateResponse represents the response from the create pending line endpoint. */
5912
+ InvoicePendingLineCreateResponse: {
5913
+ /** @description The lines that were created. */
5914
+ readonly lines: components['schemas']['InvoiceLine'][];
5915
+ /** @description The invoice containing the created lines. */
5916
+ readonly invoice: components['schemas']['Invoice'];
5917
+ /** @description Whether the invoice was newly created. */
5918
+ readonly isInvoiceNew: boolean;
5919
+ };
5699
5920
  /** @description InvoicePendingLinesActionFiltersInput specifies which lines to include in the invoice. */
5700
5921
  InvoicePendingLinesActionFiltersInput: {
5701
5922
  /** @description The pending line items to include in the invoice, if not provided:
@@ -5726,6 +5947,11 @@ export interface components {
5726
5947
  * @example 01G65Z755AFWAKHE12NY0CQ9FH
5727
5948
  */
5728
5949
  customerId: string;
5950
+ /** @description Override the progressive billing setting of the customer.
5951
+ *
5952
+ * Can be used to disable/enable progressive billing in case the business logic
5953
+ * requires it, if not provided the billing profile's progressive billing setting will be used. */
5954
+ progressiveBillingOverride?: boolean;
5729
5955
  };
5730
5956
  /** @description Reference to an invoice. */
5731
5957
  InvoiceReference: {
@@ -5749,16 +5975,6 @@ export interface components {
5749
5975
  * @description Additional metadata for the resource.
5750
5976
  */
5751
5977
  metadata?: components['schemas']['Metadata'] | null;
5752
- /**
5753
- * Format: date-time
5754
- * @description The time until the invoice is in draft status.
5755
- *
5756
- * On draft invoice creation it is calculated from the workflow settings.
5757
- *
5758
- * If manual approval is required, the draftUntil time is set.
5759
- * @example 2023-01-01T01:01:01.001Z
5760
- */
5761
- draftUntil?: Date;
5762
5978
  /** @description The supplier of the lines included in the invoice. */
5763
5979
  supplier: components['schemas']['BillingPartyReplaceUpdate'];
5764
5980
  /** @description The customer the invoice is sent to. */
@@ -5768,74 +5984,6 @@ export interface components {
5768
5984
  /** @description The workflow settings for the invoice. */
5769
5985
  workflow: components['schemas']['InvoiceWorkflowReplaceUpdate'];
5770
5986
  };
5771
- /** @description InvoiceSimulationFlatFeeLine represents a flat fee line item that can be input to the simulation endpoint. */
5772
- InvoiceSimulationFlatFeeLine: {
5773
- /**
5774
- * Display name
5775
- * @description Human-readable name for the resource. Between 1 and 256 characters.
5776
- */
5777
- name: string;
5778
- /**
5779
- * Description
5780
- * @description Optional description of the resource. Maximum 1024 characters.
5781
- */
5782
- description?: string;
5783
- /**
5784
- * Metadata
5785
- * @description Additional metadata for the resource.
5786
- */
5787
- metadata?: components['schemas']['Metadata'] | null;
5788
- /**
5789
- * @deprecated
5790
- * @description Tax config specify the tax configuration for this line.
5791
- */
5792
- taxConfig?: components['schemas']['TaxConfig'];
5793
- /** @description Period of the line item applies to for revenue recognition pruposes.
5794
- *
5795
- * Billing always treats periods as start being inclusive and end being exclusive. */
5796
- period: components['schemas']['Period'];
5797
- /**
5798
- * Format: date-time
5799
- * @description The time this line item should be invoiced.
5800
- * @example 2023-01-01T01:01:01.001Z
5801
- */
5802
- invoiceAt: Date;
5803
- /**
5804
- * @description Type of the line. (enum property replaced by openapi-typescript)
5805
- * @enum {string}
5806
- */
5807
- type: 'flat_fee';
5808
- /**
5809
- * @deprecated
5810
- * @description Price of the item being sold.
5811
- */
5812
- perUnitAmount?: components['schemas']['Numeric'];
5813
- /**
5814
- * @deprecated
5815
- * @description Payment term of the line.
5816
- * @default in_advance
5817
- */
5818
- paymentTerm?: components['schemas']['PricePaymentTerm'];
5819
- /**
5820
- * @deprecated
5821
- * @description Quantity of the item being sold.
5822
- */
5823
- quantity?: components['schemas']['Numeric'];
5824
- /** @description The rate card that is used for this line. */
5825
- rateCard?: components['schemas']['InvoiceFlatFeeRateCard'];
5826
- /**
5827
- * @description Category of the flat fee.
5828
- * @default regular
5829
- */
5830
- category?: components['schemas']['InvoiceFlatFeeCategory'];
5831
- /**
5832
- * @description ID of the line. If not specified it will be auto-generated.
5833
- *
5834
- * When discounts are specified, this must be provided, so that the discount can reference it.
5835
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
5836
- */
5837
- id?: string;
5838
- };
5839
5987
  /** @description InvoiceSimulationInput is the input for simulating an invoice. */
5840
5988
  InvoiceSimulationInput: {
5841
5989
  /** @description The number of the invoice. */
@@ -5847,10 +5995,8 @@ export interface components {
5847
5995
  /** @description Lines to be included in the generated invoice. */
5848
5996
  lines: components['schemas']['InvoiceSimulationLine'][];
5849
5997
  };
5850
- /** @description InvoiceSimulationInput represents a line item that can be input to the simulation endpoint. */
5851
- InvoiceSimulationLine: components['schemas']['InvoiceSimulationUsageBasedLine'] | components['schemas']['InvoiceSimulationFlatFeeLine'];
5852
- /** @description InvoiceSimulationUsageBasedLine represents a usage-based line item that can be input to the simulation endpoint. */
5853
- InvoiceSimulationUsageBasedLine: {
5998
+ /** @description InvoiceSimulationLine represents a usage-based line item that can be input to the simulation endpoint. */
5999
+ InvoiceSimulationLine: {
5854
6000
  /**
5855
6001
  * Display name
5856
6002
  * @description Human-readable name for the resource. Between 1 and 256 characters.
@@ -5881,11 +6027,6 @@ export interface components {
5881
6027
  * @example 2023-01-01T01:01:01.001Z
5882
6028
  */
5883
6029
  invoiceAt: Date;
5884
- /**
5885
- * @description Type of the line. (enum property replaced by openapi-typescript)
5886
- * @enum {string}
5887
- */
5888
- type: 'usage_based';
5889
6030
  /**
5890
6031
  * @deprecated
5891
6032
  * @description Price of the usage-based item being sold.
@@ -5955,135 +6096,225 @@ export interface components {
5955
6096
  * @enum {string}
5956
6097
  */
5957
6098
  InvoiceType: 'standard' | 'credit_note';
5958
- /** @description InvoiceUsageBasedLine represents a line item that is sold to the customer based on usage. */
5959
- InvoiceUsageBasedLine: {
5960
- /**
5961
- * Display name
5962
- * @description Human-readable name for the resource. Between 1 and 256 characters.
5963
- */
5964
- name: string;
6099
+ /** @description InvoiceUsageBasedRateCard represents the rate card (intent) for an usage-based line. */
6100
+ InvoiceUsageBasedRateCard: {
5965
6101
  /**
5966
- * Description
5967
- * @description Optional description of the resource. Maximum 1024 characters.
6102
+ * Feature key
6103
+ * @description The feature the customer is entitled to use.
5968
6104
  */
5969
- description?: string;
6105
+ featureKey?: string;
5970
6106
  /**
5971
- * Metadata
5972
- * @description Additional metadata for the resource.
6107
+ * Tax config
6108
+ * @description The tax config of the rate card.
6109
+ * When undefined, the tax config of the feature or the default tax config of the plan is used.
5973
6110
  */
5974
- metadata?: components['schemas']['Metadata'] | null;
6111
+ taxConfig?: components['schemas']['TaxConfig'];
6112
+ /** @description The price of the rate card.
6113
+ * When null, the feature or service is free. */
6114
+ price: components['schemas']['RateCardUsageBasedPrice'] | null;
6115
+ /** @description The discounts that are applied to the line. */
6116
+ discounts?: components['schemas']['BillingDiscounts'];
6117
+ };
6118
+ /** @description InvoiceWorkflowInvoicingSettingsReplaceUpdate represents the update model for the invoicing settings of an invoice workflow. */
6119
+ InvoiceWorkflowInvoicingSettingsReplaceUpdate: {
5975
6120
  /**
5976
- * Creation Time
5977
- * Format: date-time
5978
- * @description Timestamp of when the resource was created.
5979
- * @example 2024-01-01T01:01:01.001Z
6121
+ * @description Whether to automatically issue the invoice after the draftPeriod has passed.
6122
+ * @default true
5980
6123
  */
5981
- readonly createdAt: Date;
6124
+ autoAdvance?: boolean;
5982
6125
  /**
5983
- * Last Update Time
5984
- * Format: date-time
5985
- * @description Timestamp of when the resource was last updated.
5986
- * @example 2024-01-01T01:01:01.001Z
6126
+ * Format: ISO8601
6127
+ * @description The period for the invoice to be kept in draft status for manual reviews.
6128
+ * @default P0D
6129
+ * @example P1D
5987
6130
  */
5988
- readonly updatedAt: Date;
6131
+ draftPeriod?: string;
5989
6132
  /**
5990
- * Deletion Time
5991
- * Format: date-time
5992
- * @description Timestamp of when the resource was permanently deleted.
5993
- * @example 2024-01-01T01:01:01.001Z
6133
+ * Format: ISO8601
6134
+ * @description The period after which the invoice is due.
6135
+ * With some payment solutions it's only applicable for manual collection method.
6136
+ * @default P30D
6137
+ * @example P30D
5994
6138
  */
5995
- readonly deletedAt?: Date;
6139
+ dueAfter?: string;
6140
+ /** @description Default tax configuration to apply to the invoices. */
6141
+ defaultTaxConfig?: components['schemas']['TaxConfig'];
6142
+ };
6143
+ /** @description InvoiceWorkflowReplaceUpdate represents the update model for an invoice workflow.
6144
+ *
6145
+ * Fields that are immutable a re removed from the model. This is based on InvoiceWorkflowSettings. */
6146
+ InvoiceWorkflowReplaceUpdate: {
6147
+ /** @description The workflow used for this invoice. */
6148
+ workflow: components['schemas']['InvoiceWorkflowSettingsReplaceUpdate'];
6149
+ };
6150
+ /** @description InvoiceWorkflowSettings represents the workflow settings used by the invoice.
6151
+ *
6152
+ * This is a clone of the billing profile's workflow settings at the time of invoice creation
6153
+ * with customer overrides considered. */
6154
+ InvoiceWorkflowSettings: {
6155
+ /** @description The apps that will be used to orchestrate the invoice's workflow. */
6156
+ readonly apps?: components['schemas']['BillingProfileAppsOrReference'];
5996
6157
  /**
5997
- * @description ID of the line.
6158
+ * @description sourceBillingProfileID is the billing profile on which the workflow was based on.
6159
+ *
6160
+ * The profile is snapshotted on invoice creation, after which it can be altered independently
6161
+ * of the profile itself.
5998
6162
  * @example 01G65Z755AFWAKHE12NY0CQ9FH
5999
6163
  */
6000
- id: string;
6001
- /** @description managedBy specifies if the line is manually added via the api or managed by OpenMeter. */
6002
- readonly managedBy: components['schemas']['InvoiceLineManagedBy'];
6003
- /** @description Status of the line.
6004
- *
6005
- * External calls always create valid lines, other line types are managed by the
6006
- * billing engine of OpenMeter. */
6007
- readonly status: components['schemas']['InvoiceLineStatus'];
6008
- /** @description Discounts detailes applied to this line.
6164
+ readonly sourceBillingProfileId: string;
6165
+ /** @description The workflow details used by this invoice. */
6166
+ workflow: components['schemas']['BillingWorkflow'];
6167
+ };
6168
+ /** @description Mutable workflow settings for an invoice.
6169
+ *
6170
+ * Other fields on the invoice's workflow are not mutable, they serve as a history of the invoice's workflow
6171
+ * at creation time. */
6172
+ InvoiceWorkflowSettingsReplaceUpdate: {
6173
+ /** @description The invoicing settings for this workflow */
6174
+ invoicing: components['schemas']['InvoiceWorkflowInvoicingSettingsReplaceUpdate'];
6175
+ /** @description The payment settings for this workflow */
6176
+ payment: components['schemas']['BillingWorkflowPaymentSettings'];
6177
+ };
6178
+ /** @description List entitlements result */
6179
+ ListEntitlementsResult: components['schemas']['Entitlement'][] | components['schemas']['EntitlementPaginatedResponse'];
6180
+ /** @description List features result */
6181
+ ListFeaturesResult: components['schemas']['Feature'][] | components['schemas']['FeaturePaginatedResponse'];
6182
+ /** @description Marketplace install request payload. */
6183
+ MarketplaceInstallRequestPayload: {
6184
+ /** @description Name of the application to install.
6009
6185
  *
6010
- * New discounts can be added via the invoice's discounts API, to facilitate
6011
- * discounts that are affecting multiple lines. */
6012
- readonly discounts?: components['schemas']['InvoiceLineDiscounts'];
6013
- /** @description The invoice this item belongs to. */
6014
- invoice?: components['schemas']['InvoiceReference'];
6015
- /** @description The currency of this line. */
6016
- currency: components['schemas']['CurrencyCode'];
6017
- /** @description Taxes applied to the invoice totals. */
6018
- readonly taxes?: components['schemas']['InvoiceLineTaxItem'][];
6186
+ * If name is not provided defaults to the marketplace listing's name. */
6187
+ name?: string;
6019
6188
  /**
6020
- * @deprecated
6021
- * @description Tax config specify the tax configuration for this line.
6189
+ * @description If true, a billing profile will be created for the app.
6190
+ * The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.
6191
+ * @default true
6022
6192
  */
6023
- taxConfig?: components['schemas']['TaxConfig'];
6024
- /** @description The lines detailing the item or service sold. */
6025
- readonly children?: components['schemas']['InvoiceLine'][];
6026
- /** @description Totals for this line. */
6027
- readonly totals: components['schemas']['InvoiceTotals'];
6028
- /** @description Period of the line item applies to for revenue recognition pruposes.
6193
+ createBillingProfile?: boolean;
6194
+ };
6195
+ /** @description Marketplace install response. */
6196
+ MarketplaceInstallResponse: {
6197
+ app: components['schemas']['App'];
6198
+ /** @description Default for capabilities */
6199
+ defaultForCapabilityTypes: components['schemas']['AppCapabilityType'][];
6200
+ };
6201
+ /**
6202
+ * @description A marketplace listing.
6203
+ * Represent an available app in the app marketplace that can be installed to the organization.
6204
+ *
6205
+ * Marketplace apps only exist in config so they don't extend the Resource model.
6206
+ * @example {
6207
+ * "type": "stripe",
6208
+ * "name": "Stripe",
6209
+ * "description": "Stripe interation allows you to collect payments with Stripe.",
6210
+ * "capabilities": [
6211
+ * {
6212
+ * "type": "calculateTax",
6213
+ * "key": "stripe_calculate_tax",
6214
+ * "name": "Calculate Tax",
6215
+ * "description": "Stripe Tax calculates tax portion of the invoices."
6216
+ * },
6217
+ * {
6218
+ * "type": "invoiceCustomers",
6219
+ * "key": "stripe_invoice_customers",
6220
+ * "name": "Invoice Customers",
6221
+ * "description": "Stripe invoices customers with due amount."
6222
+ * },
6223
+ * {
6224
+ * "type": "collectPayments",
6225
+ * "key": "stripe_collect_payments",
6226
+ * "name": "Collect Payments",
6227
+ * "description": "Stripe payments collects outstanding revenue with Stripe customer's default payment method."
6228
+ * }
6229
+ * ],
6230
+ * "installMethods": [
6231
+ * "with_oauth2",
6232
+ * "with_api_key"
6233
+ * ]
6234
+ * }
6235
+ */
6236
+ MarketplaceListing: {
6237
+ /** @description The app's type */
6238
+ type: components['schemas']['AppType'];
6239
+ /** @description The app's name. */
6240
+ name: string;
6241
+ /** @description The app's description. */
6242
+ description: string;
6243
+ /** @description The app's capabilities. */
6244
+ capabilities: components['schemas']['AppCapability'][];
6245
+ /** @description Install methods.
6029
6246
  *
6030
- * Billing always treats periods as start being inclusive and end being exclusive. */
6031
- period: components['schemas']['Period'];
6247
+ * List of methods to install the app. */
6248
+ installMethods: components['schemas']['InstallMethod'][];
6249
+ };
6250
+ /** @description Paginated response */
6251
+ MarketplaceListingPaginatedResponse: {
6032
6252
  /**
6033
- * Format: date-time
6034
- * @description The time this line item should be invoiced.
6035
- * @example 2023-01-01T01:01:01.001Z
6253
+ * @description The total number of items.
6254
+ * @example 500
6036
6255
  */
6037
- invoiceAt: Date;
6038
- /** @description External IDs of the invoice in other apps such as Stripe. */
6039
- readonly externalIds?: components['schemas']['InvoiceLineAppExternalIds'];
6040
- /** @description Subscription are the references to the subscritpions that this line is related to. */
6041
- readonly subscription?: components['schemas']['InvoiceLineSubscriptionReference'];
6042
- /**
6043
- * @description Type of the line. (enum property replaced by openapi-typescript)
6044
- * @enum {string}
6045
- */
6046
- type: 'usage_based';
6256
+ totalCount: number;
6047
6257
  /**
6048
- * @deprecated
6049
- * @description Price of the usage-based item being sold.
6258
+ * @description The page index.
6259
+ * @example 1
6050
6260
  */
6051
- price?: components['schemas']['RateCardUsageBasedPrice'];
6261
+ page: number;
6052
6262
  /**
6053
- * @deprecated
6054
- * @description The feature that the usage is based on.
6263
+ * @description The maximum number of items per page.
6264
+ * @example 100
6055
6265
  */
6056
- featureKey?: string;
6057
- /** @description The rate card that is used for this line.
6058
- *
6059
- * The rate card captures the intent of the price and discounts for the usage-based item. */
6060
- rateCard?: components['schemas']['InvoiceUsageBasedRateCard'];
6061
- /** @description The quantity of the item being sold.
6062
- *
6063
- * Any usage discounts applied previously are deducted from this quantity. */
6064
- readonly quantity?: components['schemas']['Numeric'];
6065
- /** @description The quantity of the item that has been metered for the period before any discounts were applied. */
6066
- readonly meteredQuantity?: components['schemas']['Numeric'];
6067
- /** @description The quantity of the item used before this line's period.
6068
- *
6069
- * It is non-zero in case of progressive billing, when this shows how much of the usage was already billed.
6070
- *
6071
- * Any usage discounts applied previously are deducted from this quantity. */
6072
- readonly preLinePeriodQuantity?: components['schemas']['Numeric'];
6073
- /** @description The metered quantity of the item used in before this line's period without any discounts applied.
6074
- *
6075
- * It is non-zero in case of progressive billing, when this shows how much of the usage was already billed. */
6076
- readonly meteredPreLinePeriodQuantity?: components['schemas']['Numeric'];
6266
+ pageSize: number;
6267
+ /** @description The items in the current page. */
6268
+ items: components['schemas']['MarketplaceListing'][];
6077
6269
  };
6078
- /** @description InvoiceUpdateUsageBasedLineReplaceUpdate represents the update model for an UBP invoice line.
6079
- *
6080
- * This type makes ID optional to allow for creating new lines as part of the update. */
6081
- InvoiceUsageBasedLineReplaceUpdate: {
6270
+ /** @description Measure usage from */
6271
+ MeasureUsageFrom: components['schemas']['MeasureUsageFromPreset'] | components['schemas']['MeasureUsageFromTime'];
6272
+ /**
6273
+ * @description Start of measurement options
6274
+ * @enum {string}
6275
+ */
6276
+ MeasureUsageFromPreset: 'CURRENT_PERIOD_START' | 'NOW';
6277
+ /**
6278
+ * Format: date-time
6279
+ * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
6280
+ * @example 2023-01-01T01:01:01.001Z
6281
+ */
6282
+ MeasureUsageFromTime: Date;
6283
+ /**
6284
+ * @description Set of key-value pairs.
6285
+ * Metadata can be used to store additional information about a resource.
6286
+ * @example {
6287
+ * "externalId": "019142cc-a016-796a-8113-1a942fecd26d"
6288
+ * }
6289
+ */
6290
+ Metadata: {
6291
+ [key: string]: string;
6292
+ };
6293
+ /**
6294
+ * @description A meter is a configuration that defines how to match and aggregate events.
6295
+ * @example {
6296
+ * "id": "01G65Z755AFWAKHE12NY0CQ9FH",
6297
+ * "slug": "tokens_total",
6298
+ * "name": "Tokens Total",
6299
+ * "description": "AI Token Usage",
6300
+ * "aggregation": "SUM",
6301
+ * "eventType": "prompt",
6302
+ * "valueProperty": "$.tokens",
6303
+ * "groupBy": {
6304
+ * "model": "$.model",
6305
+ * "type": "$.type"
6306
+ * },
6307
+ * "createdAt": "2024-01-01T01:01:01.001Z",
6308
+ * "updatedAt": "2024-01-01T01:01:01.001Z"
6309
+ * }
6310
+ */
6311
+ Meter: {
6082
6312
  /**
6083
- * Display name
6084
- * @description Human-readable name for the resource. Between 1 and 256 characters.
6313
+ * ID
6314
+ * @description A unique identifier for the resource.
6315
+ * @example 01G65Z755AFWAKHE12NY0CQ9FH
6085
6316
  */
6086
- name: string;
6317
+ readonly id: string;
6087
6318
  /**
6088
6319
  * Description
6089
6320
  * @description Optional description of the resource. Maximum 1024 characters.
@@ -6095,52 +6326,98 @@ export interface components {
6095
6326
  */
6096
6327
  metadata?: components['schemas']['Metadata'] | null;
6097
6328
  /**
6098
- * @deprecated
6099
- * @description Tax config specify the tax configuration for this line.
6329
+ * Creation Time
6330
+ * Format: date-time
6331
+ * @description Timestamp of when the resource was created.
6332
+ * @example 2024-01-01T01:01:01.001Z
6100
6333
  */
6101
- taxConfig?: components['schemas']['TaxConfig'];
6102
- /** @description Period of the line item applies to for revenue recognition pruposes.
6103
- *
6104
- * Billing always treats periods as start being inclusive and end being exclusive. */
6105
- period: components['schemas']['Period'];
6334
+ readonly createdAt: Date;
6106
6335
  /**
6336
+ * Last Update Time
6107
6337
  * Format: date-time
6108
- * @description The time this line item should be invoiced.
6109
- * @example 2023-01-01T01:01:01.001Z
6338
+ * @description Timestamp of when the resource was last updated.
6339
+ * @example 2024-01-01T01:01:01.001Z
6110
6340
  */
6111
- invoiceAt: Date;
6341
+ readonly updatedAt: Date;
6112
6342
  /**
6113
- * @description Type of the line. (enum property replaced by openapi-typescript)
6114
- * @enum {string}
6343
+ * Deletion Time
6344
+ * Format: date-time
6345
+ * @description Timestamp of when the resource was permanently deleted.
6346
+ * @example 2024-01-01T01:01:01.001Z
6115
6347
  */
6116
- type: 'usage_based';
6348
+ readonly deletedAt?: Date;
6117
6349
  /**
6118
- * @deprecated
6119
- * @description Price of the usage-based item being sold.
6350
+ * Display name
6351
+ * @description Human-readable name for the resource. Between 1 and 256 characters.
6352
+ * Defaults to the slug if not specified.
6120
6353
  */
6121
- price?: components['schemas']['RateCardUsageBasedPrice'];
6354
+ name?: string;
6122
6355
  /**
6123
- * @deprecated
6124
- * @description The feature that the usage is based on.
6356
+ * @description A unique, human-readable identifier for the meter.
6357
+ * Must consist only alphanumeric and underscore characters.
6358
+ * @example tokens_total
6125
6359
  */
6126
- featureKey?: string;
6127
- /** @description The rate card that is used for this line.
6128
- *
6129
- * The rate card captures the intent of the price and discounts for the usage-based item. */
6130
- rateCard?: components['schemas']['InvoiceUsageBasedRateCard'];
6360
+ slug: string;
6131
6361
  /**
6132
- * @description The ID of the line.
6133
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
6362
+ * @description The aggregation type to use for the meter.
6363
+ * @example SUM
6134
6364
  */
6135
- id?: string;
6136
- };
6137
- /** @description InvoiceUsageBasedLineCreateWithCustomer represents the create model for an invoice line that is sold to the customer based on usage. */
6138
- InvoiceUsageBasedPendingLineCreate: {
6365
+ aggregation: components['schemas']['MeterAggregation'];
6139
6366
  /**
6140
- * Display name
6141
- * @description Human-readable name for the resource. Between 1 and 256 characters.
6367
+ * @description The event type to aggregate.
6368
+ * @example prompt
6142
6369
  */
6143
- name: string;
6370
+ eventType: string;
6371
+ /**
6372
+ * Format: date-time
6373
+ * @description The date since the meter should include events.
6374
+ * Useful to skip old events.
6375
+ * If not specified, all historical events are included.
6376
+ * @example 2023-01-01T01:01:01.001Z
6377
+ */
6378
+ eventFrom?: Date;
6379
+ /**
6380
+ * @description JSONPath expression to extract the value from the ingested event's data property.
6381
+ *
6382
+ * The ingested value for SUM, AVG, MIN, and MAX aggregations is a number or a string that can be parsed to a number.
6383
+ *
6384
+ * For UNIQUE_COUNT aggregation, the ingested value must be a string. For COUNT aggregation the valueProperty is ignored.
6385
+ * @example $.tokens
6386
+ */
6387
+ valueProperty?: string;
6388
+ /**
6389
+ * @description Named JSONPath expressions to extract the group by values from the event data.
6390
+ *
6391
+ * Keys must be unique and consist only alphanumeric and underscore characters.
6392
+ * @example {
6393
+ * "type": "$.type"
6394
+ * }
6395
+ */
6396
+ groupBy?: {
6397
+ [key: string]: string;
6398
+ };
6399
+ };
6400
+ /**
6401
+ * @description The aggregation type to use for the meter.
6402
+ * @enum {string}
6403
+ */
6404
+ MeterAggregation: 'SUM' | 'COUNT' | 'UNIQUE_COUNT' | 'AVG' | 'MIN' | 'MAX' | 'LATEST';
6405
+ /**
6406
+ * @description A meter create model.
6407
+ * @example {
6408
+ * "slug": "tokens_total",
6409
+ * "name": "Tokens Total",
6410
+ * "description": "AI Token Usage",
6411
+ * "aggregation": "SUM",
6412
+ * "eventType": "prompt",
6413
+ * "valueProperty": "$.tokens",
6414
+ * "groupBy": {
6415
+ * "model": "$.model",
6416
+ * "type": "$.type"
6417
+ * }
6418
+ * }
6419
+ */
6420
+ MeterCreate: {
6144
6421
  /**
6145
6422
  * Description
6146
6423
  * @description Optional description of the resource. Maximum 1024 characters.
@@ -6151,253 +6428,227 @@ export interface components {
6151
6428
  * @description Additional metadata for the resource.
6152
6429
  */
6153
6430
  metadata?: components['schemas']['Metadata'] | null;
6154
- /** @description The currency of this line. */
6155
- currency: components['schemas']['CurrencyCode'];
6156
6431
  /**
6157
- * @deprecated
6158
- * @description Tax config specify the tax configuration for this line.
6432
+ * Display name
6433
+ * @description Human-readable name for the resource. Between 1 and 256 characters.
6434
+ * Defaults to the slug if not specified.
6159
6435
  */
6160
- taxConfig?: components['schemas']['TaxConfig'];
6161
- /** @description Period of the line item applies to for revenue recognition pruposes.
6162
- *
6163
- * Billing always treats periods as start being inclusive and end being exclusive. */
6164
- period: components['schemas']['Period'];
6436
+ name?: string;
6165
6437
  /**
6166
- * Format: date-time
6167
- * @description The time this line item should be invoiced.
6168
- * @example 2023-01-01T01:01:01.001Z
6438
+ * @description A unique, human-readable identifier for the meter.
6439
+ * Must consist only alphanumeric and underscore characters.
6440
+ * @example tokens_total
6169
6441
  */
6170
- invoiceAt: Date;
6442
+ slug: string;
6171
6443
  /**
6172
- * @description Type of the line. (enum property replaced by openapi-typescript)
6173
- * @enum {string}
6444
+ * @description The aggregation type to use for the meter.
6445
+ * @example SUM
6174
6446
  */
6175
- type: 'usage_based';
6447
+ aggregation: components['schemas']['MeterAggregation'];
6176
6448
  /**
6177
- * @deprecated
6178
- * @description Price of the usage-based item being sold.
6449
+ * @description The event type to aggregate.
6450
+ * @example prompt
6179
6451
  */
6180
- price?: components['schemas']['RateCardUsageBasedPrice'];
6452
+ eventType: string;
6181
6453
  /**
6182
- * @deprecated
6183
- * @description The feature that the usage is based on.
6454
+ * Format: date-time
6455
+ * @description The date since the meter should include events.
6456
+ * Useful to skip old events.
6457
+ * If not specified, all historical events are included.
6458
+ * @example 2023-01-01T01:01:01.001Z
6184
6459
  */
6185
- featureKey?: string;
6186
- /** @description The rate card that is used for this line.
6187
- *
6188
- * The rate card captures the intent of the price and discounts for the usage-based item. */
6189
- rateCard?: components['schemas']['InvoiceUsageBasedRateCard'];
6460
+ eventFrom?: Date;
6190
6461
  /**
6191
- * @description The customer this line item belongs to.
6192
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
6462
+ * @description JSONPath expression to extract the value from the ingested event's data property.
6463
+ *
6464
+ * The ingested value for SUM, AVG, MIN, and MAX aggregations is a number or a string that can be parsed to a number.
6465
+ *
6466
+ * For UNIQUE_COUNT aggregation, the ingested value must be a string. For COUNT aggregation the valueProperty is ignored.
6467
+ * @example $.tokens
6193
6468
  */
6194
- customerId: string;
6195
- };
6196
- /** @description InvoiceUsageBasedRateCard represents the rate card (intent) for an usage-based line. */
6197
- InvoiceUsageBasedRateCard: {
6469
+ valueProperty?: string;
6198
6470
  /**
6199
- * Feature key
6200
- * @description The feature the customer is entitled to use.
6471
+ * @description Named JSONPath expressions to extract the group by values from the event data.
6472
+ *
6473
+ * Keys must be unique and consist only alphanumeric and underscore characters.
6474
+ * @example {
6475
+ * "type": "$.type"
6476
+ * }
6201
6477
  */
6202
- featureKey?: string;
6478
+ groupBy?: {
6479
+ [key: string]: string;
6480
+ };
6481
+ };
6482
+ /**
6483
+ * @description Order by options for meters.
6484
+ * @enum {string}
6485
+ */
6486
+ MeterOrderBy: 'key' | 'name' | 'aggregation' | 'createdAt' | 'updatedAt';
6487
+ /** @description A meter query request. */
6488
+ MeterQueryRequest: {
6203
6489
  /**
6204
- * Tax config
6205
- * @description The tax config of the rate card.
6206
- * When undefined, the tax config of the feature or the default tax config of the plan is used.
6490
+ * @description Client ID
6491
+ * Useful to track progress of a query.
6492
+ * @example f74e58ed-94ce-4041-ae06-cf45420451a3
6207
6493
  */
6208
- taxConfig?: components['schemas']['TaxConfig'];
6209
- /** @description The price of the rate card.
6210
- * When null, the feature or service is free. */
6211
- price: components['schemas']['RateCardUsageBasedPrice'] | null;
6212
- /** @description The discounts that are applied to the line. */
6213
- discounts?: components['schemas']['BillingDiscounts'];
6214
- };
6215
- /** @description InvoiceWorkflowInvoicingSettingsReplaceUpdate represents the update model for the invoicing settings of an invoice workflow. */
6216
- InvoiceWorkflowInvoicingSettingsReplaceUpdate: {
6494
+ clientId?: string;
6217
6495
  /**
6218
- * @description Whether to automatically issue the invoice after the draftPeriod has passed.
6219
- * @default true
6496
+ * Format: date-time
6497
+ * @description Start date-time in RFC 3339 format.
6498
+ *
6499
+ * Inclusive.
6500
+ * @example 2023-01-01T01:01:01.001Z
6220
6501
  */
6221
- autoAdvance?: boolean;
6502
+ from?: Date;
6222
6503
  /**
6223
- * Format: ISO8601
6224
- * @description The period for the invoice to be kept in draft status for manual reviews.
6225
- * @default P0D
6226
- * @example P1D
6504
+ * Format: date-time
6505
+ * @description End date-time in RFC 3339 format.
6506
+ *
6507
+ * Inclusive.
6508
+ * @example 2023-01-01T01:01:01.001Z
6227
6509
  */
6228
- draftPeriod?: string;
6510
+ to?: Date;
6229
6511
  /**
6230
- * Format: ISO8601
6231
- * @description The period after which the invoice is due.
6232
- * @default P1W
6233
- * @example P1D
6512
+ * @description If not specified, a single usage aggregate will be returned for the entirety of the specified period for each subject and group.
6513
+ * @example DAY
6234
6514
  */
6235
- dueAfter?: string;
6236
- /** @description Default tax configuration to apply to the invoices. */
6237
- defaultTaxConfig?: components['schemas']['TaxConfig'];
6238
- };
6239
- /** @description InvoiceWorkflowReplaceUpdate represents the update model for an invoice workflow.
6240
- *
6241
- * Fields that are immutable a re removed from the model. This is based on InvoiceWorkflowSettings. */
6242
- InvoiceWorkflowReplaceUpdate: {
6243
- /** @description The workflow used for this invoice. */
6244
- workflow: components['schemas']['InvoiceWorkflowSettingsReplaceUpdate'];
6245
- };
6246
- /** @description InvoiceWorkflowSettings represents the workflow settings used by the invoice.
6247
- *
6248
- * This is a clone of the billing profile's workflow settings at the time of invoice creation
6249
- * with customer overrides considered. */
6250
- InvoiceWorkflowSettings: {
6251
- /** @description The apps that will be used to orchestrate the invoice's workflow. */
6252
- readonly apps?: components['schemas']['BillingProfileAppsOrReference'];
6515
+ windowSize?: components['schemas']['WindowSize'];
6253
6516
  /**
6254
- * @description sourceBillingProfileID is the billing profile on which the workflow was based on.
6255
- *
6256
- * The profile is snapshotted on invoice creation, after which it can be altered independently
6257
- * of the profile itself.
6258
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
6517
+ * @description The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones).
6518
+ * If not specified, the UTC timezone will be used.
6519
+ * @default UTC
6520
+ * @example UTC
6259
6521
  */
6260
- readonly sourceBillingProfileId: string;
6261
- /** @description The workflow details used by this invoice. */
6262
- workflow: components['schemas']['BillingWorkflow'];
6263
- };
6264
- /** @description Mutable workflow settings for an invoice.
6265
- *
6266
- * Other fields on the invoice's workflow are not mutable, they serve as a history of the invoice's workflow
6267
- * at creation time. */
6268
- InvoiceWorkflowSettingsReplaceUpdate: {
6269
- /** @description The invoicing settings for this workflow */
6270
- invoicing: components['schemas']['InvoiceWorkflowInvoicingSettingsReplaceUpdate'];
6271
- /** @description The payment settings for this workflow */
6272
- payment: components['schemas']['BillingWorkflowPaymentSettings'];
6273
- };
6274
- /** @description List entitlements result */
6275
- ListEntitlementsResult: components['schemas']['Entitlement'][] | components['schemas']['EntitlementPaginatedResponse'];
6276
- /** @description List features result */
6277
- ListFeaturesResult: components['schemas']['Feature'][] | components['schemas']['FeaturePaginatedResponse'];
6278
- /** @description Marketplace install response. */
6279
- MarketplaceInstallResponse: {
6280
- app: components['schemas']['App'];
6281
- /** @description Default for capabilities */
6282
- defaultForCapabilityTypes: components['schemas']['AppCapabilityType'][];
6522
+ windowTimeZone?: string;
6523
+ /**
6524
+ * @description Filtering by multiple subjects.
6525
+ * @example [
6526
+ * "customer-1",
6527
+ * "customer-2"
6528
+ * ]
6529
+ */
6530
+ subject?: string[];
6531
+ /**
6532
+ * @description Simple filter for group bys with exact match.
6533
+ * @example {
6534
+ * "model": [
6535
+ * "gpt-4-turbo",
6536
+ * "gpt-4o"
6537
+ * ],
6538
+ * "type": [
6539
+ * "prompt"
6540
+ * ]
6541
+ * }
6542
+ */
6543
+ filterGroupBy?: {
6544
+ [key: string]: string[];
6545
+ };
6546
+ /**
6547
+ * @description If not specified a single aggregate will be returned for each subject and time window.
6548
+ * `subject` is a reserved group by value.
6549
+ * @example [
6550
+ * "model",
6551
+ * "type"
6552
+ * ]
6553
+ */
6554
+ groupBy?: string[];
6283
6555
  };
6284
6556
  /**
6285
- * @description A marketplace listing.
6286
- * Represent an available app in the app marketplace that can be installed to the organization.
6287
- *
6288
- * Marketplace apps only exist in config so they don't extend the Resource model.
6557
+ * @description The result of a meter query.
6289
6558
  * @example {
6290
- * "type": "stripe",
6291
- * "name": "Stripe",
6292
- * "description": "Stripe interation allows you to collect payments with Stripe.",
6293
- * "capabilities": [
6294
- * {
6295
- * "type": "calculateTax",
6296
- * "key": "stripe_calculate_tax",
6297
- * "name": "Calculate Tax",
6298
- * "description": "Stripe Tax calculates tax portion of the invoices."
6299
- * },
6300
- * {
6301
- * "type": "invoiceCustomers",
6302
- * "key": "stripe_invoice_customers",
6303
- * "name": "Invoice Customers",
6304
- * "description": "Stripe invoices customers with due amount."
6305
- * },
6559
+ * "from": "2023-01-01T00:00:00Z",
6560
+ * "to": "2023-01-02T00:00:00Z",
6561
+ * "windowSize": "DAY",
6562
+ * "data": [
6306
6563
  * {
6307
- * "type": "collectPayments",
6308
- * "key": "stripe_collect_payments",
6309
- * "name": "Collect Payments",
6310
- * "description": "Stripe payments collects outstanding revenue with Stripe customer's default payment method."
6564
+ * "value": 12,
6565
+ * "windowStart": "2023-01-01T00:00:00Z",
6566
+ * "windowEnd": "2023-01-02T00:00:00Z",
6567
+ * "subject": "customer-1",
6568
+ * "groupBy": {
6569
+ * "model": "gpt-4-turbo",
6570
+ * "type": "prompt"
6571
+ * }
6311
6572
  * }
6312
- * ],
6313
- * "installMethods": [
6314
- * "with_oauth2",
6315
- * "with_api_key"
6316
6573
  * ]
6317
6574
  * }
6318
6575
  */
6319
- MarketplaceListing: {
6320
- /** @description The app's type */
6321
- type: components['schemas']['AppType'];
6322
- /** @description The app's name. */
6323
- name: string;
6324
- /** @description The app's description. */
6325
- description: string;
6326
- /** @description The app's capabilities. */
6327
- capabilities: components['schemas']['AppCapability'][];
6328
- /** @description Install methods.
6329
- *
6330
- * List of methods to install the app. */
6331
- installMethods: components['schemas']['InstallMethod'][];
6332
- };
6333
- /** @description Paginated response */
6334
- MarketplaceListingPaginatedResponse: {
6335
- /**
6336
- * @description The total number of items.
6337
- * @example 500
6338
- */
6339
- totalCount: number;
6576
+ MeterQueryResult: {
6340
6577
  /**
6341
- * @description The page index.
6342
- * @example 1
6578
+ * Format: date-time
6579
+ * @description The start of the period the usage is queried from.
6580
+ * If not specified, the usage is queried from the beginning of time.
6581
+ * @example 2023-01-01T01:01:01.001Z
6343
6582
  */
6344
- page: number;
6583
+ from?: Date;
6345
6584
  /**
6346
- * @description The maximum number of items per page.
6347
- * @example 100
6585
+ * Format: date-time
6586
+ * @description The end of the period the usage is queried to.
6587
+ * If not specified, the usage is queried up to the current time.
6588
+ * @example 2023-01-01T01:01:01.001Z
6348
6589
  */
6349
- pageSize: number;
6350
- /** @description The items in the current page. */
6351
- items: components['schemas']['MarketplaceListing'][];
6590
+ to?: Date;
6591
+ /** @description The window size that the usage is aggregated.
6592
+ * If not specified, the usage is aggregated over the entire period. */
6593
+ windowSize?: components['schemas']['WindowSize'];
6594
+ /** @description The usage data.
6595
+ * If no data is available, an empty array is returned. */
6596
+ data: components['schemas']['MeterQueryRow'][];
6352
6597
  };
6353
- /** @description Measure usage from */
6354
- MeasureUsageFrom: components['schemas']['MeasureUsageFromPreset'] | components['schemas']['MeasureUsageFromTime'];
6355
- /**
6356
- * @description Start of measurement options
6357
- * @enum {string}
6358
- */
6359
- MeasureUsageFromPreset: 'CURRENT_PERIOD_START' | 'NOW';
6360
- /**
6361
- * Format: date-time
6362
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
6363
- * @example 2023-01-01T01:01:01.001Z
6364
- */
6365
- MeasureUsageFromTime: Date;
6366
6598
  /**
6367
- * @description Set of key-value pairs.
6368
- * Metadata can be used to store additional information about a resource.
6599
+ * @description A row in the result of a meter query.
6369
6600
  * @example {
6370
- * "externalId": "019142cc-a016-796a-8113-1a942fecd26d"
6601
+ * "value": 12,
6602
+ * "windowStart": "2023-01-01T00:00:00Z",
6603
+ * "windowEnd": "2023-01-02T00:00:00Z",
6604
+ * "subject": "customer-1",
6605
+ * "groupBy": {
6606
+ * "model": "gpt-4-turbo",
6607
+ * "type": "prompt"
6608
+ * }
6371
6609
  * }
6372
6610
  */
6373
- Metadata: {
6374
- [key: string]: string;
6611
+ MeterQueryRow: {
6612
+ /**
6613
+ * Format: double
6614
+ * @description The aggregated value.
6615
+ */
6616
+ value: number;
6617
+ /**
6618
+ * Format: date-time
6619
+ * @description The start of the window the value is aggregated over.
6620
+ * @example 2023-01-01T01:01:01.001Z
6621
+ */
6622
+ windowStart: Date;
6623
+ /**
6624
+ * Format: date-time
6625
+ * @description The end of the window the value is aggregated over.
6626
+ * @example 2023-01-01T01:01:01.001Z
6627
+ */
6628
+ windowEnd: Date;
6629
+ /** @description The subject the value is aggregated over.
6630
+ * If not specified, the value is aggregated over all subjects. */
6631
+ subject: string | null;
6632
+ /** @description The group by values the value is aggregated over. */
6633
+ groupBy: {
6634
+ [key: string]: string | null;
6635
+ };
6375
6636
  };
6376
6637
  /**
6377
- * @description A meter is a configuration that defines how to match and aggregate events.
6638
+ * @description A meter update model.
6639
+ *
6640
+ * Only the properties that can be updated are included.
6641
+ * For example, the slug and aggregation cannot be updated.
6378
6642
  * @example {
6379
- * "id": "01G65Z755AFWAKHE12NY0CQ9FH",
6380
- * "slug": "tokens_total",
6381
6643
  * "name": "Tokens Total",
6382
6644
  * "description": "AI Token Usage",
6383
- * "aggregation": "SUM",
6384
- * "eventType": "prompt",
6385
- * "valueProperty": "$.tokens",
6386
6645
  * "groupBy": {
6387
6646
  * "model": "$.model",
6388
6647
  * "type": "$.type"
6389
- * },
6390
- * "createdAt": "2024-01-01T01:01:01.001Z",
6391
- * "updatedAt": "2024-01-01T01:01:01.001Z"
6648
+ * }
6392
6649
  * }
6393
6650
  */
6394
- Meter: {
6395
- /**
6396
- * ID
6397
- * @description A unique identifier for the resource.
6398
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
6399
- */
6400
- readonly id: string;
6651
+ MeterUpdate: {
6401
6652
  /**
6402
6653
  * Description
6403
6654
  * @description Optional description of the resource. Maximum 1024 characters.
@@ -6408,6 +6659,78 @@ export interface components {
6408
6659
  * @description Additional metadata for the resource.
6409
6660
  */
6410
6661
  metadata?: components['schemas']['Metadata'] | null;
6662
+ /**
6663
+ * Display name
6664
+ * @description Human-readable name for the resource. Between 1 and 256 characters.
6665
+ * Defaults to the slug if not specified.
6666
+ */
6667
+ name?: string;
6668
+ /**
6669
+ * @description Named JSONPath expressions to extract the group by values from the event data.
6670
+ *
6671
+ * Keys must be unique and consist only alphanumeric and underscore characters.
6672
+ * @example {
6673
+ * "type": "$.type"
6674
+ * }
6675
+ */
6676
+ groupBy?: {
6677
+ [key: string]: string;
6678
+ };
6679
+ };
6680
+ /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
6681
+ NotFoundProblemResponse: components['schemas']['UnexpectedProblemResponse'];
6682
+ /** @description The server does not support the functionality required to fulfill the request. */
6683
+ NotImplementedProblemResponse: components['schemas']['UnexpectedProblemResponse'];
6684
+ /** @description Notification channel. */
6685
+ NotificationChannel: components['schemas']['NotificationChannelWebhook'];
6686
+ /** @description Union type for requests creating new notification channel with certain type. */
6687
+ NotificationChannelCreateRequest: components['schemas']['NotificationChannelWebhookCreateRequest'];
6688
+ /** @description Metadata only fields of a notification channel. */
6689
+ NotificationChannelMeta: {
6690
+ /**
6691
+ * Channel Unique Identifier
6692
+ * @description Identifies the notification channel.
6693
+ * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
6694
+ */
6695
+ readonly id: string;
6696
+ /**
6697
+ * Channel Type
6698
+ * @description Notification channel type.
6699
+ */
6700
+ type: components['schemas']['NotificationChannelType'];
6701
+ };
6702
+ /**
6703
+ * @description Order by options for notification channels.
6704
+ * @enum {string}
6705
+ */
6706
+ NotificationChannelOrderBy: 'id' | 'type' | 'createdAt' | 'updatedAt';
6707
+ /** @description Paginated response */
6708
+ NotificationChannelPaginatedResponse: {
6709
+ /**
6710
+ * @description The total number of items.
6711
+ * @example 500
6712
+ */
6713
+ totalCount: number;
6714
+ /**
6715
+ * @description The page index.
6716
+ * @example 1
6717
+ */
6718
+ page: number;
6719
+ /**
6720
+ * @description The maximum number of items per page.
6721
+ * @example 100
6722
+ */
6723
+ pageSize: number;
6724
+ /** @description The items in the current page. */
6725
+ items: components['schemas']['NotificationChannel'][];
6726
+ };
6727
+ /**
6728
+ * @description Type of the notification channel.
6729
+ * @enum {string}
6730
+ */
6731
+ NotificationChannelType: 'WEBHOOK';
6732
+ /** @description Notification channel with webhook type. */
6733
+ NotificationChannelWebhook: {
6411
6734
  /**
6412
6735
  * Creation Time
6413
6736
  * Format: date-time
@@ -6430,302 +6753,271 @@ export interface components {
6430
6753
  */
6431
6754
  readonly deletedAt?: Date;
6432
6755
  /**
6433
- * Display name
6434
- * @description Human-readable name for the resource. Between 1 and 256 characters.
6435
- * Defaults to the slug if not specified.
6756
+ * Channel Unique Identifier
6757
+ * @description Identifies the notification channel.
6758
+ * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
6436
6759
  */
6437
- name?: string;
6760
+ readonly id: string;
6438
6761
  /**
6439
- * @description A unique, human-readable identifier for the meter.
6440
- * Must consist only alphanumeric and underscore characters.
6441
- * @example tokens_total
6762
+ * Channel Type
6763
+ * @description Notification channel type.
6764
+ * @enum {string}
6442
6765
  */
6443
- slug: string;
6766
+ type: 'WEBHOOK';
6444
6767
  /**
6445
- * @description The aggregation type to use for the meter.
6446
- * @example SUM
6768
+ * Channel Name
6769
+ * @description User friendly name of the channel.
6770
+ * @example customer-webhook
6447
6771
  */
6448
- aggregation: components['schemas']['MeterAggregation'];
6772
+ name: string;
6449
6773
  /**
6450
- * @description The event type to aggregate.
6451
- * @example prompt
6774
+ * Channel Disabled
6775
+ * @description Whether the channel is disabled or not.
6776
+ * @default false
6777
+ * @example true
6452
6778
  */
6453
- eventType: string;
6779
+ disabled?: boolean;
6454
6780
  /**
6455
- * Format: date-time
6456
- * @description The date since the meter should include events.
6457
- * Useful to skip old events.
6458
- * If not specified, all historical events are included.
6459
- * @example 2023-01-01T01:01:01.001Z
6781
+ * Webhook URL
6782
+ * @description Webhook URL where the notification is sent.
6783
+ * @example https://example.com/webhook
6460
6784
  */
6461
- eventFrom?: Date;
6785
+ url: string;
6462
6786
  /**
6463
- * @description JSONPath expression to extract the value from the ingested event's data property.
6464
- *
6465
- * The ingested value for SUM, AVG, MIN, and MAX aggregations is a number or a string that can be parsed to a number.
6466
- *
6467
- * For UNIQUE_COUNT aggregation, the ingested value must be a string. For COUNT aggregation the valueProperty is ignored.
6468
- * @example $.tokens
6787
+ * Custom HTTP Headers
6788
+ * @description Custom HTTP headers sent as part of the webhook request.
6469
6789
  */
6470
- valueProperty?: string;
6790
+ customHeaders?: {
6791
+ [key: string]: string;
6792
+ };
6471
6793
  /**
6472
- * @description Named JSONPath expressions to extract the group by values from the event data.
6473
- *
6474
- * Keys must be unique and consist only alphanumeric and underscore characters.
6794
+ * Signing Secret
6795
+ * @description Signing secret used for webhook request validation on the receiving end.
6475
6796
  *
6476
- * TODO: add key format enforcement
6477
- * @example {
6478
- * "type": "$.type"
6479
- * }
6797
+ * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24
6798
+ * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8
6799
+ */
6800
+ signingSecret?: string;
6801
+ };
6802
+ /** @description Request with input parameters for creating new notification channel with webhook type. */
6803
+ NotificationChannelWebhookCreateRequest: {
6804
+ /**
6805
+ * Channel Type
6806
+ * @description Notification channel type.
6807
+ * @enum {string}
6480
6808
  */
6481
- groupBy?: {
6482
- [key: string]: string;
6483
- };
6484
- };
6485
- /**
6486
- * @description The aggregation type to use for the meter.
6487
- * @enum {string}
6488
- */
6489
- MeterAggregation: 'SUM' | 'COUNT' | 'UNIQUE_COUNT' | 'AVG' | 'MIN' | 'MAX';
6490
- /**
6491
- * @description A meter create model.
6492
- * @example {
6493
- * "slug": "tokens_total",
6494
- * "name": "Tokens Total",
6495
- * "description": "AI Token Usage",
6496
- * "aggregation": "SUM",
6497
- * "eventType": "prompt",
6498
- * "valueProperty": "$.tokens",
6499
- * "groupBy": {
6500
- * "model": "$.model",
6501
- * "type": "$.type"
6502
- * }
6503
- * }
6504
- */
6505
- MeterCreate: {
6809
+ type: 'WEBHOOK';
6506
6810
  /**
6507
- * Description
6508
- * @description Optional description of the resource. Maximum 1024 characters.
6811
+ * Channel Name
6812
+ * @description User friendly name of the channel.
6813
+ * @example customer-webhook
6509
6814
  */
6510
- description?: string;
6815
+ name: string;
6511
6816
  /**
6512
- * Metadata
6513
- * @description Additional metadata for the resource.
6817
+ * Channel Disabled
6818
+ * @description Whether the channel is disabled or not.
6819
+ * @default false
6820
+ * @example true
6514
6821
  */
6515
- metadata?: components['schemas']['Metadata'] | null;
6822
+ disabled?: boolean;
6516
6823
  /**
6517
- * Display name
6518
- * @description Human-readable name for the resource. Between 1 and 256 characters.
6519
- * Defaults to the slug if not specified.
6824
+ * Webhook URL
6825
+ * @description Webhook URL where the notification is sent.
6826
+ * @example https://example.com/webhook
6520
6827
  */
6521
- name?: string;
6828
+ url: string;
6522
6829
  /**
6523
- * @description A unique, human-readable identifier for the meter.
6524
- * Must consist only alphanumeric and underscore characters.
6525
- * @example tokens_total
6830
+ * Custom HTTP Headers
6831
+ * @description Custom HTTP headers sent as part of the webhook request.
6526
6832
  */
6527
- slug: string;
6833
+ customHeaders?: {
6834
+ [key: string]: string;
6835
+ };
6528
6836
  /**
6529
- * @description The aggregation type to use for the meter.
6530
- * @example SUM
6837
+ * Signing Secret
6838
+ * @description Signing secret used for webhook request validation on the receiving end.
6839
+ *
6840
+ * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24
6841
+ * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8
6531
6842
  */
6532
- aggregation: components['schemas']['MeterAggregation'];
6843
+ signingSecret?: string;
6844
+ };
6845
+ /** @description Type of the notification event. */
6846
+ NotificationEvent: {
6533
6847
  /**
6534
- * @description The event type to aggregate.
6535
- * @example prompt
6848
+ * Event Identifier
6849
+ * @description A unique identifier of the notification event.
6850
+ * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
6536
6851
  */
6537
- eventType: string;
6852
+ readonly id: string;
6853
+ /**
6854
+ * Event Type
6855
+ * @description Type of the notification event.
6856
+ */
6857
+ readonly type: components['schemas']['NotificationEventType'];
6538
6858
  /**
6859
+ * Creation Time
6539
6860
  * Format: date-time
6540
- * @description The date since the meter should include events.
6541
- * Useful to skip old events.
6542
- * If not specified, all historical events are included.
6861
+ * @description Timestamp when the notification event was created in RFC 3339 format.
6543
6862
  * @example 2023-01-01T01:01:01.001Z
6544
6863
  */
6545
- eventFrom?: Date;
6864
+ readonly createdAt: Date;
6865
+ /** @description The nnotification rule which generated this event. */
6866
+ readonly rule: components['schemas']['NotificationRule'];
6546
6867
  /**
6547
- * @description JSONPath expression to extract the value from the ingested event's data property.
6548
- *
6549
- * The ingested value for SUM, AVG, MIN, and MAX aggregations is a number or a string that can be parsed to a number.
6550
- *
6551
- * For UNIQUE_COUNT aggregation, the ingested value must be a string. For COUNT aggregation the valueProperty is ignored.
6552
- * @example $.tokens
6868
+ * Delivery Status
6869
+ * @description The delivery status of the notification event.
6553
6870
  */
6554
- valueProperty?: string;
6871
+ readonly deliveryStatus: components['schemas']['NotificationEventDeliveryStatus'][];
6872
+ /** @description Timestamp when the notification event was created in RFC 3339 format. */
6873
+ readonly payload: components['schemas']['NotificationEventPayload'];
6555
6874
  /**
6556
- * @description Named JSONPath expressions to extract the group by values from the event data.
6557
- *
6558
- * Keys must be unique and consist only alphanumeric and underscore characters.
6559
- *
6560
- * TODO: add key format enforcement
6561
- * @example {
6562
- * "type": "$.type"
6563
- * }
6875
+ * Annotations
6876
+ * @description Set of key-value pairs managed by the system. Cannot be modified by user.
6564
6877
  */
6565
- groupBy?: {
6566
- [key: string]: string;
6567
- };
6878
+ readonly annotations?: components['schemas']['Annotations'];
6568
6879
  };
6569
- /**
6570
- * @description Order by options for meters.
6571
- * @enum {string}
6572
- */
6573
- MeterOrderBy: 'key' | 'name' | 'aggregation' | 'createdAt' | 'updatedAt';
6574
- /**
6575
- * @description The result of a meter query.
6576
- * @example {
6577
- * "from": "2023-01-01T00:00:00Z",
6578
- * "to": "2023-01-02T00:00:00Z",
6579
- * "windowSize": "DAY",
6580
- * "data": [
6581
- * {
6582
- * "value": 12,
6583
- * "windowStart": "2023-01-01T00:00:00Z",
6584
- * "windowEnd": "2023-01-02T00:00:00Z",
6585
- * "subject": "customer-1",
6586
- * "groupBy": {
6587
- * "model": "gpt-4-turbo",
6588
- * "type": "prompt"
6589
- * }
6590
- * }
6591
- * ]
6592
- * }
6593
- */
6594
- MeterQueryResult: {
6880
+ /** @description Payload for notification event with `entitlements.balance.threshold` type. */
6881
+ NotificationEventBalanceThresholdPayload: {
6595
6882
  /**
6596
- * Format: date-time
6597
- * @description The start of the period the usage is queried from.
6598
- * If not specified, the usage is queried from the beginning of time.
6599
- * @example 2023-01-01T01:01:01.001Z
6883
+ * Notification Event Identifier
6884
+ * @description A unique identifier for the notification event the payload belongs to.
6885
+ * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
6600
6886
  */
6601
- from?: Date;
6887
+ readonly id: string;
6602
6888
  /**
6889
+ * @description Type of the notification event. (enum property replaced by openapi-typescript)
6890
+ * @enum {string}
6891
+ */
6892
+ type: 'entitlements.balance.threshold';
6893
+ /**
6894
+ * Creation Time
6603
6895
  * Format: date-time
6604
- * @description The end of the period the usage is queried to.
6605
- * If not specified, the usage is queried up to the current time.
6896
+ * @description Timestamp when the notification event was created in RFC 3339 format.
6606
6897
  * @example 2023-01-01T01:01:01.001Z
6607
6898
  */
6608
- to?: Date;
6609
- /** @description The window size that the usage is aggregated.
6610
- * If not specified, the usage is aggregated over the entire period. */
6611
- windowSize?: components['schemas']['WindowSize'];
6612
- /** @description The usage data.
6613
- * If no data is available, an empty array is returned. */
6614
- data: components['schemas']['MeterQueryRow'][];
6899
+ readonly timestamp: Date;
6900
+ /**
6901
+ * Payload Data
6902
+ * @description The data of the payload.
6903
+ */
6904
+ readonly data: components['schemas']['NotificationEventBalanceThresholdPayloadData'];
6615
6905
  };
6616
- /**
6617
- * @description A row in the result of a meter query.
6618
- * @example {
6619
- * "value": 12,
6620
- * "windowStart": "2023-01-01T00:00:00Z",
6621
- * "windowEnd": "2023-01-02T00:00:00Z",
6622
- * "subject": "customer-1",
6623
- * "groupBy": {
6624
- * "model": "gpt-4-turbo",
6625
- * "type": "prompt"
6626
- * }
6627
- * }
6628
- */
6629
- MeterQueryRow: {
6906
+ /** @description Data of the payload for notification event with `entitlements.balance.threshold` type. */
6907
+ NotificationEventBalanceThresholdPayloadData: {
6908
+ /** Entitlement */
6909
+ readonly entitlement: components['schemas']['EntitlementMetered'];
6910
+ /** Feature */
6911
+ readonly feature: components['schemas']['Feature'];
6912
+ /** Subject */
6913
+ readonly subject: components['schemas']['Subject'];
6914
+ /** Entitlement Value */
6915
+ readonly value: components['schemas']['EntitlementValue'];
6916
+ /** Threshold */
6917
+ readonly threshold: components['schemas']['NotificationRuleBalanceThresholdValue'];
6918
+ };
6919
+ /** @description The delivery status of the notification event. */
6920
+ NotificationEventDeliveryStatus: {
6630
6921
  /**
6631
- * Format: double
6632
- * @description The aggregated value.
6922
+ * @description Delivery state of the notification event to the channel.
6923
+ * @example SUCCESS
6633
6924
  */
6634
- value: number;
6925
+ readonly state: components['schemas']['NotificationEventDeliveryStatusState'];
6635
6926
  /**
6636
- * Format: date-time
6637
- * @description The start of the window the value is aggregated over.
6638
- * @example 2023-01-01T01:01:01.001Z
6927
+ * State Reason
6928
+ * @description The reason of the last deliverry state update.
6929
+ * @example Failed to dispatch event due to provider error.
6639
6930
  */
6640
- windowStart: Date;
6931
+ readonly reason: string;
6641
6932
  /**
6933
+ * Last Update Time
6642
6934
  * Format: date-time
6643
- * @description The end of the window the value is aggregated over.
6935
+ * @description Timestamp of when the status was last updated in RFC 3339 format.
6644
6936
  * @example 2023-01-01T01:01:01.001Z
6645
6937
  */
6646
- windowEnd: Date;
6647
- /** @description The subject the value is aggregated over.
6648
- * If not specified, the value is aggregated over all subjects. */
6649
- subject: string | null;
6650
- /** @description The group by values the value is aggregated over. */
6651
- groupBy: {
6652
- [key: string]: string | null;
6653
- };
6938
+ readonly updatedAt: Date;
6939
+ /**
6940
+ * Notification Channel
6941
+ * @description Notification channel the delivery sattus associated with.
6942
+ */
6943
+ readonly channel: components['schemas']['NotificationChannelMeta'];
6654
6944
  };
6655
6945
  /**
6656
- * @description A meter update model.
6657
- *
6658
- * Only the properties that can be updated are included.
6659
- * For example, the slug and aggregation cannot be updated.
6660
- * @example {
6661
- * "name": "Tokens Total",
6662
- * "description": "AI Token Usage",
6663
- * "groupBy": {
6664
- * "model": "$.model",
6665
- * "type": "$.type"
6666
- * }
6667
- * }
6946
+ * Delivery State
6947
+ * @description The delivery state of the notification event to the channel.
6948
+ * @enum {string}
6668
6949
  */
6669
- MeterUpdate: {
6950
+ NotificationEventDeliveryStatusState: 'SUCCESS' | 'FAILED' | 'SENDING' | 'PENDING';
6951
+ /** @description Base data for any payload with entitlement entitlement value. */
6952
+ NotificationEventEntitlementValuePayloadBase: {
6953
+ /** Entitlement */
6954
+ readonly entitlement: components['schemas']['EntitlementMetered'];
6955
+ /** Feature */
6956
+ readonly feature: components['schemas']['Feature'];
6957
+ /** Subject */
6958
+ readonly subject: components['schemas']['Subject'];
6959
+ /** Entitlement Value */
6960
+ readonly value: components['schemas']['EntitlementValue'];
6961
+ };
6962
+ /** @description Payload for notification event with `invoice.created` type. */
6963
+ NotificationEventInvoiceCreatedPayload: {
6670
6964
  /**
6671
- * Description
6672
- * @description Optional description of the resource. Maximum 1024 characters.
6965
+ * Notification Event Identifier
6966
+ * @description A unique identifier for the notification event the payload belongs to.
6967
+ * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
6673
6968
  */
6674
- description?: string;
6969
+ readonly id: string;
6675
6970
  /**
6676
- * Metadata
6677
- * @description Additional metadata for the resource.
6971
+ * @description Type of the notification event. (enum property replaced by openapi-typescript)
6972
+ * @enum {string}
6678
6973
  */
6679
- metadata?: components['schemas']['Metadata'] | null;
6974
+ type: 'invoice.created';
6680
6975
  /**
6681
- * Display name
6682
- * @description Human-readable name for the resource. Between 1 and 256 characters.
6683
- * Defaults to the slug if not specified.
6976
+ * Creation Time
6977
+ * Format: date-time
6978
+ * @description Timestamp when the notification event was created in RFC 3339 format.
6979
+ * @example 2023-01-01T01:01:01.001Z
6684
6980
  */
6685
- name?: string;
6981
+ readonly timestamp: Date;
6686
6982
  /**
6687
- * @description Named JSONPath expressions to extract the group by values from the event data.
6688
- *
6689
- * Keys must be unique and consist only alphanumeric and underscore characters.
6690
- *
6691
- * TODO: add key format enforcement
6692
- * @example {
6693
- * "type": "$.type"
6694
- * }
6983
+ * Payload Data
6984
+ * @description The data of the payload.
6695
6985
  */
6696
- groupBy?: {
6697
- [key: string]: string;
6698
- };
6986
+ readonly data: components['schemas']['Invoice'];
6699
6987
  };
6700
- /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
6701
- NotFoundProblemResponse: components['schemas']['UnexpectedProblemResponse'];
6702
- /** @description The server does not support the functionality required to fulfill the request. */
6703
- NotImplementedProblemResponse: components['schemas']['UnexpectedProblemResponse'];
6704
- /** @description Notification channel. */
6705
- NotificationChannel: components['schemas']['NotificationChannelWebhook'];
6706
- /** @description Union type for requests creating new notification channel with certain type. */
6707
- NotificationChannelCreateRequest: components['schemas']['NotificationChannelWebhookCreateRequest'];
6708
- /** @description Metadata only fields of a notification channel. */
6709
- NotificationChannelMeta: {
6988
+ /** @description Payload for notification event with `invoice.updated` type. */
6989
+ NotificationEventInvoiceUpdatedPayload: {
6710
6990
  /**
6711
- * Channel Unique Identifier
6712
- * @description Identifies the notification channel.
6713
- * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
6991
+ * Notification Event Identifier
6992
+ * @description A unique identifier for the notification event the payload belongs to.
6993
+ * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
6714
6994
  */
6715
6995
  readonly id: string;
6716
6996
  /**
6717
- * Channel Type
6718
- * @description Notification channel type.
6997
+ * @description Type of the notification event. (enum property replaced by openapi-typescript)
6998
+ * @enum {string}
6719
6999
  */
6720
- type: components['schemas']['NotificationChannelType'];
7000
+ type: 'invoice.updated';
7001
+ /**
7002
+ * Creation Time
7003
+ * Format: date-time
7004
+ * @description Timestamp when the notification event was created in RFC 3339 format.
7005
+ * @example 2023-01-01T01:01:01.001Z
7006
+ */
7007
+ readonly timestamp: Date;
7008
+ /**
7009
+ * Payload Data
7010
+ * @description The data of the payload.
7011
+ */
7012
+ readonly data: components['schemas']['Invoice'];
6721
7013
  };
6722
7014
  /**
6723
7015
  * @description Order by options for notification channels.
6724
7016
  * @enum {string}
6725
7017
  */
6726
- NotificationChannelOrderBy: 'id' | 'type' | 'createdAt' | 'updatedAt';
7018
+ NotificationEventOrderBy: 'id' | 'createdAt';
6727
7019
  /** @description Paginated response */
6728
- NotificationChannelPaginatedResponse: {
7020
+ NotificationEventPaginatedResponse: {
6729
7021
  /**
6730
7022
  * @description The total number of items.
6731
7023
  * @example 500
@@ -6742,15 +7034,45 @@ export interface components {
6742
7034
  */
6743
7035
  pageSize: number;
6744
7036
  /** @description The items in the current page. */
6745
- items: components['schemas']['NotificationChannel'][];
7037
+ items: components['schemas']['NotificationEvent'][];
7038
+ };
7039
+ /** @description The delivery status of the notification event. */
7040
+ NotificationEventPayload: components['schemas']['NotificationEventResetPayload'] | components['schemas']['NotificationEventBalanceThresholdPayload'] | components['schemas']['NotificationEventInvoiceCreatedPayload'] | components['schemas']['NotificationEventInvoiceUpdatedPayload'];
7041
+ /** @description Payload for notification event with `entitlements.reset` type. */
7042
+ NotificationEventResetPayload: {
7043
+ /**
7044
+ * Notification Event Identifier
7045
+ * @description A unique identifier for the notification event the payload belongs to.
7046
+ * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
7047
+ */
7048
+ readonly id: string;
7049
+ /**
7050
+ * @description Type of the notification event. (enum property replaced by openapi-typescript)
7051
+ * @enum {string}
7052
+ */
7053
+ type: 'entitlements.reset';
7054
+ /**
7055
+ * Creation Time
7056
+ * Format: date-time
7057
+ * @description Timestamp when the notification event was created in RFC 3339 format.
7058
+ * @example 2023-01-01T01:01:01.001Z
7059
+ */
7060
+ readonly timestamp: Date;
7061
+ /**
7062
+ * Payload Data
7063
+ * @description The data of the payload.
7064
+ */
7065
+ readonly data: components['schemas']['NotificationEventEntitlementValuePayloadBase'];
6746
7066
  };
6747
7067
  /**
6748
- * @description Type of the notification channel.
7068
+ * @description Type of the notification event.
6749
7069
  * @enum {string}
6750
7070
  */
6751
- NotificationChannelType: 'WEBHOOK';
6752
- /** @description Notification channel with webhook type. */
6753
- NotificationChannelWebhook: {
7071
+ NotificationEventType: 'entitlements.balance.threshold' | 'entitlements.reset' | 'invoice.created' | 'invoice.updated';
7072
+ /** @description Notification Rule. */
7073
+ NotificationRule: components['schemas']['NotificationRuleBalanceThreshold'] | components['schemas']['NotificationRuleEntitlementReset'] | components['schemas']['NotificationRuleInvoiceCreated'] | components['schemas']['NotificationRuleInvoiceUpdated'];
7074
+ /** @description Notification rule with entitlements.balance.threshold type. */
7075
+ NotificationRuleBalanceThreshold: {
6754
7076
  /**
6755
7077
  * Creation Time
6756
7078
  * Format: date-time
@@ -6773,238 +7095,274 @@ export interface components {
6773
7095
  */
6774
7096
  readonly deletedAt?: Date;
6775
7097
  /**
6776
- * Channel Unique Identifier
6777
- * @description Identifies the notification channel.
7098
+ * Rule Unique Identifier
7099
+ * @description Identifies the notification rule.
6778
7100
  * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
6779
7101
  */
6780
7102
  readonly id: string;
6781
7103
  /**
6782
- * Channel Type
6783
- * @description Notification channel type.
7104
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
6784
7105
  * @enum {string}
6785
7106
  */
6786
- type: 'WEBHOOK';
7107
+ type: 'entitlements.balance.threshold';
6787
7108
  /**
6788
- * Channel Name
6789
- * @description User friendly name of the channel.
6790
- * @example customer-webhook
7109
+ * Rule Name
7110
+ * @description The user friendly name of the notification rule.
7111
+ * @example Balance threshold reached
6791
7112
  */
6792
7113
  name: string;
6793
7114
  /**
6794
- * Channel Disabled
6795
- * @description Whether the channel is disabled or not.
7115
+ * Rule Disabled
7116
+ * @description Whether the rule is disabled or not.
6796
7117
  * @default false
6797
7118
  * @example true
6798
7119
  */
6799
7120
  disabled?: boolean;
6800
7121
  /**
6801
- * Webhook URL
6802
- * @description Webhook URL where the notification is sent.
6803
- * @example https://example.com/webhook
7122
+ * Channels assigned to Rule
7123
+ * @description List of notification channels the rule applies to.
6804
7124
  */
6805
- url: string;
7125
+ channels: components['schemas']['NotificationChannelMeta'][];
6806
7126
  /**
6807
- * Custom HTTP Headers
6808
- * @description Custom HTTP headers sent as part of the webhook request.
7127
+ * Entitlement Balance Thresholds
7128
+ * @description List of thresholds the rule suppose to be triggered.
6809
7129
  */
6810
- customHeaders?: {
6811
- [key: string]: string;
6812
- };
7130
+ thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][];
6813
7131
  /**
6814
- * Signing Secret
6815
- * @description Signing secret used for webhook request validation on the receiving end.
6816
- *
6817
- * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24
6818
- * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8
7132
+ * Features
7133
+ * @description Optional field containing list of features the rule applies to.
6819
7134
  */
6820
- signingSecret?: string;
7135
+ features?: components['schemas']['FeatureMeta'][];
6821
7136
  };
6822
- /** @description Request with input parameters for creating new notification channel with webhook type. */
6823
- NotificationChannelWebhookCreateRequest: {
7137
+ /** @description Request with input parameters for creating new notification rule with entitlements.balance.threshold type. */
7138
+ NotificationRuleBalanceThresholdCreateRequest: {
6824
7139
  /**
6825
- * Channel Type
6826
- * @description Notification channel type.
7140
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
6827
7141
  * @enum {string}
6828
7142
  */
6829
- type: 'WEBHOOK';
7143
+ type: 'entitlements.balance.threshold';
6830
7144
  /**
6831
- * Channel Name
6832
- * @description User friendly name of the channel.
6833
- * @example customer-webhook
7145
+ * Rule Name
7146
+ * @description The user friendly name of the notification rule.
7147
+ * @example Balance threshold reached
6834
7148
  */
6835
7149
  name: string;
6836
7150
  /**
6837
- * Channel Disabled
6838
- * @description Whether the channel is disabled or not.
7151
+ * Rule Disabled
7152
+ * @description Whether the rule is disabled or not.
6839
7153
  * @default false
6840
7154
  * @example true
6841
7155
  */
6842
7156
  disabled?: boolean;
6843
7157
  /**
6844
- * Webhook URL
6845
- * @description Webhook URL where the notification is sent.
6846
- * @example https://example.com/webhook
7158
+ * Entitlement Balance Thresholds
7159
+ * @description List of thresholds the rule suppose to be triggered.
6847
7160
  */
6848
- url: string;
7161
+ thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][];
6849
7162
  /**
6850
- * Custom HTTP Headers
6851
- * @description Custom HTTP headers sent as part of the webhook request.
7163
+ * Channels
7164
+ * @description List of notification channels the rule is applied to.
6852
7165
  */
6853
- customHeaders?: {
6854
- [key: string]: string;
6855
- };
7166
+ channels: string[];
6856
7167
  /**
6857
- * Signing Secret
6858
- * @description Signing secret used for webhook request validation on the receiving end.
6859
- *
6860
- * Format: `base64` encoded random bytes optionally prefixed with `whsec_`. Recommended size: 24
6861
- * @example whsec_S6g2HLnTwd9AhHwUIMFggVS9OfoPafN8
7168
+ * Features
7169
+ * @description Optional field for defining the scope of notification by feature. It may contain features by id or key.
7170
+ */
7171
+ features?: string[];
7172
+ };
7173
+ /** @description Threshold value with multiple supported types. */
7174
+ NotificationRuleBalanceThresholdValue: {
7175
+ /**
7176
+ * Threshold Value
7177
+ * Format: double
7178
+ * @description Value of the threshold.
7179
+ * @example 100
7180
+ */
7181
+ value: number;
7182
+ /**
7183
+ * @description Type of the threshold.
7184
+ * @example NUMBER
7185
+ */
7186
+ type: components['schemas']['NotificationRuleBalanceThresholdValueType'];
7187
+ };
7188
+ /**
7189
+ * Notification balance threshold type
7190
+ * @description Type of the rule in the balance threshold specification.
7191
+ * @enum {string}
7192
+ */
7193
+ NotificationRuleBalanceThresholdValueType: 'PERCENT' | 'NUMBER';
7194
+ /** @description Union type for requests creating new notification rule with certain type. */
7195
+ NotificationRuleCreateRequest: components['schemas']['NotificationRuleBalanceThresholdCreateRequest'] | components['schemas']['NotificationRuleEntitlementResetCreateRequest'] | components['schemas']['NotificationRuleInvoiceCreatedCreateRequest'] | components['schemas']['NotificationRuleInvoiceUpdatedCreateRequest'];
7196
+ /** @description Notification rule with entitlements.reset type. */
7197
+ NotificationRuleEntitlementReset: {
7198
+ /**
7199
+ * Creation Time
7200
+ * Format: date-time
7201
+ * @description Timestamp of when the resource was created.
7202
+ * @example 2024-01-01T01:01:01.001Z
7203
+ */
7204
+ readonly createdAt: Date;
7205
+ /**
7206
+ * Last Update Time
7207
+ * Format: date-time
7208
+ * @description Timestamp of when the resource was last updated.
7209
+ * @example 2024-01-01T01:01:01.001Z
7210
+ */
7211
+ readonly updatedAt: Date;
7212
+ /**
7213
+ * Deletion Time
7214
+ * Format: date-time
7215
+ * @description Timestamp of when the resource was permanently deleted.
7216
+ * @example 2024-01-01T01:01:01.001Z
7217
+ */
7218
+ readonly deletedAt?: Date;
7219
+ /**
7220
+ * Rule Unique Identifier
7221
+ * @description Identifies the notification rule.
7222
+ * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
7223
+ */
7224
+ readonly id: string;
7225
+ /**
7226
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7227
+ * @enum {string}
7228
+ */
7229
+ type: 'entitlements.reset';
7230
+ /**
7231
+ * Rule Name
7232
+ * @description The user friendly name of the notification rule.
7233
+ * @example Balance threshold reached
7234
+ */
7235
+ name: string;
7236
+ /**
7237
+ * Rule Disabled
7238
+ * @description Whether the rule is disabled or not.
7239
+ * @default false
7240
+ * @example true
7241
+ */
7242
+ disabled?: boolean;
7243
+ /**
7244
+ * Channels assigned to Rule
7245
+ * @description List of notification channels the rule applies to.
7246
+ */
7247
+ channels: components['schemas']['NotificationChannelMeta'][];
7248
+ /**
7249
+ * Features
7250
+ * @description Optional field containing list of features the rule applies to.
6862
7251
  */
6863
- signingSecret?: string;
7252
+ features?: components['schemas']['FeatureMeta'][];
6864
7253
  };
6865
- /** @description Type of the notification event. */
6866
- NotificationEvent: {
7254
+ /** @description Request with input parameters for creating new notification rule with entitlements.reset type. */
7255
+ NotificationRuleEntitlementResetCreateRequest: {
6867
7256
  /**
6868
- * Event Identifier
6869
- * @description A unique identifier of the notification event.
6870
- * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
7257
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7258
+ * @enum {string}
6871
7259
  */
6872
- readonly id: string;
7260
+ type: 'entitlements.reset';
6873
7261
  /**
6874
- * Event Type
6875
- * @description Type of the notification event.
7262
+ * Rule Name
7263
+ * @description The user friendly name of the notification rule.
7264
+ * @example Balance threshold reached
6876
7265
  */
6877
- readonly type: components['schemas']['NotificationEventType'];
7266
+ name: string;
6878
7267
  /**
6879
- * Creation Time
6880
- * Format: date-time
6881
- * @description Timestamp when the notification event was created in RFC 3339 format.
6882
- * @example 2023-01-01T01:01:01.001Z
7268
+ * Rule Disabled
7269
+ * @description Whether the rule is disabled or not.
7270
+ * @default false
7271
+ * @example true
6883
7272
  */
6884
- readonly createdAt: Date;
6885
- /** @description The nnotification rule which generated this event. */
6886
- readonly rule: components['schemas']['NotificationRule'];
7273
+ disabled?: boolean;
6887
7274
  /**
6888
- * Delivery Status
6889
- * @description The delivery status of the notification event.
7275
+ * Channels
7276
+ * @description List of notification channels the rule is applied to.
6890
7277
  */
6891
- readonly deliveryStatus: components['schemas']['NotificationEventDeliveryStatus'][];
6892
- /** @description Timestamp when the notification event was created in RFC 3339 format. */
6893
- readonly payload: components['schemas']['NotificationEventPayload'];
7278
+ channels: string[];
6894
7279
  /**
6895
- * Annotations
6896
- * @description Set of key-value pairs managed by the system. Cannot be modified by user.
7280
+ * Features
7281
+ * @description Optional field for defining the scope of notification by feature. It may contain features by id or key.
6897
7282
  */
6898
- readonly annotations?: components['schemas']['Annotations'];
7283
+ features?: string[];
6899
7284
  };
6900
- /** @description Payload for notification event with `entitlements.balance.threshold` type. */
6901
- NotificationEventBalanceThresholdPayload: {
7285
+ /** @description Notification rule with invoice.created type. */
7286
+ NotificationRuleInvoiceCreated: {
6902
7287
  /**
6903
- * Notification Event Identifier
6904
- * @description A unique identifier for the notification event the payload belongs to.
6905
- * @example 01J2KNP1YTXQRXHTDJ4KPR7PZ0
7288
+ * Creation Time
7289
+ * Format: date-time
7290
+ * @description Timestamp of when the resource was created.
7291
+ * @example 2024-01-01T01:01:01.001Z
6906
7292
  */
6907
- readonly id: string;
7293
+ readonly createdAt: Date;
6908
7294
  /**
6909
- * Notification Event Type
6910
- * @description Type of the notification event.
6911
- * @enum {string}
7295
+ * Last Update Time
7296
+ * Format: date-time
7297
+ * @description Timestamp of when the resource was last updated.
7298
+ * @example 2024-01-01T01:01:01.001Z
6912
7299
  */
6913
- readonly type: 'entitlements.balance.threshold';
7300
+ readonly updatedAt: Date;
6914
7301
  /**
6915
- * Creation Time
7302
+ * Deletion Time
6916
7303
  * Format: date-time
6917
- * @description Timestamp when the notification event was created in RFC 3339 format.
6918
- * @example 2023-01-01T01:01:01.001Z
7304
+ * @description Timestamp of when the resource was permanently deleted.
7305
+ * @example 2024-01-01T01:01:01.001Z
6919
7306
  */
6920
- readonly timestamp: Date;
7307
+ readonly deletedAt?: Date;
6921
7308
  /**
6922
- * Payload Data
6923
- * @description The data of the payload.
7309
+ * Rule Unique Identifier
7310
+ * @description Identifies the notification rule.
7311
+ * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
6924
7312
  */
6925
- readonly data: components['schemas']['NotificationEventBalanceThresholdPayloadData'];
6926
- };
6927
- /** @description Data of the payload for notification event with `entitlements.balance.threshold` type. */
6928
- NotificationEventBalanceThresholdPayloadData: {
6929
- /** Entitlement */
6930
- readonly entitlement: components['schemas']['EntitlementMetered'];
6931
- /** Feature */
6932
- readonly feature: components['schemas']['Feature'];
6933
- /** Subject */
6934
- readonly subject: components['schemas']['Subject'];
6935
- /** Entitlement Value */
6936
- readonly value: components['schemas']['EntitlementValue'];
6937
- /** Threshold */
6938
- readonly threshold: components['schemas']['NotificationRuleBalanceThresholdValue'];
6939
- };
6940
- /** @description The delivery status of the notification event. */
6941
- NotificationEventDeliveryStatus: {
7313
+ readonly id: string;
6942
7314
  /**
6943
- * @description Delivery state of the notification event to the channel.
6944
- * @example SUCCESS
7315
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7316
+ * @enum {string}
6945
7317
  */
6946
- readonly state: components['schemas']['NotificationEventDeliveryStatusState'];
7318
+ type: 'invoice.created';
6947
7319
  /**
6948
- * State Reason
6949
- * @description The reason of the last deliverry state update.
6950
- * @example Failed to dispatch event due to provider error.
7320
+ * Rule Name
7321
+ * @description The user friendly name of the notification rule.
7322
+ * @example Balance threshold reached
6951
7323
  */
6952
- readonly reason: string;
7324
+ name: string;
6953
7325
  /**
6954
- * Last Update Time
6955
- * Format: date-time
6956
- * @description Timestamp of when the status was last updated in RFC 3339 format.
6957
- * @example 2023-01-01T01:01:01.001Z
7326
+ * Rule Disabled
7327
+ * @description Whether the rule is disabled or not.
7328
+ * @default false
7329
+ * @example true
6958
7330
  */
6959
- readonly updatedAt: Date;
7331
+ disabled?: boolean;
6960
7332
  /**
6961
- * Notification Channel
6962
- * @description Notification channel the delivery sattus associated with.
7333
+ * Channels assigned to Rule
7334
+ * @description List of notification channels the rule applies to.
6963
7335
  */
6964
- readonly channel: components['schemas']['NotificationChannelMeta'];
7336
+ channels: components['schemas']['NotificationChannelMeta'][];
6965
7337
  };
6966
- /**
6967
- * Delivery State
6968
- * @description The delivery state of the notification event to the channel.
6969
- * @enum {string}
6970
- */
6971
- NotificationEventDeliveryStatusState: 'SUCCESS' | 'FAILED' | 'SENDING' | 'PENDING';
6972
- /**
6973
- * @description Order by options for notification channels.
6974
- * @enum {string}
6975
- */
6976
- NotificationEventOrderBy: 'id' | 'createdAt';
6977
- /** @description Paginated response */
6978
- NotificationEventPaginatedResponse: {
7338
+ /** @description Request with input parameters for creating new notification rule with invoice.created type. */
7339
+ NotificationRuleInvoiceCreatedCreateRequest: {
6979
7340
  /**
6980
- * @description The total number of items.
6981
- * @example 500
7341
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7342
+ * @enum {string}
6982
7343
  */
6983
- totalCount: number;
7344
+ type: 'invoice.created';
6984
7345
  /**
6985
- * @description The page index.
6986
- * @example 1
7346
+ * Rule Name
7347
+ * @description The user friendly name of the notification rule.
7348
+ * @example Balance threshold reached
6987
7349
  */
6988
- page: number;
7350
+ name: string;
6989
7351
  /**
6990
- * @description The maximum number of items per page.
6991
- * @example 100
7352
+ * Rule Disabled
7353
+ * @description Whether the rule is disabled or not.
7354
+ * @default false
7355
+ * @example true
6992
7356
  */
6993
- pageSize: number;
6994
- /** @description The items in the current page. */
6995
- items: components['schemas']['NotificationEvent'][];
7357
+ disabled?: boolean;
7358
+ /**
7359
+ * Channels
7360
+ * @description List of notification channels the rule is applied to.
7361
+ */
7362
+ channels: string[];
6996
7363
  };
6997
- /** @description The delivery status of the notification event. */
6998
- NotificationEventPayload: components['schemas']['NotificationEventBalanceThresholdPayload'];
6999
- /**
7000
- * @description Type of the notification event.
7001
- * @enum {string}
7002
- */
7003
- NotificationEventType: 'entitlements.balance.threshold';
7004
- /** @description Notification Rule. */
7005
- NotificationRule: components['schemas']['NotificationRuleBalanceThreshold'];
7006
- /** @description Notification rule with entitlements.balance.threshold type. */
7007
- NotificationRuleBalanceThreshold: {
7364
+ /** @description Notification rule with invoice.updated type. */
7365
+ NotificationRuleInvoiceUpdated: {
7008
7366
  /**
7009
7367
  * Creation Time
7010
7368
  * Format: date-time
@@ -7033,11 +7391,10 @@ export interface components {
7033
7391
  */
7034
7392
  readonly id: string;
7035
7393
  /**
7036
- * Rule Type
7037
- * @description Notification rule type.
7394
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7038
7395
  * @enum {string}
7039
7396
  */
7040
- type: 'entitlements.balance.threshold';
7397
+ type: 'invoice.updated';
7041
7398
  /**
7042
7399
  * Rule Name
7043
7400
  * @description The user friendly name of the notification rule.
@@ -7056,25 +7413,14 @@ export interface components {
7056
7413
  * @description List of notification channels the rule applies to.
7057
7414
  */
7058
7415
  channels: components['schemas']['NotificationChannelMeta'][];
7059
- /**
7060
- * Entitlement Balance Thresholds
7061
- * @description List of thresholds the rule suppose to be triggered.
7062
- */
7063
- thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][];
7064
- /**
7065
- * Features
7066
- * @description Optional field containing list of features the rule applies to.
7067
- */
7068
- features?: components['schemas']['FeatureMeta'][];
7069
7416
  };
7070
- /** @description Request with input parameters for creating new notification rule with entitlements.balance.threashold type. */
7071
- NotificationRuleBalanceThresholdCreateRequest: {
7417
+ /** @description Request with input parameters for creating new notification rule with invoice.updated type. */
7418
+ NotificationRuleInvoiceUpdatedCreateRequest: {
7072
7419
  /**
7073
- * Rule Type
7074
- * @description Notification rule type.
7420
+ * @description Notification rule type. (enum property replaced by openapi-typescript)
7075
7421
  * @enum {string}
7076
7422
  */
7077
- type: 'entitlements.balance.threshold';
7423
+ type: 'invoice.updated';
7078
7424
  /**
7079
7425
  * Rule Name
7080
7426
  * @description The user friendly name of the notification rule.
@@ -7088,45 +7434,12 @@ export interface components {
7088
7434
  * @example true
7089
7435
  */
7090
7436
  disabled?: boolean;
7091
- /**
7092
- * Entitlement Balance Thresholds
7093
- * @description List of thresholds the rule suppose to be triggered.
7094
- */
7095
- thresholds: components['schemas']['NotificationRuleBalanceThresholdValue'][];
7096
7437
  /**
7097
7438
  * Channels
7098
7439
  * @description List of notification channels the rule is applied to.
7099
7440
  */
7100
7441
  channels: string[];
7101
- /**
7102
- * Features
7103
- * @description Optional field for defining the scope of notification by feature. It may contain features by id or key.
7104
- */
7105
- features?: string[];
7106
7442
  };
7107
- /** @description Threshold value with multiple supported types. */
7108
- NotificationRuleBalanceThresholdValue: {
7109
- /**
7110
- * Threshold Value
7111
- * Format: double
7112
- * @description Value of the threshold.
7113
- * @example 100
7114
- */
7115
- value: number;
7116
- /**
7117
- * @description Type of the threshold.
7118
- * @example NUMBER
7119
- */
7120
- type: components['schemas']['NotificationRuleBalanceThresholdValueType'];
7121
- };
7122
- /**
7123
- * Notification balance threshold type
7124
- * @description Type of the rule in the balance threshold specification.
7125
- * @enum {string}
7126
- */
7127
- NotificationRuleBalanceThresholdValueType: 'PERCENT' | 'NUMBER';
7128
- /** @description Union type for requests creating new notification rule with certain type. */
7129
- NotificationRuleCreateRequest: components['schemas']['NotificationRuleBalanceThresholdCreateRequest'];
7130
7443
  /**
7131
7444
  * @description Order by options for notification channels.
7132
7445
  * @enum {string}
@@ -7318,6 +7631,24 @@ export interface components {
7318
7631
  * @default USD
7319
7632
  */
7320
7633
  currency: components['schemas']['CurrencyCode'];
7634
+ /**
7635
+ * Billing cadence
7636
+ * Format: duration
7637
+ * @description The default billing cadence for subscriptions using this plan.
7638
+ * Defines how often customers are billed using ISO8601 duration format.
7639
+ * Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).
7640
+ * @example P1M
7641
+ */
7642
+ billingCadence: string;
7643
+ /**
7644
+ * Pro-rating configuration
7645
+ * @description Default pro-rating configuration for subscriptions using this plan.
7646
+ * @default {
7647
+ * "enabled": true,
7648
+ * "mode": "prorate_prices"
7649
+ * }
7650
+ */
7651
+ proRatingConfig?: components['schemas']['ProRatingConfig'];
7321
7652
  /**
7322
7653
  * Effective start date
7323
7654
  * Format: date-time
@@ -7348,8 +7679,13 @@ export interface components {
7348
7679
  * A phase switch occurs only at the end of a billing period, ensuring that a single subscription invoice will not include charges from different phase prices.
7349
7680
  */
7350
7681
  phases: components['schemas']['PlanPhase'][];
7682
+ /**
7683
+ * Validation errors
7684
+ * @description List of validation errors.
7685
+ */
7686
+ readonly validationErrors: components['schemas']['ValidationError'][] | null;
7351
7687
  };
7352
- /** @description The AddonAssignment describes the association between a plan and add-on. */
7688
+ /** @description The PlanAddon describes the association between a plan and add-on. */
7353
7689
  PlanAddon: {
7354
7690
  /**
7355
7691
  * Creation Time
@@ -7380,36 +7716,13 @@ export interface components {
7380
7716
  /**
7381
7717
  * Metadata
7382
7718
  * @description Additional metadata for the resource.
7383
- */
7384
- metadata?: components['schemas']['Metadata'];
7385
- /**
7386
- * Addon
7387
- * @description Partially populated add-on properties.
7388
- */
7389
- addon: {
7390
- /**
7391
- * ID
7392
- * @description The ID of the add-on.
7393
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
7394
- */
7395
- id: string;
7396
- /**
7397
- * Key
7398
- * @description A semi-unique identifier for the resource.
7399
- */
7400
- readonly key: string;
7401
- /**
7402
- * Version
7403
- * @description The version of the Add-on which templates this instance.
7404
- * @default 1
7405
- */
7406
- readonly version: number;
7407
- /**
7408
- * InstanceType
7409
- * @description The instance type of the add-on.
7410
- */
7411
- readonly instanceType: components['schemas']['AddonInstanceType'];
7412
- };
7719
+ */
7720
+ metadata?: components['schemas']['Metadata'];
7721
+ /**
7722
+ * Addon
7723
+ * @description Add-on object.
7724
+ */
7725
+ readonly addon: components['schemas']['Addon'];
7413
7726
  /**
7414
7727
  * The plan phase from the add-on becomes purchasable
7415
7728
  * @description The key of the plan phase from the add-on becomes available for purchase.
@@ -7421,6 +7734,11 @@ export interface components {
7421
7734
  * It is not applicable for add-ons with single instance type.
7422
7735
  */
7423
7736
  maxQuantity?: number;
7737
+ /**
7738
+ * Validation errors
7739
+ * @description List of validation errors.
7740
+ */
7741
+ readonly validationErrors: components['schemas']['ValidationError'][] | null;
7424
7742
  };
7425
7743
  /** @description A plan add-on assignment create request. */
7426
7744
  PlanAddonCreate: {
@@ -7441,16 +7759,11 @@ export interface components {
7441
7759
  */
7442
7760
  maxQuantity?: number;
7443
7761
  /**
7444
- * Addon
7445
- * @description The add-on to create.
7762
+ * Add-on unique identifier
7763
+ * @description The add-on unique identifier in ULID format.
7764
+ * @example 01G65Z755AFWAKHE12NY0CQ9FH
7446
7765
  */
7447
- addon: {
7448
- /**
7449
- * @description The ID of the add-on.
7450
- * @example 01G65Z755AFWAKHE12NY0CQ9FH
7451
- */
7452
- id: string;
7453
- };
7766
+ addonId: string;
7454
7767
  };
7455
7768
  /**
7456
7769
  * @description Order by options for plan add-on assignments.
@@ -7526,6 +7839,24 @@ export interface components {
7526
7839
  * @default USD
7527
7840
  */
7528
7841
  currency: components['schemas']['CurrencyCode'];
7842
+ /**
7843
+ * Billing cadence
7844
+ * Format: duration
7845
+ * @description The default billing cadence for subscriptions using this plan.
7846
+ * Defines how often customers are billed using ISO8601 duration format.
7847
+ * Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).
7848
+ * @example P1M
7849
+ */
7850
+ billingCadence: string;
7851
+ /**
7852
+ * Pro-rating configuration
7853
+ * @description Default pro-rating configuration for subscriptions using this plan.
7854
+ * @default {
7855
+ * "enabled": true,
7856
+ * "mode": "prorate_prices"
7857
+ * }
7858
+ */
7859
+ proRatingConfig?: components['schemas']['ProRatingConfig'];
7529
7860
  /**
7530
7861
  * Plan phases
7531
7862
  * @description The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses.
@@ -7631,6 +7962,24 @@ export interface components {
7631
7962
  metadata?: components['schemas']['Metadata'] | null;
7632
7963
  /** @description Alignment configuration for the plan. */
7633
7964
  alignment?: components['schemas']['Alignment'];
7965
+ /**
7966
+ * Billing cadence
7967
+ * Format: duration
7968
+ * @description The default billing cadence for subscriptions using this plan.
7969
+ * Defines how often customers are billed using ISO8601 duration format.
7970
+ * Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).
7971
+ * @example P1M
7972
+ */
7973
+ billingCadence: string;
7974
+ /**
7975
+ * Pro-rating configuration
7976
+ * @description Default pro-rating configuration for subscriptions using this plan.
7977
+ * @default {
7978
+ * "enabled": true,
7979
+ * "mode": "prorate_prices"
7980
+ * }
7981
+ */
7982
+ proRatingConfig?: components['schemas']['ProRatingConfig'];
7634
7983
  /**
7635
7984
  * Plan phases
7636
7985
  * @description The plan phase or pricing ramp allows changing a plan's rate cards over time as a subscription progresses.
@@ -7654,10 +8003,19 @@ export interface components {
7654
8003
  metadata?: components['schemas']['Metadata'];
7655
8004
  /** @description The plan reference to change to. */
7656
8005
  plan: components['schemas']['PlanReferenceInput'];
8006
+ /** @description The key of the phase to start the subscription in.
8007
+ * If not provided, the subscription will start in the first phase of the plan. */
8008
+ startingPhase?: string;
7657
8009
  /** @description The name of the Subscription. If not provided the plan name is used. */
7658
8010
  name?: string;
7659
8011
  /** @description Description for the Subscription. */
7660
8012
  description?: string;
8013
+ /**
8014
+ * Format: date-time
8015
+ * @description The billing anchor of the subscription. The provided date will be normalized according to the billing cadence to the nearest recurrence before start time. If not provided, the previous subscription billing anchor will be used.
8016
+ * @example 2023-01-01T01:01:01.001Z
8017
+ */
8018
+ billingAnchor?: Date;
7661
8019
  };
7662
8020
  /** @description Create subscription based on plan. */
7663
8021
  PlanSubscriptionCreate: {
@@ -7667,6 +8025,9 @@ export interface components {
7667
8025
  metadata?: components['schemas']['Metadata'];
7668
8026
  /** @description The plan reference to change to. */
7669
8027
  plan: components['schemas']['PlanReferenceInput'];
8028
+ /** @description The key of the phase to start the subscription in.
8029
+ * If not provided, the subscription will start in the first phase of the plan. */
8030
+ startingPhase?: string;
7670
8031
  /** @description The name of the Subscription. If not provided the plan name is used. */
7671
8032
  name?: string;
7672
8033
  /** @description Description for the Subscription. */
@@ -7684,6 +8045,12 @@ export interface components {
7684
8045
  customerId?: string;
7685
8046
  /** @description The key of the customer. Provide either the key or ID. */
7686
8047
  customerKey?: string;
8048
+ /**
8049
+ * Format: date-time
8050
+ * @description The billing anchor of the subscription. The provided date will be normalized according to the billing cadence to the nearest recurrence before start time. If not provided, the subscription start time will be used.
8051
+ * @example 2023-01-01T01:01:01.001Z
8052
+ */
8053
+ billingAnchor?: Date;
7687
8054
  };
7688
8055
  /** @description A consumer portal token.
7689
8056
  *
@@ -7751,6 +8118,26 @@ export interface components {
7751
8118
  */
7752
8119
  unitPrice: components['schemas']['UnitPrice'] | null;
7753
8120
  };
8121
+ /** @description Configuration for pro-rating behavior. */
8122
+ ProRatingConfig: {
8123
+ /**
8124
+ * Enable pro-rating
8125
+ * @description Whether pro-rating is enabled for this plan.
8126
+ * @default true
8127
+ */
8128
+ enabled: boolean;
8129
+ /**
8130
+ * Pro-rating mode
8131
+ * @description How to handle pro-rating for billing period changes.
8132
+ * @default prorate_prices
8133
+ */
8134
+ mode: components['schemas']['ProRatingMode'];
8135
+ };
8136
+ /**
8137
+ * @description Pro-rating mode options for handling billing period changes.
8138
+ * @enum {string}
8139
+ */
8140
+ ProRatingMode: 'prorate_prices';
7754
8141
  /** @description Progress describes a progress of a task. */
7755
8142
  Progress: {
7756
8143
  /**
@@ -8106,9 +8493,6 @@ export interface components {
8106
8493
  readonly listing: components['schemas']['MarketplaceListing'];
8107
8494
  /** @description Status of the app connection. */
8108
8495
  readonly status: components['schemas']['AppStatus'];
8109
- /** @description Default for the app type
8110
- * Only one app of each type can be default. */
8111
- default: boolean;
8112
8496
  /**
8113
8497
  * @description The app's type is Sandbox. (enum property replaced by openapi-typescript)
8114
8498
  * @enum {string}
@@ -8132,9 +8516,6 @@ export interface components {
8132
8516
  * @description Additional metadata for the resource.
8133
8517
  */
8134
8518
  metadata?: components['schemas']['Metadata'] | null;
8135
- /** @description Default for the app type
8136
- * Only one app of each type can be default. */
8137
- default: boolean;
8138
8519
  /**
8139
8520
  * @description The app's type is Sandbox. (enum property replaced by openapi-typescript)
8140
8521
  * @enum {string}
@@ -8177,7 +8558,6 @@ export interface components {
8177
8558
  * "type": "stripe",
8178
8559
  * "name": "Stripe",
8179
8560
  * "status": "ready",
8180
- * "default": true,
8181
8561
  * "listing": {
8182
8562
  * "type": "stripe",
8183
8563
  * "name": "Stripe",
@@ -8261,9 +8641,6 @@ export interface components {
8261
8641
  readonly listing: components['schemas']['MarketplaceListing'];
8262
8642
  /** @description Status of the app connection. */
8263
8643
  readonly status: components['schemas']['AppStatus'];
8264
- /** @description Default for the app type
8265
- * Only one app of each type can be default. */
8266
- default: boolean;
8267
8644
  /**
8268
8645
  * @description The app's type is Stripe. (enum property replaced by openapi-typescript)
8269
8646
  * @enum {string}
@@ -8294,9 +8671,6 @@ export interface components {
8294
8671
  * @description Additional metadata for the resource.
8295
8672
  */
8296
8673
  metadata?: components['schemas']['Metadata'] | null;
8297
- /** @description Default for the app type
8298
- * Only one app of each type can be default. */
8299
- default: boolean;
8300
8674
  /**
8301
8675
  * @description The app's type is Stripe. (enum property replaced by openapi-typescript)
8302
8676
  * @enum {string}
@@ -8414,7 +8788,11 @@ export interface components {
8414
8788
  message?: string;
8415
8789
  };
8416
8790
  /**
8417
- * @description A subject is a unique identifier for a user or entity.
8791
+ * @description A subject is a unique identifier for a usage attribution by its key.
8792
+ * Subjects only exist in the concept of metering.
8793
+ * Subjects are optional to create and work as an enrichment for the subject key like displayName, metadata, etc.
8794
+ * Subjects are useful when you are reporting usage events with your own database ID but want to enrich the subject with a human-readable name or metadata.
8795
+ * For most use cases, a subject is equivalent to a customer.
8418
8796
  * @example {
8419
8797
  * "id": "01G65Z755AFWAKHE12NY0CQ9FH",
8420
8798
  * "key": "customer-id",
@@ -8422,8 +8800,6 @@ export interface components {
8422
8800
  * "metadata": {
8423
8801
  * "hubspotId": "123456"
8424
8802
  * },
8425
- * "currentPeriodStart": "2023-01-01T00:00:00Z",
8426
- * "currentPeriodEnd": "2023-02-01T00:00:00Z",
8427
8803
  * "stripeCustomerId": "cus_JMOlctsKV8"
8428
8804
  * }
8429
8805
  */
@@ -8435,7 +8811,8 @@ export interface components {
8435
8811
  readonly id: string;
8436
8812
  /**
8437
8813
  * @description A unique, human-readable identifier for the subject.
8438
- * @example customer-id
8814
+ * This is typically a database ID or a customer key.
8815
+ * @example customer-db-id-123
8439
8816
  */
8440
8817
  key: string;
8441
8818
  /**
@@ -8443,25 +8820,34 @@ export interface components {
8443
8820
  * @example Customer Name
8444
8821
  */
8445
8822
  displayName?: string | null;
8446
- /** @example {
8823
+ /**
8824
+ * @description Metadata for the subject.
8825
+ * @example {
8447
8826
  * "hubspotId": "123456"
8448
- * } */
8827
+ * }
8828
+ */
8449
8829
  metadata?: {
8450
8830
  [key: string]: unknown;
8451
8831
  } | null;
8452
8832
  /**
8453
8833
  * Format: date-time
8454
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8834
+ * @deprecated
8835
+ * @description The start of the current period for the subject.
8455
8836
  * @example 2023-01-01T00:00:00Z
8456
8837
  */
8457
8838
  currentPeriodStart?: Date;
8458
8839
  /**
8459
8840
  * Format: date-time
8460
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8841
+ * @deprecated
8842
+ * @description The end of the current period for the subject.
8461
8843
  * @example 2023-02-01T00:00:00Z
8462
8844
  */
8463
8845
  currentPeriodEnd?: Date;
8464
- /** @example cus_JMOlctsKV8 */
8846
+ /**
8847
+ * @deprecated
8848
+ * @description The Stripe customer ID for the subject.
8849
+ * @example cus_JMOlctsKV8
8850
+ */
8465
8851
  stripeCustomerId?: string | null;
8466
8852
  };
8467
8853
  /**
@@ -8472,15 +8858,14 @@ export interface components {
8472
8858
  * "metadata": {
8473
8859
  * "hubspotId": "123456"
8474
8860
  * },
8475
- * "currentPeriodStart": "2023-01-01T00:00:00Z",
8476
- * "currentPeriodEnd": "2023-02-01T00:00:00Z",
8477
8861
  * "stripeCustomerId": "cus_JMOlctsKV8"
8478
8862
  * }
8479
8863
  */
8480
8864
  SubjectUpsert: {
8481
8865
  /**
8482
8866
  * @description A unique, human-readable identifier for the subject.
8483
- * @example customer-id
8867
+ * This is typically a database ID or a customer key.
8868
+ * @example customer-db-id-123
8484
8869
  */
8485
8870
  key: string;
8486
8871
  /**
@@ -8488,25 +8873,34 @@ export interface components {
8488
8873
  * @example Customer Name
8489
8874
  */
8490
8875
  displayName?: string | null;
8491
- /** @example {
8876
+ /**
8877
+ * @description Metadata for the subject.
8878
+ * @example {
8492
8879
  * "hubspotId": "123456"
8493
- * } */
8880
+ * }
8881
+ */
8494
8882
  metadata?: {
8495
8883
  [key: string]: unknown;
8496
8884
  } | null;
8497
8885
  /**
8498
8886
  * Format: date-time
8499
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8887
+ * @deprecated
8888
+ * @description The start of the current period for the subject.
8500
8889
  * @example 2023-01-01T00:00:00Z
8501
8890
  */
8502
8891
  currentPeriodStart?: Date;
8503
8892
  /**
8504
8893
  * Format: date-time
8505
- * @description [RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.
8894
+ * @deprecated
8895
+ * @description The end of the current period for the subject.
8506
8896
  * @example 2023-02-01T00:00:00Z
8507
8897
  */
8508
8898
  currentPeriodEnd?: Date;
8509
- /** @example cus_JMOlctsKV8 */
8899
+ /**
8900
+ * @deprecated
8901
+ * @description The Stripe customer ID for the subject.
8902
+ * @example cus_JMOlctsKV8
8903
+ */
8510
8904
  stripeCustomerId?: string | null;
8511
8905
  };
8512
8906
  /** @description Subscription is an exact subscription instance. */
@@ -8583,6 +8977,31 @@ export interface components {
8583
8977
  * @default USD
8584
8978
  */
8585
8979
  currency: components['schemas']['CurrencyCode'];
8980
+ /**
8981
+ * Billing cadence
8982
+ * Format: duration
8983
+ * @description The billing cadence for the subscriptions.
8984
+ * Defines how often customers are billed using ISO8601 duration format.
8985
+ * Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).
8986
+ * @example P1M
8987
+ */
8988
+ readonly billingCadence: string;
8989
+ /**
8990
+ * Pro-rating configuration
8991
+ * @description The pro-rating configuration for the subscriptions.
8992
+ * @default {
8993
+ * "enabled": true,
8994
+ * "mode": "prorate_prices"
8995
+ * }
8996
+ */
8997
+ readonly proRatingConfig?: components['schemas']['ProRatingConfig'];
8998
+ /**
8999
+ * Billing anchor
9000
+ * Format: date-time
9001
+ * @description The normalizedbilling anchor of the subscription.
9002
+ * @example 2023-01-01T01:01:01.001Z
9003
+ */
9004
+ readonly billingAnchor: Date;
8586
9005
  };
8587
9006
  /** @description A subscription add-on, represents concrete instances of an add-on for a given subscription. */
8588
9007
  SubscriptionAddon: {
@@ -8633,13 +9052,13 @@ export interface components {
8633
9052
  * @description The cadence start of the resource.
8634
9053
  * @example 2023-01-01T01:01:01.001Z
8635
9054
  */
8636
- activeFrom: Date;
9055
+ readonly activeFrom: Date;
8637
9056
  /**
8638
9057
  * Format: date-time
8639
9058
  * @description The cadence end of the resource.
8640
9059
  * @example 2023-01-01T01:01:01.001Z
8641
9060
  */
8642
- activeTo?: Date;
9061
+ readonly activeTo?: Date;
8643
9062
  /**
8644
9063
  * Addon
8645
9064
  * @description Partially populated add-on properties.
@@ -8731,18 +9150,6 @@ export interface components {
8731
9150
  * @description Additional metadata for the resource.
8732
9151
  */
8733
9152
  metadata?: components['schemas']['Metadata'] | null;
8734
- /**
8735
- * Format: date-time
8736
- * @description The cadence start of the resource.
8737
- * @example 2023-01-01T01:01:01.001Z
8738
- */
8739
- activeFrom: Date;
8740
- /**
8741
- * Format: date-time
8742
- * @description The cadence end of the resource.
8743
- * @example 2023-01-01T01:01:01.001Z
8744
- */
8745
- activeTo?: Date;
8746
9153
  /**
8747
9154
  * Quantity
8748
9155
  * @description The quantity of the add-on. Always 1 for single instance add-ons.
@@ -8817,18 +9224,6 @@ export interface components {
8817
9224
  * @description Additional metadata for the resource.
8818
9225
  */
8819
9226
  metadata?: components['schemas']['Metadata'] | null;
8820
- /**
8821
- * Format: date-time
8822
- * @description The cadence start of the resource.
8823
- * @example 2023-01-01T01:01:01.001Z
8824
- */
8825
- activeFrom?: Date;
8826
- /**
8827
- * Format: date-time
8828
- * @description The cadence end of the resource.
8829
- * @example 2023-01-01T01:01:01.001Z
8830
- */
8831
- activeTo?: Date;
8832
9227
  /**
8833
9228
  * Quantity
8834
9229
  * @description The quantity of the add-on. Always 1 for single instance add-ons.
@@ -8948,6 +9343,31 @@ export interface components {
8948
9343
  * @default USD
8949
9344
  */
8950
9345
  currency: components['schemas']['CurrencyCode'];
9346
+ /**
9347
+ * Billing cadence
9348
+ * Format: duration
9349
+ * @description The billing cadence for the subscriptions.
9350
+ * Defines how often customers are billed using ISO8601 duration format.
9351
+ * Examples: "P1M" (monthly), "P3M" (quarterly), "P1Y" (annually).
9352
+ * @example P1M
9353
+ */
9354
+ readonly billingCadence: string;
9355
+ /**
9356
+ * Pro-rating configuration
9357
+ * @description The pro-rating configuration for the subscriptions.
9358
+ * @default {
9359
+ * "enabled": true,
9360
+ * "mode": "prorate_prices"
9361
+ * }
9362
+ */
9363
+ readonly proRatingConfig?: components['schemas']['ProRatingConfig'];
9364
+ /**
9365
+ * Billing anchor
9366
+ * Format: date-time
9367
+ * @description The normalizedbilling anchor of the subscription.
9368
+ * @example 2023-01-01T01:01:01.001Z
9369
+ */
9370
+ readonly billingAnchor: Date;
8951
9371
  /** @description Alignment details enriched with the current billing period. */
8952
9372
  alignment?: components['schemas']['SubscriptionAlignment'];
8953
9373
  /** @description The phases of the subscription. */
@@ -9018,7 +9438,7 @@ export interface components {
9018
9438
  *
9019
9439
  * 2. If a Feature is not associated with the SubscriptionItem, it is referenced by the Price
9020
9440
  *
9021
- * We say referenced by the Price regardless of how a price itself is referenced, it colloquially makes sense to say paying the same price for the same thing”. In practice this should be derived from what's printed on the invoice line-item. */
9441
+ * We say "referenced by the Price" regardless of how a price itself is referenced, it colloquially makes sense to say "paying the same price for the same thing". In practice this should be derived from what's printed on the invoice line-item. */
9022
9442
  key: string;
9023
9443
  /** @description The feature's key (if present). */
9024
9444
  featureKey?: string;
@@ -9196,22 +9616,6 @@ export interface components {
9196
9616
  * @enum {string}
9197
9617
  */
9198
9618
  SubscriptionTimingEnum: 'immediate' | 'next_billing_cycle';
9199
- /** @description Operational webhook reqeuest sent by Svix. */
9200
- SvixOperationalWebhookRequest: {
9201
- /**
9202
- * Operational Webhook Type
9203
- * @description The type of the Svix operational webhook request.
9204
- * @enum {string}
9205
- */
9206
- type: 'endpoint.created' | 'endpoint.deleted' | 'endpoint.disabled' | 'endpoint.updated' | 'message.attempt.exhausted' | 'message.attempt.failing' | 'message.attempt.recovered';
9207
- /**
9208
- * Operational Webhook Payload
9209
- * @description The payload of the Svix operational webhook request.
9210
- */
9211
- data: {
9212
- [key: string]: string;
9213
- };
9214
- };
9215
9619
  /**
9216
9620
  * @description Tax behavior.
9217
9621
  *
@@ -9345,6 +9749,26 @@ export interface components {
9345
9749
  */
9346
9750
  maximumAmount?: components['schemas']['Numeric'];
9347
9751
  };
9752
+ /** @description Validation errors providing details about compatibility issues between a plan and its add-on. */
9753
+ ValidationError: {
9754
+ /**
9755
+ * @description The path to the field.
9756
+ * @example addons/pro/ratecards/token/featureKey
9757
+ */
9758
+ readonly field: string;
9759
+ /**
9760
+ * @description The machine readable description of the error.
9761
+ * @example invalid_feature_key
9762
+ */
9763
+ readonly code: string;
9764
+ /**
9765
+ * @description The human readable description of the error.
9766
+ * @example not found feature by key
9767
+ */
9768
+ readonly message: string;
9769
+ /** @description Additional attributes. */
9770
+ readonly attributes?: components['schemas']['Annotations'];
9771
+ };
9348
9772
  /** @description ValidationIssue captures any validation issues related to the invoice.
9349
9773
  *
9350
9774
  * Issues with severity "critical" will prevent the invoice from being issued. */
@@ -9478,7 +9902,7 @@ export interface components {
9478
9902
  * @description Aggregation window size.
9479
9903
  * @enum {string}
9480
9904
  */
9481
- WindowSize: 'MINUTE' | 'HOUR' | 'DAY';
9905
+ WindowSize: 'MINUTE' | 'HOUR' | 'DAY' | 'MONTH';
9482
9906
  /** @description The windowed balance history. */
9483
9907
  WindowedBalanceHistory: {
9484
9908
  /** @description The windowed balance history.
@@ -9542,6 +9966,12 @@ export interface components {
9542
9966
  'GrantOrderByOrdering.order': components['schemas']['SortOrder'];
9543
9967
  /** @description The order by field. */
9544
9968
  'GrantOrderByOrdering.orderBy': components['schemas']['GrantOrderBy'];
9969
+ /** @description Filter by invoice created time.
9970
+ * Inclusive. */
9971
+ 'InvoiceListParams.createdAfter': Date | string;
9972
+ /** @description Filter by invoice created time.
9973
+ * Inclusive. */
9974
+ 'InvoiceListParams.createdBefore': Date | string;
9545
9975
  /** @description Filter by customer ID */
9546
9976
  'InvoiceListParams.customers': string[];
9547
9977
  /** @description What parts of the list output to expand in listings */
@@ -9550,10 +9980,18 @@ export interface components {
9550
9980
  'InvoiceListParams.extendedStatuses': string[];
9551
9981
  /** @description Include deleted invoices */
9552
9982
  'InvoiceListParams.includeDeleted': boolean;
9553
- /** @description Filter by invoice creation time */
9983
+ /** @description Filter by invoice issued time.
9984
+ * Inclusive. */
9554
9985
  'InvoiceListParams.issuedAfter': Date | string;
9555
- /** @description Filter by invoice creation time */
9986
+ /** @description Filter by invoice issued time.
9987
+ * Inclusive. */
9556
9988
  'InvoiceListParams.issuedBefore': Date | string;
9989
+ /** @description Filter by period start time.
9990
+ * Inclusive. */
9991
+ 'InvoiceListParams.periodStartAfter': Date | string;
9992
+ /** @description Filter by period start time.
9993
+ * Inclusive. */
9994
+ 'InvoiceListParams.periodStartBefore': Date | string;
9557
9995
  /** @description Filter by the invoice status. */
9558
9996
  'InvoiceListParams.statuses': components['schemas']['InvoiceStatus'][];
9559
9997
  /** @description The order direction. */
@@ -9745,6 +10183,7 @@ export type BillingWorkflowCollectionSettings = components['schemas']['BillingWo
9745
10183
  export type BillingWorkflowCreate = components['schemas']['BillingWorkflowCreate'];
9746
10184
  export type BillingWorkflowInvoicingSettings = components['schemas']['BillingWorkflowInvoicingSettings'];
9747
10185
  export type BillingWorkflowPaymentSettings = components['schemas']['BillingWorkflowPaymentSettings'];
10186
+ export type BillingWorkflowTaxSettings = components['schemas']['BillingWorkflowTaxSettings'];
9748
10187
  export type CheckoutSessionCustomTextAfterSubmitParams = components['schemas']['CheckoutSessionCustomTextAfterSubmitParams'];
9749
10188
  export type CheckoutSessionUiMode = components['schemas']['CheckoutSessionUIMode'];
9750
10189
  export type ClientAppStartResponse = components['schemas']['ClientAppStartResponse'];
@@ -9854,14 +10293,12 @@ export type InvoiceAppExternalIds = components['schemas']['InvoiceAppExternalIds
9854
10293
  export type InvoiceAvailableActionDetails = components['schemas']['InvoiceAvailableActionDetails'];
9855
10294
  export type InvoiceAvailableActionInvoiceDetails = components['schemas']['InvoiceAvailableActionInvoiceDetails'];
9856
10295
  export type InvoiceAvailableActions = components['schemas']['InvoiceAvailableActions'];
10296
+ export type InvoiceDetailedLine = components['schemas']['InvoiceDetailedLine'];
10297
+ export type InvoiceDetailedLineCostCategory = components['schemas']['InvoiceDetailedLineCostCategory'];
10298
+ export type InvoiceDetailedLineRateCard = components['schemas']['InvoiceDetailedLineRateCard'];
9857
10299
  export type InvoiceDocumentRef = components['schemas']['InvoiceDocumentRef'];
9858
10300
  export type InvoiceDocumentRefType = components['schemas']['InvoiceDocumentRefType'];
9859
10301
  export type InvoiceExpand = components['schemas']['InvoiceExpand'];
9860
- export type InvoiceFlatFeeCategory = components['schemas']['InvoiceFlatFeeCategory'];
9861
- export type InvoiceFlatFeeLine = components['schemas']['InvoiceFlatFeeLine'];
9862
- export type InvoiceFlatFeeLineReplaceUpdate = components['schemas']['InvoiceFlatFeeLineReplaceUpdate'];
9863
- export type InvoiceFlatFeePendingLineCreate = components['schemas']['InvoiceFlatFeePendingLineCreate'];
9864
- export type InvoiceFlatFeeRateCard = components['schemas']['InvoiceFlatFeeRateCard'];
9865
10302
  export type InvoiceGenericDocumentRef = components['schemas']['InvoiceGenericDocumentRef'];
9866
10303
  export type InvoiceLine = components['schemas']['InvoiceLine'];
9867
10304
  export type InvoiceLineAmountDiscount = components['schemas']['InvoiceLineAmountDiscount'];
@@ -9879,21 +10316,18 @@ export type InvoiceOrderBy = components['schemas']['InvoiceOrderBy'];
9879
10316
  export type InvoicePaginatedResponse = components['schemas']['InvoicePaginatedResponse'];
9880
10317
  export type InvoicePaymentTerms = components['schemas']['InvoicePaymentTerms'];
9881
10318
  export type InvoicePendingLineCreate = components['schemas']['InvoicePendingLineCreate'];
10319
+ export type InvoicePendingLineCreateInput = components['schemas']['InvoicePendingLineCreateInput'];
10320
+ export type InvoicePendingLineCreateResponse = components['schemas']['InvoicePendingLineCreateResponse'];
9882
10321
  export type InvoicePendingLinesActionFiltersInput = components['schemas']['InvoicePendingLinesActionFiltersInput'];
9883
10322
  export type InvoicePendingLinesActionInput = components['schemas']['InvoicePendingLinesActionInput'];
9884
10323
  export type InvoiceReference = components['schemas']['InvoiceReference'];
9885
10324
  export type InvoiceReplaceUpdate = components['schemas']['InvoiceReplaceUpdate'];
9886
- export type InvoiceSimulationFlatFeeLine = components['schemas']['InvoiceSimulationFlatFeeLine'];
9887
10325
  export type InvoiceSimulationInput = components['schemas']['InvoiceSimulationInput'];
9888
10326
  export type InvoiceSimulationLine = components['schemas']['InvoiceSimulationLine'];
9889
- export type InvoiceSimulationUsageBasedLine = components['schemas']['InvoiceSimulationUsageBasedLine'];
9890
10327
  export type InvoiceStatus = components['schemas']['InvoiceStatus'];
9891
10328
  export type InvoiceStatusDetails = components['schemas']['InvoiceStatusDetails'];
9892
10329
  export type InvoiceTotals = components['schemas']['InvoiceTotals'];
9893
10330
  export type InvoiceType = components['schemas']['InvoiceType'];
9894
- export type InvoiceUsageBasedLine = components['schemas']['InvoiceUsageBasedLine'];
9895
- export type InvoiceUsageBasedLineReplaceUpdate = components['schemas']['InvoiceUsageBasedLineReplaceUpdate'];
9896
- export type InvoiceUsageBasedPendingLineCreate = components['schemas']['InvoiceUsageBasedPendingLineCreate'];
9897
10331
  export type InvoiceUsageBasedRateCard = components['schemas']['InvoiceUsageBasedRateCard'];
9898
10332
  export type InvoiceWorkflowInvoicingSettingsReplaceUpdate = components['schemas']['InvoiceWorkflowInvoicingSettingsReplaceUpdate'];
9899
10333
  export type InvoiceWorkflowReplaceUpdate = components['schemas']['InvoiceWorkflowReplaceUpdate'];
@@ -9901,6 +10335,7 @@ export type InvoiceWorkflowSettings = components['schemas']['InvoiceWorkflowSett
9901
10335
  export type InvoiceWorkflowSettingsReplaceUpdate = components['schemas']['InvoiceWorkflowSettingsReplaceUpdate'];
9902
10336
  export type ListEntitlementsResult = components['schemas']['ListEntitlementsResult'];
9903
10337
  export type ListFeaturesResult = components['schemas']['ListFeaturesResult'];
10338
+ export type MarketplaceInstallRequestPayload = components['schemas']['MarketplaceInstallRequestPayload'];
9904
10339
  export type MarketplaceInstallResponse = components['schemas']['MarketplaceInstallResponse'];
9905
10340
  export type MarketplaceListing = components['schemas']['MarketplaceListing'];
9906
10341
  export type MarketplaceListingPaginatedResponse = components['schemas']['MarketplaceListingPaginatedResponse'];
@@ -9912,6 +10347,7 @@ export type Meter = components['schemas']['Meter'];
9912
10347
  export type MeterAggregation = components['schemas']['MeterAggregation'];
9913
10348
  export type MeterCreate = components['schemas']['MeterCreate'];
9914
10349
  export type MeterOrderBy = components['schemas']['MeterOrderBy'];
10350
+ export type MeterQueryRequest = components['schemas']['MeterQueryRequest'];
9915
10351
  export type MeterQueryResult = components['schemas']['MeterQueryResult'];
9916
10352
  export type MeterQueryRow = components['schemas']['MeterQueryRow'];
9917
10353
  export type MeterUpdate = components['schemas']['MeterUpdate'];
@@ -9930,9 +10366,13 @@ export type NotificationEventBalanceThresholdPayload = components['schemas']['No
9930
10366
  export type NotificationEventBalanceThresholdPayloadData = components['schemas']['NotificationEventBalanceThresholdPayloadData'];
9931
10367
  export type NotificationEventDeliveryStatus = components['schemas']['NotificationEventDeliveryStatus'];
9932
10368
  export type NotificationEventDeliveryStatusState = components['schemas']['NotificationEventDeliveryStatusState'];
10369
+ export type NotificationEventEntitlementValuePayloadBase = components['schemas']['NotificationEventEntitlementValuePayloadBase'];
10370
+ export type NotificationEventInvoiceCreatedPayload = components['schemas']['NotificationEventInvoiceCreatedPayload'];
10371
+ export type NotificationEventInvoiceUpdatedPayload = components['schemas']['NotificationEventInvoiceUpdatedPayload'];
9933
10372
  export type NotificationEventOrderBy = components['schemas']['NotificationEventOrderBy'];
9934
10373
  export type NotificationEventPaginatedResponse = components['schemas']['NotificationEventPaginatedResponse'];
9935
10374
  export type NotificationEventPayload = components['schemas']['NotificationEventPayload'];
10375
+ export type NotificationEventResetPayload = components['schemas']['NotificationEventResetPayload'];
9936
10376
  export type NotificationEventType = components['schemas']['NotificationEventType'];
9937
10377
  export type NotificationRule = components['schemas']['NotificationRule'];
9938
10378
  export type NotificationRuleBalanceThreshold = components['schemas']['NotificationRuleBalanceThreshold'];
@@ -9940,6 +10380,12 @@ export type NotificationRuleBalanceThresholdCreateRequest = components['schemas'
9940
10380
  export type NotificationRuleBalanceThresholdValue = components['schemas']['NotificationRuleBalanceThresholdValue'];
9941
10381
  export type NotificationRuleBalanceThresholdValueType = components['schemas']['NotificationRuleBalanceThresholdValueType'];
9942
10382
  export type NotificationRuleCreateRequest = components['schemas']['NotificationRuleCreateRequest'];
10383
+ export type NotificationRuleEntitlementReset = components['schemas']['NotificationRuleEntitlementReset'];
10384
+ export type NotificationRuleEntitlementResetCreateRequest = components['schemas']['NotificationRuleEntitlementResetCreateRequest'];
10385
+ export type NotificationRuleInvoiceCreated = components['schemas']['NotificationRuleInvoiceCreated'];
10386
+ export type NotificationRuleInvoiceCreatedCreateRequest = components['schemas']['NotificationRuleInvoiceCreatedCreateRequest'];
10387
+ export type NotificationRuleInvoiceUpdated = components['schemas']['NotificationRuleInvoiceUpdated'];
10388
+ export type NotificationRuleInvoiceUpdatedCreateRequest = components['schemas']['NotificationRuleInvoiceUpdatedCreateRequest'];
9943
10389
  export type NotificationRuleOrderBy = components['schemas']['NotificationRuleOrderBy'];
9944
10390
  export type NotificationRulePaginatedResponse = components['schemas']['NotificationRulePaginatedResponse'];
9945
10391
  export type Numeric = components['schemas']['Numeric'];
@@ -9971,6 +10417,8 @@ export type PortalToken = components['schemas']['PortalToken'];
9971
10417
  export type PreconditionFailedProblemResponse = components['schemas']['PreconditionFailedProblemResponse'];
9972
10418
  export type PricePaymentTerm = components['schemas']['PricePaymentTerm'];
9973
10419
  export type PriceTier = components['schemas']['PriceTier'];
10420
+ export type ProRatingConfig = components['schemas']['ProRatingConfig'];
10421
+ export type ProRatingMode = components['schemas']['ProRatingMode'];
9974
10422
  export type Progress = components['schemas']['Progress'];
9975
10423
  export type RateCard = components['schemas']['RateCard'];
9976
10424
  export type RateCardBooleanEntitlement = components['schemas']['RateCardBooleanEntitlement'];
@@ -10023,7 +10471,6 @@ export type SubscriptionPhaseExpanded = components['schemas']['SubscriptionPhase
10023
10471
  export type SubscriptionStatus = components['schemas']['SubscriptionStatus'];
10024
10472
  export type SubscriptionTiming = components['schemas']['SubscriptionTiming'];
10025
10473
  export type SubscriptionTimingEnum = components['schemas']['SubscriptionTimingEnum'];
10026
- export type SvixOperationalWebhookRequest = components['schemas']['SvixOperationalWebhookRequest'];
10027
10474
  export type TaxBehavior = components['schemas']['TaxBehavior'];
10028
10475
  export type TaxConfig = components['schemas']['TaxConfig'];
10029
10476
  export type TieredPriceMode = components['schemas']['TieredPriceMode'];
@@ -10032,6 +10479,7 @@ export type UnauthorizedProblemResponse = components['schemas']['UnauthorizedPro
10032
10479
  export type UnexpectedProblemResponse = components['schemas']['UnexpectedProblemResponse'];
10033
10480
  export type UnitPrice = components['schemas']['UnitPrice'];
10034
10481
  export type UnitPriceWithCommitments = components['schemas']['UnitPriceWithCommitments'];
10482
+ export type ValidationError = components['schemas']['ValidationError'];
10035
10483
  export type ValidationIssue = components['schemas']['ValidationIssue'];
10036
10484
  export type ValidationIssueSeverity = components['schemas']['ValidationIssueSeverity'];
10037
10485
  export type VoidInvoiceActionCreate = components['schemas']['VoidInvoiceActionCreate'];
@@ -10068,12 +10516,16 @@ export type ParameterFeatureOrderByOrderingOrder = components['parameters']['Fea
10068
10516
  export type ParameterFeatureOrderByOrderingOrderBy = components['parameters']['FeatureOrderByOrdering.orderBy'];
10069
10517
  export type ParameterGrantOrderByOrderingOrder = components['parameters']['GrantOrderByOrdering.order'];
10070
10518
  export type ParameterGrantOrderByOrderingOrderBy = components['parameters']['GrantOrderByOrdering.orderBy'];
10519
+ export type ParameterInvoiceListParamsCreatedAfter = components['parameters']['InvoiceListParams.createdAfter'];
10520
+ export type ParameterInvoiceListParamsCreatedBefore = components['parameters']['InvoiceListParams.createdBefore'];
10071
10521
  export type ParameterInvoiceListParamsCustomers = components['parameters']['InvoiceListParams.customers'];
10072
10522
  export type ParameterInvoiceListParamsExpand = components['parameters']['InvoiceListParams.expand'];
10073
10523
  export type ParameterInvoiceListParamsExtendedStatuses = components['parameters']['InvoiceListParams.extendedStatuses'];
10074
10524
  export type ParameterInvoiceListParamsIncludeDeleted = components['parameters']['InvoiceListParams.includeDeleted'];
10075
10525
  export type ParameterInvoiceListParamsIssuedAfter = components['parameters']['InvoiceListParams.issuedAfter'];
10076
10526
  export type ParameterInvoiceListParamsIssuedBefore = components['parameters']['InvoiceListParams.issuedBefore'];
10527
+ export type ParameterInvoiceListParamsPeriodStartAfter = components['parameters']['InvoiceListParams.periodStartAfter'];
10528
+ export type ParameterInvoiceListParamsPeriodStartBefore = components['parameters']['InvoiceListParams.periodStartBefore'];
10077
10529
  export type ParameterInvoiceListParamsStatuses = components['parameters']['InvoiceListParams.statuses'];
10078
10530
  export type ParameterInvoiceOrderByOrderingOrder = components['parameters']['InvoiceOrderByOrdering.order'];
10079
10531
  export type ParameterInvoiceOrderByOrderingOrderBy = components['parameters']['InvoiceOrderByOrdering.orderBy'];
@@ -12024,6 +12476,95 @@ export interface operations {
12024
12476
  };
12025
12477
  };
12026
12478
  };
12479
+ createPendingInvoiceLine: {
12480
+ parameters: {
12481
+ query?: never;
12482
+ header?: never;
12483
+ path: {
12484
+ customerId: string;
12485
+ };
12486
+ cookie?: never;
12487
+ };
12488
+ requestBody: {
12489
+ content: {
12490
+ 'application/json': components['schemas']['InvoicePendingLineCreateInput'];
12491
+ };
12492
+ };
12493
+ responses: {
12494
+ /** @description The request has succeeded and a new resource has been created as a result. */
12495
+ 201: {
12496
+ headers: {
12497
+ [name: string]: unknown;
12498
+ };
12499
+ content: {
12500
+ 'application/json': components['schemas']['InvoicePendingLineCreateResponse'];
12501
+ };
12502
+ };
12503
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
12504
+ 400: {
12505
+ headers: {
12506
+ [name: string]: unknown;
12507
+ };
12508
+ content: {
12509
+ 'application/problem+json': components['schemas']['BadRequestProblemResponse'];
12510
+ };
12511
+ };
12512
+ /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
12513
+ 401: {
12514
+ headers: {
12515
+ [name: string]: unknown;
12516
+ };
12517
+ content: {
12518
+ 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'];
12519
+ };
12520
+ };
12521
+ /** @description The server understood the request but refuses to authorize it. */
12522
+ 403: {
12523
+ headers: {
12524
+ [name: string]: unknown;
12525
+ };
12526
+ content: {
12527
+ 'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
12528
+ };
12529
+ };
12530
+ /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */
12531
+ 412: {
12532
+ headers: {
12533
+ [name: string]: unknown;
12534
+ };
12535
+ content: {
12536
+ 'application/problem+json': components['schemas']['PreconditionFailedProblemResponse'];
12537
+ };
12538
+ };
12539
+ /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
12540
+ 500: {
12541
+ headers: {
12542
+ [name: string]: unknown;
12543
+ };
12544
+ content: {
12545
+ 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'];
12546
+ };
12547
+ };
12548
+ /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
12549
+ 503: {
12550
+ headers: {
12551
+ [name: string]: unknown;
12552
+ };
12553
+ content: {
12554
+ 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'];
12555
+ };
12556
+ };
12557
+ /** @description An unexpected error response. */
12558
+ default: {
12559
+ headers: {
12560
+ [name: string]: unknown;
12561
+ };
12562
+ content: {
12563
+ 'application/problem+json': components['schemas']['UnexpectedProblemResponse'];
12564
+ };
12565
+ };
12566
+ };
12567
+ };
12027
12568
  simulateInvoice: {
12028
12569
  parameters: {
12029
12570
  query?: never;
@@ -12120,10 +12661,24 @@ export interface operations {
12120
12661
  statuses?: components['parameters']['InvoiceListParams.statuses'];
12121
12662
  /** @description Filter by invoice extended statuses */
12122
12663
  extendedStatuses?: components['parameters']['InvoiceListParams.extendedStatuses'];
12123
- /** @description Filter by invoice creation time */
12664
+ /** @description Filter by invoice issued time.
12665
+ * Inclusive. */
12124
12666
  issuedAfter?: components['parameters']['InvoiceListParams.issuedAfter'];
12125
- /** @description Filter by invoice creation time */
12667
+ /** @description Filter by invoice issued time.
12668
+ * Inclusive. */
12126
12669
  issuedBefore?: components['parameters']['InvoiceListParams.issuedBefore'];
12670
+ /** @description Filter by period start time.
12671
+ * Inclusive. */
12672
+ periodStartAfter?: components['parameters']['InvoiceListParams.periodStartAfter'];
12673
+ /** @description Filter by period start time.
12674
+ * Inclusive. */
12675
+ periodStartBefore?: components['parameters']['InvoiceListParams.periodStartBefore'];
12676
+ /** @description Filter by invoice created time.
12677
+ * Inclusive. */
12678
+ createdAfter?: components['parameters']['InvoiceListParams.createdAfter'];
12679
+ /** @description Filter by invoice created time.
12680
+ * Inclusive. */
12681
+ createdBefore?: components['parameters']['InvoiceListParams.createdBefore'];
12127
12682
  /** @description What parts of the list output to expand in listings */
12128
12683
  expand?: components['parameters']['InvoiceListParams.expand'];
12129
12684
  /** @description Filter by customer ID */
@@ -12310,26 +12865,27 @@ export interface operations {
12310
12865
  };
12311
12866
  };
12312
12867
  };
12313
- createPendingInvoiceLine: {
12868
+ getInvoice: {
12314
12869
  parameters: {
12315
- query?: never;
12316
- header?: never;
12317
- path?: never;
12318
- cookie?: never;
12319
- };
12320
- requestBody: {
12321
- content: {
12322
- 'application/json': components['schemas']['InvoicePendingLineCreate'][];
12870
+ query?: {
12871
+ expand?: components['schemas']['InvoiceExpand'][];
12872
+ includeDeletedLines?: boolean;
12873
+ };
12874
+ header?: never;
12875
+ path: {
12876
+ invoiceId: string;
12323
12877
  };
12878
+ cookie?: never;
12324
12879
  };
12880
+ requestBody?: never;
12325
12881
  responses: {
12326
- /** @description The request has succeeded and a new resource has been created as a result. */
12327
- 201: {
12882
+ /** @description The request has succeeded. */
12883
+ 200: {
12328
12884
  headers: {
12329
12885
  [name: string]: unknown;
12330
12886
  };
12331
12887
  content: {
12332
- 'application/json': components['schemas']['InvoiceLine'][];
12888
+ 'application/json': components['schemas']['Invoice'];
12333
12889
  };
12334
12890
  };
12335
12891
  /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
@@ -12359,6 +12915,15 @@ export interface operations {
12359
12915
  'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
12360
12916
  };
12361
12917
  };
12918
+ /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
12919
+ 404: {
12920
+ headers: {
12921
+ [name: string]: unknown;
12922
+ };
12923
+ content: {
12924
+ 'application/problem+json': components['schemas']['NotFoundProblemResponse'];
12925
+ };
12926
+ };
12362
12927
  /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */
12363
12928
  412: {
12364
12929
  headers: {
@@ -12397,19 +12962,20 @@ export interface operations {
12397
12962
  };
12398
12963
  };
12399
12964
  };
12400
- getInvoice: {
12965
+ updateInvoice: {
12401
12966
  parameters: {
12402
- query?: {
12403
- expand?: components['schemas']['InvoiceExpand'][];
12404
- includeDeletedLines?: boolean;
12405
- };
12967
+ query?: never;
12406
12968
  header?: never;
12407
12969
  path: {
12408
12970
  invoiceId: string;
12409
12971
  };
12410
12972
  cookie?: never;
12411
12973
  };
12412
- requestBody?: never;
12974
+ requestBody: {
12975
+ content: {
12976
+ 'application/json': components['schemas']['InvoiceReplaceUpdate'];
12977
+ };
12978
+ };
12413
12979
  responses: {
12414
12980
  /** @description The request has succeeded. */
12415
12981
  200: {
@@ -12494,7 +13060,7 @@ export interface operations {
12494
13060
  };
12495
13061
  };
12496
13062
  };
12497
- updateInvoice: {
13063
+ deleteInvoice: {
12498
13064
  parameters: {
12499
13065
  query?: never;
12500
13066
  header?: never;
@@ -12503,20 +13069,14 @@ export interface operations {
12503
13069
  };
12504
13070
  cookie?: never;
12505
13071
  };
12506
- requestBody: {
12507
- content: {
12508
- 'application/json': components['schemas']['InvoiceReplaceUpdate'];
12509
- };
12510
- };
13072
+ requestBody?: never;
12511
13073
  responses: {
12512
- /** @description The request has succeeded. */
12513
- 200: {
13074
+ /** @description There is no content to send for this request, but the headers may be useful. */
13075
+ 204: {
12514
13076
  headers: {
12515
13077
  [name: string]: unknown;
12516
13078
  };
12517
- content: {
12518
- 'application/json': components['schemas']['Invoice'];
12519
- };
13079
+ content?: never;
12520
13080
  };
12521
13081
  /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
12522
13082
  400: {
@@ -12592,7 +13152,7 @@ export interface operations {
12592
13152
  };
12593
13153
  };
12594
13154
  };
12595
- deleteInvoice: {
13155
+ advanceInvoiceAction: {
12596
13156
  parameters: {
12597
13157
  query?: never;
12598
13158
  header?: never;
@@ -12603,12 +13163,14 @@ export interface operations {
12603
13163
  };
12604
13164
  requestBody?: never;
12605
13165
  responses: {
12606
- /** @description There is no content to send for this request, but the headers may be useful. */
12607
- 204: {
13166
+ /** @description The request has succeeded. */
13167
+ 200: {
12608
13168
  headers: {
12609
13169
  [name: string]: unknown;
12610
13170
  };
12611
- content?: never;
13171
+ content: {
13172
+ 'application/json': components['schemas']['Invoice'];
13173
+ };
12612
13174
  };
12613
13175
  /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
12614
13176
  400: {
@@ -12684,7 +13246,7 @@ export interface operations {
12684
13246
  };
12685
13247
  };
12686
13248
  };
12687
- advanceInvoiceAction: {
13249
+ approveInvoiceAction: {
12688
13250
  parameters: {
12689
13251
  query?: never;
12690
13252
  header?: never;
@@ -12778,7 +13340,7 @@ export interface operations {
12778
13340
  };
12779
13341
  };
12780
13342
  };
12781
- approveInvoiceAction: {
13343
+ retryInvoiceAction: {
12782
13344
  parameters: {
12783
13345
  query?: never;
12784
13346
  header?: never;
@@ -12872,7 +13434,7 @@ export interface operations {
12872
13434
  };
12873
13435
  };
12874
13436
  };
12875
- retryInvoiceAction: {
13437
+ snapshotQuantitiesInvoiceAction: {
12876
13438
  parameters: {
12877
13439
  query?: never;
12878
13440
  header?: never;
@@ -16164,12 +16726,7 @@ export interface operations {
16164
16726
  };
16165
16727
  requestBody: {
16166
16728
  content: {
16167
- 'application/json': {
16168
- /** @description Name of the application to install.
16169
- *
16170
- * If not set defaults to the marketplace item's description. */
16171
- name?: string;
16172
- };
16729
+ 'application/json': components['schemas']['MarketplaceInstallRequestPayload'];
16173
16730
  };
16174
16731
  };
16175
16732
  responses: {
@@ -16260,13 +16817,19 @@ export interface operations {
16260
16817
  requestBody: {
16261
16818
  content: {
16262
16819
  'application/json': {
16263
- /** @description The API key for the provider.
16264
- * For example, the Stripe API key. */
16265
- apiKey: string;
16266
16820
  /** @description Name of the application to install.
16267
16821
  *
16268
- * If not set defaults to the marketplace item's description. */
16822
+ * If name is not provided defaults to the marketplace listing's name. */
16269
16823
  name?: string;
16824
+ /**
16825
+ * @description If true, a billing profile will be created for the app.
16826
+ * The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.
16827
+ * @default true
16828
+ */
16829
+ createBillingProfile?: boolean;
16830
+ /** @description The API key for the provider.
16831
+ * For example, the Stripe API key. */
16832
+ apiKey: string;
16270
16833
  };
16271
16834
  };
16272
16835
  };
@@ -17118,6 +17681,104 @@ export interface operations {
17118
17681
  };
17119
17682
  };
17120
17683
  };
17684
+ queryMeterPost: {
17685
+ parameters: {
17686
+ query?: never;
17687
+ header?: never;
17688
+ path: {
17689
+ meterIdOrSlug: string;
17690
+ };
17691
+ cookie?: never;
17692
+ };
17693
+ requestBody: {
17694
+ content: {
17695
+ 'application/json': components['schemas']['MeterQueryRequest'];
17696
+ };
17697
+ };
17698
+ responses: {
17699
+ /** @description The request has succeeded. */
17700
+ 200: {
17701
+ headers: {
17702
+ [name: string]: unknown;
17703
+ };
17704
+ content: {
17705
+ 'application/json': components['schemas']['MeterQueryResult'];
17706
+ };
17707
+ };
17708
+ /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
17709
+ 400: {
17710
+ headers: {
17711
+ [name: string]: unknown;
17712
+ };
17713
+ content: {
17714
+ 'application/problem+json': components['schemas']['BadRequestProblemResponse'];
17715
+ };
17716
+ };
17717
+ /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
17718
+ 401: {
17719
+ headers: {
17720
+ [name: string]: unknown;
17721
+ };
17722
+ content: {
17723
+ 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'];
17724
+ };
17725
+ };
17726
+ /** @description The server understood the request but refuses to authorize it. */
17727
+ 403: {
17728
+ headers: {
17729
+ [name: string]: unknown;
17730
+ };
17731
+ content: {
17732
+ 'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
17733
+ };
17734
+ };
17735
+ /** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
17736
+ 404: {
17737
+ headers: {
17738
+ [name: string]: unknown;
17739
+ };
17740
+ content: {
17741
+ 'application/problem+json': components['schemas']['NotFoundProblemResponse'];
17742
+ };
17743
+ };
17744
+ /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */
17745
+ 412: {
17746
+ headers: {
17747
+ [name: string]: unknown;
17748
+ };
17749
+ content: {
17750
+ 'application/problem+json': components['schemas']['PreconditionFailedProblemResponse'];
17751
+ };
17752
+ };
17753
+ /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
17754
+ 500: {
17755
+ headers: {
17756
+ [name: string]: unknown;
17757
+ };
17758
+ content: {
17759
+ 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'];
17760
+ };
17761
+ };
17762
+ /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
17763
+ 503: {
17764
+ headers: {
17765
+ [name: string]: unknown;
17766
+ };
17767
+ content: {
17768
+ 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'];
17769
+ };
17770
+ };
17771
+ /** @description An unexpected error response. */
17772
+ default: {
17773
+ headers: {
17774
+ [name: string]: unknown;
17775
+ };
17776
+ content: {
17777
+ 'application/problem+json': components['schemas']['UnexpectedProblemResponse'];
17778
+ };
17779
+ };
17780
+ };
17781
+ };
17121
17782
  listMeterSubjects: {
17122
17783
  parameters: {
17123
17784
  query?: never;
@@ -18467,91 +19128,6 @@ export interface operations {
18467
19128
  };
18468
19129
  };
18469
19130
  };
18470
- receiveSvixOperationalEvent: {
18471
- parameters: {
18472
- query?: never;
18473
- header?: never;
18474
- path?: never;
18475
- cookie?: never;
18476
- };
18477
- requestBody: {
18478
- content: {
18479
- 'application/json': components['schemas']['SvixOperationalWebhookRequest'];
18480
- };
18481
- };
18482
- responses: {
18483
- /** @description There is no content to send for this request, but the headers may be useful. */
18484
- 204: {
18485
- headers: {
18486
- [name: string]: unknown;
18487
- };
18488
- content?: never;
18489
- };
18490
- /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
18491
- 400: {
18492
- headers: {
18493
- [name: string]: unknown;
18494
- };
18495
- content: {
18496
- 'application/problem+json': components['schemas']['BadRequestProblemResponse'];
18497
- };
18498
- };
18499
- /** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
18500
- 401: {
18501
- headers: {
18502
- [name: string]: unknown;
18503
- };
18504
- content: {
18505
- 'application/problem+json': components['schemas']['UnauthorizedProblemResponse'];
18506
- };
18507
- };
18508
- /** @description The server understood the request but refuses to authorize it. */
18509
- 403: {
18510
- headers: {
18511
- [name: string]: unknown;
18512
- };
18513
- content: {
18514
- 'application/problem+json': components['schemas']['ForbiddenProblemResponse'];
18515
- };
18516
- };
18517
- /** @description One or more conditions given in the request header fields evaluated to false when tested on the server. */
18518
- 412: {
18519
- headers: {
18520
- [name: string]: unknown;
18521
- };
18522
- content: {
18523
- 'application/problem+json': components['schemas']['PreconditionFailedProblemResponse'];
18524
- };
18525
- };
18526
- /** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
18527
- 500: {
18528
- headers: {
18529
- [name: string]: unknown;
18530
- };
18531
- content: {
18532
- 'application/problem+json': components['schemas']['InternalServerErrorProblemResponse'];
18533
- };
18534
- };
18535
- /** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
18536
- 503: {
18537
- headers: {
18538
- [name: string]: unknown;
18539
- };
18540
- content: {
18541
- 'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse'];
18542
- };
18543
- };
18544
- /** @description An unexpected error response. */
18545
- default: {
18546
- headers: {
18547
- [name: string]: unknown;
18548
- };
18549
- content: {
18550
- 'application/problem+json': components['schemas']['UnexpectedProblemResponse'];
18551
- };
18552
- };
18553
- };
18554
- };
18555
19131
  listPlans: {
18556
19132
  parameters: {
18557
19133
  query?: {
@@ -22658,7 +23234,24 @@ export interface operations {
22658
23234
  requestBody: {
22659
23235
  content: {
22660
23236
  'application/json': {
23237
+ /**
23238
+ * @description Timing configuration for the migration, when the migration should take effect.
23239
+ * If not supported by the subscription, 400 will be returned.
23240
+ * @default immediate
23241
+ */
23242
+ timing?: components['schemas']['SubscriptionTiming'];
23243
+ /** @description The version of the plan to migrate to.
23244
+ * If not provided, the subscription will migrate to the latest version of the current plan. */
22661
23245
  targetVersion?: number;
23246
+ /** @description The key of the phase to start the subscription in.
23247
+ * If not provided, the subscription will start in the first phase of the plan. */
23248
+ startingPhase?: string;
23249
+ /**
23250
+ * Format: date-time
23251
+ * @description The billing anchor of the subscription. The provided date will be normalized according to the billing cadence to the nearest recurrence before start time. If not provided, the previous subscription billing anchor will be used.
23252
+ * @example 2023-01-01T01:01:01.001Z
23253
+ */
23254
+ billingAnchor?: Date;
22662
23255
  };
22663
23256
  };
22664
23257
  };