@openmeter/client 1.0.0-beta-12e68f1db5c4 → 1.0.0-beta-7e82dfcabfc1
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.
- package/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/schemas.d.ts +3550 -306
- package/dist/models/schemas.js +212 -82
- package/dist/models/types.d.ts +327 -120
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -477,9 +477,6 @@ export const subscriptionCostBasisMode = z
|
|
|
477
477
|
export const subscriptionStatus = z
|
|
478
478
|
.enum(['active', 'inactive', 'canceled', 'scheduled'])
|
|
479
479
|
.describe('Subscription status.');
|
|
480
|
-
export const subscriptionEditTimingEnum = z
|
|
481
|
-
.enum(['immediate', 'next_billing_cycle'])
|
|
482
|
-
.describe('Subscription edit timing. When immediate, the requested changes take effect immediately. When next_billing_cycle, the requested changes take effect at the next billing cycle.');
|
|
483
480
|
export const unitConfigOperation = z
|
|
484
481
|
.enum(['divide', 'multiply'])
|
|
485
482
|
.describe('The arithmetic operation used to convert raw metered units into billing units. - `divide`: Divide the metered quantity by the conversion factor (e.g., bytes ÷ 1e9 = GB). - `multiply`: Multiply the metered quantity by the conversion factor (e.g., cost × 1.2 = cost + 20% margin).');
|
|
@@ -501,6 +498,9 @@ export const rateCardBooleanEntitlement = z
|
|
|
501
498
|
.describe('The type of the entitlement template.'),
|
|
502
499
|
})
|
|
503
500
|
.describe('The entitlement template of a boolean entitlement.');
|
|
501
|
+
export const subscriptionEditTimingEnum = z
|
|
502
|
+
.enum(['immediate', 'next_billing_cycle'])
|
|
503
|
+
.describe('Subscription edit timing. When immediate, the requested changes take effect immediately. When next_billing_cycle, the requested changes take effect at the next billing cycle.');
|
|
504
504
|
export const appType = z
|
|
505
505
|
.enum(['sandbox', 'stripe', 'external_invoicing'])
|
|
506
506
|
.describe('The type of the app.');
|
|
@@ -1331,16 +1331,16 @@ export const subscriptionCostBasisPin = z
|
|
|
1331
1331
|
costBasisId: ulid,
|
|
1332
1332
|
})
|
|
1333
1333
|
.describe('A cost basis pinned to a custom-currency pair for the subscription.');
|
|
1334
|
-
export const
|
|
1334
|
+
export const featureReference = z
|
|
1335
1335
|
.object({
|
|
1336
1336
|
id: ulid,
|
|
1337
1337
|
})
|
|
1338
|
-
.describe('
|
|
1339
|
-
export const
|
|
1338
|
+
.describe('Feature reference.');
|
|
1339
|
+
export const addonReference = z
|
|
1340
1340
|
.object({
|
|
1341
1341
|
id: ulid,
|
|
1342
1342
|
})
|
|
1343
|
-
.describe('
|
|
1343
|
+
.describe('Addon reference.');
|
|
1344
1344
|
export const appReference = z
|
|
1345
1345
|
.object({
|
|
1346
1346
|
id: ulid,
|
|
@@ -1669,6 +1669,13 @@ export const creditGrantFilters = z
|
|
|
1669
1669
|
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
1670
1670
|
})
|
|
1671
1671
|
.describe('Filters for the credit grant.');
|
|
1672
|
+
export const subscriptionPlanReference = z
|
|
1673
|
+
.object({
|
|
1674
|
+
id: ulid,
|
|
1675
|
+
key: resourceKey,
|
|
1676
|
+
version: z.number().int().gte(1).describe('The plan version.'),
|
|
1677
|
+
})
|
|
1678
|
+
.describe('A reference to the plan a subscription was created from, pinned to an exact revision.');
|
|
1672
1679
|
export const upsertPlanAddonRequest = z
|
|
1673
1680
|
.object({
|
|
1674
1681
|
name: z
|
|
@@ -2059,6 +2066,12 @@ export const rateCardProrationConfiguration = z
|
|
|
2059
2066
|
mode: rateCardProrationMode,
|
|
2060
2067
|
})
|
|
2061
2068
|
.describe('The proration configuration of the rate card.');
|
|
2069
|
+
export const subscriptionProRatingConfig = z
|
|
2070
|
+
.object({
|
|
2071
|
+
enabled: z.boolean().describe('Whether pro-rating is enabled.'),
|
|
2072
|
+
mode: rateCardProrationMode,
|
|
2073
|
+
})
|
|
2074
|
+
.describe('The pro-rating configuration of a subscription.');
|
|
2062
2075
|
export const subscriptionCreate = z
|
|
2063
2076
|
.object({
|
|
2064
2077
|
labels: labels.optional(),
|
|
@@ -2084,9 +2097,6 @@ export const subscriptionCreate = z
|
|
|
2084
2097
|
costBasisMode: subscriptionCostBasisMode.optional().default('dynamic'),
|
|
2085
2098
|
})
|
|
2086
2099
|
.describe('Subscription create request.');
|
|
2087
|
-
export const subscriptionEditTiming = z
|
|
2088
|
-
.union([subscriptionEditTimingEnum, dateTime])
|
|
2089
|
-
.describe('Subscription edit timing defined when the changes should take effect. If the provided configuration is not supported by the subscription, an error will be returned.');
|
|
2090
2100
|
export const unitConfig = z
|
|
2091
2101
|
.object({
|
|
2092
2102
|
operation: unitConfigOperation,
|
|
@@ -2104,6 +2114,9 @@ export const unitConfig = z
|
|
|
2104
2114
|
.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.'),
|
|
2105
2115
|
})
|
|
2106
2116
|
.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)');
|
|
2117
|
+
export const subscriptionEditTiming = z
|
|
2118
|
+
.union([subscriptionEditTimingEnum, dateTime])
|
|
2119
|
+
.describe('Subscription edit timing defined when the changes should take effect. If the provided configuration is not supported by the subscription, an error will be returned.');
|
|
2107
2120
|
export const taxCodeAppMapping = z
|
|
2108
2121
|
.object({
|
|
2109
2122
|
appType: appType,
|
|
@@ -2563,25 +2576,6 @@ export const updateOrganizationDefaultTaxCodesRequest = z
|
|
|
2563
2576
|
creditGrantTaxCode: taxCodeReference.optional(),
|
|
2564
2577
|
})
|
|
2565
2578
|
.describe('OrganizationDefaultTaxCodes update request.');
|
|
2566
|
-
export const subscription = z
|
|
2567
|
-
.object({
|
|
2568
|
-
id: ulid,
|
|
2569
|
-
labels: labels.optional(),
|
|
2570
|
-
createdAt: dateTime,
|
|
2571
|
-
updatedAt: dateTime,
|
|
2572
|
-
deletedAt: dateTime.optional(),
|
|
2573
|
-
customerId: ulid,
|
|
2574
|
-
planId: ulid.optional(),
|
|
2575
|
-
invoiceCurrency: currencyCode,
|
|
2576
|
-
costBasisMode: subscriptionCostBasisMode.default('dynamic'),
|
|
2577
|
-
costBasisPins: z
|
|
2578
|
-
.array(subscriptionCostBasisPin)
|
|
2579
|
-
.describe('Cost bases pinned to custom-currency pairs for this subscription.'),
|
|
2580
|
-
billingAnchor: dateTime,
|
|
2581
|
-
status: subscriptionStatus,
|
|
2582
|
-
settlementMode: settlementMode.optional(),
|
|
2583
|
-
})
|
|
2584
|
-
.describe('Subscription.');
|
|
2585
2579
|
export const planAddon = z
|
|
2586
2580
|
.object({
|
|
2587
2581
|
id: ulid,
|
|
@@ -3316,18 +3310,6 @@ export const workflowTaxSettings = z
|
|
|
3316
3310
|
defaultTaxConfig: taxConfig.optional(),
|
|
3317
3311
|
})
|
|
3318
3312
|
.describe('Tax settings for a billing workflow.');
|
|
3319
|
-
export const subscriptionPagePaginatedResponse = z
|
|
3320
|
-
.object({
|
|
3321
|
-
data: z.array(subscription),
|
|
3322
|
-
meta: paginatedMeta,
|
|
3323
|
-
})
|
|
3324
|
-
.describe('Page paginated response.');
|
|
3325
|
-
export const subscriptionChangeResponse = z
|
|
3326
|
-
.object({
|
|
3327
|
-
current: subscription,
|
|
3328
|
-
next: subscription,
|
|
3329
|
-
})
|
|
3330
|
-
.describe('Response for changing a subscription.');
|
|
3331
3313
|
export const planAddonPagePaginatedResponse = z
|
|
3332
3314
|
.object({
|
|
3333
3315
|
data: z.array(planAddon),
|
|
@@ -3978,6 +3960,14 @@ export const createChargeRequest = z
|
|
|
3978
3960
|
createChargeUsageBasedRequest,
|
|
3979
3961
|
])
|
|
3980
3962
|
.describe('Customer charge.');
|
|
3963
|
+
export const subscriptionItem = z
|
|
3964
|
+
.object({
|
|
3965
|
+
id: ulid,
|
|
3966
|
+
activeFrom: dateTime,
|
|
3967
|
+
activeTo: dateTime.optional(),
|
|
3968
|
+
rateCard: rateCard,
|
|
3969
|
+
})
|
|
3970
|
+
.describe('A subscription item pins a rate card to a cadence within a subscription phase.');
|
|
3981
3971
|
export const subscriptionAddonRateCard = z
|
|
3982
3972
|
.object({
|
|
3983
3973
|
rateCard: rateCard,
|
|
@@ -4198,6 +4188,31 @@ export const upsertBillingProfileRequest = z
|
|
|
4198
4188
|
export const charge = z
|
|
4199
4189
|
.discriminatedUnion('type', [chargeFlatFee, chargeUsageBased])
|
|
4200
4190
|
.describe('Customer charge.');
|
|
4191
|
+
export const subscriptionPhase = z
|
|
4192
|
+
.object({
|
|
4193
|
+
id: ulid,
|
|
4194
|
+
name: z
|
|
4195
|
+
.string()
|
|
4196
|
+
.min(1)
|
|
4197
|
+
.max(256)
|
|
4198
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
4199
|
+
description: z
|
|
4200
|
+
.string()
|
|
4201
|
+
.max(1024)
|
|
4202
|
+
.optional()
|
|
4203
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
4204
|
+
labels: labels.optional(),
|
|
4205
|
+
createdAt: dateTime,
|
|
4206
|
+
updatedAt: dateTime,
|
|
4207
|
+
deletedAt: dateTime.optional(),
|
|
4208
|
+
key: resourceKey,
|
|
4209
|
+
activeFrom: dateTime,
|
|
4210
|
+
activeTo: dateTime.optional(),
|
|
4211
|
+
items: z
|
|
4212
|
+
.array(subscriptionItem)
|
|
4213
|
+
.describe('The rate cards in effect for this phase, resolved to the version active at the queried time (the currently active version for the current phase, the first version for future phases, and the last version for past phases).'),
|
|
4214
|
+
})
|
|
4215
|
+
.describe("A subscription phase groups the rate cards in effect for a segment of the subscription's lifetime. Analogous to plan phases.");
|
|
4201
4216
|
export const subscriptionAddon = z
|
|
4202
4217
|
.object({
|
|
4203
4218
|
id: ulid,
|
|
@@ -4352,6 +4367,44 @@ export const chargePagePaginatedResponse = z
|
|
|
4352
4367
|
meta: paginatedMeta,
|
|
4353
4368
|
})
|
|
4354
4369
|
.describe('Page paginated response.');
|
|
4370
|
+
export const subscription = z
|
|
4371
|
+
.object({
|
|
4372
|
+
id: ulid,
|
|
4373
|
+
labels: labels.optional(),
|
|
4374
|
+
createdAt: dateTime,
|
|
4375
|
+
updatedAt: dateTime,
|
|
4376
|
+
deletedAt: dateTime.optional(),
|
|
4377
|
+
name: z
|
|
4378
|
+
.string()
|
|
4379
|
+
.min(1)
|
|
4380
|
+
.max(256)
|
|
4381
|
+
.describe('Display name of the subscription. Defaults to the plan name when the subscription is created from a plan.'),
|
|
4382
|
+
description: z
|
|
4383
|
+
.string()
|
|
4384
|
+
.max(1024)
|
|
4385
|
+
.optional()
|
|
4386
|
+
.describe('Optional description of the subscription.'),
|
|
4387
|
+
activeFrom: dateTime,
|
|
4388
|
+
activeTo: dateTime.optional(),
|
|
4389
|
+
customerId: ulid,
|
|
4390
|
+
planId: ulid.optional(),
|
|
4391
|
+
plan: subscriptionPlanReference.optional(),
|
|
4392
|
+
invoiceCurrency: currencyCode,
|
|
4393
|
+
costBasisMode: subscriptionCostBasisMode.default('dynamic'),
|
|
4394
|
+
costBasisPins: z
|
|
4395
|
+
.array(subscriptionCostBasisPin)
|
|
4396
|
+
.describe('Cost bases pinned to custom-currency pairs for this subscription.'),
|
|
4397
|
+
billingCadence: iso8601Duration,
|
|
4398
|
+
proRatingConfig: subscriptionProRatingConfig.optional(),
|
|
4399
|
+
billingAnchor: dateTime,
|
|
4400
|
+
status: subscriptionStatus,
|
|
4401
|
+
settlementMode: settlementMode.optional(),
|
|
4402
|
+
currentPeriod: closedPeriod.optional(),
|
|
4403
|
+
phases: z
|
|
4404
|
+
.array(subscriptionPhase)
|
|
4405
|
+
.describe("The phases of the subscription in chronological order. A phase groups the rate cards that are in effect for a segment of the subscription's lifetime."),
|
|
4406
|
+
})
|
|
4407
|
+
.describe('Subscription.');
|
|
4355
4408
|
export const subscriptionAddonPagePaginatedResponse = z
|
|
4356
4409
|
.object({
|
|
4357
4410
|
data: z.array(subscriptionAddon),
|
|
@@ -4425,6 +4478,18 @@ export const updateInvoiceStandardRequest = z
|
|
|
4425
4478
|
.describe('Line items on this invoice. Always returned on single-resource GET; omitted on list endpoints unless explicitly expanded. Editable via update: existing lines are matched by `id`, lines without an `id` are created, and lines present on the invoice but omitted from the update request are deleted. Detailed (child) lines are always computed and cannot be edited directly.'),
|
|
4426
4479
|
})
|
|
4427
4480
|
.describe('InvoiceStandard update request.');
|
|
4481
|
+
export const subscriptionPagePaginatedResponse = z
|
|
4482
|
+
.object({
|
|
4483
|
+
data: z.array(subscription),
|
|
4484
|
+
meta: paginatedMeta,
|
|
4485
|
+
})
|
|
4486
|
+
.describe('Page paginated response.');
|
|
4487
|
+
export const subscriptionChangeResponse = z
|
|
4488
|
+
.object({
|
|
4489
|
+
current: subscription,
|
|
4490
|
+
next: subscription,
|
|
4491
|
+
})
|
|
4492
|
+
.describe('Response for changing a subscription.');
|
|
4428
4493
|
export const invoice = z
|
|
4429
4494
|
.discriminatedUnion('type', [invoiceStandard])
|
|
4430
4495
|
.describe('An invoice issued to a customer. The `type` field determines the concrete variant: - `standard`: a standard invoice for charges owed.');
|
|
@@ -5629,9 +5694,6 @@ export const subscriptionCostBasisModeWire = z
|
|
|
5629
5694
|
export const subscriptionStatusWire = z
|
|
5630
5695
|
.enum(['active', 'inactive', 'canceled', 'scheduled'])
|
|
5631
5696
|
.describe('Subscription status.');
|
|
5632
|
-
export const subscriptionEditTimingEnumWire = z
|
|
5633
|
-
.enum(['immediate', 'next_billing_cycle'])
|
|
5634
|
-
.describe('Subscription edit timing. When immediate, the requested changes take effect immediately. When next_billing_cycle, the requested changes take effect at the next billing cycle.');
|
|
5635
5697
|
export const unitConfigOperationWire = z
|
|
5636
5698
|
.enum(['divide', 'multiply'])
|
|
5637
5699
|
.describe('The arithmetic operation used to convert raw metered units into billing units. - `divide`: Divide the metered quantity by the conversion factor (e.g., bytes ÷ 1e9 = GB). - `multiply`: Multiply the metered quantity by the conversion factor (e.g., cost × 1.2 = cost + 20% margin).');
|
|
@@ -5653,6 +5715,9 @@ export const rateCardBooleanEntitlementWire = z
|
|
|
5653
5715
|
.describe('The type of the entitlement template.'),
|
|
5654
5716
|
})
|
|
5655
5717
|
.describe('The entitlement template of a boolean entitlement.');
|
|
5718
|
+
export const subscriptionEditTimingEnumWire = z
|
|
5719
|
+
.enum(['immediate', 'next_billing_cycle'])
|
|
5720
|
+
.describe('Subscription edit timing. When immediate, the requested changes take effect immediately. When next_billing_cycle, the requested changes take effect at the next billing cycle.');
|
|
5656
5721
|
export const appTypeWire = z
|
|
5657
5722
|
.enum(['sandbox', 'stripe', 'external_invoicing'])
|
|
5658
5723
|
.describe('The type of the app.');
|
|
@@ -6477,16 +6542,16 @@ export const subscriptionCostBasisPinWire = z
|
|
|
6477
6542
|
cost_basis_id: ulidWire,
|
|
6478
6543
|
})
|
|
6479
6544
|
.describe('A cost basis pinned to a custom-currency pair for the subscription.');
|
|
6480
|
-
export const
|
|
6545
|
+
export const featureReferenceWire = z
|
|
6481
6546
|
.strictObject({
|
|
6482
6547
|
id: ulidWire,
|
|
6483
6548
|
})
|
|
6484
|
-
.describe('
|
|
6485
|
-
export const
|
|
6549
|
+
.describe('Feature reference.');
|
|
6550
|
+
export const addonReferenceWire = z
|
|
6486
6551
|
.strictObject({
|
|
6487
6552
|
id: ulidWire,
|
|
6488
6553
|
})
|
|
6489
|
-
.describe('
|
|
6554
|
+
.describe('Addon reference.');
|
|
6490
6555
|
export const appReferenceWire = z
|
|
6491
6556
|
.strictObject({
|
|
6492
6557
|
id: ulidWire,
|
|
@@ -6814,6 +6879,13 @@ export const creditGrantFiltersWire = z
|
|
|
6814
6879
|
.describe('Limit the credit grant to specific features. If no features are specified, the credit grant can be used for any feature.'),
|
|
6815
6880
|
})
|
|
6816
6881
|
.describe('Filters for the credit grant.');
|
|
6882
|
+
export const subscriptionPlanReferenceWire = z
|
|
6883
|
+
.strictObject({
|
|
6884
|
+
id: ulidWire,
|
|
6885
|
+
key: resourceKeyWire,
|
|
6886
|
+
version: z.number().int().gte(1).describe('The plan version.'),
|
|
6887
|
+
})
|
|
6888
|
+
.describe('A reference to the plan a subscription was created from, pinned to an exact revision.');
|
|
6817
6889
|
export const upsertPlanAddonRequestWire = z
|
|
6818
6890
|
.strictObject({
|
|
6819
6891
|
name: z
|
|
@@ -7188,6 +7260,12 @@ export const rateCardProrationConfigurationWire = z
|
|
|
7188
7260
|
mode: rateCardProrationModeWire,
|
|
7189
7261
|
})
|
|
7190
7262
|
.describe('The proration configuration of the rate card.');
|
|
7263
|
+
export const subscriptionProRatingConfigWire = z
|
|
7264
|
+
.strictObject({
|
|
7265
|
+
enabled: z.boolean().describe('Whether pro-rating is enabled.'),
|
|
7266
|
+
mode: rateCardProrationModeWire,
|
|
7267
|
+
})
|
|
7268
|
+
.describe('The pro-rating configuration of a subscription.');
|
|
7191
7269
|
export const subscriptionCreateWire = z
|
|
7192
7270
|
.strictObject({
|
|
7193
7271
|
labels: labelsWire.optional(),
|
|
@@ -7213,9 +7291,6 @@ export const subscriptionCreateWire = z
|
|
|
7213
7291
|
cost_basis_mode: subscriptionCostBasisModeWire.optional(),
|
|
7214
7292
|
})
|
|
7215
7293
|
.describe('Subscription create request.');
|
|
7216
|
-
export const subscriptionEditTimingWire = z
|
|
7217
|
-
.union([subscriptionEditTimingEnumWire, dateTimeWire])
|
|
7218
|
-
.describe('Subscription edit timing defined when the changes should take effect. If the provided configuration is not supported by the subscription, an error will be returned.');
|
|
7219
7294
|
export const unitConfigWire = z
|
|
7220
7295
|
.strictObject({
|
|
7221
7296
|
operation: unitConfigOperationWire,
|
|
@@ -7232,6 +7307,9 @@ export const unitConfigWire = z
|
|
|
7232
7307
|
.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.'),
|
|
7233
7308
|
})
|
|
7234
7309
|
.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)');
|
|
7310
|
+
export const subscriptionEditTimingWire = z
|
|
7311
|
+
.union([subscriptionEditTimingEnumWire, dateTimeWire])
|
|
7312
|
+
.describe('Subscription edit timing defined when the changes should take effect. If the provided configuration is not supported by the subscription, an error will be returned.');
|
|
7235
7313
|
export const taxCodeAppMappingWire = z
|
|
7236
7314
|
.strictObject({
|
|
7237
7315
|
app_type: appTypeWire,
|
|
@@ -7685,25 +7763,6 @@ export const updateOrganizationDefaultTaxCodesRequestWire = z
|
|
|
7685
7763
|
credit_grant_tax_code: taxCodeReferenceWire.optional(),
|
|
7686
7764
|
})
|
|
7687
7765
|
.describe('OrganizationDefaultTaxCodes update request.');
|
|
7688
|
-
export const subscriptionWire = z
|
|
7689
|
-
.strictObject({
|
|
7690
|
-
id: ulidWire,
|
|
7691
|
-
labels: labelsWire.optional(),
|
|
7692
|
-
created_at: dateTimeWire,
|
|
7693
|
-
updated_at: dateTimeWire,
|
|
7694
|
-
deleted_at: dateTimeWire.optional(),
|
|
7695
|
-
customer_id: ulidWire,
|
|
7696
|
-
plan_id: ulidWire.optional(),
|
|
7697
|
-
invoice_currency: currencyCodeWire,
|
|
7698
|
-
cost_basis_mode: subscriptionCostBasisModeWire,
|
|
7699
|
-
cost_basis_pins: z
|
|
7700
|
-
.array(subscriptionCostBasisPinWire)
|
|
7701
|
-
.describe('Cost bases pinned to custom-currency pairs for this subscription.'),
|
|
7702
|
-
billing_anchor: dateTimeWire,
|
|
7703
|
-
status: subscriptionStatusWire,
|
|
7704
|
-
settlement_mode: settlementModeWire.optional(),
|
|
7705
|
-
})
|
|
7706
|
-
.describe('Subscription.');
|
|
7707
7766
|
export const planAddonWire = z
|
|
7708
7767
|
.strictObject({
|
|
7709
7768
|
id: ulidWire,
|
|
@@ -8441,18 +8500,6 @@ export const workflowTaxSettingsWire = z
|
|
|
8441
8500
|
default_tax_config: taxConfigWire.optional(),
|
|
8442
8501
|
})
|
|
8443
8502
|
.describe('Tax settings for a billing workflow.');
|
|
8444
|
-
export const subscriptionPagePaginatedResponseWire = z
|
|
8445
|
-
.strictObject({
|
|
8446
|
-
data: z.array(subscriptionWire),
|
|
8447
|
-
meta: paginatedMetaWire,
|
|
8448
|
-
})
|
|
8449
|
-
.describe('Page paginated response.');
|
|
8450
|
-
export const subscriptionChangeResponseWire = z
|
|
8451
|
-
.strictObject({
|
|
8452
|
-
current: subscriptionWire,
|
|
8453
|
-
next: subscriptionWire,
|
|
8454
|
-
})
|
|
8455
|
-
.describe('Response for changing a subscription.');
|
|
8456
8503
|
export const planAddonPagePaginatedResponseWire = z
|
|
8457
8504
|
.strictObject({
|
|
8458
8505
|
data: z.array(planAddonWire),
|
|
@@ -9105,6 +9152,14 @@ export const createChargeRequestWire = z
|
|
|
9105
9152
|
createChargeUsageBasedRequestWire,
|
|
9106
9153
|
])
|
|
9107
9154
|
.describe('Customer charge.');
|
|
9155
|
+
export const subscriptionItemWire = z
|
|
9156
|
+
.strictObject({
|
|
9157
|
+
id: ulidWire,
|
|
9158
|
+
active_from: dateTimeWire,
|
|
9159
|
+
active_to: dateTimeWire.optional(),
|
|
9160
|
+
rate_card: rateCardWire,
|
|
9161
|
+
})
|
|
9162
|
+
.describe('A subscription item pins a rate card to a cadence within a subscription phase.');
|
|
9108
9163
|
export const subscriptionAddonRateCardWire = z
|
|
9109
9164
|
.strictObject({
|
|
9110
9165
|
rate_card: rateCardWire,
|
|
@@ -9324,6 +9379,31 @@ export const upsertBillingProfileRequestWire = z
|
|
|
9324
9379
|
export const chargeWire = z
|
|
9325
9380
|
.discriminatedUnion('type', [chargeFlatFeeWire, chargeUsageBasedWire])
|
|
9326
9381
|
.describe('Customer charge.');
|
|
9382
|
+
export const subscriptionPhaseWire = z
|
|
9383
|
+
.strictObject({
|
|
9384
|
+
id: ulidWire,
|
|
9385
|
+
name: z
|
|
9386
|
+
.string()
|
|
9387
|
+
.min(1)
|
|
9388
|
+
.max(256)
|
|
9389
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
9390
|
+
description: z
|
|
9391
|
+
.string()
|
|
9392
|
+
.max(1024)
|
|
9393
|
+
.optional()
|
|
9394
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
9395
|
+
labels: labelsWire.optional(),
|
|
9396
|
+
created_at: dateTimeWire,
|
|
9397
|
+
updated_at: dateTimeWire,
|
|
9398
|
+
deleted_at: dateTimeWire.optional(),
|
|
9399
|
+
key: resourceKeyWire,
|
|
9400
|
+
active_from: dateTimeWire,
|
|
9401
|
+
active_to: dateTimeWire.optional(),
|
|
9402
|
+
items: z
|
|
9403
|
+
.array(subscriptionItemWire)
|
|
9404
|
+
.describe('The rate cards in effect for this phase, resolved to the version active at the queried time (the currently active version for the current phase, the first version for future phases, and the last version for past phases).'),
|
|
9405
|
+
})
|
|
9406
|
+
.describe("A subscription phase groups the rate cards in effect for a segment of the subscription's lifetime. Analogous to plan phases.");
|
|
9327
9407
|
export const subscriptionAddonWire = z
|
|
9328
9408
|
.strictObject({
|
|
9329
9409
|
id: ulidWire,
|
|
@@ -9474,6 +9554,44 @@ export const chargePagePaginatedResponseWire = z
|
|
|
9474
9554
|
meta: paginatedMetaWire,
|
|
9475
9555
|
})
|
|
9476
9556
|
.describe('Page paginated response.');
|
|
9557
|
+
export const subscriptionWire = z
|
|
9558
|
+
.strictObject({
|
|
9559
|
+
id: ulidWire,
|
|
9560
|
+
labels: labelsWire.optional(),
|
|
9561
|
+
created_at: dateTimeWire,
|
|
9562
|
+
updated_at: dateTimeWire,
|
|
9563
|
+
deleted_at: dateTimeWire.optional(),
|
|
9564
|
+
name: z
|
|
9565
|
+
.string()
|
|
9566
|
+
.min(1)
|
|
9567
|
+
.max(256)
|
|
9568
|
+
.describe('Display name of the subscription. Defaults to the plan name when the subscription is created from a plan.'),
|
|
9569
|
+
description: z
|
|
9570
|
+
.string()
|
|
9571
|
+
.max(1024)
|
|
9572
|
+
.optional()
|
|
9573
|
+
.describe('Optional description of the subscription.'),
|
|
9574
|
+
active_from: dateTimeWire,
|
|
9575
|
+
active_to: dateTimeWire.optional(),
|
|
9576
|
+
customer_id: ulidWire,
|
|
9577
|
+
plan_id: ulidWire.optional(),
|
|
9578
|
+
plan: subscriptionPlanReferenceWire.optional(),
|
|
9579
|
+
invoice_currency: currencyCodeWire,
|
|
9580
|
+
cost_basis_mode: subscriptionCostBasisModeWire,
|
|
9581
|
+
cost_basis_pins: z
|
|
9582
|
+
.array(subscriptionCostBasisPinWire)
|
|
9583
|
+
.describe('Cost bases pinned to custom-currency pairs for this subscription.'),
|
|
9584
|
+
billing_cadence: iso8601DurationWire,
|
|
9585
|
+
pro_rating_config: subscriptionProRatingConfigWire.optional(),
|
|
9586
|
+
billing_anchor: dateTimeWire,
|
|
9587
|
+
status: subscriptionStatusWire,
|
|
9588
|
+
settlement_mode: settlementModeWire.optional(),
|
|
9589
|
+
current_period: closedPeriodWire.optional(),
|
|
9590
|
+
phases: z
|
|
9591
|
+
.array(subscriptionPhaseWire)
|
|
9592
|
+
.describe("The phases of the subscription in chronological order. A phase groups the rate cards that are in effect for a segment of the subscription's lifetime."),
|
|
9593
|
+
})
|
|
9594
|
+
.describe('Subscription.');
|
|
9477
9595
|
export const subscriptionAddonPagePaginatedResponseWire = z
|
|
9478
9596
|
.strictObject({
|
|
9479
9597
|
data: z.array(subscriptionAddonWire),
|
|
@@ -9547,6 +9665,18 @@ export const updateInvoiceStandardRequestWire = z
|
|
|
9547
9665
|
.describe('Line items on this invoice. Always returned on single-resource GET; omitted on list endpoints unless explicitly expanded. Editable via update: existing lines are matched by `id`, lines without an `id` are created, and lines present on the invoice but omitted from the update request are deleted. Detailed (child) lines are always computed and cannot be edited directly.'),
|
|
9548
9666
|
})
|
|
9549
9667
|
.describe('InvoiceStandard update request.');
|
|
9668
|
+
export const subscriptionPagePaginatedResponseWire = z
|
|
9669
|
+
.strictObject({
|
|
9670
|
+
data: z.array(subscriptionWire),
|
|
9671
|
+
meta: paginatedMetaWire,
|
|
9672
|
+
})
|
|
9673
|
+
.describe('Page paginated response.');
|
|
9674
|
+
export const subscriptionChangeResponseWire = z
|
|
9675
|
+
.strictObject({
|
|
9676
|
+
current: subscriptionWire,
|
|
9677
|
+
next: subscriptionWire,
|
|
9678
|
+
})
|
|
9679
|
+
.describe('Response for changing a subscription.');
|
|
9550
9680
|
export const invoiceWire = z
|
|
9551
9681
|
.discriminatedUnion('type', [invoiceStandardWire])
|
|
9552
9682
|
.describe('An invoice issued to a customer. The `type` field determines the concrete variant: - `standard`: a standard invoice for charges owed.');
|