@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/types.d.ts
CHANGED
|
@@ -831,14 +831,14 @@ export interface SubscriptionCostBasisPin {
|
|
|
831
831
|
/** The pinned cost basis resource ID. */
|
|
832
832
|
costBasisId: string;
|
|
833
833
|
}
|
|
834
|
-
/** Addon reference. */
|
|
835
|
-
export interface AddonReference {
|
|
836
|
-
id: string;
|
|
837
|
-
}
|
|
838
834
|
/** Feature reference. */
|
|
839
835
|
export interface FeatureReference {
|
|
840
836
|
id: string;
|
|
841
837
|
}
|
|
838
|
+
/** Addon reference. */
|
|
839
|
+
export interface AddonReference {
|
|
840
|
+
id: string;
|
|
841
|
+
}
|
|
842
842
|
/** App reference. */
|
|
843
843
|
export interface AppReference {
|
|
844
844
|
/** The ID of the app. */
|
|
@@ -1249,6 +1249,18 @@ export interface CreditGrantFilters {
|
|
|
1249
1249
|
*/
|
|
1250
1250
|
features?: string[];
|
|
1251
1251
|
}
|
|
1252
|
+
/**
|
|
1253
|
+
* A reference to the plan a subscription was created from, pinned to an exact
|
|
1254
|
+
* revision.
|
|
1255
|
+
*/
|
|
1256
|
+
export interface SubscriptionPlanReference {
|
|
1257
|
+
/** The plan ID (exact revision). */
|
|
1258
|
+
id: string;
|
|
1259
|
+
/** The plan key. References the plan across versions. */
|
|
1260
|
+
key: string;
|
|
1261
|
+
/** The plan version. */
|
|
1262
|
+
version: number;
|
|
1263
|
+
}
|
|
1252
1264
|
/** PlanAddon upsert request. */
|
|
1253
1265
|
export interface UpsertPlanAddonRequest {
|
|
1254
1266
|
/**
|
|
@@ -1759,6 +1771,13 @@ export interface RateCardProrationConfiguration {
|
|
|
1759
1771
|
/** The proration mode of the rate card. */
|
|
1760
1772
|
mode: 'no_proration' | 'prorate_prices';
|
|
1761
1773
|
}
|
|
1774
|
+
/** The pro-rating configuration of a subscription. */
|
|
1775
|
+
export interface SubscriptionProRatingConfig {
|
|
1776
|
+
/** Whether pro-rating is enabled. */
|
|
1777
|
+
enabled: boolean;
|
|
1778
|
+
/** How pro-rating is calculated when enabled. */
|
|
1779
|
+
mode: 'no_proration' | 'prorate_prices';
|
|
1780
|
+
}
|
|
1762
1781
|
/** Subscription create request. */
|
|
1763
1782
|
export interface SubscriptionCreate {
|
|
1764
1783
|
labels?: Labels;
|
|
@@ -2476,52 +2495,6 @@ export interface UpdateOrganizationDefaultTaxCodesRequest {
|
|
|
2476
2495
|
/** Default tax code for credit grants. */
|
|
2477
2496
|
creditGrantTaxCode?: TaxCodeReference;
|
|
2478
2497
|
}
|
|
2479
|
-
/** Subscription. */
|
|
2480
|
-
export interface Subscription {
|
|
2481
|
-
id: string;
|
|
2482
|
-
labels?: Labels;
|
|
2483
|
-
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2484
|
-
createdAt: Date;
|
|
2485
|
-
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2486
|
-
updatedAt: Date;
|
|
2487
|
-
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2488
|
-
deletedAt?: Date;
|
|
2489
|
-
/** The customer ID of the subscription. */
|
|
2490
|
-
customerId: string;
|
|
2491
|
-
/** The plan ID of the subscription. Set if subscription is created from a plan. */
|
|
2492
|
-
planId?: string;
|
|
2493
|
-
/** The fiat currency in which the subscription is invoiced. */
|
|
2494
|
-
invoiceCurrency: string;
|
|
2495
|
-
/**
|
|
2496
|
-
* Controls whether custom-currency cost bases are resolved dynamically or pinned
|
|
2497
|
-
* when their currency pair is introduced to the subscription.
|
|
2498
|
-
*/
|
|
2499
|
-
costBasisMode: 'dynamic' | 'pinned';
|
|
2500
|
-
/** Cost bases pinned to custom-currency pairs for this subscription. */
|
|
2501
|
-
costBasisPins: SubscriptionCostBasisPin[];
|
|
2502
|
-
/**
|
|
2503
|
-
* A billing anchor is the fixed point in time that determines the subscription's
|
|
2504
|
-
* recurring billing cycle. It affects when charges occur and how prorations are
|
|
2505
|
-
* calculated. Common anchors:
|
|
2506
|
-
*
|
|
2507
|
-
* - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
|
|
2508
|
-
* - Subscription anniversary (day customer signed up)
|
|
2509
|
-
* - Custom date (customer-specified day)
|
|
2510
|
-
*/
|
|
2511
|
-
billingAnchor: Date;
|
|
2512
|
-
/** The status of the subscription. */
|
|
2513
|
-
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
2514
|
-
/**
|
|
2515
|
-
* Settlement mode for billing.
|
|
2516
|
-
*
|
|
2517
|
-
* Values:
|
|
2518
|
-
*
|
|
2519
|
-
* - `credit_then_invoice`: Credits are applied first, then any remainder is
|
|
2520
|
-
* invoiced.
|
|
2521
|
-
* - `credit_only`: Usage is settled exclusively against credits.
|
|
2522
|
-
*/
|
|
2523
|
-
settlementMode?: 'credit_then_invoice' | 'credit_only';
|
|
2524
|
-
}
|
|
2525
2498
|
/**
|
|
2526
2499
|
* PlanAddon represents an association between a plan and an add-on, controlling
|
|
2527
2500
|
* which add-ons are available for purchase within a plan.
|
|
@@ -3487,18 +3460,6 @@ export interface WorkflowTaxSettings {
|
|
|
3487
3460
|
defaultTaxConfig?: TaxConfig;
|
|
3488
3461
|
}
|
|
3489
3462
|
/** Page paginated response. */
|
|
3490
|
-
export interface SubscriptionPagePaginatedResponse {
|
|
3491
|
-
data: Subscription[];
|
|
3492
|
-
meta: PaginatedMeta;
|
|
3493
|
-
}
|
|
3494
|
-
/** Response for changing a subscription. */
|
|
3495
|
-
export interface SubscriptionChangeResponse {
|
|
3496
|
-
/** The current subscription before the change. */
|
|
3497
|
-
current: Subscription;
|
|
3498
|
-
/** The new state of the subscription after the change. */
|
|
3499
|
-
next: Subscription;
|
|
3500
|
-
}
|
|
3501
|
-
/** Page paginated response. */
|
|
3502
3463
|
export interface PlanAddonPagePaginatedResponse {
|
|
3503
3464
|
data: PlanAddon[];
|
|
3504
3465
|
meta: PaginatedMeta;
|
|
@@ -4470,6 +4431,20 @@ export interface ChargeUsageBased {
|
|
|
4470
4431
|
*/
|
|
4471
4432
|
systemIntent?: ChargeUsageBasedSystemIntent;
|
|
4472
4433
|
}
|
|
4434
|
+
/** A subscription item pins a rate card to a cadence within a subscription phase. */
|
|
4435
|
+
export interface SubscriptionItem {
|
|
4436
|
+
/** The unique identifier of the subscription item instance. */
|
|
4437
|
+
id: string;
|
|
4438
|
+
/** An ISO-8601 timestamp representation of when this item version becomes active. */
|
|
4439
|
+
activeFrom: Date;
|
|
4440
|
+
/**
|
|
4441
|
+
* An ISO-8601 timestamp representation of when this item version stops being
|
|
4442
|
+
* active.
|
|
4443
|
+
*/
|
|
4444
|
+
activeTo?: Date;
|
|
4445
|
+
/** The rate card describing what the customer gets and pays for this item. */
|
|
4446
|
+
rateCard: RateCard;
|
|
4447
|
+
}
|
|
4473
4448
|
/** A rate card for a subscription add-on. */
|
|
4474
4449
|
export interface SubscriptionAddonRateCard {
|
|
4475
4450
|
/** The rate card. */
|
|
@@ -4821,6 +4796,46 @@ export interface UpsertBillingProfileRequest {
|
|
|
4821
4796
|
/** Whether this is the default profile. */
|
|
4822
4797
|
default: boolean;
|
|
4823
4798
|
}
|
|
4799
|
+
/**
|
|
4800
|
+
* A subscription phase groups the rate cards in effect for a segment of the
|
|
4801
|
+
* subscription's lifetime. Analogous to plan phases.
|
|
4802
|
+
*/
|
|
4803
|
+
export interface SubscriptionPhase {
|
|
4804
|
+
id: string;
|
|
4805
|
+
/**
|
|
4806
|
+
* Display name of the resource.
|
|
4807
|
+
*
|
|
4808
|
+
* Between 1 and 256 characters.
|
|
4809
|
+
*/
|
|
4810
|
+
name: string;
|
|
4811
|
+
/**
|
|
4812
|
+
* Optional description of the resource.
|
|
4813
|
+
*
|
|
4814
|
+
* Maximum 1024 characters.
|
|
4815
|
+
*/
|
|
4816
|
+
description?: string;
|
|
4817
|
+
labels?: Labels;
|
|
4818
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
4819
|
+
createdAt: Date;
|
|
4820
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
4821
|
+
updatedAt: Date;
|
|
4822
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
4823
|
+
deletedAt?: Date;
|
|
4824
|
+
key: string;
|
|
4825
|
+
/** An ISO-8601 timestamp representation of when the phase becomes active. */
|
|
4826
|
+
activeFrom: Date;
|
|
4827
|
+
/**
|
|
4828
|
+
* An ISO-8601 timestamp representation of when the phase stops being active.
|
|
4829
|
+
* Open-ended for the last phase.
|
|
4830
|
+
*/
|
|
4831
|
+
activeTo?: Date;
|
|
4832
|
+
/**
|
|
4833
|
+
* The rate cards in effect for this phase, resolved to the version active at the
|
|
4834
|
+
* queried time (the currently active version for the current phase, the first
|
|
4835
|
+
* version for future phases, and the last version for past phases).
|
|
4836
|
+
*/
|
|
4837
|
+
items: SubscriptionItem[];
|
|
4838
|
+
}
|
|
4824
4839
|
/** Addon purchased with a subscription. */
|
|
4825
4840
|
export interface SubscriptionAddon {
|
|
4826
4841
|
id: string;
|
|
@@ -5012,6 +5027,92 @@ export interface ChargePagePaginatedResponse {
|
|
|
5012
5027
|
data: Charge[];
|
|
5013
5028
|
meta: PaginatedMeta;
|
|
5014
5029
|
}
|
|
5030
|
+
/** Subscription. */
|
|
5031
|
+
export interface Subscription {
|
|
5032
|
+
id: string;
|
|
5033
|
+
labels?: Labels;
|
|
5034
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
5035
|
+
createdAt: Date;
|
|
5036
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
5037
|
+
updatedAt: Date;
|
|
5038
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
5039
|
+
deletedAt?: Date;
|
|
5040
|
+
/**
|
|
5041
|
+
* Display name of the subscription. Defaults to the plan name when the
|
|
5042
|
+
* subscription is created from a plan.
|
|
5043
|
+
*/
|
|
5044
|
+
name: string;
|
|
5045
|
+
/** Optional description of the subscription. */
|
|
5046
|
+
description?: string;
|
|
5047
|
+
/**
|
|
5048
|
+
* An ISO-8601 timestamp representation of when the subscription became (or will
|
|
5049
|
+
* become) active.
|
|
5050
|
+
*/
|
|
5051
|
+
activeFrom: Date;
|
|
5052
|
+
/**
|
|
5053
|
+
* An ISO-8601 timestamp representation of when the subscription stops being
|
|
5054
|
+
* active. Open-ended when not set.
|
|
5055
|
+
*/
|
|
5056
|
+
activeTo?: Date;
|
|
5057
|
+
/** The customer ID of the subscription. */
|
|
5058
|
+
customerId: string;
|
|
5059
|
+
/** The plan ID of the subscription. Set if subscription is created from a plan. */
|
|
5060
|
+
planId?: string;
|
|
5061
|
+
/**
|
|
5062
|
+
* The plan the subscription was created from, if any. Includes the plan key and
|
|
5063
|
+
* version so clients can resolve the exact plan revision.
|
|
5064
|
+
*/
|
|
5065
|
+
plan?: SubscriptionPlanReference;
|
|
5066
|
+
/** The fiat currency in which the subscription is invoiced. */
|
|
5067
|
+
invoiceCurrency: string;
|
|
5068
|
+
/**
|
|
5069
|
+
* Controls whether custom-currency cost bases are resolved dynamically or pinned
|
|
5070
|
+
* when their currency pair is introduced to the subscription.
|
|
5071
|
+
*/
|
|
5072
|
+
costBasisMode: 'dynamic' | 'pinned';
|
|
5073
|
+
/** Cost bases pinned to custom-currency pairs for this subscription. */
|
|
5074
|
+
costBasisPins: SubscriptionCostBasisPin[];
|
|
5075
|
+
/**
|
|
5076
|
+
* The billing cadence of the subscription in ISO-8601 duration format. Defines how
|
|
5077
|
+
* often the customer is billed. Examples: `P1M` (monthly), `P3M` (quarterly),
|
|
5078
|
+
* `P1Y` (annually).
|
|
5079
|
+
*/
|
|
5080
|
+
billingCadence: string;
|
|
5081
|
+
/** The pro-rating configuration of the subscription. */
|
|
5082
|
+
proRatingConfig?: SubscriptionProRatingConfig;
|
|
5083
|
+
/**
|
|
5084
|
+
* A billing anchor is the fixed point in time that determines the subscription's
|
|
5085
|
+
* recurring billing cycle. It affects when charges occur and how prorations are
|
|
5086
|
+
* calculated. Common anchors:
|
|
5087
|
+
*
|
|
5088
|
+
* - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
|
|
5089
|
+
* - Subscription anniversary (day customer signed up)
|
|
5090
|
+
* - Custom date (customer-specified day)
|
|
5091
|
+
*/
|
|
5092
|
+
billingAnchor: Date;
|
|
5093
|
+
/** The status of the subscription. */
|
|
5094
|
+
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
5095
|
+
/**
|
|
5096
|
+
* Settlement mode for billing.
|
|
5097
|
+
*
|
|
5098
|
+
* Values:
|
|
5099
|
+
*
|
|
5100
|
+
* - `credit_then_invoice`: Credits are applied first, then any remainder is
|
|
5101
|
+
* invoiced.
|
|
5102
|
+
* - `credit_only`: Usage is settled exclusively against credits.
|
|
5103
|
+
*/
|
|
5104
|
+
settlementMode?: 'credit_then_invoice' | 'credit_only';
|
|
5105
|
+
/**
|
|
5106
|
+
* The current aligned billing period. Present only when the subscription is active
|
|
5107
|
+
* and aligned.
|
|
5108
|
+
*/
|
|
5109
|
+
currentPeriod?: ClosedPeriod;
|
|
5110
|
+
/**
|
|
5111
|
+
* The phases of the subscription in chronological order. A phase groups the rate
|
|
5112
|
+
* cards that are in effect for a segment of the subscription's lifetime.
|
|
5113
|
+
*/
|
|
5114
|
+
phases: SubscriptionPhase[];
|
|
5115
|
+
}
|
|
5015
5116
|
/** Page paginated response. */
|
|
5016
5117
|
export interface SubscriptionAddonPagePaginatedResponse {
|
|
5017
5118
|
data: SubscriptionAddon[];
|
|
@@ -5135,6 +5236,18 @@ export interface UpdateInvoiceStandardRequest {
|
|
|
5135
5236
|
lines?: UpdateInvoiceLine[];
|
|
5136
5237
|
}
|
|
5137
5238
|
/** Page paginated response. */
|
|
5239
|
+
export interface SubscriptionPagePaginatedResponse {
|
|
5240
|
+
data: Subscription[];
|
|
5241
|
+
meta: PaginatedMeta;
|
|
5242
|
+
}
|
|
5243
|
+
/** Response for changing a subscription. */
|
|
5244
|
+
export interface SubscriptionChangeResponse {
|
|
5245
|
+
/** The current subscription before the change. */
|
|
5246
|
+
current: Subscription;
|
|
5247
|
+
/** The new state of the subscription after the change. */
|
|
5248
|
+
next: Subscription;
|
|
5249
|
+
}
|
|
5250
|
+
/** Page paginated response. */
|
|
5138
5251
|
export interface InvoicePagePaginatedResponse {
|
|
5139
5252
|
data: Invoice[];
|
|
5140
5253
|
meta: PaginatedMeta;
|
|
@@ -5656,52 +5769,6 @@ export interface EntitlementAccessQueryRequestInput {
|
|
|
5656
5769
|
customer: EntitlementAccessQueryRequestCustomers;
|
|
5657
5770
|
feature?: EntitlementAccessQueryRequestFeatures;
|
|
5658
5771
|
}
|
|
5659
|
-
/** Subscription. */
|
|
5660
|
-
export interface SubscriptionInput {
|
|
5661
|
-
id: string;
|
|
5662
|
-
labels?: Labels;
|
|
5663
|
-
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
5664
|
-
createdAt: Date;
|
|
5665
|
-
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
5666
|
-
updatedAt: Date;
|
|
5667
|
-
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
5668
|
-
deletedAt?: Date;
|
|
5669
|
-
/** The customer ID of the subscription. */
|
|
5670
|
-
customerId: string;
|
|
5671
|
-
/** The plan ID of the subscription. Set if subscription is created from a plan. */
|
|
5672
|
-
planId?: string;
|
|
5673
|
-
/** The fiat currency in which the subscription is invoiced. */
|
|
5674
|
-
invoiceCurrency: string;
|
|
5675
|
-
/**
|
|
5676
|
-
* Controls whether custom-currency cost bases are resolved dynamically or pinned
|
|
5677
|
-
* when their currency pair is introduced to the subscription.
|
|
5678
|
-
*/
|
|
5679
|
-
costBasisMode?: 'dynamic' | 'pinned';
|
|
5680
|
-
/** Cost bases pinned to custom-currency pairs for this subscription. */
|
|
5681
|
-
costBasisPins: SubscriptionCostBasisPin[];
|
|
5682
|
-
/**
|
|
5683
|
-
* A billing anchor is the fixed point in time that determines the subscription's
|
|
5684
|
-
* recurring billing cycle. It affects when charges occur and how prorations are
|
|
5685
|
-
* calculated. Common anchors:
|
|
5686
|
-
*
|
|
5687
|
-
* - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
|
|
5688
|
-
* - Subscription anniversary (day customer signed up)
|
|
5689
|
-
* - Custom date (customer-specified day)
|
|
5690
|
-
*/
|
|
5691
|
-
billingAnchor: Date;
|
|
5692
|
-
/** The status of the subscription. */
|
|
5693
|
-
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
5694
|
-
/**
|
|
5695
|
-
* Settlement mode for billing.
|
|
5696
|
-
*
|
|
5697
|
-
* Values:
|
|
5698
|
-
*
|
|
5699
|
-
* - `credit_then_invoice`: Credits are applied first, then any remainder is
|
|
5700
|
-
* invoiced.
|
|
5701
|
-
* - `credit_only`: Usage is settled exclusively against credits.
|
|
5702
|
-
*/
|
|
5703
|
-
settlementMode?: 'credit_then_invoice' | 'credit_only';
|
|
5704
|
-
}
|
|
5705
5772
|
/** An ingested metering event with ingestion metadata. */
|
|
5706
5773
|
export interface IngestedEventInput {
|
|
5707
5774
|
/** The original event ingested. */
|
|
@@ -5946,18 +6013,6 @@ export interface WorkflowTaxSettingsInput {
|
|
|
5946
6013
|
*/
|
|
5947
6014
|
defaultTaxConfig?: TaxConfig;
|
|
5948
6015
|
}
|
|
5949
|
-
/** Page paginated response. */
|
|
5950
|
-
export interface SubscriptionPagePaginatedResponseInput {
|
|
5951
|
-
data: SubscriptionInput[];
|
|
5952
|
-
meta: PaginatedMeta;
|
|
5953
|
-
}
|
|
5954
|
-
/** Response for changing a subscription. */
|
|
5955
|
-
export interface SubscriptionChangeResponseInput {
|
|
5956
|
-
/** The current subscription before the change. */
|
|
5957
|
-
current: SubscriptionInput;
|
|
5958
|
-
/** The new state of the subscription after the change. */
|
|
5959
|
-
next: SubscriptionInput;
|
|
5960
|
-
}
|
|
5961
6016
|
/** Cursor paginated response. */
|
|
5962
6017
|
export interface IngestedEventPaginatedResponseInput {
|
|
5963
6018
|
data: IngestedEventInput[];
|
|
@@ -6280,6 +6335,20 @@ export interface WorkflowInput {
|
|
|
6280
6335
|
/** The tax settings for this workflow */
|
|
6281
6336
|
tax?: WorkflowTaxSettingsInput;
|
|
6282
6337
|
}
|
|
6338
|
+
/** A subscription item pins a rate card to a cadence within a subscription phase. */
|
|
6339
|
+
export interface SubscriptionItemInput {
|
|
6340
|
+
/** The unique identifier of the subscription item instance. */
|
|
6341
|
+
id: string;
|
|
6342
|
+
/** An ISO-8601 timestamp representation of when this item version becomes active. */
|
|
6343
|
+
activeFrom: Date;
|
|
6344
|
+
/**
|
|
6345
|
+
* An ISO-8601 timestamp representation of when this item version stops being
|
|
6346
|
+
* active.
|
|
6347
|
+
*/
|
|
6348
|
+
activeTo?: Date;
|
|
6349
|
+
/** The rate card describing what the customer gets and pays for this item. */
|
|
6350
|
+
rateCard: RateCardInput;
|
|
6351
|
+
}
|
|
6283
6352
|
/** A rate card for a subscription add-on. */
|
|
6284
6353
|
export interface SubscriptionAddonRateCardInput {
|
|
6285
6354
|
/** The rate card. */
|
|
@@ -6589,6 +6658,46 @@ export interface UpsertBillingProfileRequestInput {
|
|
|
6589
6658
|
/** Whether this is the default profile. */
|
|
6590
6659
|
default: boolean;
|
|
6591
6660
|
}
|
|
6661
|
+
/**
|
|
6662
|
+
* A subscription phase groups the rate cards in effect for a segment of the
|
|
6663
|
+
* subscription's lifetime. Analogous to plan phases.
|
|
6664
|
+
*/
|
|
6665
|
+
export interface SubscriptionPhaseInput {
|
|
6666
|
+
id: string;
|
|
6667
|
+
/**
|
|
6668
|
+
* Display name of the resource.
|
|
6669
|
+
*
|
|
6670
|
+
* Between 1 and 256 characters.
|
|
6671
|
+
*/
|
|
6672
|
+
name: string;
|
|
6673
|
+
/**
|
|
6674
|
+
* Optional description of the resource.
|
|
6675
|
+
*
|
|
6676
|
+
* Maximum 1024 characters.
|
|
6677
|
+
*/
|
|
6678
|
+
description?: string;
|
|
6679
|
+
labels?: Labels;
|
|
6680
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
6681
|
+
createdAt: Date;
|
|
6682
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
6683
|
+
updatedAt: Date;
|
|
6684
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
6685
|
+
deletedAt?: Date;
|
|
6686
|
+
key: string;
|
|
6687
|
+
/** An ISO-8601 timestamp representation of when the phase becomes active. */
|
|
6688
|
+
activeFrom: Date;
|
|
6689
|
+
/**
|
|
6690
|
+
* An ISO-8601 timestamp representation of when the phase stops being active.
|
|
6691
|
+
* Open-ended for the last phase.
|
|
6692
|
+
*/
|
|
6693
|
+
activeTo?: Date;
|
|
6694
|
+
/**
|
|
6695
|
+
* The rate cards in effect for this phase, resolved to the version active at the
|
|
6696
|
+
* queried time (the currently active version for the current phase, the first
|
|
6697
|
+
* version for future phases, and the last version for past phases).
|
|
6698
|
+
*/
|
|
6699
|
+
items: SubscriptionItemInput[];
|
|
6700
|
+
}
|
|
6592
6701
|
/** Addon purchased with a subscription. */
|
|
6593
6702
|
export interface SubscriptionAddonInput {
|
|
6594
6703
|
id: string;
|
|
@@ -6775,6 +6884,92 @@ export interface ProfilePagePaginatedResponseInput {
|
|
|
6775
6884
|
data: ProfileInput[];
|
|
6776
6885
|
meta: PaginatedMeta;
|
|
6777
6886
|
}
|
|
6887
|
+
/** Subscription. */
|
|
6888
|
+
export interface SubscriptionInput {
|
|
6889
|
+
id: string;
|
|
6890
|
+
labels?: Labels;
|
|
6891
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
6892
|
+
createdAt: Date;
|
|
6893
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
6894
|
+
updatedAt: Date;
|
|
6895
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
6896
|
+
deletedAt?: Date;
|
|
6897
|
+
/**
|
|
6898
|
+
* Display name of the subscription. Defaults to the plan name when the
|
|
6899
|
+
* subscription is created from a plan.
|
|
6900
|
+
*/
|
|
6901
|
+
name: string;
|
|
6902
|
+
/** Optional description of the subscription. */
|
|
6903
|
+
description?: string;
|
|
6904
|
+
/**
|
|
6905
|
+
* An ISO-8601 timestamp representation of when the subscription became (or will
|
|
6906
|
+
* become) active.
|
|
6907
|
+
*/
|
|
6908
|
+
activeFrom: Date;
|
|
6909
|
+
/**
|
|
6910
|
+
* An ISO-8601 timestamp representation of when the subscription stops being
|
|
6911
|
+
* active. Open-ended when not set.
|
|
6912
|
+
*/
|
|
6913
|
+
activeTo?: Date;
|
|
6914
|
+
/** The customer ID of the subscription. */
|
|
6915
|
+
customerId: string;
|
|
6916
|
+
/** The plan ID of the subscription. Set if subscription is created from a plan. */
|
|
6917
|
+
planId?: string;
|
|
6918
|
+
/**
|
|
6919
|
+
* The plan the subscription was created from, if any. Includes the plan key and
|
|
6920
|
+
* version so clients can resolve the exact plan revision.
|
|
6921
|
+
*/
|
|
6922
|
+
plan?: SubscriptionPlanReference;
|
|
6923
|
+
/** The fiat currency in which the subscription is invoiced. */
|
|
6924
|
+
invoiceCurrency: string;
|
|
6925
|
+
/**
|
|
6926
|
+
* Controls whether custom-currency cost bases are resolved dynamically or pinned
|
|
6927
|
+
* when their currency pair is introduced to the subscription.
|
|
6928
|
+
*/
|
|
6929
|
+
costBasisMode?: 'dynamic' | 'pinned';
|
|
6930
|
+
/** Cost bases pinned to custom-currency pairs for this subscription. */
|
|
6931
|
+
costBasisPins: SubscriptionCostBasisPin[];
|
|
6932
|
+
/**
|
|
6933
|
+
* The billing cadence of the subscription in ISO-8601 duration format. Defines how
|
|
6934
|
+
* often the customer is billed. Examples: `P1M` (monthly), `P3M` (quarterly),
|
|
6935
|
+
* `P1Y` (annually).
|
|
6936
|
+
*/
|
|
6937
|
+
billingCadence: string;
|
|
6938
|
+
/** The pro-rating configuration of the subscription. */
|
|
6939
|
+
proRatingConfig?: SubscriptionProRatingConfig;
|
|
6940
|
+
/**
|
|
6941
|
+
* A billing anchor is the fixed point in time that determines the subscription's
|
|
6942
|
+
* recurring billing cycle. It affects when charges occur and how prorations are
|
|
6943
|
+
* calculated. Common anchors:
|
|
6944
|
+
*
|
|
6945
|
+
* - Calendar month (1st of each month): `2025-01-01T00:00:00Z`
|
|
6946
|
+
* - Subscription anniversary (day customer signed up)
|
|
6947
|
+
* - Custom date (customer-specified day)
|
|
6948
|
+
*/
|
|
6949
|
+
billingAnchor: Date;
|
|
6950
|
+
/** The status of the subscription. */
|
|
6951
|
+
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
6952
|
+
/**
|
|
6953
|
+
* Settlement mode for billing.
|
|
6954
|
+
*
|
|
6955
|
+
* Values:
|
|
6956
|
+
*
|
|
6957
|
+
* - `credit_then_invoice`: Credits are applied first, then any remainder is
|
|
6958
|
+
* invoiced.
|
|
6959
|
+
* - `credit_only`: Usage is settled exclusively against credits.
|
|
6960
|
+
*/
|
|
6961
|
+
settlementMode?: 'credit_then_invoice' | 'credit_only';
|
|
6962
|
+
/**
|
|
6963
|
+
* The current aligned billing period. Present only when the subscription is active
|
|
6964
|
+
* and aligned.
|
|
6965
|
+
*/
|
|
6966
|
+
currentPeriod?: ClosedPeriod;
|
|
6967
|
+
/**
|
|
6968
|
+
* The phases of the subscription in chronological order. A phase groups the rate
|
|
6969
|
+
* cards that are in effect for a segment of the subscription's lifetime.
|
|
6970
|
+
*/
|
|
6971
|
+
phases: SubscriptionPhaseInput[];
|
|
6972
|
+
}
|
|
6778
6973
|
/** Page paginated response. */
|
|
6779
6974
|
export interface SubscriptionAddonPagePaginatedResponseInput {
|
|
6780
6975
|
data: SubscriptionAddonInput[];
|
|
@@ -6898,6 +7093,18 @@ export interface UpdateInvoiceStandardRequestInput {
|
|
|
6898
7093
|
lines?: UpdateInvoiceLine[];
|
|
6899
7094
|
}
|
|
6900
7095
|
/** Page paginated response. */
|
|
7096
|
+
export interface SubscriptionPagePaginatedResponseInput {
|
|
7097
|
+
data: SubscriptionInput[];
|
|
7098
|
+
meta: PaginatedMeta;
|
|
7099
|
+
}
|
|
7100
|
+
/** Response for changing a subscription. */
|
|
7101
|
+
export interface SubscriptionChangeResponseInput {
|
|
7102
|
+
/** The current subscription before the change. */
|
|
7103
|
+
current: SubscriptionInput;
|
|
7104
|
+
/** The new state of the subscription after the change. */
|
|
7105
|
+
next: SubscriptionInput;
|
|
7106
|
+
}
|
|
7107
|
+
/** Page paginated response. */
|
|
6901
7108
|
export interface InvoicePagePaginatedResponseInput {
|
|
6902
7109
|
data: InvoiceInput[];
|
|
6903
7110
|
meta: PaginatedMeta;
|