@openmeter/client 1.0.0-beta.230 → 1.0.0-beta.232

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 (137) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +365 -76
  3. package/dist/core.d.ts +0 -1
  4. package/dist/core.js +11 -1
  5. package/dist/funcs/addons.d.ts +49 -1
  6. package/dist/funcs/addons.js +109 -12
  7. package/dist/funcs/apps.d.ts +55 -2
  8. package/dist/funcs/apps.js +179 -4
  9. package/dist/funcs/billing.d.ts +46 -1
  10. package/dist/funcs/billing.js +81 -8
  11. package/dist/funcs/currencies.d.ts +39 -2
  12. package/dist/funcs/currencies.js +93 -6
  13. package/dist/funcs/customers.d.ts +165 -2
  14. package/dist/funcs/customers.js +402 -40
  15. package/dist/funcs/defaults.d.ts +10 -1
  16. package/dist/funcs/defaults.js +11 -1
  17. package/dist/funcs/entitlements.d.ts +5 -1
  18. package/dist/funcs/entitlements.js +18 -4
  19. package/dist/funcs/events.d.ts +14 -1
  20. package/dist/funcs/events.js +18 -1
  21. package/dist/funcs/features.d.ts +42 -1
  22. package/dist/funcs/features.js +91 -10
  23. package/dist/funcs/governance.d.ts +14 -1
  24. package/dist/funcs/governance.js +15 -1
  25. package/dist/funcs/index.d.ts +0 -1
  26. package/dist/funcs/index.js +1 -1
  27. package/dist/funcs/invoices.d.ts +102 -2
  28. package/dist/funcs/invoices.js +247 -8
  29. package/dist/funcs/llmCost.d.ts +36 -1
  30. package/dist/funcs/llmCost.js +63 -6
  31. package/dist/funcs/meters.d.ts +53 -1
  32. package/dist/funcs/meters.js +113 -12
  33. package/dist/funcs/planAddons.d.ts +35 -1
  34. package/dist/funcs/planAddons.js +101 -18
  35. package/dist/funcs/plans.d.ts +49 -1
  36. package/dist/funcs/plans.js +109 -12
  37. package/dist/funcs/subscriptions.d.ts +59 -1
  38. package/dist/funcs/subscriptions.js +147 -18
  39. package/dist/funcs/tax.d.ts +25 -1
  40. package/dist/funcs/tax.js +60 -8
  41. package/dist/index.d.ts +4 -7
  42. package/dist/index.js +4 -6
  43. package/dist/lib/config.d.ts +2 -3
  44. package/dist/lib/config.js +1 -1
  45. package/dist/lib/encodings.d.ts +0 -1
  46. package/dist/lib/encodings.js +1 -1
  47. package/dist/lib/paginate.d.ts +56 -0
  48. package/dist/lib/paginate.js +60 -0
  49. package/dist/lib/request.d.ts +0 -1
  50. package/dist/lib/request.js +1 -1
  51. package/dist/lib/to-error.d.ts +0 -1
  52. package/dist/lib/to-error.js +1 -1
  53. package/dist/lib/types.d.ts +0 -1
  54. package/dist/lib/types.js +1 -1
  55. package/dist/lib/version.d.ts +1 -0
  56. package/dist/lib/version.js +5 -0
  57. package/dist/lib/wire.d.ts +4 -1
  58. package/dist/lib/wire.js +118 -7
  59. package/dist/models/errors.d.ts +13 -2
  60. package/dist/models/errors.js +31 -4
  61. package/dist/models/operations/addons.d.ts +0 -1
  62. package/dist/models/operations/addons.js +1 -1
  63. package/dist/models/operations/apps.d.ts +26 -5
  64. package/dist/models/operations/apps.js +1 -1
  65. package/dist/models/operations/billing.d.ts +0 -1
  66. package/dist/models/operations/billing.js +1 -1
  67. package/dist/models/operations/currencies.d.ts +10 -1
  68. package/dist/models/operations/currencies.js +1 -1
  69. package/dist/models/operations/customers.d.ts +11 -7
  70. package/dist/models/operations/customers.js +1 -1
  71. package/dist/models/operations/defaults.d.ts +0 -1
  72. package/dist/models/operations/defaults.js +1 -1
  73. package/dist/models/operations/entitlements.d.ts +0 -1
  74. package/dist/models/operations/entitlements.js +1 -1
  75. package/dist/models/operations/events.d.ts +0 -1
  76. package/dist/models/operations/events.js +1 -1
  77. package/dist/models/operations/features.d.ts +0 -1
  78. package/dist/models/operations/features.js +1 -1
  79. package/dist/models/operations/governance.d.ts +0 -1
  80. package/dist/models/operations/governance.js +1 -1
  81. package/dist/models/operations/invoices.d.ts +20 -7
  82. package/dist/models/operations/invoices.js +1 -1
  83. package/dist/models/operations/llmCost.d.ts +0 -1
  84. package/dist/models/operations/llmCost.js +1 -1
  85. package/dist/models/operations/meters.d.ts +0 -1
  86. package/dist/models/operations/meters.js +1 -1
  87. package/dist/models/operations/planAddons.d.ts +0 -1
  88. package/dist/models/operations/planAddons.js +1 -1
  89. package/dist/models/operations/plans.d.ts +0 -1
  90. package/dist/models/operations/plans.js +1 -1
  91. package/dist/models/operations/subscriptions.d.ts +0 -1
  92. package/dist/models/operations/subscriptions.js +1 -1
  93. package/dist/models/operations/tax.d.ts +0 -1
  94. package/dist/models/operations/tax.js +1 -1
  95. package/dist/models/schemas.d.ts +11651 -6090
  96. package/dist/models/schemas.js +991 -468
  97. package/dist/models/types.d.ts +941 -810
  98. package/dist/models/types.js +1 -1
  99. package/dist/sdk/addons.d.ts +60 -1
  100. package/dist/sdk/addons.js +63 -1
  101. package/dist/sdk/apps.d.ts +68 -2
  102. package/dist/sdk/apps.js +81 -2
  103. package/dist/sdk/billing.d.ts +57 -1
  104. package/dist/sdk/billing.js +60 -1
  105. package/dist/sdk/customers.d.ts +211 -2
  106. package/dist/sdk/customers.js +222 -2
  107. package/dist/sdk/defaults.d.ts +10 -1
  108. package/dist/sdk/defaults.js +11 -1
  109. package/dist/sdk/entitlements.d.ts +5 -1
  110. package/dist/sdk/entitlements.js +6 -1
  111. package/dist/sdk/events.d.ts +25 -1
  112. package/dist/sdk/events.js +28 -1
  113. package/dist/sdk/features.d.ts +53 -1
  114. package/dist/sdk/features.js +56 -1
  115. package/dist/sdk/internal.d.ts +328 -0
  116. package/dist/sdk/internal.js +404 -0
  117. package/dist/sdk/invoices.d.ts +5 -2
  118. package/dist/sdk/invoices.js +13 -2
  119. package/dist/sdk/llmCost.d.ts +57 -1
  120. package/dist/sdk/llmCost.js +62 -1
  121. package/dist/sdk/meters.d.ts +64 -1
  122. package/dist/sdk/meters.js +67 -1
  123. package/dist/sdk/planAddons.d.ts +46 -1
  124. package/dist/sdk/planAddons.js +49 -1
  125. package/dist/sdk/plans.d.ts +60 -1
  126. package/dist/sdk/plans.js +63 -1
  127. package/dist/sdk/sdk.d.ts +9 -13
  128. package/dist/sdk/sdk.js +11 -20
  129. package/dist/sdk/subscriptions.d.ts +72 -3
  130. package/dist/sdk/subscriptions.js +77 -5
  131. package/dist/sdk/tax.d.ts +34 -1
  132. package/dist/sdk/tax.js +37 -1
  133. package/package.json +30 -6
  134. package/dist/sdk/currencies.d.ts +0 -12
  135. package/dist/sdk/currencies.js +0 -21
  136. package/dist/sdk/governance.d.ts +0 -9
  137. package/dist/sdk/governance.js +0 -12
@@ -1,3 +1,4 @@
1
+ // Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
1
2
  import { z } from 'zod';
2
3
  export const labels = z
3
4
  .record(z.string(), z.string())
@@ -8,6 +9,11 @@ export const currencyCode = z
8
9
  .max(3)
9
10
  .regex(new RegExp('^[A-Z]{3}$'))
10
11
  .describe('Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. Custom three-letter currency codes are also supported for convenience.');
12
+ export const currencyCodeCustom = z
13
+ .string()
14
+ .min(4)
15
+ .max(24)
16
+ .describe('Custom currency code. It should be a unique code but not conflicting with any existing fiat currency codes.');
11
17
  export const numeric = z
12
18
  .string()
13
19
  .regex(new RegExp('^\\-?[0-9]+(\\.[0-9]+)?$'))
@@ -109,9 +115,9 @@ export const cursorMetaPage = z
109
115
  .object({
110
116
  first: z.string().optional().describe('URI to the first page.'),
111
117
  last: z.string().optional().describe('URI to the last page.'),
112
- next: z.string().optional().describe('URI to the next page.'),
113
- previous: z.string().optional().describe('URI to the previous page.'),
114
- size: z.number().int().optional().describe('Requested page size.'),
118
+ next: z.string().nullable().describe('URI to the next page.'),
119
+ previous: z.string().nullable().describe('URI to the previous page.'),
120
+ size: z.number().int().describe('Requested page size.'),
115
121
  })
116
122
  .describe('Cursor pagination metadata.');
117
123
  export const invalidRules = z
@@ -410,9 +416,12 @@ export const stringFieldFilterExact = z
410
416
  }),
411
417
  ])
412
418
  .describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
419
+ export const creditGrantVoidPaymentAdjustment = z
420
+ .enum(['none'])
421
+ .describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
413
422
  export const creditTransactionType = z
414
- .enum(['funded', 'consumed', 'expired'])
415
- .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used.');
423
+ .enum(['funded', 'consumed', 'expired', 'voided'])
424
+ .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used. - `voided`: Credit removed because the grant was voided before being used.');
416
425
  export const chargesExpand = z
417
426
  .enum(['real_time_usage'])
418
427
  .describe("Expands for customer charges. Values: - `real_time_usage`: The charge's real-time usage.");
@@ -492,9 +501,52 @@ export const rateCardBooleanEntitlement = z
492
501
  export const appType = z
493
502
  .enum(['sandbox', 'stripe', 'external_invoicing'])
494
503
  .describe('The type of the app.');
504
+ export const appCapabilityType = z
505
+ .enum([
506
+ 'report_usage',
507
+ 'report_events',
508
+ 'calculate_tax',
509
+ 'invoice_customers',
510
+ 'collect_payments',
511
+ ])
512
+ .describe('Supported capability types for an App. Each capability defines an integration function that an App can perform.');
513
+ export const appInstallMethods = z
514
+ .enum(['with_oauth2', 'with_api_key', 'no_credentials_required'])
515
+ .describe('Supported installation methods for an app.');
495
516
  export const appStatus = z
496
517
  .enum(['ready', 'unauthorized'])
497
518
  .describe('Connection status of an installed app.');
519
+ export const updateLabels = z
520
+ .record(z.string(), z.string())
521
+ .describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
522
+ export const installAppStripeWithApiKey = z
523
+ .object({
524
+ type: z.literal('stripe').describe('Type of the app.'),
525
+ name: z.string().describe('Name of the app.'),
526
+ createBillingProfile: z
527
+ .boolean()
528
+ .describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
529
+ apiKey: z.string().describe('API key for the app.'),
530
+ })
531
+ .describe('Model for installing an app from the catalog with an API key.');
532
+ export const installAppSandbox = z
533
+ .object({
534
+ type: z.literal('sandbox').describe('Type of the app.'),
535
+ name: z.string().describe('Name of the app.'),
536
+ createBillingProfile: z
537
+ .boolean()
538
+ .describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
539
+ })
540
+ .describe('Base model for installing an app from the catalog.');
541
+ export const installAppExternalInvoicing = z
542
+ .object({
543
+ type: z.literal('external_invoicing').describe('Type of the app.'),
544
+ name: z.string().describe('Name of the app.'),
545
+ createBillingProfile: z
546
+ .boolean()
547
+ .describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
548
+ })
549
+ .describe('Base model for installing an app from the catalog.');
498
550
  export const taxIdentificationCode = z
499
551
  .string()
500
552
  .min(1)
@@ -598,9 +650,6 @@ export const invoiceLineExternalReferences = z
598
650
  export const invoiceDetailedLineCostCategory = z
599
651
  .enum(['regular', 'commitment'])
600
652
  .describe('Cost category of a detailed invoice line item.');
601
- export const updateLabels = z
602
- .record(z.string(), z.string())
603
- .describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
604
653
  export const updateBillingInvoiceWorkflowInvoicingSettings = z
605
654
  .object({
606
655
  autoAdvance: z
@@ -642,11 +691,9 @@ export const updatePriceFree = z
642
691
  export const currencyType = z
643
692
  .enum(['fiat', 'custom'])
644
693
  .describe('Currency type for custom currencies. It should be a unique code but not conflicting with any existing standard currency codes.');
645
- export const currencyCodeCustom = z
646
- .string()
647
- .min(3)
648
- .max(24)
649
- .describe('Custom currency code. It should be a unique code but not conflicting with any existing fiat currency codes.');
694
+ export const currencyExpand = z
695
+ .enum(['cost_basis'])
696
+ .describe("Expands for currencies. Values: - `cost_basis`: The currency's active and scheduled cost basis.");
650
697
  export const featureLlmTokenType = z
651
698
  .enum([
652
699
  'input',
@@ -974,12 +1021,6 @@ export const appCustomerDataExternalInvoicing = z
974
1021
  labels: labels.optional(),
975
1022
  })
976
1023
  .describe('External invoicing customer data.');
977
- export const billingCurrencyCode = z
978
- .union([currencyCode])
979
- .describe('Fiat or custom currency code.');
980
- export const createCurrencyCode = z
981
- .union([currencyCode])
982
- .describe('Fiat or custom currency code.');
983
1024
  export const currencyFiat = z
984
1025
  .object({
985
1026
  type: z.literal('fiat').describe('The type of the currency.'),
@@ -993,6 +1034,22 @@ export const currencyFiat = z
993
1034
  .min(1)
994
1035
  .optional()
995
1036
  .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
1037
+ precision: z
1038
+ .number()
1039
+ .int()
1040
+ .nonnegative()
1041
+ .lte(4294967295)
1042
+ .describe('The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.'),
1043
+ decimalMark: z
1044
+ .string()
1045
+ .min(1)
1046
+ .max(1)
1047
+ .describe('The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.'),
1048
+ thousandSeparator: z
1049
+ .string()
1050
+ .min(1)
1051
+ .max(1)
1052
+ .describe('The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.'),
996
1053
  code: currencyCode,
997
1054
  })
998
1055
  .describe('Currency describes a currency supported by the billing system.');
@@ -1001,6 +1058,43 @@ export const listCostBasesParamsFilter = z
1001
1058
  fiatCode: currencyCode.optional(),
1002
1059
  })
1003
1060
  .describe('Filter options for listing cost bases.');
1061
+ export const billingCurrencyCode = z
1062
+ .union([currencyCode, currencyCodeCustom])
1063
+ .describe('Fiat or custom currency code.');
1064
+ export const createCurrencyCode = z
1065
+ .union([currencyCode, currencyCodeCustom])
1066
+ .describe('Fiat or custom currency code.');
1067
+ export const createCurrencyCustomRequest = z
1068
+ .object({
1069
+ name: z
1070
+ .string()
1071
+ .min(1)
1072
+ .max(256)
1073
+ .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
1074
+ symbol: z
1075
+ .string()
1076
+ .min(1)
1077
+ .optional()
1078
+ .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
1079
+ precision: z
1080
+ .number()
1081
+ .int()
1082
+ .nonnegative()
1083
+ .lte(4294967295)
1084
+ .describe('The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.'),
1085
+ decimalMark: z
1086
+ .string()
1087
+ .min(1)
1088
+ .max(1)
1089
+ .describe('The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.'),
1090
+ thousandSeparator: z
1091
+ .string()
1092
+ .min(1)
1093
+ .max(1)
1094
+ .describe('The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.'),
1095
+ code: currencyCodeCustom,
1096
+ })
1097
+ .describe('CurrencyCustom create request.');
1004
1098
  export const currencyAmount = z
1005
1099
  .object({
1006
1100
  amount: numeric,
@@ -1271,23 +1365,26 @@ export const event = z
1271
1365
  .min(1)
1272
1366
  .describe('Contains a value describing the type of event related to the originating occurrence.'),
1273
1367
  datacontenttype: z
1274
- .union([z.literal('application/json'), z.null()])
1368
+ .literal('application/json')
1369
+ .nullable()
1275
1370
  .optional()
1276
1371
  .describe('Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP.'),
1277
1372
  dataschema: z
1278
- .union([z.string(), z.null()])
1373
+ .string()
1374
+ .nullable()
1279
1375
  .optional()
1280
1376
  .describe('Identifies the schema that data adheres to.'),
1281
1377
  subject: z
1282
1378
  .string()
1283
1379
  .min(1)
1284
1380
  .describe('Describes the subject of the event in the context of the event producer (identified by source).'),
1285
- time: z
1286
- .union([dateTime, z.null()])
1381
+ time: dateTime
1382
+ .nullable()
1287
1383
  .optional()
1288
1384
  .describe('Timestamp of when the occurrence happened. Must adhere to RFC 3339.'),
1289
1385
  data: z
1290
- .union([z.record(z.string(), z.unknown()), z.null()])
1386
+ .record(z.string(), z.unknown())
1387
+ .nullable()
1291
1388
  .optional()
1292
1389
  .describe('The event payload. Optional, if present it must be a JSON object.'),
1293
1390
  })
@@ -1370,8 +1467,8 @@ export const createCostBasisRequest = z
1370
1467
  export const featureCostQueryRow = z
1371
1468
  .object({
1372
1469
  usage: numeric,
1373
- cost: z
1374
- .union([numeric, z.null()])
1470
+ cost: numeric
1471
+ .nullable()
1375
1472
  .describe('The computed cost amount (usage × unit cost). Null when pricing is not available for the given combination of dimensions.'),
1376
1473
  currency: currencyCode,
1377
1474
  detail: z
@@ -1930,6 +2027,13 @@ export const listPlansParamsFilter = z
1930
2027
  currency: stringFieldFilterExact.optional(),
1931
2028
  })
1932
2029
  .describe('Filter options for listing plans.');
2030
+ export const voidCreditGrantRequest = z
2031
+ .object({
2032
+ paymentAdjustment: creditGrantVoidPaymentAdjustment
2033
+ .optional()
2034
+ .default('none'),
2035
+ })
2036
+ .describe('Request body for voiding a credit grant.');
1933
2037
  export const subscriptionCreate = z
1934
2038
  .object({
1935
2039
  labels: labels.optional(),
@@ -1993,19 +2097,85 @@ export const unitConfig = z
1993
2097
  .describe('A human-readable label for the converted unit shown on invoices and in the customer portal (e.g., "GB", "hours", "M tokens"). Optional. When omitted, no unit label is rendered.'),
1994
2098
  })
1995
2099
  .describe('Unit conversion configuration. Transforms raw metered quantities into billing-ready units before pricing and entitlement evaluation. Applied at the rate card level so the same feature can be billed in different units across plans. Examples: - Meter bytes, bill GB: operation=divide, conversionFactor=1e9, rounding=ceiling, displayUnit="GB" - Meter seconds, bill hours: operation=divide, conversionFactor=3600, rounding=ceiling, displayUnit="hours" - Cost + 20% margin: operation=multiply, conversionFactor=1.2 - Bill per million tokens: operation=divide, conversionFactor=1e6, rounding=ceiling, displayUnit="M" v1 equivalents: - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier + UnitPrice(amount=1) - PackagePrice(amount, quantityPerPkg): operation=divide, conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount)');
1996
- export const appCatalogItem = z
1997
- .object({
1998
- type: appType,
1999
- name: z.string().describe('Name of the app.'),
2000
- description: z.string().describe('Description of the app.'),
2001
- })
2002
- .describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
2003
2100
  export const taxCodeAppMapping = z
2004
2101
  .object({
2005
2102
  appType: appType,
2006
2103
  taxCode: z.string().describe('Tax code.'),
2007
2104
  })
2008
2105
  .describe('Mapping of app types to tax codes.');
2106
+ export const appCapability = z
2107
+ .object({
2108
+ type: appCapabilityType,
2109
+ key: resourceKey,
2110
+ name: z.string().describe('Name of the capability.'),
2111
+ description: z.string().describe('Description of the capability.'),
2112
+ })
2113
+ .describe('App capability describes a function that an App can perform.');
2114
+ export const updateAppStripeRequest = z
2115
+ .object({
2116
+ name: z
2117
+ .string()
2118
+ .min(1)
2119
+ .max(256)
2120
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
2121
+ description: z
2122
+ .string()
2123
+ .max(1024)
2124
+ .optional()
2125
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
2126
+ labels: updateLabels.optional(),
2127
+ type: z.literal('stripe').describe('The app type.'),
2128
+ secretApiKey: z
2129
+ .string()
2130
+ .optional()
2131
+ .describe('The Stripe secret API key used to authenticate API requests.'),
2132
+ })
2133
+ .describe('AppStripe update request.');
2134
+ export const updateAppSandboxRequest = z
2135
+ .object({
2136
+ name: z
2137
+ .string()
2138
+ .min(1)
2139
+ .max(256)
2140
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
2141
+ description: z
2142
+ .string()
2143
+ .max(1024)
2144
+ .optional()
2145
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
2146
+ labels: updateLabels.optional(),
2147
+ type: z.literal('sandbox').describe('The app type.'),
2148
+ })
2149
+ .describe('AppSandbox update request.');
2150
+ export const updateAppExternalInvoicingRequest = z
2151
+ .object({
2152
+ name: z
2153
+ .string()
2154
+ .min(1)
2155
+ .max(256)
2156
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
2157
+ description: z
2158
+ .string()
2159
+ .max(1024)
2160
+ .optional()
2161
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
2162
+ labels: updateLabels.optional(),
2163
+ type: z.literal('external_invoicing').describe('The app type.'),
2164
+ enableDraftSyncHook: z
2165
+ .boolean()
2166
+ .describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
2167
+ enableIssuingSyncHook: z
2168
+ .boolean()
2169
+ .describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
2170
+ })
2171
+ .describe('AppExternalInvoicing update request.');
2172
+ export const installAppRequest = z
2173
+ .discriminatedUnion('type', [
2174
+ installAppStripeWithApiKey,
2175
+ installAppSandbox,
2176
+ installAppExternalInvoicing,
2177
+ ])
2178
+ .describe('Request to install an app from the catalog.');
2009
2179
  export const partyTaxIdentity = z
2010
2180
  .object({
2011
2181
  code: taxIdentificationCode.optional(),
@@ -2115,39 +2285,6 @@ export const listCurrenciesParamsFilter = z
2115
2285
  code: stringFieldFilter.optional(),
2116
2286
  })
2117
2287
  .describe('Filter options for listing currencies.');
2118
- export const currencyCustom = z
2119
- .object({
2120
- type: z.literal('custom').describe('The type of the currency.'),
2121
- name: z
2122
- .string()
2123
- .min(1)
2124
- .max(256)
2125
- .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
2126
- symbol: z
2127
- .string()
2128
- .min(1)
2129
- .optional()
2130
- .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
2131
- id: ulid,
2132
- code: currencyCodeCustom,
2133
- createdAt: dateTime,
2134
- })
2135
- .describe('Describes custom currency.');
2136
- export const createCurrencyCustomRequest = z
2137
- .object({
2138
- name: z
2139
- .string()
2140
- .min(1)
2141
- .max(256)
2142
- .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
2143
- symbol: z
2144
- .string()
2145
- .min(1)
2146
- .optional()
2147
- .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
2148
- code: currencyCodeCustom,
2149
- })
2150
- .describe('CurrencyCustom create request.');
2151
2288
  export const governanceQueryRequest = z
2152
2289
  .object({
2153
2290
  includeCredits: z
@@ -2556,6 +2693,44 @@ export const meterQueryResult = z
2556
2693
  .describe('The usage data. If no data is available, an empty array is returned.'),
2557
2694
  })
2558
2695
  .describe('Meter query result.');
2696
+ export const currencyCustom = z
2697
+ .object({
2698
+ type: z.literal('custom').describe('The type of the currency.'),
2699
+ name: z
2700
+ .string()
2701
+ .min(1)
2702
+ .max(256)
2703
+ .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
2704
+ symbol: z
2705
+ .string()
2706
+ .min(1)
2707
+ .optional()
2708
+ .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
2709
+ precision: z
2710
+ .number()
2711
+ .int()
2712
+ .nonnegative()
2713
+ .lte(4294967295)
2714
+ .describe('The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.'),
2715
+ decimalMark: z
2716
+ .string()
2717
+ .min(1)
2718
+ .max(1)
2719
+ .describe('The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.'),
2720
+ thousandSeparator: z
2721
+ .string()
2722
+ .min(1)
2723
+ .max(1)
2724
+ .describe('The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.'),
2725
+ id: ulid,
2726
+ code: currencyCodeCustom,
2727
+ createdAt: dateTime,
2728
+ costBasis: z
2729
+ .array(costBasis)
2730
+ .optional()
2731
+ .describe('The list of active and scheduled cost bases for the custom currency. Expired and deleted cost bases are excluded.'),
2732
+ })
2733
+ .describe('Describes custom currency.');
2559
2734
  export const featureCostQueryResult = z
2560
2735
  .object({
2561
2736
  from: dateTime.optional(),
@@ -2826,9 +3001,8 @@ export const invoiceUsageQuantityDetail = z
2826
3001
  appliedUnitConfig: unitConfig,
2827
3002
  })
2828
3003
  .describe('Usage quantity details on an invoice line item when UnitConfig is in effect. Provides the full audit trail from raw meter output to the invoiced amount.');
2829
- export const appStripe = z
3004
+ export const createTaxCodeRequest = z
2830
3005
  .object({
2831
- id: ulid,
2832
3006
  name: z
2833
3007
  .string()
2834
3008
  .min(1)
@@ -2840,24 +3014,13 @@ export const appStripe = z
2840
3014
  .optional()
2841
3015
  .describe('Optional description of the resource. Maximum 1024 characters.'),
2842
3016
  labels: labels.optional(),
2843
- createdAt: dateTime,
2844
- updatedAt: dateTime,
2845
- deletedAt: dateTime.optional(),
2846
- type: z.literal('stripe').describe('The app type.'),
2847
- definition: appCatalogItem,
2848
- status: appStatus,
2849
- accountId: z
2850
- .string()
2851
- .describe('The Stripe account ID associated with the connected Stripe account.'),
2852
- livemode: z
2853
- .boolean()
2854
- .describe('Indicates whether the app is connected to a live Stripe account.'),
2855
- maskedApiKey: z
2856
- .string()
2857
- .describe('The masked Stripe API key that only exposes the first and last few characters.'),
3017
+ key: resourceKey,
3018
+ appMappings: z
3019
+ .array(taxCodeAppMapping)
3020
+ .describe('Mapping of app types to tax codes.'),
2858
3021
  })
2859
- .describe('Stripe app.');
2860
- export const appSandbox = z
3022
+ .describe('TaxCode create request.');
3023
+ export const taxCode = z
2861
3024
  .object({
2862
3025
  id: ulid,
2863
3026
  name: z
@@ -2874,14 +3037,14 @@ export const appSandbox = z
2874
3037
  createdAt: dateTime,
2875
3038
  updatedAt: dateTime,
2876
3039
  deletedAt: dateTime.optional(),
2877
- type: z.literal('sandbox').describe('The app type.'),
2878
- definition: appCatalogItem,
2879
- status: appStatus,
3040
+ key: resourceKey,
3041
+ appMappings: z
3042
+ .array(taxCodeAppMapping)
3043
+ .describe('Mapping of app types to tax codes.'),
2880
3044
  })
2881
- .describe('Sandbox app can be used for testing billing features.');
2882
- export const appExternalInvoicing = z
3045
+ .describe('Tax codes by provider.');
3046
+ export const upsertTaxCodeRequest = z
2883
3047
  .object({
2884
- id: ulid,
2885
3048
  name: z
2886
3049
  .string()
2887
3050
  .min(1)
@@ -2893,80 +3056,29 @@ export const appExternalInvoicing = z
2893
3056
  .optional()
2894
3057
  .describe('Optional description of the resource. Maximum 1024 characters.'),
2895
3058
  labels: labels.optional(),
2896
- createdAt: dateTime,
2897
- updatedAt: dateTime,
2898
- deletedAt: dateTime.optional(),
2899
- type: z.literal('external_invoicing').describe('The app type.'),
2900
- definition: appCatalogItem,
2901
- status: appStatus,
2902
- enableDraftSyncHook: z
2903
- .boolean()
2904
- .describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
2905
- enableIssuingSyncHook: z
2906
- .boolean()
2907
- .describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
3059
+ appMappings: z
3060
+ .array(taxCodeAppMapping)
3061
+ .describe('Mapping of app types to tax codes.'),
2908
3062
  })
2909
- .describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
2910
- export const createTaxCodeRequest = z
3063
+ .describe('TaxCode upsert request.');
3064
+ export const appCatalogItem = z
2911
3065
  .object({
2912
- name: z
2913
- .string()
2914
- .min(1)
2915
- .max(256)
2916
- .describe('Display name of the resource. Between 1 and 256 characters.'),
2917
- description: z
2918
- .string()
2919
- .max(1024)
2920
- .optional()
2921
- .describe('Optional description of the resource. Maximum 1024 characters.'),
2922
- labels: labels.optional(),
2923
- key: resourceKey,
2924
- appMappings: z
2925
- .array(taxCodeAppMapping)
2926
- .describe('Mapping of app types to tax codes.'),
2927
- })
2928
- .describe('TaxCode create request.');
2929
- export const taxCode = z
2930
- .object({
2931
- id: ulid,
2932
- name: z
2933
- .string()
2934
- .min(1)
2935
- .max(256)
2936
- .describe('Display name of the resource. Between 1 and 256 characters.'),
2937
- description: z
2938
- .string()
2939
- .max(1024)
2940
- .optional()
2941
- .describe('Optional description of the resource. Maximum 1024 characters.'),
2942
- labels: labels.optional(),
2943
- createdAt: dateTime,
2944
- updatedAt: dateTime,
2945
- deletedAt: dateTime.optional(),
2946
- key: resourceKey,
2947
- appMappings: z
2948
- .array(taxCodeAppMapping)
2949
- .describe('Mapping of app types to tax codes.'),
2950
- })
2951
- .describe('Tax codes by provider.');
2952
- export const upsertTaxCodeRequest = z
2953
- .object({
2954
- name: z
2955
- .string()
2956
- .min(1)
2957
- .max(256)
2958
- .describe('Display name of the resource. Between 1 and 256 characters.'),
2959
- description: z
2960
- .string()
2961
- .max(1024)
2962
- .optional()
2963
- .describe('Optional description of the resource. Maximum 1024 characters.'),
2964
- labels: labels.optional(),
2965
- appMappings: z
2966
- .array(taxCodeAppMapping)
2967
- .describe('Mapping of app types to tax codes.'),
3066
+ type: appType,
3067
+ name: z.string().describe('Name of the app.'),
3068
+ description: z.string().describe('Description of the app.'),
3069
+ capabilities: z.array(appCapability).describe('Capabilities of the app.'),
3070
+ installMethods: z
3071
+ .array(appInstallMethods)
3072
+ .describe('Available install methods of the app.'),
2968
3073
  })
2969
- .describe('TaxCode upsert request.');
3074
+ .describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
3075
+ export const updateAppRequest = z
3076
+ .discriminatedUnion('type', [
3077
+ updateAppStripeRequest,
3078
+ updateAppSandboxRequest,
3079
+ updateAppExternalInvoicingRequest,
3080
+ ])
3081
+ .describe('Request to update an installed app.');
2970
3082
  export const invoiceWorkflow = z
2971
3083
  .object({
2972
3084
  invoicing: invoiceWorkflowInvoicingSettings.optional(),
@@ -3003,9 +3115,6 @@ export const updateBillingInvoiceWorkflow = z
3003
3115
  payment: updateBillingWorkflowPaymentSettings.optional(),
3004
3116
  })
3005
3117
  .describe('Invoice-level snapshot of the workflow configuration. Contains only the settings that are meaningful for an already-created invoice: invoicing behaviour and payment settings. Collection alignment and tax policy are gather-time / profile-wide concerns and are not included.');
3006
- export const currency = z
3007
- .discriminatedUnion('type', [currencyFiat, currencyCustom])
3008
- .describe('Fiat or custom currency.');
3009
3118
  export const governanceFeatureAccess = z
3010
3119
  .object({
3011
3120
  hasAccess: z
@@ -3216,6 +3325,9 @@ export const ingestedEventPaginatedResponse = z
3216
3325
  meta: cursorMeta,
3217
3326
  })
3218
3327
  .describe('Cursor paginated response.');
3328
+ export const currency = z
3329
+ .discriminatedUnion('type', [currencyFiat, currencyCustom])
3330
+ .describe('Fiat or custom currency.');
3219
3331
  export const invalidParameters = z
3220
3332
  .array(invalidParameter)
3221
3333
  .min(1)
@@ -3332,15 +3444,99 @@ export const workflowCollectionAlignment = z
3332
3444
  workflowCollectionAlignmentAnchored,
3333
3445
  ])
3334
3446
  .describe('The alignment for collecting the pending line items into an invoice. Defaults to subscription, which means that we are to create a new invoice every time the a subscription period starts (for in advance items) or ends (for in arrears items).');
3335
- export const app = z
3336
- .discriminatedUnion('type', [appStripe, appSandbox, appExternalInvoicing])
3337
- .describe('Installed application.');
3338
3447
  export const taxCodePagePaginatedResponse = z
3339
3448
  .object({
3340
3449
  data: z.array(taxCode),
3341
3450
  meta: paginatedMeta,
3342
3451
  })
3343
3452
  .describe('Page paginated response.');
3453
+ export const appStripe = z
3454
+ .object({
3455
+ id: ulid,
3456
+ name: z
3457
+ .string()
3458
+ .min(1)
3459
+ .max(256)
3460
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
3461
+ description: z
3462
+ .string()
3463
+ .max(1024)
3464
+ .optional()
3465
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
3466
+ labels: labels.optional(),
3467
+ createdAt: dateTime,
3468
+ updatedAt: dateTime,
3469
+ deletedAt: dateTime.optional(),
3470
+ type: z.literal('stripe').describe('The app type.'),
3471
+ definition: appCatalogItem,
3472
+ status: appStatus,
3473
+ accountId: z
3474
+ .string()
3475
+ .describe('The Stripe account ID associated with the connected Stripe account.'),
3476
+ livemode: z
3477
+ .boolean()
3478
+ .describe('Indicates whether the app is connected to a live Stripe account.'),
3479
+ maskedApiKey: z
3480
+ .string()
3481
+ .describe('The masked Stripe API key that only exposes the first and last few characters.'),
3482
+ })
3483
+ .describe('Stripe app.');
3484
+ export const appSandbox = z
3485
+ .object({
3486
+ id: ulid,
3487
+ name: z
3488
+ .string()
3489
+ .min(1)
3490
+ .max(256)
3491
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
3492
+ description: z
3493
+ .string()
3494
+ .max(1024)
3495
+ .optional()
3496
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
3497
+ labels: labels.optional(),
3498
+ createdAt: dateTime,
3499
+ updatedAt: dateTime,
3500
+ deletedAt: dateTime.optional(),
3501
+ type: z.literal('sandbox').describe('The app type.'),
3502
+ definition: appCatalogItem,
3503
+ status: appStatus,
3504
+ })
3505
+ .describe('Sandbox app can be used for testing billing features.');
3506
+ export const appExternalInvoicing = z
3507
+ .object({
3508
+ id: ulid,
3509
+ name: z
3510
+ .string()
3511
+ .min(1)
3512
+ .max(256)
3513
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
3514
+ description: z
3515
+ .string()
3516
+ .max(1024)
3517
+ .optional()
3518
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
3519
+ labels: labels.optional(),
3520
+ createdAt: dateTime,
3521
+ updatedAt: dateTime,
3522
+ deletedAt: dateTime.optional(),
3523
+ type: z.literal('external_invoicing').describe('The app type.'),
3524
+ definition: appCatalogItem,
3525
+ status: appStatus,
3526
+ enableDraftSyncHook: z
3527
+ .boolean()
3528
+ .describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
3529
+ enableIssuingSyncHook: z
3530
+ .boolean()
3531
+ .describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
3532
+ })
3533
+ .describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
3534
+ export const appCatalogItemPagePaginatedResponse = z
3535
+ .object({
3536
+ data: z.array(appCatalogItem),
3537
+ meta: paginatedMeta,
3538
+ })
3539
+ .describe('Page paginated response.');
3344
3540
  export const invoiceWorkflowSettings = z
3345
3541
  .object({
3346
3542
  apps: invoiceWorkflowAppsReferences.optional(),
@@ -3383,12 +3579,6 @@ export const updateInvoiceWorkflowSettings = z
3383
3579
  workflow: updateBillingInvoiceWorkflow,
3384
3580
  })
3385
3581
  .describe('Snapshot of the billing workflow configuration captured at invoice creation.');
3386
- export const currencyPagePaginatedResponse = z
3387
- .object({
3388
- data: z.array(currency),
3389
- meta: paginatedMeta,
3390
- })
3391
- .describe('Page paginated response.');
3392
3582
  export const governanceQueryResult = z
3393
3583
  .object({
3394
3584
  matched: z
@@ -3464,8 +3654,8 @@ export const createFeatureRequest = z
3464
3654
  .describe('Feature create request.');
3465
3655
  export const updateFeatureRequest = z
3466
3656
  .object({
3467
- unitCost: z
3468
- .union([featureUnitCost, z.null()])
3657
+ unitCost: featureUnitCost
3658
+ .nullable()
3469
3659
  .optional()
3470
3660
  .describe('Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or "llm" to look up cost from the LLM cost database based on meter group-by properties. Set to `null` to clear the existing unit cost; omit to leave it unchanged.'),
3471
3661
  })
@@ -3476,6 +3666,12 @@ export const creditGrantPagePaginatedResponse = z
3476
3666
  meta: paginatedMeta,
3477
3667
  })
3478
3668
  .describe('Page paginated response.');
3669
+ export const currencyPagePaginatedResponse = z
3670
+ .object({
3671
+ data: z.array(currency),
3672
+ meta: paginatedMeta,
3673
+ })
3674
+ .describe('Page paginated response.');
3479
3675
  export const badRequest = z
3480
3676
  .intersection(baseError, z.object({
3481
3677
  invalidParameters: invalidParameters,
@@ -3523,19 +3719,9 @@ export const workflowCollectionSettings = z
3523
3719
  .describe('This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods.'),
3524
3720
  })
3525
3721
  .describe('Workflow collection specifies how to collect the pending line items for an invoice.');
3526
- export const appPagePaginatedResponse = z
3527
- .object({
3528
- data: z.array(app),
3529
- meta: paginatedMeta,
3530
- })
3531
- .describe('Page paginated response.');
3532
- export const profileApps = z
3533
- .object({
3534
- tax: app,
3535
- invoicing: app,
3536
- payment: app,
3537
- })
3538
- .describe('Applications used by a billing profile.');
3722
+ export const app = z
3723
+ .discriminatedUnion('type', [appStripe, appSandbox, appExternalInvoicing])
3724
+ .describe('Installed application.');
3539
3725
  export const governanceQueryResponse = z
3540
3726
  .object({
3541
3727
  data: z
@@ -3660,6 +3846,7 @@ export const rateCard = z
3660
3846
  labels: labels.optional(),
3661
3847
  key: resourceKey,
3662
3848
  feature: featureReference.optional(),
3849
+ currency: billingCurrencyCode.optional(),
3663
3850
  billingCadence: iso8601Duration.optional(),
3664
3851
  price: price,
3665
3852
  unitConfig: unitConfig.optional(),
@@ -3676,6 +3863,7 @@ export const invoiceLineRateCard = z
3676
3863
  taxConfig: rateCardTaxConfig.optional(),
3677
3864
  featureKey: resourceKey.optional(),
3678
3865
  discounts: rateCardDiscounts.optional(),
3866
+ unitConfig: unitConfig.optional(),
3679
3867
  })
3680
3868
  .describe('Rate card configuration snapshot for a usage-based invoice line.');
3681
3869
  export const updateInvoiceLineRateCard = z
@@ -3700,6 +3888,25 @@ export const workflow = z
3700
3888
  tax: workflowTaxSettings.optional(),
3701
3889
  })
3702
3890
  .describe('Billing workflow settings.');
3891
+ export const appPagePaginatedResponse = z
3892
+ .object({
3893
+ data: z.array(app),
3894
+ meta: paginatedMeta,
3895
+ })
3896
+ .describe('Page paginated response.');
3897
+ export const billingInstallAppResponse = z
3898
+ .object({
3899
+ app: app,
3900
+ defaultForCapabilityTypes: z.array(appCapabilityType),
3901
+ })
3902
+ .describe('Response of the app install.');
3903
+ export const profileApps = z
3904
+ .object({
3905
+ tax: app,
3906
+ invoicing: app,
3907
+ payment: app,
3908
+ })
3909
+ .describe('Applications used by a billing profile.');
3703
3910
  export const chargeUsageBased = z
3704
3911
  .object({
3705
3912
  id: ulid,
@@ -4024,7 +4231,7 @@ export const plan = z
4024
4231
  .gte(1)
4025
4232
  .default(1)
4026
4233
  .describe('Plans are versioned to allow you to make changes without affecting running subscriptions.'),
4027
- currency: currencyCode,
4234
+ currency: billingCurrencyCode,
4028
4235
  billingCadence: iso8601Duration,
4029
4236
  proRatingEnabled: z
4030
4237
  .boolean()
@@ -4059,7 +4266,7 @@ export const createPlanRequest = z
4059
4266
  .describe('Optional description of the resource. Maximum 1024 characters.'),
4060
4267
  labels: labels.optional(),
4061
4268
  key: resourceKey,
4062
- currency: currencyCode,
4269
+ currency: billingCurrencyCode,
4063
4270
  billingCadence: iso8601Duration,
4064
4271
  proRatingEnabled: z
4065
4272
  .boolean()
@@ -4363,6 +4570,12 @@ export const createCreditAdjustmentPathParams = z.object({
4363
4570
  });
4364
4571
  export const createCreditAdjustmentBody = createCreditAdjustmentRequest;
4365
4572
  export const createCreditAdjustmentResponse = creditAdjustment;
4573
+ export const voidCreditGrantPathParams = z.object({
4574
+ customerId: ulid,
4575
+ creditGrantId: ulid,
4576
+ });
4577
+ export const voidCreditGrantBody = voidCreditGrantRequest;
4578
+ export const voidCreditGrantResponse = creditGrant;
4366
4579
  export const updateCreditGrantExternalSettlementPathParams = z.object({
4367
4580
  customerId: ulid,
4368
4581
  creditGrantId: ulid,
@@ -4502,6 +4715,37 @@ export const getAppPathParams = z.object({
4502
4715
  appId: ulid,
4503
4716
  });
4504
4717
  export const getAppResponse = app;
4718
+ export const uninstallAppPathParams = z.object({
4719
+ appId: ulid,
4720
+ });
4721
+ export const updateAppPathParams = z.object({
4722
+ appId: ulid,
4723
+ });
4724
+ export const updateAppBody = updateAppRequest;
4725
+ export const updateAppResponse = app;
4726
+ export const listAppCatalogQueryParams = z.object({
4727
+ page: z
4728
+ .object({
4729
+ size: z.coerce
4730
+ .number()
4731
+ .int()
4732
+ .optional()
4733
+ .describe('The number of items to include per page.'),
4734
+ number: z.coerce.number().int().optional().describe('The page number.'),
4735
+ })
4736
+ .optional()
4737
+ .describe('Determines which page of the collection to retrieve.'),
4738
+ });
4739
+ export const listAppCatalogResponse = z.object({
4740
+ data: z.array(appCatalogItem),
4741
+ meta: paginatedMeta,
4742
+ });
4743
+ export const getAppCatalogItemPathParams = z.object({
4744
+ appType: appType,
4745
+ });
4746
+ export const getAppCatalogItemResponse = appCatalogItem;
4747
+ export const installAppBody = installAppRequest;
4748
+ export const installAppResponse = billingInstallAppResponse;
4505
4749
  export const listBillingProfilesQueryParams = z.object({
4506
4750
  page: z
4507
4751
  .object({
@@ -4564,6 +4808,22 @@ export const updateInvoiceResponse = invoice;
4564
4808
  export const deleteInvoicePathParams = z.object({
4565
4809
  invoiceId: ulid,
4566
4810
  });
4811
+ export const advanceInvoicePathParams = z.object({
4812
+ invoiceId: ulid,
4813
+ });
4814
+ export const advanceInvoiceResponse = invoice;
4815
+ export const approveInvoicePathParams = z.object({
4816
+ invoiceId: ulid,
4817
+ });
4818
+ export const approveInvoiceResponse = invoice;
4819
+ export const retryInvoicePathParams = z.object({
4820
+ invoiceId: ulid,
4821
+ });
4822
+ export const retryInvoiceResponse = invoice;
4823
+ export const snapshotQuantitiesInvoicePathParams = z.object({
4824
+ invoiceId: ulid,
4825
+ });
4826
+ export const snapshotQuantitiesInvoiceResponse = invoice;
4567
4827
  export const createTaxCodeBody = createTaxCodeRequest;
4568
4828
  export const createTaxCodeResponse = taxCode;
4569
4829
  export const getTaxCodePathParams = z.object({
@@ -4613,6 +4873,10 @@ export const listCurrenciesQueryParams = z.object({
4613
4873
  .describe('Determines which page of the collection to retrieve.'),
4614
4874
  sort: sortQuery.optional(),
4615
4875
  filter: listCurrenciesParamsFilter.optional(),
4876
+ expand: z
4877
+ .array(currencyExpand)
4878
+ .optional()
4879
+ .describe('Expand the currencies returned in the response. To include the active and scheduled cost basis add: expand=cost_basis'),
4616
4880
  });
4617
4881
  export const listCurrenciesResponse = z.object({
4618
4882
  data: z.array(currency),
@@ -4620,6 +4884,10 @@ export const listCurrenciesResponse = z.object({
4620
4884
  });
4621
4885
  export const createCustomCurrencyBody = createCurrencyCustomRequest;
4622
4886
  export const createCustomCurrencyResponse = currencyCustom;
4887
+ export const getCustomCurrencyPathParams = z.object({
4888
+ currencyId: ulid,
4889
+ });
4890
+ export const getCustomCurrencyResponse = currencyCustom;
4623
4891
  export const listCostBasesPathParams = z.object({
4624
4892
  currencyId: ulid,
4625
4893
  });
@@ -4869,6 +5137,11 @@ export const currencyCodeWire = z
4869
5137
  .max(3)
4870
5138
  .regex(new RegExp('^[A-Z]{3}$'))
4871
5139
  .describe('Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code. Custom three-letter currency codes are also supported for convenience.');
5140
+ export const currencyCodeCustomWire = z
5141
+ .string()
5142
+ .min(4)
5143
+ .max(24)
5144
+ .describe('Custom currency code. It should be a unique code but not conflicting with any existing fiat currency codes.');
4872
5145
  export const numericWire = z
4873
5146
  .string()
4874
5147
  .regex(new RegExp('^\\-?[0-9]+(\\.[0-9]+)?$'))
@@ -4943,7 +5216,7 @@ export const ulidWire = z
4943
5216
  .describe('ULID (Universally Unique Lexicographically Sortable Identifier).');
4944
5217
  export const dateTimeWire = z
4945
5218
  .string()
4946
- .datetime()
5219
+ .datetime({ offset: true })
4947
5220
  .describe('[RFC3339](https://tools.ietf.org/html/rfc3339) formatted date-time string in UTC.');
4948
5221
  export const sortQueryWire = z
4949
5222
  .strictObject({
@@ -4951,7 +5224,6 @@ export const sortQueryWire = z
4951
5224
  order: z
4952
5225
  .union([z.literal('asc'), z.literal('desc')])
4953
5226
  .optional()
4954
- .default('asc')
4955
5227
  .describe('The sort order. `asc` for ascending, `desc` for descending.'),
4956
5228
  })
4957
5229
  .describe('Sort query. The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.');
@@ -4971,9 +5243,9 @@ export const cursorMetaPageWire = z
4971
5243
  .strictObject({
4972
5244
  first: z.string().optional().describe('URI to the first page.'),
4973
5245
  last: z.string().optional().describe('URI to the last page.'),
4974
- next: z.string().optional().describe('URI to the next page.'),
4975
- previous: z.string().optional().describe('URI to the previous page.'),
4976
- size: z.number().int().optional().describe('Requested page size.'),
5246
+ next: z.string().nullable().describe('URI to the next page.'),
5247
+ previous: z.string().nullable().describe('URI to the previous page.'),
5248
+ size: z.number().int().describe('Requested page size.'),
4977
5249
  })
4978
5250
  .describe('Cursor pagination metadata.');
4979
5251
  export const invalidRulesWire = z
@@ -5026,7 +5298,6 @@ export const baseErrorWire = z
5026
5298
  .intersection(z.object({
5027
5299
  type: z
5028
5300
  .string()
5029
- .default('about:blank')
5030
5301
  .describe('Type contains a URI that identifies the problem type.'),
5031
5302
  status: z
5032
5303
  .number()
@@ -5272,9 +5543,12 @@ export const stringFieldFilterExactWire = z
5272
5543
  }),
5273
5544
  ])
5274
5545
  .describe('Filters on the given string field value by exact match. All properties are optional; provide exactly one to specify the comparison.');
5546
+ export const creditGrantVoidPaymentAdjustmentWire = z
5547
+ .enum(['none'])
5548
+ .describe('Describes how voiding a credit grant adjusts related payment state. - `none`: Voiding does not adjust invoices, payment authorization, settlement, payment intents, or external collection state.');
5275
5549
  export const creditTransactionTypeWire = z
5276
- .enum(['funded', 'consumed', 'expired'])
5277
- .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used.');
5550
+ .enum(['funded', 'consumed', 'expired', 'voided'])
5551
+ .describe('The type of the credit transaction. - `funded`: Credit granted and available for consumption. - `consumed`: Credit consumed by usage or fees. - `expired`: Credit removed because it expired before being used. - `voided`: Credit removed because the grant was voided before being used.');
5278
5552
  export const chargesExpandWire = z
5279
5553
  .enum(['real_time_usage'])
5280
5554
  .describe("Expands for customer charges. Values: - `real_time_usage`: The charge's real-time usage.");
@@ -5354,18 +5628,61 @@ export const rateCardBooleanEntitlementWire = z
5354
5628
  export const appTypeWire = z
5355
5629
  .enum(['sandbox', 'stripe', 'external_invoicing'])
5356
5630
  .describe('The type of the app.');
5631
+ export const appCapabilityTypeWire = z
5632
+ .enum([
5633
+ 'report_usage',
5634
+ 'report_events',
5635
+ 'calculate_tax',
5636
+ 'invoice_customers',
5637
+ 'collect_payments',
5638
+ ])
5639
+ .describe('Supported capability types for an App. Each capability defines an integration function that an App can perform.');
5640
+ export const appInstallMethodsWire = z
5641
+ .enum(['with_oauth2', 'with_api_key', 'no_credentials_required'])
5642
+ .describe('Supported installation methods for an app.');
5357
5643
  export const appStatusWire = z
5358
5644
  .enum(['ready', 'unauthorized'])
5359
5645
  .describe('Connection status of an installed app.');
5360
- export const taxIdentificationCodeWire = z
5361
- .string()
5362
- .min(1)
5363
- .max(32)
5364
- .describe('Tax identifier code is a normalized tax code shown on the original identity document.');
5365
- export const workflowCollectionAlignmentSubscriptionWire = z
5646
+ export const updateLabelsWire = z
5647
+ .record(z.string(), z.string())
5648
+ .describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
5649
+ export const installAppStripeWithApiKeyWire = z
5366
5650
  .strictObject({
5367
- type: z.literal('subscription').describe('The type of alignment.'),
5368
- })
5651
+ type: z.literal('stripe').describe('Type of the app.'),
5652
+ name: z.string().describe('Name of the app.'),
5653
+ create_billing_profile: z
5654
+ .boolean()
5655
+ .describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
5656
+ api_key: z.string().describe('API key for the app.'),
5657
+ })
5658
+ .describe('Model for installing an app from the catalog with an API key.');
5659
+ export const installAppSandboxWire = z
5660
+ .strictObject({
5661
+ type: z.literal('sandbox').describe('Type of the app.'),
5662
+ name: z.string().describe('Name of the app.'),
5663
+ create_billing_profile: z
5664
+ .boolean()
5665
+ .describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
5666
+ })
5667
+ .describe('Base model for installing an app from the catalog.');
5668
+ export const installAppExternalInvoicingWire = z
5669
+ .strictObject({
5670
+ type: z.literal('external_invoicing').describe('Type of the app.'),
5671
+ name: z.string().describe('Name of the app.'),
5672
+ create_billing_profile: z
5673
+ .boolean()
5674
+ .describe('If true, a billing profile will be created for the app. The Stripe app will be also set as the default billing profile if the current default is a Sandbox app.'),
5675
+ })
5676
+ .describe('Base model for installing an app from the catalog.');
5677
+ export const taxIdentificationCodeWire = z
5678
+ .string()
5679
+ .min(1)
5680
+ .max(32)
5681
+ .describe('Tax identifier code is a normalized tax code shown on the original identity document.');
5682
+ export const workflowCollectionAlignmentSubscriptionWire = z
5683
+ .strictObject({
5684
+ type: z.literal('subscription').describe('The type of alignment.'),
5685
+ })
5369
5686
  .describe('BillingWorkflowCollectionAlignmentSubscription specifies the alignment for collecting the pending line items into an invoice.');
5370
5687
  export const workflowInvoicingSubscriptionEndProrationModeWire = z
5371
5688
  .enum(['bill_full_period', 'bill_actual_period'])
@@ -5385,7 +5702,6 @@ export const workflowPaymentSendInvoiceSettingsWire = z
5385
5702
  due_after: z
5386
5703
  .string()
5387
5704
  .optional()
5388
- .default('P30D')
5389
5705
  .describe("The period after which the invoice is due. With some payment solutions it's only applicable for manual collection method."),
5390
5706
  })
5391
5707
  .describe('Payment settings for a billing workflow when the collection method is send invoice.');
@@ -5433,12 +5749,10 @@ export const invoiceWorkflowInvoicingSettingsWire = z
5433
5749
  auto_advance: z
5434
5750
  .boolean()
5435
5751
  .optional()
5436
- .default(true)
5437
5752
  .describe('Whether to automatically issue the invoice after the draft_period has passed.'),
5438
5753
  draft_period: z
5439
5754
  .string()
5440
5755
  .optional()
5441
- .default('P0D')
5442
5756
  .describe('The period for the invoice to be kept in draft status for manual reviews.'),
5443
5757
  due_after: z
5444
5758
  .string()
@@ -5460,20 +5774,15 @@ export const invoiceLineExternalReferencesWire = z
5460
5774
  export const invoiceDetailedLineCostCategoryWire = z
5461
5775
  .enum(['regular', 'commitment'])
5462
5776
  .describe('Cost category of a detailed invoice line item.');
5463
- export const updateLabelsWire = z
5464
- .record(z.string(), z.string())
5465
- .describe('Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\\_".');
5466
5777
  export const updateBillingInvoiceWorkflowInvoicingSettingsWire = z
5467
5778
  .strictObject({
5468
5779
  auto_advance: z
5469
5780
  .boolean()
5470
5781
  .optional()
5471
- .default(true)
5472
5782
  .describe('Whether to automatically issue the invoice after the draft_period has passed.'),
5473
5783
  draft_period: z
5474
5784
  .string()
5475
5785
  .optional()
5476
- .default('P0D')
5477
5786
  .describe('The period for the invoice to be kept in draft status for manual reviews.'),
5478
5787
  })
5479
5788
  .describe('Invoice-level invoicing settings. A subset of BillingWorkflowInvoicingSettings limited to fields that are meaningful per-invoice. progressive_billing is omitted as it is a gather-time / profile-level decision.');
@@ -5492,7 +5801,6 @@ export const updateBillingWorkflowPaymentSendInvoiceSettingsWire = z
5492
5801
  due_after: z
5493
5802
  .string()
5494
5803
  .optional()
5495
- .default('P30D')
5496
5804
  .describe("The period after which the invoice is due. With some payment solutions it's only applicable for manual collection method."),
5497
5805
  })
5498
5806
  .describe('Payment settings for a billing workflow when the collection method is send invoice.');
@@ -5504,11 +5812,9 @@ export const updatePriceFreeWire = z
5504
5812
  export const currencyTypeWire = z
5505
5813
  .enum(['fiat', 'custom'])
5506
5814
  .describe('Currency type for custom currencies. It should be a unique code but not conflicting with any existing standard currency codes.');
5507
- export const currencyCodeCustomWire = z
5508
- .string()
5509
- .min(3)
5510
- .max(24)
5511
- .describe('Custom currency code. It should be a unique code but not conflicting with any existing fiat currency codes.');
5815
+ export const currencyExpandWire = z
5816
+ .enum(['cost_basis'])
5817
+ .describe("Expands for currencies. Values: - `cost_basis`: The currency's active and scheduled cost basis.");
5512
5818
  export const featureLlmTokenTypeWire = z
5513
5819
  .enum([
5514
5820
  'input',
@@ -5836,12 +6142,6 @@ export const appCustomerDataExternalInvoicingWire = z
5836
6142
  labels: labelsWire.optional(),
5837
6143
  })
5838
6144
  .describe('External invoicing customer data.');
5839
- export const billingCurrencyCodeWire = z
5840
- .union([currencyCodeWire])
5841
- .describe('Fiat or custom currency code.');
5842
- export const createCurrencyCodeWire = z
5843
- .union([currencyCodeWire])
5844
- .describe('Fiat or custom currency code.');
5845
6145
  export const currencyFiatWire = z
5846
6146
  .strictObject({
5847
6147
  type: z.literal('fiat').describe('The type of the currency.'),
@@ -5855,6 +6155,22 @@ export const currencyFiatWire = z
5855
6155
  .min(1)
5856
6156
  .optional()
5857
6157
  .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
6158
+ precision: z
6159
+ .number()
6160
+ .int()
6161
+ .nonnegative()
6162
+ .lte(4294967295)
6163
+ .describe('The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.'),
6164
+ decimal_mark: z
6165
+ .string()
6166
+ .min(1)
6167
+ .max(1)
6168
+ .describe('The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.'),
6169
+ thousand_separator: z
6170
+ .string()
6171
+ .min(1)
6172
+ .max(1)
6173
+ .describe('The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.'),
5858
6174
  code: currencyCodeWire,
5859
6175
  })
5860
6176
  .describe('Currency describes a currency supported by the billing system.');
@@ -5863,6 +6179,43 @@ export const listCostBasesParamsFilterWire = z
5863
6179
  fiat_code: currencyCodeWire.optional(),
5864
6180
  })
5865
6181
  .describe('Filter options for listing cost bases.');
6182
+ export const billingCurrencyCodeWire = z
6183
+ .union([currencyCodeWire, currencyCodeCustomWire])
6184
+ .describe('Fiat or custom currency code.');
6185
+ export const createCurrencyCodeWire = z
6186
+ .union([currencyCodeWire, currencyCodeCustomWire])
6187
+ .describe('Fiat or custom currency code.');
6188
+ export const createCurrencyCustomRequestWire = z
6189
+ .strictObject({
6190
+ name: z
6191
+ .string()
6192
+ .min(1)
6193
+ .max(256)
6194
+ .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
6195
+ symbol: z
6196
+ .string()
6197
+ .min(1)
6198
+ .optional()
6199
+ .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
6200
+ precision: z
6201
+ .number()
6202
+ .int()
6203
+ .nonnegative()
6204
+ .lte(4294967295)
6205
+ .describe('The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.'),
6206
+ decimal_mark: z
6207
+ .string()
6208
+ .min(1)
6209
+ .max(1)
6210
+ .describe('The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.'),
6211
+ thousand_separator: z
6212
+ .string()
6213
+ .min(1)
6214
+ .max(1)
6215
+ .describe('The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.'),
6216
+ code: currencyCodeCustomWire,
6217
+ })
6218
+ .describe('CurrencyCustom create request.');
5866
6219
  export const currencyAmountWire = z
5867
6220
  .strictObject({
5868
6221
  amount: numericWire,
@@ -6126,30 +6479,32 @@ export const eventWire = z
6126
6479
  specversion: z
6127
6480
  .string()
6128
6481
  .min(1)
6129
- .default('1.0')
6130
6482
  .describe('The version of the CloudEvents specification which the event uses.'),
6131
6483
  type: z
6132
6484
  .string()
6133
6485
  .min(1)
6134
6486
  .describe('Contains a value describing the type of event related to the originating occurrence.'),
6135
6487
  datacontenttype: z
6136
- .union([z.literal('application/json'), z.null()])
6488
+ .literal('application/json')
6489
+ .nullable()
6137
6490
  .optional()
6138
6491
  .describe('Content type of the CloudEvents data value. Only the value "application/json" is allowed over HTTP.'),
6139
6492
  dataschema: z
6140
- .union([z.string(), z.null()])
6493
+ .string()
6494
+ .nullable()
6141
6495
  .optional()
6142
6496
  .describe('Identifies the schema that data adheres to.'),
6143
6497
  subject: z
6144
6498
  .string()
6145
6499
  .min(1)
6146
6500
  .describe('Describes the subject of the event in the context of the event producer (identified by source).'),
6147
- time: z
6148
- .union([dateTimeWire, z.null()])
6501
+ time: dateTimeWire
6502
+ .nullable()
6149
6503
  .optional()
6150
6504
  .describe('Timestamp of when the occurrence happened. Must adhere to RFC 3339.'),
6151
6505
  data: z
6152
- .union([z.record(z.string(), z.unknown()), z.null()])
6506
+ .record(z.string(), z.unknown())
6507
+ .nullable()
6153
6508
  .optional()
6154
6509
  .describe('The event payload. Optional, if present it must be a JSON object.'),
6155
6510
  })
@@ -6232,8 +6587,8 @@ export const createCostBasisRequestWire = z
6232
6587
  export const featureCostQueryRowWire = z
6233
6588
  .strictObject({
6234
6589
  usage: numericWire,
6235
- cost: z
6236
- .union([numericWire, z.null()])
6590
+ cost: numericWire
6591
+ .nullable()
6237
6592
  .describe('The computed cost amount (usage × unit cost). Null when pricing is not available for the given combination of dimensions.'),
6238
6593
  currency: currencyCodeWire,
6239
6594
  detail: z
@@ -6621,15 +6976,9 @@ export const updateAddressWire = z
6621
6976
  .describe('Address');
6622
6977
  export const appStripeCreateCheckoutSessionCustomerUpdateWire = z
6623
6978
  .strictObject({
6624
- address: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire
6625
- .optional()
6626
- .default('never'),
6627
- name: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire
6628
- .optional()
6629
- .default('never'),
6630
- shipping: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire
6631
- .optional()
6632
- .default('never'),
6979
+ address: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire.optional(),
6980
+ name: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire.optional(),
6981
+ shipping: appStripeCreateCheckoutSessionCustomerUpdateBehaviorWire.optional(),
6633
6982
  })
6634
6983
  .describe('Controls which customer fields can be updated by the checkout session.');
6635
6984
  export const appStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementWire = z
@@ -6642,11 +6991,8 @@ export const appStripeCreateCheckoutSessionTaxIdCollectionWire = z
6642
6991
  enabled: z
6643
6992
  .boolean()
6644
6993
  .optional()
6645
- .default(false)
6646
6994
  .describe('Enable tax ID collection during checkout. Defaults to false.'),
6647
- required: appStripeCreateCheckoutSessionTaxIdCollectionRequiredWire
6648
- .optional()
6649
- .default('never'),
6995
+ required: appStripeCreateCheckoutSessionTaxIdCollectionRequiredWire.optional(),
6650
6996
  })
6651
6997
  .describe('Tax ID collection configuration for checkout sessions.');
6652
6998
  export const appStripeCreateCheckoutSessionResultWire = z
@@ -6720,10 +7066,8 @@ export const entitlementAccessResultWire = z
6720
7066
  export const createCreditGrantPurchaseWire = z
6721
7067
  .strictObject({
6722
7068
  currency: currencyCodeWire,
6723
- per_unit_cost_basis: numericWire.optional().default('1.0'),
6724
- availability_policy: creditAvailabilityPolicyWire
6725
- .optional()
6726
- .default('on_creation'),
7069
+ per_unit_cost_basis: numericWire.optional(),
7070
+ availability_policy: creditAvailabilityPolicyWire.optional(),
6727
7071
  })
6728
7072
  .describe('Purchase and payment terms of the grant.');
6729
7073
  export const rateCardMeteredEntitlementWire = z
@@ -6734,7 +7078,6 @@ export const rateCardMeteredEntitlementWire = z
6734
7078
  is_soft_limit: z
6735
7079
  .boolean()
6736
7080
  .optional()
6737
- .default(false)
6738
7081
  .describe('If soft limit is true, the subject can use the feature even if the entitlement is exhausted; access remains granted.'),
6739
7082
  limit: z
6740
7083
  .number()
@@ -6753,11 +7096,9 @@ export const recurringPeriodWire = z
6753
7096
  export const creditGrantPurchaseWire = z
6754
7097
  .strictObject({
6755
7098
  currency: currencyCodeWire,
6756
- per_unit_cost_basis: numericWire.optional().default('1.0'),
7099
+ per_unit_cost_basis: numericWire.optional(),
6757
7100
  amount: numericWire,
6758
- availability_policy: creditAvailabilityPolicyWire
6759
- .optional()
6760
- .default('on_creation'),
7101
+ availability_policy: creditAvailabilityPolicyWire.optional(),
6761
7102
  settlement_status: creditPurchasePaymentSettlementStatusWire.optional(),
6762
7103
  })
6763
7104
  .describe('Purchase and payment terms of the grant.');
@@ -6792,6 +7133,11 @@ export const listPlansParamsFilterWire = z
6792
7133
  currency: stringFieldFilterExactWire.optional(),
6793
7134
  })
6794
7135
  .describe('Filter options for listing plans.');
7136
+ export const voidCreditGrantRequestWire = z
7137
+ .strictObject({
7138
+ payment_adjustment: creditGrantVoidPaymentAdjustmentWire.optional(),
7139
+ })
7140
+ .describe('Request body for voiding a credit grant.');
6795
7141
  export const subscriptionCreateWire = z
6796
7142
  .strictObject({
6797
7143
  labels: labelsWire.optional(),
@@ -6842,12 +7188,11 @@ export const unitConfigWire = z
6842
7188
  .strictObject({
6843
7189
  operation: unitConfigOperationWire,
6844
7190
  conversion_factor: numericWire,
6845
- rounding: unitConfigRoundingModeWire.optional().default('none'),
7191
+ rounding: unitConfigRoundingModeWire.optional(),
6846
7192
  precision: z
6847
7193
  .number()
6848
7194
  .int()
6849
7195
  .optional()
6850
- .default(0)
6851
7196
  .describe('The number of decimal places to retain after rounding. Only meaningful when rounding is not "none". Defaults to 0 (round to whole numbers).'),
6852
7197
  display_unit: z
6853
7198
  .string()
@@ -6855,19 +7200,85 @@ export const unitConfigWire = z
6855
7200
  .describe('A human-readable label for the converted unit shown on invoices and in the customer portal (e.g., "GB", "hours", "M tokens"). Optional. When omitted, no unit label is rendered.'),
6856
7201
  })
6857
7202
  .describe('Unit conversion configuration. Transforms raw metered quantities into billing-ready units before pricing and entitlement evaluation. Applied at the rate card level so the same feature can be billed in different units across plans. Examples: - Meter bytes, bill GB: operation=divide, conversionFactor=1e9, rounding=ceiling, displayUnit="GB" - Meter seconds, bill hours: operation=divide, conversionFactor=3600, rounding=ceiling, displayUnit="hours" - Cost + 20% margin: operation=multiply, conversionFactor=1.2 - Bill per million tokens: operation=divide, conversionFactor=1e6, rounding=ceiling, displayUnit="M" v1 equivalents: - DynamicPrice(multiplier): operation=multiply, conversionFactor=multiplier + UnitPrice(amount=1) - PackagePrice(amount, quantityPerPkg): operation=divide, conversionFactor=quantityPerPkg, rounding=ceiling + UnitPrice(amount)');
6858
- export const appCatalogItemWire = z
6859
- .strictObject({
6860
- type: appTypeWire,
6861
- name: z.string().describe('Name of the app.'),
6862
- description: z.string().describe('Description of the app.'),
6863
- })
6864
- .describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
6865
7203
  export const taxCodeAppMappingWire = z
6866
7204
  .strictObject({
6867
7205
  app_type: appTypeWire,
6868
7206
  tax_code: z.string().describe('Tax code.'),
6869
7207
  })
6870
7208
  .describe('Mapping of app types to tax codes.');
7209
+ export const appCapabilityWire = z
7210
+ .strictObject({
7211
+ type: appCapabilityTypeWire,
7212
+ key: resourceKeyWire,
7213
+ name: z.string().describe('Name of the capability.'),
7214
+ description: z.string().describe('Description of the capability.'),
7215
+ })
7216
+ .describe('App capability describes a function that an App can perform.');
7217
+ export const updateAppStripeRequestWire = z
7218
+ .strictObject({
7219
+ name: z
7220
+ .string()
7221
+ .min(1)
7222
+ .max(256)
7223
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
7224
+ description: z
7225
+ .string()
7226
+ .max(1024)
7227
+ .optional()
7228
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
7229
+ labels: updateLabelsWire.optional(),
7230
+ type: z.literal('stripe').describe('The app type.'),
7231
+ secret_api_key: z
7232
+ .string()
7233
+ .optional()
7234
+ .describe('The Stripe secret API key used to authenticate API requests.'),
7235
+ })
7236
+ .describe('AppStripe update request.');
7237
+ export const updateAppSandboxRequestWire = z
7238
+ .strictObject({
7239
+ name: z
7240
+ .string()
7241
+ .min(1)
7242
+ .max(256)
7243
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
7244
+ description: z
7245
+ .string()
7246
+ .max(1024)
7247
+ .optional()
7248
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
7249
+ labels: updateLabelsWire.optional(),
7250
+ type: z.literal('sandbox').describe('The app type.'),
7251
+ })
7252
+ .describe('AppSandbox update request.');
7253
+ export const updateAppExternalInvoicingRequestWire = z
7254
+ .strictObject({
7255
+ name: z
7256
+ .string()
7257
+ .min(1)
7258
+ .max(256)
7259
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
7260
+ description: z
7261
+ .string()
7262
+ .max(1024)
7263
+ .optional()
7264
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
7265
+ labels: updateLabelsWire.optional(),
7266
+ type: z.literal('external_invoicing').describe('The app type.'),
7267
+ enable_draft_sync_hook: z
7268
+ .boolean()
7269
+ .describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
7270
+ enable_issuing_sync_hook: z
7271
+ .boolean()
7272
+ .describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
7273
+ })
7274
+ .describe('AppExternalInvoicing update request.');
7275
+ export const installAppRequestWire = z
7276
+ .discriminatedUnion('type', [
7277
+ installAppStripeWithApiKeyWire,
7278
+ installAppSandboxWire,
7279
+ installAppExternalInvoicingWire,
7280
+ ])
7281
+ .describe('Request to install an app from the catalog.');
6871
7282
  export const partyTaxIdentityWire = z
6872
7283
  .strictObject({
6873
7284
  code: taxIdentificationCodeWire.optional(),
@@ -6883,21 +7294,16 @@ export const workflowInvoicingSettingsWire = z
6883
7294
  auto_advance: z
6884
7295
  .boolean()
6885
7296
  .optional()
6886
- .default(true)
6887
7297
  .describe('Whether to automatically issue the invoice after the draftPeriod has passed.'),
6888
7298
  draft_period: z
6889
7299
  .string()
6890
7300
  .optional()
6891
- .default('P0D')
6892
7301
  .describe('The period for the invoice to be kept in draft status for manual reviews.'),
6893
7302
  progressive_billing: z
6894
7303
  .boolean()
6895
7304
  .optional()
6896
- .default(true)
6897
7305
  .describe('Should progressive billing be allowed for this workflow?'),
6898
- subscription_end_proration_mode: workflowInvoicingSubscriptionEndProrationModeWire
6899
- .optional()
6900
- .default('bill_actual_period'),
7306
+ subscription_end_proration_mode: workflowInvoicingSubscriptionEndProrationModeWire.optional(),
6901
7307
  })
6902
7308
  .describe('Invoice settings for a billing workflow.');
6903
7309
  export const workflowPaymentSettingsWire = z
@@ -6977,45 +7383,11 @@ export const listCurrenciesParamsFilterWire = z
6977
7383
  code: stringFieldFilterWire.optional(),
6978
7384
  })
6979
7385
  .describe('Filter options for listing currencies.');
6980
- export const currencyCustomWire = z
6981
- .strictObject({
6982
- type: z.literal('custom').describe('The type of the currency.'),
6983
- name: z
6984
- .string()
6985
- .min(1)
6986
- .max(256)
6987
- .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
6988
- symbol: z
6989
- .string()
6990
- .min(1)
6991
- .optional()
6992
- .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
6993
- id: ulidWire,
6994
- code: currencyCodeCustomWire,
6995
- created_at: dateTimeWire,
6996
- })
6997
- .describe('Describes custom currency.');
6998
- export const createCurrencyCustomRequestWire = z
6999
- .strictObject({
7000
- name: z
7001
- .string()
7002
- .min(1)
7003
- .max(256)
7004
- .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
7005
- symbol: z
7006
- .string()
7007
- .min(1)
7008
- .optional()
7009
- .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
7010
- code: currencyCodeCustomWire,
7011
- })
7012
- .describe('CurrencyCustom create request.');
7013
7386
  export const governanceQueryRequestWire = z
7014
7387
  .strictObject({
7015
7388
  include_credits: z
7016
7389
  .boolean()
7017
7390
  .optional()
7018
- .default(false)
7019
7391
  .describe('Whether to include credit balance availability for each resolved customer. When true, each feature evaluation includes credit balance checks. Defaults to `false`.'),
7020
7392
  customer: governanceQueryRequestCustomersWire,
7021
7393
  feature: governanceQueryRequestFeaturesWire.optional(),
@@ -7418,6 +7790,44 @@ export const meterQueryResultWire = z
7418
7790
  .describe('The usage data. If no data is available, an empty array is returned.'),
7419
7791
  })
7420
7792
  .describe('Meter query result.');
7793
+ export const currencyCustomWire = z
7794
+ .strictObject({
7795
+ type: z.literal('custom').describe('The type of the currency.'),
7796
+ name: z
7797
+ .string()
7798
+ .min(1)
7799
+ .max(256)
7800
+ .describe('The name of the currency. It should be a human-readable string that represents the name of the currency, such as "US Dollar" or "Euro".'),
7801
+ symbol: z
7802
+ .string()
7803
+ .min(1)
7804
+ .optional()
7805
+ .describe('The symbol of the currency. It should be a string that represents the symbol of the currency, such as "$" for US Dollar or "€" for Euro.'),
7806
+ precision: z
7807
+ .number()
7808
+ .int()
7809
+ .nonnegative()
7810
+ .lte(4294967295)
7811
+ .describe('The precision of the currency. It should be a number that represents the number of decimal places used for the currency, such as 2 for US Dollar or Euro.'),
7812
+ decimal_mark: z
7813
+ .string()
7814
+ .min(1)
7815
+ .max(1)
7816
+ .describe('The decimal mark for the currency. It should be a string that represents the decimal mark of the currency, such as "." for US Dollar or "," for Euro.'),
7817
+ thousand_separator: z
7818
+ .string()
7819
+ .min(1)
7820
+ .max(1)
7821
+ .describe('The thousand separator for the currency. It should be a string that represents the thousand separator of the currency, such as "," for US Dollar or "." for Euro.'),
7822
+ id: ulidWire,
7823
+ code: currencyCodeCustomWire,
7824
+ created_at: dateTimeWire,
7825
+ cost_basis: z
7826
+ .array(costBasisWire)
7827
+ .optional()
7828
+ .describe('The list of active and scheduled cost bases for the custom currency. Expired and deleted cost bases are excluded.'),
7829
+ })
7830
+ .describe('Describes custom currency.');
7421
7831
  export const featureCostQueryResultWire = z
7422
7832
  .strictObject({
7423
7833
  from: dateTimeWire.optional(),
@@ -7636,7 +8046,7 @@ export const subscriptionChangeResponseWire = z
7636
8046
  .describe('Response for changing a subscription.');
7637
8047
  export const subscriptionCancelWire = z
7638
8048
  .strictObject({
7639
- timing: subscriptionEditTimingWire.optional().default('immediate'),
8049
+ timing: subscriptionEditTimingWire.optional(),
7640
8050
  })
7641
8051
  .describe('Request for canceling a subscription.');
7642
8052
  export const subscriptionChangeWire = z
@@ -7688,9 +8098,8 @@ export const invoiceUsageQuantityDetailWire = z
7688
8098
  applied_unit_config: unitConfigWire,
7689
8099
  })
7690
8100
  .describe('Usage quantity details on an invoice line item when UnitConfig is in effect. Provides the full audit trail from raw meter output to the invoiced amount.');
7691
- export const appStripeWire = z
8101
+ export const createTaxCodeRequestWire = z
7692
8102
  .strictObject({
7693
- id: ulidWire,
7694
8103
  name: z
7695
8104
  .string()
7696
8105
  .min(1)
@@ -7702,24 +8111,13 @@ export const appStripeWire = z
7702
8111
  .optional()
7703
8112
  .describe('Optional description of the resource. Maximum 1024 characters.'),
7704
8113
  labels: labelsWire.optional(),
7705
- created_at: dateTimeWire,
7706
- updated_at: dateTimeWire,
7707
- deleted_at: dateTimeWire.optional(),
7708
- type: z.literal('stripe').describe('The app type.'),
7709
- definition: appCatalogItemWire,
7710
- status: appStatusWire,
7711
- account_id: z
7712
- .string()
7713
- .describe('The Stripe account ID associated with the connected Stripe account.'),
7714
- livemode: z
7715
- .boolean()
7716
- .describe('Indicates whether the app is connected to a live Stripe account.'),
7717
- masked_api_key: z
7718
- .string()
7719
- .describe('The masked Stripe API key that only exposes the first and last few characters.'),
8114
+ key: resourceKeyWire,
8115
+ app_mappings: z
8116
+ .array(taxCodeAppMappingWire)
8117
+ .describe('Mapping of app types to tax codes.'),
7720
8118
  })
7721
- .describe('Stripe app.');
7722
- export const appSandboxWire = z
8119
+ .describe('TaxCode create request.');
8120
+ export const taxCodeWire = z
7723
8121
  .strictObject({
7724
8122
  id: ulidWire,
7725
8123
  name: z
@@ -7736,79 +8134,10 @@ export const appSandboxWire = z
7736
8134
  created_at: dateTimeWire,
7737
8135
  updated_at: dateTimeWire,
7738
8136
  deleted_at: dateTimeWire.optional(),
7739
- type: z.literal('sandbox').describe('The app type.'),
7740
- definition: appCatalogItemWire,
7741
- status: appStatusWire,
7742
- })
7743
- .describe('Sandbox app can be used for testing billing features.');
7744
- export const appExternalInvoicingWire = z
7745
- .strictObject({
7746
- id: ulidWire,
7747
- name: z
7748
- .string()
7749
- .min(1)
7750
- .max(256)
7751
- .describe('Display name of the resource. Between 1 and 256 characters.'),
7752
- description: z
7753
- .string()
7754
- .max(1024)
7755
- .optional()
7756
- .describe('Optional description of the resource. Maximum 1024 characters.'),
7757
- labels: labelsWire.optional(),
7758
- created_at: dateTimeWire,
7759
- updated_at: dateTimeWire,
7760
- deleted_at: dateTimeWire.optional(),
7761
- type: z.literal('external_invoicing').describe('The app type.'),
7762
- definition: appCatalogItemWire,
7763
- status: appStatusWire,
7764
- enable_draft_sync_hook: z
7765
- .boolean()
7766
- .describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
7767
- enable_issuing_sync_hook: z
7768
- .boolean()
7769
- .describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
7770
- })
7771
- .describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
7772
- export const createTaxCodeRequestWire = z
7773
- .strictObject({
7774
- name: z
7775
- .string()
7776
- .min(1)
7777
- .max(256)
7778
- .describe('Display name of the resource. Between 1 and 256 characters.'),
7779
- description: z
7780
- .string()
7781
- .max(1024)
7782
- .optional()
7783
- .describe('Optional description of the resource. Maximum 1024 characters.'),
7784
- labels: labelsWire.optional(),
7785
- key: resourceKeyWire,
7786
- app_mappings: z
7787
- .array(taxCodeAppMappingWire)
7788
- .describe('Mapping of app types to tax codes.'),
7789
- })
7790
- .describe('TaxCode create request.');
7791
- export const taxCodeWire = z
7792
- .strictObject({
7793
- id: ulidWire,
7794
- name: z
7795
- .string()
7796
- .min(1)
7797
- .max(256)
7798
- .describe('Display name of the resource. Between 1 and 256 characters.'),
7799
- description: z
7800
- .string()
7801
- .max(1024)
7802
- .optional()
7803
- .describe('Optional description of the resource. Maximum 1024 characters.'),
7804
- labels: labelsWire.optional(),
7805
- created_at: dateTimeWire,
7806
- updated_at: dateTimeWire,
7807
- deleted_at: dateTimeWire.optional(),
7808
- key: resourceKeyWire,
7809
- app_mappings: z
7810
- .array(taxCodeAppMappingWire)
7811
- .describe('Mapping of app types to tax codes.'),
8137
+ key: resourceKeyWire,
8138
+ app_mappings: z
8139
+ .array(taxCodeAppMappingWire)
8140
+ .describe('Mapping of app types to tax codes.'),
7812
8141
  })
7813
8142
  .describe('Tax codes by provider.');
7814
8143
  export const upsertTaxCodeRequestWire = z
@@ -7829,6 +8158,26 @@ export const upsertTaxCodeRequestWire = z
7829
8158
  .describe('Mapping of app types to tax codes.'),
7830
8159
  })
7831
8160
  .describe('TaxCode upsert request.');
8161
+ export const appCatalogItemWire = z
8162
+ .strictObject({
8163
+ type: appTypeWire,
8164
+ name: z.string().describe('Name of the app.'),
8165
+ description: z.string().describe('Description of the app.'),
8166
+ capabilities: z
8167
+ .array(appCapabilityWire)
8168
+ .describe('Capabilities of the app.'),
8169
+ install_methods: z
8170
+ .array(appInstallMethodsWire)
8171
+ .describe('Available install methods of the app.'),
8172
+ })
8173
+ .describe('Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc.');
8174
+ export const updateAppRequestWire = z
8175
+ .discriminatedUnion('type', [
8176
+ updateAppStripeRequestWire,
8177
+ updateAppSandboxRequestWire,
8178
+ updateAppExternalInvoicingRequestWire,
8179
+ ])
8180
+ .describe('Request to update an installed app.');
7832
8181
  export const invoiceWorkflowWire = z
7833
8182
  .strictObject({
7834
8183
  invoicing: invoiceWorkflowInvoicingSettingsWire.optional(),
@@ -7865,9 +8214,6 @@ export const updateBillingInvoiceWorkflowWire = z
7865
8214
  payment: updateBillingWorkflowPaymentSettingsWire.optional(),
7866
8215
  })
7867
8216
  .describe('Invoice-level snapshot of the workflow configuration. Contains only the settings that are meaningful for an already-created invoice: invoicing behaviour and payment settings. Collection alignment and tax policy are gather-time / profile-wide concerns and are not included.');
7868
- export const currencyWire = z
7869
- .discriminatedUnion('type', [currencyFiatWire, currencyCustomWire])
7870
- .describe('Fiat or custom currency.');
7871
8217
  export const governanceFeatureAccessWire = z
7872
8218
  .strictObject({
7873
8219
  has_access: z
@@ -7975,7 +8321,6 @@ export const createCreditGrantRequestWire = z
7975
8321
  .gte(1)
7976
8322
  .lte(1000)
7977
8323
  .optional()
7978
- .default(10)
7979
8324
  .describe('Draw-down priority of the grant. Lower values have higher priority.'),
7980
8325
  effective_at: dateTimeWire.optional(),
7981
8326
  expires_after: iso8601DurationWire.optional(),
@@ -8012,7 +8357,6 @@ export const creditGrantWire = z
8012
8357
  .gte(1)
8013
8358
  .lte(1000)
8014
8359
  .optional()
8015
- .default(10)
8016
8360
  .describe('Draw-down priority of the grant. Lower values have higher priority.'),
8017
8361
  effective_at: dateTimeWire.optional(),
8018
8362
  key: externalResourceKeyWire.optional(),
@@ -8061,12 +8405,10 @@ export const workflowTaxSettingsWire = z
8061
8405
  enabled: z
8062
8406
  .boolean()
8063
8407
  .optional()
8064
- .default(true)
8065
8408
  .describe('Enable automatic tax calculation when tax is supported by the app. For example, with Stripe Invoicing when enabled, tax is calculated via Stripe Tax.'),
8066
8409
  enforced: z
8067
8410
  .boolean()
8068
8411
  .optional()
8069
- .default(false)
8070
8412
  .describe('Enforce tax calculation when tax is supported by the app. When enabled, the billing system will not allow to create an invoice without tax calculation. Enforcement is different per apps, for example, Stripe app requires customer to have a tax location when starting a paid subscription.'),
8071
8413
  default_tax_config: taxConfigWire.optional(),
8072
8414
  })
@@ -8083,6 +8425,9 @@ export const ingestedEventPaginatedResponseWire = z
8083
8425
  meta: cursorMetaWire,
8084
8426
  })
8085
8427
  .describe('Cursor paginated response.');
8428
+ export const currencyWire = z
8429
+ .discriminatedUnion('type', [currencyFiatWire, currencyCustomWire])
8430
+ .describe('Fiat or custom currency.');
8086
8431
  export const invalidParametersWire = z
8087
8432
  .array(invalidParameterWire)
8088
8433
  .min(1)
@@ -8095,7 +8440,6 @@ export const meterQueryRequestWire = z
8095
8440
  time_zone: z
8096
8441
  .string()
8097
8442
  .optional()
8098
- .default('UTC')
8099
8443
  .describe('The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). The time zone is used to determine the start and end of the time buckets. If not specified, the UTC timezone will be used.'),
8100
8444
  group_by_dimensions: z
8101
8445
  .array(z.string())
@@ -8147,9 +8491,7 @@ export const updateSupplierWire = z
8147
8491
  .describe("Snapshot of the supplier's information at the time the invoice was issued. Structurally a read-only subset of `BillingParty` (the type configured on the billing profile), so the snapshot stays aligned with the source. `key` is omitted because it is not part of the snapshotted supplier data.");
8148
8492
  export const appStripeCreateCheckoutSessionRequestOptionsWire = z
8149
8493
  .strictObject({
8150
- billing_address_collection: appStripeCreateCheckoutSessionBillingAddressCollectionWire
8151
- .optional()
8152
- .default('auto'),
8494
+ billing_address_collection: appStripeCreateCheckoutSessionBillingAddressCollectionWire.optional(),
8153
8495
  cancel_url: z
8154
8496
  .string()
8155
8497
  .optional()
@@ -8184,7 +8526,7 @@ export const appStripeCreateCheckoutSessionRequestOptionsWire = z
8184
8526
  .string()
8185
8527
  .optional()
8186
8528
  .describe('Success URL to redirect customers after completing payment or setup. Not allowed when ui_mode is "embedded". See: https://docs.stripe.com/payments/checkout/custom-success-page'),
8187
- ui_mode: appStripeCheckoutSessionUiModeWire.optional().default('hosted'),
8529
+ ui_mode: appStripeCheckoutSessionUiModeWire.optional(),
8188
8530
  payment_method_types: z
8189
8531
  .array(z.string())
8190
8532
  .optional()
@@ -8199,19 +8541,99 @@ export const workflowCollectionAlignmentWire = z
8199
8541
  workflowCollectionAlignmentAnchoredWire,
8200
8542
  ])
8201
8543
  .describe('The alignment for collecting the pending line items into an invoice. Defaults to subscription, which means that we are to create a new invoice every time the a subscription period starts (for in advance items) or ends (for in arrears items).');
8202
- export const appWire = z
8203
- .discriminatedUnion('type', [
8204
- appStripeWire,
8205
- appSandboxWire,
8206
- appExternalInvoicingWire,
8207
- ])
8208
- .describe('Installed application.');
8209
8544
  export const taxCodePagePaginatedResponseWire = z
8210
8545
  .strictObject({
8211
8546
  data: z.array(taxCodeWire),
8212
8547
  meta: paginatedMetaWire,
8213
8548
  })
8214
8549
  .describe('Page paginated response.');
8550
+ export const appStripeWire = z
8551
+ .strictObject({
8552
+ id: ulidWire,
8553
+ name: z
8554
+ .string()
8555
+ .min(1)
8556
+ .max(256)
8557
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
8558
+ description: z
8559
+ .string()
8560
+ .max(1024)
8561
+ .optional()
8562
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
8563
+ labels: labelsWire.optional(),
8564
+ created_at: dateTimeWire,
8565
+ updated_at: dateTimeWire,
8566
+ deleted_at: dateTimeWire.optional(),
8567
+ type: z.literal('stripe').describe('The app type.'),
8568
+ definition: appCatalogItemWire,
8569
+ status: appStatusWire,
8570
+ account_id: z
8571
+ .string()
8572
+ .describe('The Stripe account ID associated with the connected Stripe account.'),
8573
+ livemode: z
8574
+ .boolean()
8575
+ .describe('Indicates whether the app is connected to a live Stripe account.'),
8576
+ masked_api_key: z
8577
+ .string()
8578
+ .describe('The masked Stripe API key that only exposes the first and last few characters.'),
8579
+ })
8580
+ .describe('Stripe app.');
8581
+ export const appSandboxWire = z
8582
+ .strictObject({
8583
+ id: ulidWire,
8584
+ name: z
8585
+ .string()
8586
+ .min(1)
8587
+ .max(256)
8588
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
8589
+ description: z
8590
+ .string()
8591
+ .max(1024)
8592
+ .optional()
8593
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
8594
+ labels: labelsWire.optional(),
8595
+ created_at: dateTimeWire,
8596
+ updated_at: dateTimeWire,
8597
+ deleted_at: dateTimeWire.optional(),
8598
+ type: z.literal('sandbox').describe('The app type.'),
8599
+ definition: appCatalogItemWire,
8600
+ status: appStatusWire,
8601
+ })
8602
+ .describe('Sandbox app can be used for testing billing features.');
8603
+ export const appExternalInvoicingWire = z
8604
+ .strictObject({
8605
+ id: ulidWire,
8606
+ name: z
8607
+ .string()
8608
+ .min(1)
8609
+ .max(256)
8610
+ .describe('Display name of the resource. Between 1 and 256 characters.'),
8611
+ description: z
8612
+ .string()
8613
+ .max(1024)
8614
+ .optional()
8615
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
8616
+ labels: labelsWire.optional(),
8617
+ created_at: dateTimeWire,
8618
+ updated_at: dateTimeWire,
8619
+ deleted_at: dateTimeWire.optional(),
8620
+ type: z.literal('external_invoicing').describe('The app type.'),
8621
+ definition: appCatalogItemWire,
8622
+ status: appStatusWire,
8623
+ enable_draft_sync_hook: z
8624
+ .boolean()
8625
+ .describe('Enable draft synchronization hook. When enabled, invoices will pause at the draft state and wait for the integration to call the draft synchronized endpoint before progressing to the issuing state. This allows the external system to validate and prepare the invoice data. When disabled, invoices automatically progress through the draft state based on the configured workflow timing.'),
8626
+ enable_issuing_sync_hook: z
8627
+ .boolean()
8628
+ .describe('Enable issuing synchronization hook. When enabled, invoices will pause at the issuing state and wait for the integration to call the issuing synchronized endpoint before progressing to the issued state. This ensures the external invoicing system has successfully created and finalized the invoice before it is marked as issued. When disabled, invoices automatically progress through the issuing state and are immediately marked as issued.'),
8629
+ })
8630
+ .describe('External Invoicing app enables integration with third-party invoicing or payment system. The app supports a bi-directional synchronization pattern where OpenMeter Billing manages the invoice lifecycle while the external system handles invoice presentation and payment collection. Integration workflow: 1. The billing system creates invoices and transitions them through lifecycle states (draft → issuing → issued) 2. The integration receives webhook notifications about invoice state changes 3. The integration calls back to provide external system IDs and metadata 4. The integration reports payment events back via the payment status API State synchronization is controlled by hooks that pause invoice progression until the external system confirms synchronization via API callbacks.');
8631
+ export const appCatalogItemPagePaginatedResponseWire = z
8632
+ .strictObject({
8633
+ data: z.array(appCatalogItemWire),
8634
+ meta: paginatedMetaWire,
8635
+ })
8636
+ .describe('Page paginated response.');
8215
8637
  export const invoiceWorkflowSettingsWire = z
8216
8638
  .strictObject({
8217
8639
  apps: invoiceWorkflowAppsReferencesWire.optional(),
@@ -8238,7 +8660,7 @@ export const invoiceDetailedLineWire = z
8238
8660
  deleted_at: dateTimeWire.optional(),
8239
8661
  service_period: closedPeriodWire,
8240
8662
  totals: totalsWire,
8241
- category: invoiceDetailedLineCostCategoryWire.default('regular'),
8663
+ category: invoiceDetailedLineCostCategoryWire,
8242
8664
  discounts: invoiceLineDiscountsWire.optional(),
8243
8665
  credits_applied: z
8244
8666
  .array(invoiceLineCreditsAppliedWire)
@@ -8254,12 +8676,6 @@ export const updateInvoiceWorkflowSettingsWire = z
8254
8676
  workflow: updateBillingInvoiceWorkflowWire,
8255
8677
  })
8256
8678
  .describe('Snapshot of the billing workflow configuration captured at invoice creation.');
8257
- export const currencyPagePaginatedResponseWire = z
8258
- .strictObject({
8259
- data: z.array(currencyWire),
8260
- meta: paginatedMetaWire,
8261
- })
8262
- .describe('Page paginated response.');
8263
8679
  export const governanceQueryResultWire = z
8264
8680
  .strictObject({
8265
8681
  matched: z
@@ -8339,8 +8755,8 @@ export const createFeatureRequestWire = z
8339
8755
  .describe('Feature create request.');
8340
8756
  export const updateFeatureRequestWire = z
8341
8757
  .strictObject({
8342
- unit_cost: z
8343
- .union([featureUnitCostWire, z.null()])
8758
+ unit_cost: featureUnitCostWire
8759
+ .nullable()
8344
8760
  .optional()
8345
8761
  .describe('Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or "llm" to look up cost from the LLM cost database based on meter group-by properties. Set to `null` to clear the existing unit cost; omit to leave it unchanged.'),
8346
8762
  })
@@ -8351,6 +8767,12 @@ export const creditGrantPagePaginatedResponseWire = z
8351
8767
  meta: paginatedMetaWire,
8352
8768
  })
8353
8769
  .describe('Page paginated response.');
8770
+ export const currencyPagePaginatedResponseWire = z
8771
+ .strictObject({
8772
+ data: z.array(currencyWire),
8773
+ meta: paginatedMetaWire,
8774
+ })
8775
+ .describe('Page paginated response.');
8354
8776
  export const badRequestWire = z
8355
8777
  .intersection(baseErrorWire, z.strictObject({
8356
8778
  invalid_parameters: invalidParametersWire,
@@ -8388,29 +8810,20 @@ export const customerStripeCreateCheckoutSessionRequestWire = z
8388
8810
  .describe('Request to create a Stripe Checkout Session for the customer. Checkout Sessions are used to collect payment method information from customers in a secure, Stripe-hosted interface. This integration uses setup mode to collect payment methods that can be charged later for subscription billing.');
8389
8811
  export const workflowCollectionSettingsWire = z
8390
8812
  .strictObject({
8391
- alignment: workflowCollectionAlignmentWire.optional().default({
8392
- type: 'subscription',
8393
- }),
8813
+ alignment: workflowCollectionAlignmentWire.optional(),
8394
8814
  interval: z
8395
8815
  .string()
8396
8816
  .optional()
8397
- .default('PT1H')
8398
8817
  .describe('This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods.'),
8399
8818
  })
8400
8819
  .describe('Workflow collection specifies how to collect the pending line items for an invoice.');
8401
- export const appPagePaginatedResponseWire = z
8402
- .strictObject({
8403
- data: z.array(appWire),
8404
- meta: paginatedMetaWire,
8405
- })
8406
- .describe('Page paginated response.');
8407
- export const profileAppsWire = z
8408
- .strictObject({
8409
- tax: appWire,
8410
- invoicing: appWire,
8411
- payment: appWire,
8412
- })
8413
- .describe('Applications used by a billing profile.');
8820
+ export const appWire = z
8821
+ .discriminatedUnion('type', [
8822
+ appStripeWire,
8823
+ appSandboxWire,
8824
+ appExternalInvoicingWire,
8825
+ ])
8826
+ .describe('Installed application.');
8414
8827
  export const governanceQueryResponseWire = z
8415
8828
  .strictObject({
8416
8829
  data: z
@@ -8535,10 +8948,11 @@ export const rateCardWire = z
8535
8948
  labels: labelsWire.optional(),
8536
8949
  key: resourceKeyWire,
8537
8950
  feature: featureReferenceWire.optional(),
8951
+ currency: billingCurrencyCodeWire.optional(),
8538
8952
  billing_cadence: iso8601DurationWire.optional(),
8539
8953
  price: priceWire,
8540
8954
  unit_config: unitConfigWire.optional(),
8541
- payment_term: pricePaymentTermWire.optional().default('in_arrears'),
8955
+ payment_term: pricePaymentTermWire.optional(),
8542
8956
  commitments: spendCommitmentsWire.optional(),
8543
8957
  discounts: rateCardDiscountsWire.optional(),
8544
8958
  tax_config: rateCardTaxConfigWire.optional(),
@@ -8551,6 +8965,7 @@ export const invoiceLineRateCardWire = z
8551
8965
  tax_config: rateCardTaxConfigWire.optional(),
8552
8966
  feature_key: resourceKeyWire.optional(),
8553
8967
  discounts: rateCardDiscountsWire.optional(),
8968
+ unit_config: unitConfigWire.optional(),
8554
8969
  })
8555
8970
  .describe('Rate card configuration snapshot for a usage-based invoice line.');
8556
8971
  export const updateInvoiceLineRateCardWire = z
@@ -8575,6 +8990,25 @@ export const workflowWire = z
8575
8990
  tax: workflowTaxSettingsWire.optional(),
8576
8991
  })
8577
8992
  .describe('Billing workflow settings.');
8993
+ export const appPagePaginatedResponseWire = z
8994
+ .strictObject({
8995
+ data: z.array(appWire),
8996
+ meta: paginatedMetaWire,
8997
+ })
8998
+ .describe('Page paginated response.');
8999
+ export const billingInstallAppResponseWire = z
9000
+ .strictObject({
9001
+ app: appWire,
9002
+ default_for_capability_types: z.array(appCapabilityTypeWire),
9003
+ })
9004
+ .describe('Response of the app install.');
9005
+ export const profileAppsWire = z
9006
+ .strictObject({
9007
+ tax: appWire,
9008
+ invoicing: appWire,
9009
+ payment: appWire,
9010
+ })
9011
+ .describe('Applications used by a billing profile.');
8578
9012
  export const chargeUsageBasedWire = z
8579
9013
  .strictObject({
8580
9014
  id: ulidWire,
@@ -8670,7 +9104,6 @@ export const addonWire = z
8670
9104
  .number()
8671
9105
  .int()
8672
9106
  .gte(1)
8673
- .default(1)
8674
9107
  .describe('Version of the add-on. Incremented when the add-on is updated.'),
8675
9108
  instance_type: addonInstanceTypeWire,
8676
9109
  currency: billingCurrencyCodeWire,
@@ -8897,14 +9330,12 @@ export const planWire = z
8897
9330
  .number()
8898
9331
  .int()
8899
9332
  .gte(1)
8900
- .default(1)
8901
9333
  .describe('Plans are versioned to allow you to make changes without affecting running subscriptions.'),
8902
- currency: currencyCodeWire,
9334
+ currency: billingCurrencyCodeWire,
8903
9335
  billing_cadence: iso8601DurationWire,
8904
9336
  pro_rating_enabled: z
8905
9337
  .boolean()
8906
9338
  .optional()
8907
- .default(true)
8908
9339
  .describe('Whether pro-rating is enabled for this plan.'),
8909
9340
  effective_from: dateTimeWire.optional(),
8910
9341
  effective_to: dateTimeWire.optional(),
@@ -8913,9 +9344,7 @@ export const planWire = z
8913
9344
  .array(planPhaseWire)
8914
9345
  .min(1)
8915
9346
  .describe('The plan phases define the pricing ramp for a subscription. A phase switch occurs only at the end of a billing period. At least one phase is required.'),
8916
- settlement_mode: settlementModeWire
8917
- .optional()
8918
- .default('credit_then_invoice'),
9347
+ settlement_mode: settlementModeWire.optional(),
8919
9348
  validation_errors: z
8920
9349
  .array(productCatalogValidationErrorWire)
8921
9350
  .optional()
@@ -8936,12 +9365,11 @@ export const createPlanRequestWire = z
8936
9365
  .describe('Optional description of the resource. Maximum 1024 characters.'),
8937
9366
  labels: labelsWire.optional(),
8938
9367
  key: resourceKeyWire,
8939
- currency: currencyCodeWire,
9368
+ currency: billingCurrencyCodeWire,
8940
9369
  billing_cadence: iso8601DurationWire,
8941
9370
  pro_rating_enabled: z
8942
9371
  .boolean()
8943
9372
  .optional()
8944
- .default(true)
8945
9373
  .describe('Whether pro-rating is enabled for this plan.'),
8946
9374
  phases: z
8947
9375
  .array(planPhaseWire)
@@ -8965,7 +9393,6 @@ export const upsertPlanRequestWire = z
8965
9393
  pro_rating_enabled: z
8966
9394
  .boolean()
8967
9395
  .optional()
8968
- .default(true)
8969
9396
  .describe('Whether pro-rating is enabled for this plan.'),
8970
9397
  phases: z
8971
9398
  .array(planPhaseWire)
@@ -9085,7 +9512,10 @@ export const invoicePagePaginatedResponseWire = z
9085
9512
  export const listMeteringEventsQueryParamsWire = z.object({
9086
9513
  page: cursorPaginationQueryPageWire.optional(),
9087
9514
  filter: listEventsParamsFilterWire.optional(),
9088
- sort: sortQueryWire.optional(),
9515
+ sort: z
9516
+ .string()
9517
+ .optional()
9518
+ .describe('Sort events returned in the response. Supported sort attributes are: - `time` (default) - `ingested_at` - `stored_at` When omitted, events are sorted by `time desc` (most recent first). When a sort field is provided without a suffix, it sorts descending. Append the `asc` suffix to sort ascending, or the `desc` suffix to sort descending.'),
9089
9519
  });
9090
9520
  export const listMeteringEventsResponseWire = z.strictObject({
9091
9521
  data: z.array(ingestedEventWire),
@@ -9113,7 +9543,10 @@ export const listMetersQueryParamsWire = z.object({
9113
9543
  })
9114
9544
  .optional()
9115
9545
  .describe('Determines which page of the collection to retrieve.'),
9116
- sort: sortQueryWire.optional(),
9546
+ sort: z
9547
+ .string()
9548
+ .optional()
9549
+ .describe('Sort meters returned in the response. Supported sort attributes are: - `key` - `name` - `aggregation` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9117
9550
  filter: listMetersParamsFilterWire.optional(),
9118
9551
  });
9119
9552
  export const listMetersResponseWire = z.strictObject({
@@ -9156,7 +9589,10 @@ export const listCustomersQueryParamsWire = z.object({
9156
9589
  })
9157
9590
  .optional()
9158
9591
  .describe('Determines which page of the collection to retrieve.'),
9159
- sort: sortQueryWire.optional(),
9592
+ sort: z
9593
+ .string()
9594
+ .optional()
9595
+ .describe('Sort customers returned in the response. Supported sort attributes are: - `id` - `name` (default) - `created_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9160
9596
  filter: listCustomersParamsFilterWire.optional(),
9161
9597
  });
9162
9598
  export const listCustomersResponseWire = z.strictObject({
@@ -9243,6 +9679,12 @@ export const createCreditAdjustmentPathParamsWire = z.object({
9243
9679
  });
9244
9680
  export const createCreditAdjustmentBodyWire = createCreditAdjustmentRequestWire;
9245
9681
  export const createCreditAdjustmentResponseWire = creditAdjustmentWire;
9682
+ export const voidCreditGrantPathParamsWire = z.object({
9683
+ customerId: ulidWire,
9684
+ creditGrantId: ulidWire,
9685
+ });
9686
+ export const voidCreditGrantBodyWire = voidCreditGrantRequestWire;
9687
+ export const voidCreditGrantResponseWire = creditGrantWire;
9246
9688
  export const updateCreditGrantExternalSettlementPathParamsWire = z.object({
9247
9689
  customerId: ulidWire,
9248
9690
  creditGrantId: ulidWire,
@@ -9275,7 +9717,10 @@ export const listCustomerChargesQueryParamsWire = z.object({
9275
9717
  })
9276
9718
  .optional()
9277
9719
  .describe('Determines which page of the collection to retrieve.'),
9278
- sort: sortQueryWire.optional(),
9720
+ sort: z
9721
+ .string()
9722
+ .optional()
9723
+ .describe('Sort charges returned in the response. Supported sort attributes are: - `id` - `created_at` - `service_period.from` - `billing_period.from`'),
9279
9724
  filter: listChargesParamsFilterWire.optional(),
9280
9725
  expand: z
9281
9726
  .array(chargesExpandWire)
@@ -9305,7 +9750,10 @@ export const listSubscriptionsQueryParamsWire = z.object({
9305
9750
  })
9306
9751
  .optional()
9307
9752
  .describe('Determines which page of the collection to retrieve.'),
9308
- sort: sortQueryWire.optional(),
9753
+ sort: z
9754
+ .string()
9755
+ .optional()
9756
+ .describe('Sort subscriptions returned in the response. Supported sort attributes are: - `id` - `active_from` (default) - `active_to` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9309
9757
  filter: listSubscriptionsParamsFilterWire.optional(),
9310
9758
  });
9311
9759
  export const listSubscriptionsResponseWire = z.strictObject({
@@ -9350,7 +9798,10 @@ export const listSubscriptionAddonsQueryParamsWire = z.object({
9350
9798
  })
9351
9799
  .optional()
9352
9800
  .describe('Determines which page of the collection to retrieve.'),
9353
- sort: sortQueryWire.optional(),
9801
+ sort: z
9802
+ .string()
9803
+ .optional()
9804
+ .describe('Sort subscription addons returned in the response. Supported sort attributes are: - `id` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9354
9805
  });
9355
9806
  export const listSubscriptionAddonsResponseWire = z.strictObject({
9356
9807
  data: z.array(subscriptionAddonWire),
@@ -9382,6 +9833,37 @@ export const getAppPathParamsWire = z.object({
9382
9833
  appId: ulidWire,
9383
9834
  });
9384
9835
  export const getAppResponseWire = appWire;
9836
+ export const uninstallAppPathParamsWire = z.object({
9837
+ appId: ulidWire,
9838
+ });
9839
+ export const updateAppPathParamsWire = z.object({
9840
+ appId: ulidWire,
9841
+ });
9842
+ export const updateAppBodyWire = updateAppRequestWire;
9843
+ export const updateAppResponseWire = appWire;
9844
+ export const listAppCatalogQueryParamsWire = z.object({
9845
+ page: z
9846
+ .strictObject({
9847
+ size: z.coerce
9848
+ .number()
9849
+ .int()
9850
+ .optional()
9851
+ .describe('The number of items to include per page.'),
9852
+ number: z.coerce.number().int().optional().describe('The page number.'),
9853
+ })
9854
+ .optional()
9855
+ .describe('Determines which page of the collection to retrieve.'),
9856
+ });
9857
+ export const listAppCatalogResponseWire = z.strictObject({
9858
+ data: z.array(appCatalogItemWire),
9859
+ meta: paginatedMetaWire,
9860
+ });
9861
+ export const getAppCatalogItemPathParamsWire = z.object({
9862
+ appType: appTypeWire,
9863
+ });
9864
+ export const getAppCatalogItemResponseWire = appCatalogItemWire;
9865
+ export const installAppBodyWire = installAppRequestWire;
9866
+ export const installAppResponseWire = billingInstallAppResponseWire;
9385
9867
  export const listBillingProfilesQueryParamsWire = z.object({
9386
9868
  page: z
9387
9869
  .strictObject({
@@ -9425,7 +9907,10 @@ export const listInvoicesQueryParamsWire = z.object({
9425
9907
  })
9426
9908
  .optional()
9427
9909
  .describe('Determines which page of the collection to retrieve.'),
9428
- sort: sortQueryWire.optional(),
9910
+ sort: z
9911
+ .string()
9912
+ .optional()
9913
+ .describe('Sort invoices returned in the response. Supported sort attributes: - `issued_at` - `created_at` (default) - `service_period_start` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9429
9914
  filter: listInvoicesParamsFilterWire.optional(),
9430
9915
  });
9431
9916
  export const listInvoicesResponseWire = z.strictObject({
@@ -9444,6 +9929,22 @@ export const updateInvoiceResponseWire = invoiceWire;
9444
9929
  export const deleteInvoicePathParamsWire = z.object({
9445
9930
  invoiceId: ulidWire,
9446
9931
  });
9932
+ export const advanceInvoicePathParamsWire = z.object({
9933
+ invoiceId: ulidWire,
9934
+ });
9935
+ export const advanceInvoiceResponseWire = invoiceWire;
9936
+ export const approveInvoicePathParamsWire = z.object({
9937
+ invoiceId: ulidWire,
9938
+ });
9939
+ export const approveInvoiceResponseWire = invoiceWire;
9940
+ export const retryInvoicePathParamsWire = z.object({
9941
+ invoiceId: ulidWire,
9942
+ });
9943
+ export const retryInvoiceResponseWire = invoiceWire;
9944
+ export const snapshotQuantitiesInvoicePathParamsWire = z.object({
9945
+ invoiceId: ulidWire,
9946
+ });
9947
+ export const snapshotQuantitiesInvoiceResponseWire = invoiceWire;
9447
9948
  export const createTaxCodeBodyWire = createTaxCodeRequestWire;
9448
9949
  export const createTaxCodeResponseWire = taxCodeWire;
9449
9950
  export const getTaxCodePathParamsWire = z.object({
@@ -9491,8 +9992,15 @@ export const listCurrenciesQueryParamsWire = z.object({
9491
9992
  })
9492
9993
  .optional()
9493
9994
  .describe('Determines which page of the collection to retrieve.'),
9494
- sort: sortQueryWire.optional(),
9995
+ sort: z
9996
+ .string()
9997
+ .optional()
9998
+ .describe('Sort currencies returned in the response. Supported sort attributes are: - `code` (default) - `name` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9495
9999
  filter: listCurrenciesParamsFilterWire.optional(),
10000
+ expand: z
10001
+ .array(currencyExpandWire)
10002
+ .optional()
10003
+ .describe('Expand the currencies returned in the response. To include the active and scheduled cost basis add: expand=cost_basis'),
9496
10004
  });
9497
10005
  export const listCurrenciesResponseWire = z.strictObject({
9498
10006
  data: z.array(currencyWire),
@@ -9500,6 +10008,10 @@ export const listCurrenciesResponseWire = z.strictObject({
9500
10008
  });
9501
10009
  export const createCustomCurrencyBodyWire = createCurrencyCustomRequestWire;
9502
10010
  export const createCustomCurrencyResponseWire = currencyCustomWire;
10011
+ export const getCustomCurrencyPathParamsWire = z.object({
10012
+ currencyId: ulidWire,
10013
+ });
10014
+ export const getCustomCurrencyResponseWire = currencyCustomWire;
9503
10015
  export const listCostBasesPathParamsWire = z.object({
9504
10016
  currencyId: ulidWire,
9505
10017
  });
@@ -9538,7 +10050,10 @@ export const listFeaturesQueryParamsWire = z.object({
9538
10050
  })
9539
10051
  .optional()
9540
10052
  .describe('Determines which page of the collection to retrieve.'),
9541
- sort: sortQueryWire.optional(),
10053
+ sort: z
10054
+ .string()
10055
+ .optional()
10056
+ .describe('Sort features returned in the response. Supported sort attributes are: - `key` - `name` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9542
10057
  filter: listFeatureParamsFilterWire.optional(),
9543
10058
  });
9544
10059
  export const listFeaturesResponseWire = z.strictObject({
@@ -9566,7 +10081,10 @@ export const queryFeatureCostBodyWire = meterQueryRequestWire;
9566
10081
  export const queryFeatureCostResponseWire = featureCostQueryResultWire;
9567
10082
  export const listLlmCostPricesQueryParamsWire = z.object({
9568
10083
  filter: listLlmCostPricesParamsFilterWire.optional(),
9569
- sort: sortQueryWire.optional(),
10084
+ sort: z
10085
+ .string()
10086
+ .optional()
10087
+ .describe('Sort prices returned in the response. Supported sort attributes are: - `id` - `provider.id` - `model.id` (default) - `effective_from` - `effective_to` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9570
10088
  page: z
9571
10089
  .strictObject({
9572
10090
  size: z.coerce
@@ -9622,7 +10140,10 @@ export const listPlansQueryParamsWire = z.object({
9622
10140
  })
9623
10141
  .optional()
9624
10142
  .describe('Determines which page of the collection to retrieve.'),
9625
- sort: sortQueryWire.optional(),
10143
+ sort: z
10144
+ .string()
10145
+ .optional()
10146
+ .describe('Sort plans returned in the response. Supported sort attributes are: - `id` - `key` - `version` - `created_at` (default) - `updated_at`'),
9626
10147
  filter: listPlansParamsFilterWire.optional(),
9627
10148
  });
9628
10149
  export const listPlansResponseWire = z.strictObject({
@@ -9663,7 +10184,10 @@ export const listAddonsQueryParamsWire = z.object({
9663
10184
  })
9664
10185
  .optional()
9665
10186
  .describe('Determines which page of the collection to retrieve.'),
9666
- sort: sortQueryWire.optional(),
10187
+ sort: z
10188
+ .string()
10189
+ .optional()
10190
+ .describe('Sort add-ons returned in the response. Supported sort attributes are: - `id` - `key` - `name` - `created_at` (default) - `updated_at` The `asc` suffix is optional as the default sort order is ascending. The `desc` suffix is used to specify a descending order.'),
9667
10191
  filter: listAddonsParamsFilterWire.optional(),
9668
10192
  });
9669
10193
  export const listAddonsResponseWire = z.strictObject({
@@ -9740,4 +10264,3 @@ export const queryGovernanceAccessQueryParamsWire = z.object({
9740
10264
  });
9741
10265
  export const queryGovernanceAccessBodyWire = governanceQueryRequestWire;
9742
10266
  export const queryGovernanceAccessResponseWire = governanceQueryResponseWire;
9743
- //# sourceMappingURL=schemas.js.map