@openmeter/client 1.0.0-beta.233 → 1.0.0-beta.234
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/README.md +52 -14
- package/dist/funcs/customers.d.ts +112 -1
- package/dist/funcs/customers.js +430 -0
- package/dist/funcs/entitlements.d.ts +38 -1
- package/dist/funcs/entitlements.js +169 -6
- package/dist/funcs/grants.d.ts +24 -0
- package/dist/funcs/grants.js +78 -0
- package/dist/funcs/index.d.ts +2 -0
- package/dist/funcs/index.js +2 -0
- package/dist/funcs/notifications.d.ts +43 -0
- package/dist/funcs/notifications.js +163 -0
- package/dist/index.d.ts +3 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/operations/customers.d.ts +109 -1
- package/dist/models/operations/entitlements.d.ts +59 -4
- package/dist/models/operations/grants.d.ts +43 -0
- package/dist/models/operations/grants.js +2 -0
- package/dist/models/operations/notifications.d.ts +46 -0
- package/dist/models/operations/notifications.js +2 -0
- package/dist/models/schemas.d.ts +6549 -2716
- package/dist/models/schemas.js +1795 -360
- package/dist/models/types.d.ts +1175 -228
- package/dist/sdk/apps.d.ts +20 -1
- package/dist/sdk/apps.js +24 -1
- package/dist/sdk/entitlements.d.ts +1 -9
- package/dist/sdk/entitlements.js +1 -11
- package/dist/sdk/internal.d.ts +324 -22
- package/dist/sdk/internal.js +397 -25
- package/dist/sdk/notifications.d.ts +58 -0
- package/dist/sdk/notifications.js +72 -0
- package/dist/sdk/subscriptions.d.ts +1 -9
- package/dist/sdk/subscriptions.js +1 -11
- package/package.json +1 -1
package/dist/models/types.d.ts
CHANGED
|
@@ -147,6 +147,28 @@ export interface AppStripeCreateCustomerPortalSessionOptions {
|
|
|
147
147
|
* "mesh", "kic", or "\_".
|
|
148
148
|
*/
|
|
149
149
|
export type CreateLabels = Record<string, string>;
|
|
150
|
+
/** An integer version comparison. Exactly one operator must be provided. */
|
|
151
|
+
export interface CreateVersionFilter {
|
|
152
|
+
/** Match this exact version. */
|
|
153
|
+
eq?: number;
|
|
154
|
+
/** Match one of these versions. */
|
|
155
|
+
in?: number[];
|
|
156
|
+
/** Match this version and later versions. */
|
|
157
|
+
gte?: number;
|
|
158
|
+
/** Match this version and earlier versions. */
|
|
159
|
+
lte?: number;
|
|
160
|
+
}
|
|
161
|
+
/** An integer version comparison. Exactly one operator must be provided. */
|
|
162
|
+
export interface VersionFilter {
|
|
163
|
+
/** Match this exact version. */
|
|
164
|
+
eq?: number;
|
|
165
|
+
/** Match one of these versions. */
|
|
166
|
+
in?: number[];
|
|
167
|
+
/** Match this version and later versions. */
|
|
168
|
+
gte?: number;
|
|
169
|
+
/** Match this version and earlier versions. */
|
|
170
|
+
lte?: number;
|
|
171
|
+
}
|
|
150
172
|
/** Free price. */
|
|
151
173
|
export interface PriceFree {
|
|
152
174
|
/** The type of the price. */
|
|
@@ -606,19 +628,58 @@ export interface CreateCurrencyCustomRequest {
|
|
|
606
628
|
thousandSeparator: string;
|
|
607
629
|
code: string;
|
|
608
630
|
}
|
|
609
|
-
/**
|
|
631
|
+
/**
|
|
632
|
+
* Balance details of a metered entitlement at the evaluation time, which is the
|
|
633
|
+
* `at` query parameter when given and the current time otherwise.
|
|
634
|
+
*/
|
|
610
635
|
export interface EntitlementAccessValue {
|
|
611
|
-
/**
|
|
636
|
+
/**
|
|
637
|
+
* The remaining balance of the entitlement in the usage period at the evaluation
|
|
638
|
+
* time.
|
|
639
|
+
*/
|
|
612
640
|
balance: string;
|
|
613
|
-
/** The usage recorded in the
|
|
641
|
+
/** The usage recorded in the usage period at the evaluation time. */
|
|
614
642
|
usage: string;
|
|
615
|
-
/**
|
|
643
|
+
/**
|
|
644
|
+
* The usage exceeding the available balance in the usage period at the evaluation
|
|
645
|
+
* time.
|
|
646
|
+
*/
|
|
616
647
|
overage: string;
|
|
617
|
-
/**
|
|
648
|
+
/**
|
|
649
|
+
* The total amount granted and available to the entitlement at the evaluation
|
|
650
|
+
* time.
|
|
651
|
+
*/
|
|
618
652
|
totalAvailableGrantAmount: string;
|
|
619
653
|
/** The remaining balance of each grant, keyed by grant ID. */
|
|
620
654
|
grantBalances: Record<string, string>;
|
|
621
655
|
}
|
|
656
|
+
/**
|
|
657
|
+
* Usage granted automatically after each reset of a metered entitlement. The
|
|
658
|
+
* balance returns to `amount` after every reset.
|
|
659
|
+
*/
|
|
660
|
+
export interface EntitlementIssueAfterReset {
|
|
661
|
+
/** The amount granted after each reset, in the feature's unit. */
|
|
662
|
+
amount: string;
|
|
663
|
+
/**
|
|
664
|
+
* The priority of the grant created after each reset. Lower values have higher
|
|
665
|
+
* priority.
|
|
666
|
+
*/
|
|
667
|
+
priority: number;
|
|
668
|
+
}
|
|
669
|
+
/** Entitlement balance at the boundaries of a burndown segment. */
|
|
670
|
+
export interface EntitlementBurndownBalance {
|
|
671
|
+
/** The balance at the start of the segment. */
|
|
672
|
+
start: string;
|
|
673
|
+
/** The balance at the end of the segment. */
|
|
674
|
+
end: string;
|
|
675
|
+
}
|
|
676
|
+
/** Grant balances at the boundaries of a burndown segment, keyed by grant ID. */
|
|
677
|
+
export interface EntitlementBurndownGrantBalances {
|
|
678
|
+
/** The balance of each active grant at the start of the segment. */
|
|
679
|
+
start: Record<string, string>;
|
|
680
|
+
/** The balance of each active grant at the end of the segment. */
|
|
681
|
+
end: Record<string, string>;
|
|
682
|
+
}
|
|
622
683
|
/** Cost basis with an explicit conversion rate supplied with the charge. */
|
|
623
684
|
export interface CreateChargeCostBasisManual {
|
|
624
685
|
/** Discriminator selecting the cost basis mode. */
|
|
@@ -873,6 +934,17 @@ export interface ProfileReference {
|
|
|
873
934
|
/** The ID of the billing profile. */
|
|
874
935
|
id: string;
|
|
875
936
|
}
|
|
937
|
+
/** Feature reference. */
|
|
938
|
+
export interface FeatureReference {
|
|
939
|
+
id: string;
|
|
940
|
+
}
|
|
941
|
+
/** Usage taken from a single grant. */
|
|
942
|
+
export interface EntitlementGrantUsage {
|
|
943
|
+
/** The ID of the grant. */
|
|
944
|
+
grantId: string;
|
|
945
|
+
/** The usage taken from the grant. */
|
|
946
|
+
usage: string;
|
|
947
|
+
}
|
|
876
948
|
/** Cost basis pinned to a specific cost basis resource of the custom currency. */
|
|
877
949
|
export interface CreateChargeCostBasisPinned {
|
|
878
950
|
/** Discriminator selecting the cost basis mode. */
|
|
@@ -908,6 +980,10 @@ export interface CreditGrantInvoiceReference {
|
|
|
908
980
|
id: string;
|
|
909
981
|
};
|
|
910
982
|
}
|
|
983
|
+
/** CurrencyCustom reference. */
|
|
984
|
+
export interface CurrencyCustomReference {
|
|
985
|
+
id: string;
|
|
986
|
+
}
|
|
911
987
|
/** A cost basis pinned to a custom-currency pair for the subscription. */
|
|
912
988
|
export interface SubscriptionCostBasisPin {
|
|
913
989
|
/** The managed custom currency ID. */
|
|
@@ -917,10 +993,6 @@ export interface SubscriptionCostBasisPin {
|
|
|
917
993
|
/** The pinned cost basis resource ID. */
|
|
918
994
|
costBasisId: string;
|
|
919
995
|
}
|
|
920
|
-
/** Feature reference. */
|
|
921
|
-
export interface FeatureReference {
|
|
922
|
-
id: string;
|
|
923
|
-
}
|
|
924
996
|
/**
|
|
925
997
|
* Subscription reference represents a reference to the specific subscription item
|
|
926
998
|
* this entity represents.
|
|
@@ -1102,24 +1174,6 @@ export interface AppStripeCreateCustomerPortalSessionResult {
|
|
|
1102
1174
|
*/
|
|
1103
1175
|
url: string;
|
|
1104
1176
|
}
|
|
1105
|
-
/**
|
|
1106
|
-
* Fiat conversion rate a custom-currency charge is invoiced at. Present once the
|
|
1107
|
-
* cost basis is resolved; dynamic cost bases are exposed only after the service
|
|
1108
|
-
* period has started.
|
|
1109
|
-
*/
|
|
1110
|
-
export interface ChargeResolvedCostBasis {
|
|
1111
|
-
/** The fiat currency the charge amount is converted into for invoicing. */
|
|
1112
|
-
fiatCurrency: string;
|
|
1113
|
-
/** Fiat amount per one unit of the custom currency. */
|
|
1114
|
-
rate: string;
|
|
1115
|
-
/**
|
|
1116
|
-
* ID of the custom currency's cost basis resource the rate was taken from. Absent
|
|
1117
|
-
* for manual cost bases.
|
|
1118
|
-
*/
|
|
1119
|
-
costBasisId?: string;
|
|
1120
|
-
/** When the rate was resolved. */
|
|
1121
|
-
resolvedAt: Date;
|
|
1122
|
-
}
|
|
1123
1177
|
/**
|
|
1124
1178
|
* A period with defined start and end dates.
|
|
1125
1179
|
*
|
|
@@ -1139,6 +1193,42 @@ export interface ClosedPeriod {
|
|
|
1139
1193
|
*/
|
|
1140
1194
|
to: Date;
|
|
1141
1195
|
}
|
|
1196
|
+
/** Request body for resetting the usage of a metered entitlement. */
|
|
1197
|
+
export interface ResetCustomerEntitlementUsageRequest {
|
|
1198
|
+
/**
|
|
1199
|
+
* The time the reset takes effect. Defaults to the current time and cannot be in
|
|
1200
|
+
* the future. Truncated to the minute.
|
|
1201
|
+
*/
|
|
1202
|
+
effectiveAt?: Date;
|
|
1203
|
+
/**
|
|
1204
|
+
* Whether the usage period anchor is kept. When false, the anchor moves to
|
|
1205
|
+
* `effective_at`.
|
|
1206
|
+
*/
|
|
1207
|
+
retainAnchor: boolean;
|
|
1208
|
+
/**
|
|
1209
|
+
* Whether overage carries over into the new usage period. Defaults to the
|
|
1210
|
+
* entitlement's own setting.
|
|
1211
|
+
*/
|
|
1212
|
+
preserveOverage?: boolean;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Fiat conversion rate a custom-currency charge is invoiced at. Present once the
|
|
1216
|
+
* cost basis is resolved; dynamic cost bases are exposed only after the service
|
|
1217
|
+
* period has started.
|
|
1218
|
+
*/
|
|
1219
|
+
export interface ChargeResolvedCostBasis {
|
|
1220
|
+
/** The fiat currency the charge amount is converted into for invoicing. */
|
|
1221
|
+
fiatCurrency: string;
|
|
1222
|
+
/** Fiat amount per one unit of the custom currency. */
|
|
1223
|
+
rate: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* ID of the custom currency's cost basis resource the rate was taken from. Absent
|
|
1226
|
+
* for manual cost bases.
|
|
1227
|
+
*/
|
|
1228
|
+
costBasisId?: string;
|
|
1229
|
+
/** When the rate was resolved. */
|
|
1230
|
+
resolvedAt: Date;
|
|
1231
|
+
}
|
|
1142
1232
|
/** A subscription add-on event. */
|
|
1143
1233
|
export interface SubscriptionAddonTimelineSegment {
|
|
1144
1234
|
/** An ISO-8601 timestamp representation of the cadence start of the resource. */
|
|
@@ -1398,22 +1488,6 @@ export interface NotImplemented extends BaseError {
|
|
|
1398
1488
|
/** Not Available. */
|
|
1399
1489
|
export interface NotAvailable extends BaseError {
|
|
1400
1490
|
}
|
|
1401
|
-
/** Filters for the credit grant. */
|
|
1402
|
-
export interface CreateCreditGrantFilters {
|
|
1403
|
-
/**
|
|
1404
|
-
* Limit the credit grant to specific features. If no features are specified, the
|
|
1405
|
-
* credit grant can be used for any feature.
|
|
1406
|
-
*/
|
|
1407
|
-
features?: string[];
|
|
1408
|
-
}
|
|
1409
|
-
/** Filters for the credit grant. */
|
|
1410
|
-
export interface CreditGrantFilters {
|
|
1411
|
-
/**
|
|
1412
|
-
* Limit the credit grant to specific features. If no features are specified, the
|
|
1413
|
-
* credit grant can be used for any feature.
|
|
1414
|
-
*/
|
|
1415
|
-
features?: string[];
|
|
1416
|
-
}
|
|
1417
1491
|
/**
|
|
1418
1492
|
* A reference to the plan a subscription was created from, pinned to an exact
|
|
1419
1493
|
* revision.
|
|
@@ -1776,6 +1850,43 @@ export interface CustomerStripeCreateCustomerPortalSessionRequest {
|
|
|
1776
1850
|
/** Options for configuring the Stripe Customer Portal Session. */
|
|
1777
1851
|
stripeOptions: AppStripeCreateCustomerPortalSessionOptions;
|
|
1778
1852
|
}
|
|
1853
|
+
/** Entitlement access check result. */
|
|
1854
|
+
export interface EntitlementAccessCheckResult {
|
|
1855
|
+
/**
|
|
1856
|
+
* Whether the customer has access to the feature. Always true for `boolean` and
|
|
1857
|
+
* `static` entitlements. Depends on balance for `metered` entitlements.
|
|
1858
|
+
*/
|
|
1859
|
+
hasAccess: boolean;
|
|
1860
|
+
/**
|
|
1861
|
+
* Only available for static entitlements. Config is the JSON parsable
|
|
1862
|
+
* configuration of the entitlement. Useful to describe per customer configuration.
|
|
1863
|
+
*/
|
|
1864
|
+
config?: string;
|
|
1865
|
+
/**
|
|
1866
|
+
* The type of the entitlement.
|
|
1867
|
+
*
|
|
1868
|
+
* If not provided, the feature has no entitlement defined (has access is always
|
|
1869
|
+
* false in this case)
|
|
1870
|
+
*/
|
|
1871
|
+
type?: 'metered' | 'static' | 'boolean';
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* Recurring period input. The anchor is optional; the owning resource defines the
|
|
1875
|
+
* default, typically its creation time.
|
|
1876
|
+
*/
|
|
1877
|
+
export interface RecurringPeriodInput {
|
|
1878
|
+
/** The interval duration in ISO 8601 format. */
|
|
1879
|
+
interval: string;
|
|
1880
|
+
/** A date-time anchor to base the recurring period on. */
|
|
1881
|
+
anchor?: Date;
|
|
1882
|
+
}
|
|
1883
|
+
/** Recurring period with an anchor and an interval. */
|
|
1884
|
+
export interface RecurringPeriod {
|
|
1885
|
+
/** A date-time anchor to base the recurring period on. */
|
|
1886
|
+
anchor: Date;
|
|
1887
|
+
/** The interval duration in ISO 8601 format. */
|
|
1888
|
+
interval: string;
|
|
1889
|
+
}
|
|
1779
1890
|
/** The entitlement template of a metered entitlement. */
|
|
1780
1891
|
export interface RateCardMeteredEntitlement {
|
|
1781
1892
|
/** The type of the entitlement template. */
|
|
@@ -1826,12 +1937,32 @@ export interface SubscriptionEditStretchPhase {
|
|
|
1826
1937
|
/** The ISO-8601 duration to extend the phase by. */
|
|
1827
1938
|
extendBy: string;
|
|
1828
1939
|
}
|
|
1829
|
-
/**
|
|
1830
|
-
export interface
|
|
1831
|
-
/**
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1940
|
+
/** Filter options for getting a credit balance. */
|
|
1941
|
+
export interface GetCreditBalanceParamsFilter {
|
|
1942
|
+
/**
|
|
1943
|
+
* Filter credit balance by currency code. When historical custom currencies reuse
|
|
1944
|
+
* a code, each managed currency is returned as a separate balance row.
|
|
1945
|
+
*/
|
|
1946
|
+
currency?: StringFieldFilterExact;
|
|
1947
|
+
/**
|
|
1948
|
+
* Filter credit balance by feature key. Omit to return the total portfolio value.
|
|
1949
|
+
* Use `exists=false` to return only unrestricted balance.
|
|
1950
|
+
*/
|
|
1951
|
+
featureKey?: StringFieldFilter;
|
|
1952
|
+
}
|
|
1953
|
+
/** Filter options for listing plans. */
|
|
1954
|
+
export interface ListPlansParamsFilter {
|
|
1955
|
+
key?: StringFieldFilter;
|
|
1956
|
+
name?: StringFieldFilter;
|
|
1957
|
+
status?: StringFieldFilterExact;
|
|
1958
|
+
currency?: StringFieldFilterExact;
|
|
1959
|
+
}
|
|
1960
|
+
/** A plan key and an optional version constraint for matching credit grants. */
|
|
1961
|
+
export interface CreateCreditGrantPlanFilter {
|
|
1962
|
+
/** The plan key in the customer's namespace. */
|
|
1963
|
+
key: string;
|
|
1964
|
+
/** Omission matches all versions, including future versions. */
|
|
1965
|
+
version?: CreateVersionFilter;
|
|
1835
1966
|
}
|
|
1836
1967
|
/**
|
|
1837
1968
|
* Request body for updating the external payment settlement status of a credit
|
|
@@ -1841,6 +1972,13 @@ export interface UpdateCreditGrantExternalSettlementRequest {
|
|
|
1841
1972
|
/** The new payment settlement status. */
|
|
1842
1973
|
status: 'pending' | 'authorized' | 'settled';
|
|
1843
1974
|
}
|
|
1975
|
+
/** A plan key and an optional version constraint for matching credit grants. */
|
|
1976
|
+
export interface CreditGrantPlanFilter {
|
|
1977
|
+
/** The plan key in the customer's namespace. */
|
|
1978
|
+
key: string;
|
|
1979
|
+
/** Omission matches all versions, including future versions. */
|
|
1980
|
+
version?: VersionFilter;
|
|
1981
|
+
}
|
|
1844
1982
|
/** Filter options for listing credit grants. */
|
|
1845
1983
|
export interface ListCreditGrantsParamsFilter {
|
|
1846
1984
|
/** Filter credit grants by status. */
|
|
@@ -1865,26 +2003,6 @@ export interface ValidationIssue {
|
|
|
1865
2003
|
/** Component that reported the validation issue, if applicable. */
|
|
1866
2004
|
component?: string;
|
|
1867
2005
|
}
|
|
1868
|
-
/** Filter options for getting a credit balance. */
|
|
1869
|
-
export interface GetCreditBalanceParamsFilter {
|
|
1870
|
-
/**
|
|
1871
|
-
* Filter credit balance by currency code. When historical custom currencies reuse
|
|
1872
|
-
* a code, each managed currency is returned as a separate balance row.
|
|
1873
|
-
*/
|
|
1874
|
-
currency?: StringFieldFilterExact;
|
|
1875
|
-
/**
|
|
1876
|
-
* Filter credit balance by feature key. Omit to return the total portfolio value.
|
|
1877
|
-
* Use `exists=false` to return only unrestricted balance.
|
|
1878
|
-
*/
|
|
1879
|
-
featureKey?: StringFieldFilter;
|
|
1880
|
-
}
|
|
1881
|
-
/** Filter options for listing plans. */
|
|
1882
|
-
export interface ListPlansParamsFilter {
|
|
1883
|
-
key?: StringFieldFilter;
|
|
1884
|
-
name?: StringFieldFilter;
|
|
1885
|
-
status?: StringFieldFilterExact;
|
|
1886
|
-
currency?: StringFieldFilterExact;
|
|
1887
|
-
}
|
|
1888
2006
|
/** Request body for voiding a credit grant. */
|
|
1889
2007
|
export interface VoidCreditGrantRequest {
|
|
1890
2008
|
/**
|
|
@@ -2197,6 +2315,120 @@ export interface EntitlementAccessQueryError {
|
|
|
2197
2315
|
/** The customer identifier from the request that produced this error. */
|
|
2198
2316
|
customer?: string;
|
|
2199
2317
|
}
|
|
2318
|
+
/**
|
|
2319
|
+
* A notification channel delivers notification events, such as entitlement balance
|
|
2320
|
+
* threshold crossings, to an external system. Today the only supported channel
|
|
2321
|
+
* type is a webhook delivered via Svix.
|
|
2322
|
+
*/
|
|
2323
|
+
export interface NotificationChannel {
|
|
2324
|
+
id: string;
|
|
2325
|
+
/**
|
|
2326
|
+
* Display name of the resource.
|
|
2327
|
+
*
|
|
2328
|
+
* Between 1 and 256 characters.
|
|
2329
|
+
*/
|
|
2330
|
+
name: string;
|
|
2331
|
+
labels?: Labels;
|
|
2332
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2333
|
+
createdAt: Date;
|
|
2334
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
2335
|
+
updatedAt: Date;
|
|
2336
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
2337
|
+
deletedAt?: Date;
|
|
2338
|
+
/** The type of the channel. Immutable after creation. */
|
|
2339
|
+
type: 'webhook';
|
|
2340
|
+
/**
|
|
2341
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2342
|
+
* events.
|
|
2343
|
+
*/
|
|
2344
|
+
disabled: boolean;
|
|
2345
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2346
|
+
url: string;
|
|
2347
|
+
/**
|
|
2348
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2349
|
+
* header name.
|
|
2350
|
+
*/
|
|
2351
|
+
customHeaders?: Record<string, string>;
|
|
2352
|
+
/**
|
|
2353
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2354
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2355
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2356
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2357
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2358
|
+
*/
|
|
2359
|
+
signingSecret?: string;
|
|
2360
|
+
}
|
|
2361
|
+
/** NotificationChannel create request. */
|
|
2362
|
+
export interface CreateNotificationChannelRequest {
|
|
2363
|
+
/**
|
|
2364
|
+
* Display name of the resource.
|
|
2365
|
+
*
|
|
2366
|
+
* Between 1 and 256 characters.
|
|
2367
|
+
*/
|
|
2368
|
+
name: string;
|
|
2369
|
+
labels?: Labels;
|
|
2370
|
+
/** The type of the channel. Immutable after creation. */
|
|
2371
|
+
type: 'webhook';
|
|
2372
|
+
/**
|
|
2373
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2374
|
+
* events.
|
|
2375
|
+
*/
|
|
2376
|
+
disabled: boolean;
|
|
2377
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2378
|
+
url: string;
|
|
2379
|
+
/**
|
|
2380
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2381
|
+
* header name.
|
|
2382
|
+
*/
|
|
2383
|
+
customHeaders?: Record<string, string>;
|
|
2384
|
+
/**
|
|
2385
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2386
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2387
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2388
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2389
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2390
|
+
*/
|
|
2391
|
+
signingSecret?: string;
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* Request body for updating a notification channel. Updates replace the channel's
|
|
2395
|
+
* mutable state rather than merging it: `type`, `name`, and `url` must always be
|
|
2396
|
+
* provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to
|
|
2397
|
+
* their defaults (enabled, no labels, no custom headers). `signing_secret` is the
|
|
2398
|
+
* one exception: omitting it keeps the channel's current signing secret instead of
|
|
2399
|
+
* clearing the credential.
|
|
2400
|
+
*/
|
|
2401
|
+
export interface UpdateNotificationChannelRequest {
|
|
2402
|
+
/**
|
|
2403
|
+
* Display name of the resource.
|
|
2404
|
+
*
|
|
2405
|
+
* Between 1 and 256 characters.
|
|
2406
|
+
*/
|
|
2407
|
+
name: string;
|
|
2408
|
+
/** The type of the channel. Immutable after creation. */
|
|
2409
|
+
type: 'webhook';
|
|
2410
|
+
/** The URL that webhook notification events are delivered to. */
|
|
2411
|
+
url: string;
|
|
2412
|
+
labels?: Labels;
|
|
2413
|
+
/**
|
|
2414
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
2415
|
+
* events.
|
|
2416
|
+
*/
|
|
2417
|
+
disabled: boolean;
|
|
2418
|
+
/**
|
|
2419
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
2420
|
+
* header name.
|
|
2421
|
+
*/
|
|
2422
|
+
customHeaders?: Record<string, string>;
|
|
2423
|
+
/**
|
|
2424
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
2425
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
2426
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
2427
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
2428
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
2429
|
+
*/
|
|
2430
|
+
signingSecret?: string;
|
|
2431
|
+
}
|
|
2200
2432
|
/** App customer data. */
|
|
2201
2433
|
export interface AppCustomerData {
|
|
2202
2434
|
/**
|
|
@@ -2254,26 +2486,6 @@ export interface CreditAdjustment {
|
|
|
2254
2486
|
description?: string;
|
|
2255
2487
|
labels?: Labels;
|
|
2256
2488
|
}
|
|
2257
|
-
/** The credit balance by currency. */
|
|
2258
|
-
export interface CreditBalance {
|
|
2259
|
-
currency: BillingCurrencyCode;
|
|
2260
|
-
/** Immutable managed currency identifier. Present only for custom currencies. */
|
|
2261
|
-
customCurrencyId?: string;
|
|
2262
|
-
/**
|
|
2263
|
-
* Credits available after applying currently live charge impacts.
|
|
2264
|
-
*
|
|
2265
|
-
* Always zero for historical balance queries using the `timestamp` parameter
|
|
2266
|
-
* because live charge impacts cannot be reconstructed historically.
|
|
2267
|
-
*/
|
|
2268
|
-
live: string;
|
|
2269
|
-
/** Credits that have been booked on the ledger as of the balance timestamp. */
|
|
2270
|
-
settled: string;
|
|
2271
|
-
/**
|
|
2272
|
-
* Credits that have been granted but are not yet written to the ledger, or are
|
|
2273
|
-
* written to the ledger with a future booked time.
|
|
2274
|
-
*/
|
|
2275
|
-
pending: string;
|
|
2276
|
-
}
|
|
2277
2489
|
/** CreditAdjustment create request. */
|
|
2278
2490
|
export interface CreateCreditAdjustmentRequest {
|
|
2279
2491
|
/**
|
|
@@ -2310,48 +2522,6 @@ export interface ListCreditTransactionsParamsFilter {
|
|
|
2310
2522
|
*/
|
|
2311
2523
|
featureKey?: StringFieldFilter;
|
|
2312
2524
|
}
|
|
2313
|
-
/**
|
|
2314
|
-
* A credit transaction represents a single credit movement on the customer's
|
|
2315
|
-
* balance.
|
|
2316
|
-
*
|
|
2317
|
-
* Credit transactions are immutable.
|
|
2318
|
-
*/
|
|
2319
|
-
export interface CreditTransaction {
|
|
2320
|
-
id: string;
|
|
2321
|
-
/**
|
|
2322
|
-
* Display name of the resource.
|
|
2323
|
-
*
|
|
2324
|
-
* Between 1 and 256 characters.
|
|
2325
|
-
*/
|
|
2326
|
-
name: string;
|
|
2327
|
-
/**
|
|
2328
|
-
* Optional description of the resource.
|
|
2329
|
-
*
|
|
2330
|
-
* Maximum 1024 characters.
|
|
2331
|
-
*/
|
|
2332
|
-
description?: string;
|
|
2333
|
-
labels?: Labels;
|
|
2334
|
-
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2335
|
-
createdAt: Date;
|
|
2336
|
-
/** The date and time the transaction was booked. */
|
|
2337
|
-
bookedAt: Date;
|
|
2338
|
-
/** The type of credit transaction. */
|
|
2339
|
-
type: 'funded' | 'consumed' | 'expired' | 'voided';
|
|
2340
|
-
/** Currency of the balance affected by the transaction. */
|
|
2341
|
-
currency: BillingCurrencyCode;
|
|
2342
|
-
/** Immutable managed currency identifier. Present only for custom currencies. */
|
|
2343
|
-
customCurrencyId?: string;
|
|
2344
|
-
/**
|
|
2345
|
-
* Signed amount of the credit movement. Positive values add balance, negative
|
|
2346
|
-
* values reduce balance.
|
|
2347
|
-
*/
|
|
2348
|
-
amount: string;
|
|
2349
|
-
/** The available balance before and after the transaction. */
|
|
2350
|
-
availableBalance: {
|
|
2351
|
-
before: string;
|
|
2352
|
-
after: string;
|
|
2353
|
-
};
|
|
2354
|
-
}
|
|
2355
2525
|
/** Monetary amount in a fiat or custom currency. */
|
|
2356
2526
|
export interface CurrencyAmount {
|
|
2357
2527
|
/** The amount as an arbitrary-precision decimal string. */
|
|
@@ -2359,11 +2529,34 @@ export interface CurrencyAmount {
|
|
|
2359
2529
|
/** The fiat or custom currency code of the amount. */
|
|
2360
2530
|
currency: BillingCurrencyCode;
|
|
2361
2531
|
}
|
|
2362
|
-
/** Entitlement
|
|
2363
|
-
export interface
|
|
2532
|
+
/** Entitlement value result. */
|
|
2533
|
+
export interface EntitlementValueResult {
|
|
2364
2534
|
/** The type of the entitlement. */
|
|
2365
2535
|
type: 'metered' | 'static' | 'boolean';
|
|
2366
|
-
/** The feature key
|
|
2536
|
+
/** The feature key being evaluated. */
|
|
2537
|
+
featureKey: string;
|
|
2538
|
+
/**
|
|
2539
|
+
* Whether the customer has access to the feature. Always true for `boolean` and
|
|
2540
|
+
* `static` entitlements. Depends on balance for `metered` entitlements.
|
|
2541
|
+
*/
|
|
2542
|
+
hasAccess: boolean;
|
|
2543
|
+
/**
|
|
2544
|
+
* Only available for static entitlements. Config is the JSON parsable
|
|
2545
|
+
* configuration of the entitlement. Useful to describe per customer configuration.
|
|
2546
|
+
*/
|
|
2547
|
+
config?: string;
|
|
2548
|
+
/**
|
|
2549
|
+
* Only available for metered entitlements. The balance details of the entitlement
|
|
2550
|
+
* at the evaluation time. Requires the `value` expand.
|
|
2551
|
+
*/
|
|
2552
|
+
value?: EntitlementAccessValue;
|
|
2553
|
+
}
|
|
2554
|
+
/**
|
|
2555
|
+
* Entitlement value looked up by feature key. A missing entitlement has no type
|
|
2556
|
+
* and does not grant access.
|
|
2557
|
+
*/
|
|
2558
|
+
export interface EntitlementFeatureValueResult {
|
|
2559
|
+
/** The feature key being evaluated. */
|
|
2367
2560
|
featureKey: string;
|
|
2368
2561
|
/**
|
|
2369
2562
|
* Whether the customer has access to the feature. Always true for `boolean` and
|
|
@@ -2376,10 +2569,17 @@ export interface EntitlementAccessResult {
|
|
|
2376
2569
|
*/
|
|
2377
2570
|
config?: string;
|
|
2378
2571
|
/**
|
|
2379
|
-
* Only available for metered entitlements. The
|
|
2380
|
-
*
|
|
2572
|
+
* Only available for metered entitlements. The balance details of the entitlement
|
|
2573
|
+
* at the evaluation time. Requires the `value` expand.
|
|
2381
2574
|
*/
|
|
2382
2575
|
value?: EntitlementAccessValue;
|
|
2576
|
+
/**
|
|
2577
|
+
* The type of the entitlement.
|
|
2578
|
+
*
|
|
2579
|
+
* If not provided, the feature has no entitlement defined (has access is always
|
|
2580
|
+
* false in this case)
|
|
2581
|
+
*/
|
|
2582
|
+
type?: 'metered' | 'static' | 'boolean';
|
|
2383
2583
|
}
|
|
2384
2584
|
/**
|
|
2385
2585
|
* A price tier used in graduated and volume pricing.
|
|
@@ -2537,6 +2737,33 @@ export interface ListCustomersParamsFilter {
|
|
|
2537
2737
|
planKey?: StringFieldFilter;
|
|
2538
2738
|
billingProfileId?: UlidFieldFilter;
|
|
2539
2739
|
}
|
|
2740
|
+
/** Filter options for listing customer entitlements. */
|
|
2741
|
+
export interface ListCustomerEntitlementsParamsFilter {
|
|
2742
|
+
/** Filter entitlements by feature ID. */
|
|
2743
|
+
featureId?: UlidFieldFilter;
|
|
2744
|
+
/** Filter entitlements by feature key. */
|
|
2745
|
+
featureKey?: StringFieldFilterExact;
|
|
2746
|
+
/** Filter entitlements by type (`metered`, `static` or `boolean`). */
|
|
2747
|
+
type?: StringFieldFilterExact;
|
|
2748
|
+
}
|
|
2749
|
+
/** Filter options for listing entitlements. */
|
|
2750
|
+
export interface ListEntitlementsParamsFilter {
|
|
2751
|
+
/** Filter entitlements by feature ID. */
|
|
2752
|
+
featureId?: UlidFieldFilter;
|
|
2753
|
+
/** Filter entitlements by feature key. */
|
|
2754
|
+
featureKey?: StringFieldFilterExact;
|
|
2755
|
+
/** Filter entitlements by type (`metered`, `static` or `boolean`). */
|
|
2756
|
+
type?: StringFieldFilterExact;
|
|
2757
|
+
/** Filter entitlements by customer ID. */
|
|
2758
|
+
customerId?: UlidFieldFilter;
|
|
2759
|
+
}
|
|
2760
|
+
/** Filter options for listing grants. */
|
|
2761
|
+
export interface ListGrantsParamsFilter {
|
|
2762
|
+
/** Filter grants by the ID of the customer that owns the entitlement. */
|
|
2763
|
+
customerId?: UlidFieldFilter;
|
|
2764
|
+
/** Filter grants by the ID of the entitlement's feature. */
|
|
2765
|
+
featureId?: UlidFieldFilter;
|
|
2766
|
+
}
|
|
2540
2767
|
/** Filter options for listing subscriptions. */
|
|
2541
2768
|
export interface ListSubscriptionsParamsFilter {
|
|
2542
2769
|
id?: UlidFieldFilter;
|
|
@@ -2581,33 +2808,44 @@ export interface ListPlanAddonsParamsFilter {
|
|
|
2581
2808
|
planCurrency?: StringFieldFilter;
|
|
2582
2809
|
}
|
|
2583
2810
|
/**
|
|
2584
|
-
* Tax configuration for a
|
|
2811
|
+
* Tax configuration for a billable resource.
|
|
2585
2812
|
*
|
|
2586
|
-
*
|
|
2587
|
-
*
|
|
2813
|
+
* Applies a tax code and tax behavior to the resulting invoice line items. When
|
|
2814
|
+
* not set, the applicable default is used: the billing profile default tax
|
|
2815
|
+
* configuration, then the organization default tax code.
|
|
2588
2816
|
*/
|
|
2589
|
-
export interface
|
|
2590
|
-
/**
|
|
2817
|
+
export interface CreateTaxCodeConfig {
|
|
2818
|
+
/**
|
|
2819
|
+
* Tax behavior.
|
|
2820
|
+
*
|
|
2821
|
+
* This enum is used to specify whether tax is included in the price or excluded
|
|
2822
|
+
* from the price. If not specified, the billing profile is used to determine the
|
|
2823
|
+
* tax behavior. If not specified in the billing profile, the provider's default
|
|
2824
|
+
* behavior is used.
|
|
2825
|
+
*/
|
|
2591
2826
|
behavior?: 'inclusive' | 'exclusive';
|
|
2592
2827
|
/** Tax code applied to the invoice line item. */
|
|
2593
|
-
|
|
2828
|
+
code?: CreateResourceReference;
|
|
2594
2829
|
}
|
|
2595
2830
|
/**
|
|
2596
|
-
* Tax configuration for a
|
|
2831
|
+
* Tax configuration for a billable resource.
|
|
2597
2832
|
*
|
|
2598
|
-
*
|
|
2599
|
-
*
|
|
2833
|
+
* Applies a tax code and tax behavior to the resulting invoice line items. When
|
|
2834
|
+
* not set, the applicable default is used: the billing profile default tax
|
|
2835
|
+
* configuration, then the organization default tax code.
|
|
2600
2836
|
*/
|
|
2601
|
-
export interface
|
|
2602
|
-
/**
|
|
2837
|
+
export interface TaxCodeConfig {
|
|
2838
|
+
/**
|
|
2839
|
+
* Tax behavior.
|
|
2840
|
+
*
|
|
2841
|
+
* This enum is used to specify whether tax is included in the price or excluded
|
|
2842
|
+
* from the price. If not specified, the billing profile is used to determine the
|
|
2843
|
+
* tax behavior. If not specified in the billing profile, the provider's default
|
|
2844
|
+
* behavior is used.
|
|
2845
|
+
*/
|
|
2603
2846
|
behavior?: 'inclusive' | 'exclusive';
|
|
2604
2847
|
/** Tax code applied to the invoice line item. */
|
|
2605
|
-
|
|
2606
|
-
}
|
|
2607
|
-
/** The tax config of the rate card. */
|
|
2608
|
-
export interface RateCardTaxConfig {
|
|
2609
|
-
behavior?: 'inclusive' | 'exclusive';
|
|
2610
|
-
code: TaxCodeReference;
|
|
2848
|
+
code?: TaxCodeReference;
|
|
2611
2849
|
}
|
|
2612
2850
|
/** Set of provider specific tax configs. */
|
|
2613
2851
|
export interface TaxConfig {
|
|
@@ -2656,6 +2894,68 @@ export interface UpdateOrganizationDefaultTaxCodesRequest {
|
|
|
2656
2894
|
/** Default tax code for credit grants. */
|
|
2657
2895
|
creditGrantTaxCode?: TaxCodeReference;
|
|
2658
2896
|
}
|
|
2897
|
+
/** The credit balance by currency. */
|
|
2898
|
+
export interface CreditBalance {
|
|
2899
|
+
currency: BillingCurrencyCode;
|
|
2900
|
+
/** Managed currency reference. Present only for custom currencies. */
|
|
2901
|
+
customCurrency?: CurrencyCustomReference;
|
|
2902
|
+
/**
|
|
2903
|
+
* Credits available after applying currently live charge impacts.
|
|
2904
|
+
*
|
|
2905
|
+
* Always zero for historical balance queries using the `timestamp` parameter
|
|
2906
|
+
* because live charge impacts cannot be reconstructed historically.
|
|
2907
|
+
*/
|
|
2908
|
+
live: string;
|
|
2909
|
+
/** Credits that have been booked on the ledger as of the balance timestamp. */
|
|
2910
|
+
settled: string;
|
|
2911
|
+
/**
|
|
2912
|
+
* Credits that have been granted but are not yet written to the ledger, or are
|
|
2913
|
+
* written to the ledger with a future booked time.
|
|
2914
|
+
*/
|
|
2915
|
+
pending: string;
|
|
2916
|
+
}
|
|
2917
|
+
/**
|
|
2918
|
+
* A credit transaction represents a single credit movement on the customer's
|
|
2919
|
+
* balance.
|
|
2920
|
+
*
|
|
2921
|
+
* Credit transactions are immutable.
|
|
2922
|
+
*/
|
|
2923
|
+
export interface CreditTransaction {
|
|
2924
|
+
id: string;
|
|
2925
|
+
/**
|
|
2926
|
+
* Display name of the resource.
|
|
2927
|
+
*
|
|
2928
|
+
* Between 1 and 256 characters.
|
|
2929
|
+
*/
|
|
2930
|
+
name: string;
|
|
2931
|
+
/**
|
|
2932
|
+
* Optional description of the resource.
|
|
2933
|
+
*
|
|
2934
|
+
* Maximum 1024 characters.
|
|
2935
|
+
*/
|
|
2936
|
+
description?: string;
|
|
2937
|
+
labels?: Labels;
|
|
2938
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
2939
|
+
createdAt: Date;
|
|
2940
|
+
/** The date and time the transaction was booked. */
|
|
2941
|
+
bookedAt: Date;
|
|
2942
|
+
/** The type of credit transaction. */
|
|
2943
|
+
type: 'funded' | 'consumed' | 'expired' | 'voided';
|
|
2944
|
+
/** Currency of the balance affected by the transaction. */
|
|
2945
|
+
currency: BillingCurrencyCode;
|
|
2946
|
+
/** Managed currency reference. Present only for custom currencies. */
|
|
2947
|
+
customCurrency?: CurrencyCustomReference;
|
|
2948
|
+
/**
|
|
2949
|
+
* Signed amount of the credit movement. Positive values add balance, negative
|
|
2950
|
+
* values reduce balance.
|
|
2951
|
+
*/
|
|
2952
|
+
amount: string;
|
|
2953
|
+
/** The available balance before and after the transaction. */
|
|
2954
|
+
availableBalance: {
|
|
2955
|
+
before: string;
|
|
2956
|
+
after: string;
|
|
2957
|
+
};
|
|
2958
|
+
}
|
|
2659
2959
|
/**
|
|
2660
2960
|
* BillingInvoiceWorkflowAppsReferences represents the references (id) to the apps
|
|
2661
2961
|
* used by a billing profile
|
|
@@ -2741,10 +3041,25 @@ export interface CreatePlanAddonRequest {
|
|
|
2741
3041
|
*/
|
|
2742
3042
|
maxQuantity?: number;
|
|
2743
3043
|
}
|
|
2744
|
-
/**
|
|
2745
|
-
|
|
3044
|
+
/**
|
|
3045
|
+
* Tax configuration for a billable resource.
|
|
3046
|
+
*
|
|
3047
|
+
* Applies a tax code and tax behavior to the resulting invoice line items. When
|
|
3048
|
+
* not set, the applicable default is used: the billing profile default tax
|
|
3049
|
+
* configuration, then the organization default tax code.
|
|
3050
|
+
*/
|
|
3051
|
+
export interface UpdateTaxCodeConfig {
|
|
3052
|
+
/**
|
|
3053
|
+
* Tax behavior.
|
|
3054
|
+
*
|
|
3055
|
+
* This enum is used to specify whether tax is included in the price or excluded
|
|
3056
|
+
* from the price. If not specified, the billing profile is used to determine the
|
|
3057
|
+
* tax behavior. If not specified in the billing profile, the provider's default
|
|
3058
|
+
* behavior is used.
|
|
3059
|
+
*/
|
|
2746
3060
|
behavior?: 'inclusive' | 'exclusive';
|
|
2747
|
-
code
|
|
3061
|
+
/** Tax code applied to the invoice line item. */
|
|
3062
|
+
code?: UpdateResourceReference;
|
|
2748
3063
|
}
|
|
2749
3064
|
/** Filter options for listing ingested events. */
|
|
2750
3065
|
export interface ListEventsParamsFilter {
|
|
@@ -2828,6 +3143,15 @@ export interface ListChargesParamsFilter {
|
|
|
2828
3143
|
/** Filter charges by the ID of their customer. */
|
|
2829
3144
|
customerId?: UlidFieldFilter;
|
|
2830
3145
|
}
|
|
3146
|
+
/** Filter options for listing notification channels. */
|
|
3147
|
+
export interface ListNotificationChannelsParamsFilter {
|
|
3148
|
+
id?: UlidFieldFilter;
|
|
3149
|
+
name?: StringFieldFilter;
|
|
3150
|
+
type?: StringFieldFilterExact;
|
|
3151
|
+
disabled?: BooleanFieldFilter;
|
|
3152
|
+
createdAt?: DateTimeFieldFilter;
|
|
3153
|
+
updatedAt?: DateTimeFieldFilter;
|
|
3154
|
+
}
|
|
2831
3155
|
/** Resource filters. */
|
|
2832
3156
|
export interface ResourceFilters {
|
|
2833
3157
|
name?: StringFieldFilter;
|
|
@@ -2839,9 +3163,7 @@ export interface ResourceFilters {
|
|
|
2839
3163
|
}
|
|
2840
3164
|
/** Field filters with all supported types. */
|
|
2841
3165
|
export interface FieldFilters {
|
|
2842
|
-
boolean?:
|
|
2843
|
-
eq: boolean;
|
|
2844
|
-
};
|
|
3166
|
+
boolean?: BooleanFieldFilter;
|
|
2845
3167
|
numeric?: number | {
|
|
2846
3168
|
eq?: number;
|
|
2847
3169
|
neq?: number;
|
|
@@ -2879,6 +3201,33 @@ export interface MeterQueryResult {
|
|
|
2879
3201
|
/** The usage data. If no data is available, an empty array is returned. */
|
|
2880
3202
|
data: MeterQueryRow[];
|
|
2881
3203
|
}
|
|
3204
|
+
/** Usage and balance of a single history window. */
|
|
3205
|
+
export interface EntitlementHistoryWindow {
|
|
3206
|
+
/** The period the window covers. */
|
|
3207
|
+
period: ClosedPeriod;
|
|
3208
|
+
/** The usage recorded in the window. */
|
|
3209
|
+
usage: string;
|
|
3210
|
+
/** The entitlement balance at the start of the window. */
|
|
3211
|
+
balanceAtStart: string;
|
|
3212
|
+
}
|
|
3213
|
+
/** A period in which grants were consumed in a fixed order. */
|
|
3214
|
+
export interface EntitlementBurndownSegment {
|
|
3215
|
+
/** The period the segment covers. */
|
|
3216
|
+
period: ClosedPeriod;
|
|
3217
|
+
/** The usage recorded in the segment. */
|
|
3218
|
+
usage: string;
|
|
3219
|
+
/** The usage in the segment not covered by any grant. */
|
|
3220
|
+
overage: string;
|
|
3221
|
+
/** The entitlement balance at the start and at the end of the segment. */
|
|
3222
|
+
balance: EntitlementBurndownBalance;
|
|
3223
|
+
/**
|
|
3224
|
+
* The balance of each active grant at the start and at the end of the segment,
|
|
3225
|
+
* keyed by grant ID.
|
|
3226
|
+
*/
|
|
3227
|
+
grantBalances: EntitlementBurndownGrantBalances;
|
|
3228
|
+
/** The grants consumed in the segment and the usage taken from each. */
|
|
3229
|
+
grantUsages: EntitlementGrantUsage[];
|
|
3230
|
+
}
|
|
2882
3231
|
/** A detailed line produced by a flat fee charge's realization run. */
|
|
2883
3232
|
export interface ChargeRealizationDetailedLineFlatFee {
|
|
2884
3233
|
id: string;
|
|
@@ -3117,52 +3466,311 @@ export interface InvoiceCustomer {
|
|
|
3117
3466
|
* resource itself, the key is optional here because the invoice snapshot may
|
|
3118
3467
|
* predate or omit it.
|
|
3119
3468
|
*/
|
|
3120
|
-
key?: string;
|
|
3121
|
-
}
|
|
3122
|
-
/** A collection of addresses for the party. */
|
|
3123
|
-
export interface UpdateBillingPartyAddresses {
|
|
3124
|
-
/** Billing address. */
|
|
3125
|
-
billingAddress: UpdateAddress;
|
|
3126
|
-
}
|
|
3127
|
-
/** Snapshot of the customer's information at the time the invoice was issued. */
|
|
3128
|
-
export interface UpdateInvoiceCustomer {
|
|
3469
|
+
key?: string;
|
|
3470
|
+
}
|
|
3471
|
+
/** A collection of addresses for the party. */
|
|
3472
|
+
export interface UpdateBillingPartyAddresses {
|
|
3473
|
+
/** Billing address. */
|
|
3474
|
+
billingAddress: UpdateAddress;
|
|
3475
|
+
}
|
|
3476
|
+
/** Snapshot of the customer's information at the time the invoice was issued. */
|
|
3477
|
+
export interface UpdateInvoiceCustomer {
|
|
3478
|
+
/**
|
|
3479
|
+
* Display name of the resource.
|
|
3480
|
+
*
|
|
3481
|
+
* Between 1 and 256 characters.
|
|
3482
|
+
*/
|
|
3483
|
+
name: string;
|
|
3484
|
+
/** Mapping to attribute metered usage to the customer by the event subject. */
|
|
3485
|
+
usageAttribution?: UpdateCustomerUsageAttribution;
|
|
3486
|
+
/** The billing address of the customer. Used for tax and invoicing. */
|
|
3487
|
+
billingAddress?: UpdateAddress;
|
|
3488
|
+
id: string;
|
|
3489
|
+
/**
|
|
3490
|
+
* Optional external resource key for the customer.
|
|
3491
|
+
*
|
|
3492
|
+
* Omitted when the customer was created without a key. Unlike on the customer
|
|
3493
|
+
* resource itself, the key is optional here because the invoice snapshot may
|
|
3494
|
+
* predate or omit it.
|
|
3495
|
+
*/
|
|
3496
|
+
key?: string;
|
|
3497
|
+
}
|
|
3498
|
+
/** Checkout Session consent collection configuration. */
|
|
3499
|
+
export interface AppStripeCreateCheckoutSessionConsentCollection {
|
|
3500
|
+
/** Controls the visibility of payment method reuse agreement. */
|
|
3501
|
+
paymentMethodReuseAgreement?: AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement;
|
|
3502
|
+
/**
|
|
3503
|
+
* Enables collection of promotional communication consent.
|
|
3504
|
+
*
|
|
3505
|
+
* Only available to US merchants. When set to "auto", Checkout determines whether
|
|
3506
|
+
* to show the option based on the customer's locale.
|
|
3507
|
+
*/
|
|
3508
|
+
promotions?: 'auto' | 'none';
|
|
3509
|
+
/**
|
|
3510
|
+
* Requires customers to accept terms of service before payment.
|
|
3511
|
+
*
|
|
3512
|
+
* Requires a valid terms of service URL in your Stripe Dashboard settings.
|
|
3513
|
+
*/
|
|
3514
|
+
termsOfService?: 'none' | 'required';
|
|
3515
|
+
}
|
|
3516
|
+
/** A grant to issue for a metered entitlement. */
|
|
3517
|
+
export interface EntitlementGrantCreateRequest {
|
|
3518
|
+
/** The amount to grant, in the feature's unit. Must be positive. */
|
|
3519
|
+
amount: string;
|
|
3520
|
+
/**
|
|
3521
|
+
* The priority of the grant. Lower values have higher priority. Grants are
|
|
3522
|
+
* consumed in priority order, then by closest expiration, then by earliest
|
|
3523
|
+
* creation.
|
|
3524
|
+
*/
|
|
3525
|
+
priority?: number;
|
|
3526
|
+
/**
|
|
3527
|
+
* The time the grant becomes effective and the anchor for recurring grants. The
|
|
3528
|
+
* value is truncated to the start of the minute.
|
|
3529
|
+
*/
|
|
3530
|
+
effectiveAt: Date;
|
|
3531
|
+
/**
|
|
3532
|
+
* The duration after which the grant expires, counted from `effective_at`. Only
|
|
3533
|
+
* single-unit durations are accepted, such as `PT12H`, `P7D`, `P2W`, `P3M`, or
|
|
3534
|
+
* `P1Y`. If omitted, the grant never expires.
|
|
3535
|
+
*/
|
|
3536
|
+
expiresAfter?: string;
|
|
3537
|
+
/**
|
|
3538
|
+
* The maximum balance carried over at reset. The balance after a reset is
|
|
3539
|
+
* `MIN(max_rollover_amount, MAX(balance_before_reset, min_rollover_amount))`.
|
|
3540
|
+
* Defaults to `amount`.
|
|
3541
|
+
*/
|
|
3542
|
+
maxRolloverAmount?: string;
|
|
3543
|
+
/**
|
|
3544
|
+
* The minimum balance carried over at reset. The balance after a reset is
|
|
3545
|
+
* `MIN(max_rollover_amount, MAX(balance_before_reset, min_rollover_amount))`.
|
|
3546
|
+
* Defaults to `0`.
|
|
3547
|
+
*/
|
|
3548
|
+
minRolloverAmount?: string;
|
|
3549
|
+
labels?: Labels;
|
|
3550
|
+
/**
|
|
3551
|
+
* The recurrence of the grant. When set, the amount is issued again every
|
|
3552
|
+
* interval. The anchor defaults to `effective_at`.
|
|
3553
|
+
*/
|
|
3554
|
+
recurrence?: RecurringPeriodInput;
|
|
3555
|
+
}
|
|
3556
|
+
/** Static entitlement create request. */
|
|
3557
|
+
export interface CreateEntitlementStaticRequest {
|
|
3558
|
+
/** The type of the entitlement. */
|
|
3559
|
+
type: 'static';
|
|
3560
|
+
/** The feature the customer is entitled to use. */
|
|
3561
|
+
feature: FeatureReference;
|
|
3562
|
+
labels?: Labels;
|
|
3563
|
+
/**
|
|
3564
|
+
* The entitlement configuration as a JSON value. Returned when checking
|
|
3565
|
+
* entitlement access.
|
|
3566
|
+
*/
|
|
3567
|
+
config: unknown;
|
|
3568
|
+
/**
|
|
3569
|
+
* The usage period of the entitlement. The anchor defaults to the entitlement
|
|
3570
|
+
* creation time.
|
|
3571
|
+
*/
|
|
3572
|
+
usagePeriod?: RecurringPeriodInput;
|
|
3573
|
+
}
|
|
3574
|
+
/** Boolean entitlement create request. */
|
|
3575
|
+
export interface CreateEntitlementBooleanRequest {
|
|
3576
|
+
/** The type of the entitlement. */
|
|
3577
|
+
type: 'boolean';
|
|
3578
|
+
/** The feature the customer is entitled to use. */
|
|
3579
|
+
feature: FeatureReference;
|
|
3580
|
+
labels?: Labels;
|
|
3581
|
+
/**
|
|
3582
|
+
* The usage period of the entitlement. The anchor defaults to the entitlement
|
|
3583
|
+
* creation time.
|
|
3584
|
+
*/
|
|
3585
|
+
usagePeriod?: RecurringPeriodInput;
|
|
3586
|
+
}
|
|
3587
|
+
/**
|
|
3588
|
+
* A metered entitlement grants a usage allowance for a feature. Access is
|
|
3589
|
+
* determined by the balance: the allowance provided by grants is burnt down by
|
|
3590
|
+
* usage.
|
|
3591
|
+
*/
|
|
3592
|
+
export interface EntitlementMetered {
|
|
3593
|
+
id: string;
|
|
3594
|
+
/** The type of the entitlement. */
|
|
3595
|
+
type: 'metered';
|
|
3596
|
+
/** The feature the customer is entitled to use. */
|
|
3597
|
+
feature: FeatureReference;
|
|
3598
|
+
/** The customer the entitlement belongs to. */
|
|
3599
|
+
customer: CustomerReference;
|
|
3600
|
+
labels?: Labels;
|
|
3601
|
+
/** The time from which the entitlement is active. */
|
|
3602
|
+
activeFrom: Date;
|
|
3603
|
+
/**
|
|
3604
|
+
* The time until which the entitlement is active. If not set, the entitlement is
|
|
3605
|
+
* active until deleted.
|
|
3606
|
+
*/
|
|
3607
|
+
activeTo?: Date;
|
|
3608
|
+
/** The time the entitlement was created. */
|
|
3609
|
+
createdAt: Date;
|
|
3610
|
+
/** The time the entitlement was last updated. */
|
|
3611
|
+
updatedAt: Date;
|
|
3612
|
+
/** The time the entitlement was deleted. */
|
|
3613
|
+
deletedAt?: Date;
|
|
3614
|
+
/**
|
|
3615
|
+
* The usage period of the entitlement. The balance resets at the start of every
|
|
3616
|
+
* period.
|
|
3617
|
+
*/
|
|
3618
|
+
usagePeriod: RecurringPeriod;
|
|
3619
|
+
/** The current usage period of the entitlement. */
|
|
3620
|
+
currentUsagePeriod: ClosedPeriod;
|
|
3621
|
+
/**
|
|
3622
|
+
* If true, the customer keeps access to the feature after the balance is
|
|
3623
|
+
* exhausted.
|
|
3624
|
+
*/
|
|
3625
|
+
isSoftLimit: boolean;
|
|
3626
|
+
/** Usage granted automatically after each reset. Cannot be combined with `grants`. */
|
|
3627
|
+
issue?: EntitlementIssueAfterReset;
|
|
3628
|
+
/** The amount granted automatically after each reset. */
|
|
3629
|
+
issueAfterReset?: string;
|
|
3630
|
+
/** The priority of the grant created after each reset. */
|
|
3631
|
+
issueAfterResetPriority: number;
|
|
3632
|
+
/** If true, the overage is preserved at reset. If false, the usage is reset to 0. */
|
|
3633
|
+
preserveOverageAtReset: boolean;
|
|
3634
|
+
/** The time from which usage is measured. */
|
|
3635
|
+
measureUsageFrom: Date;
|
|
3636
|
+
/** The time of the last reset. */
|
|
3637
|
+
lastReset: Date;
|
|
3638
|
+
}
|
|
3639
|
+
/** A static entitlement grants access to a feature together with a configuration. */
|
|
3640
|
+
export interface EntitlementStatic {
|
|
3641
|
+
id: string;
|
|
3642
|
+
/** The type of the entitlement. */
|
|
3643
|
+
type: 'static';
|
|
3644
|
+
/** The feature the customer is entitled to use. */
|
|
3645
|
+
feature: FeatureReference;
|
|
3646
|
+
/** The customer the entitlement belongs to. */
|
|
3647
|
+
customer: CustomerReference;
|
|
3648
|
+
labels?: Labels;
|
|
3649
|
+
/** The usage period of the entitlement. */
|
|
3650
|
+
usagePeriod?: RecurringPeriod;
|
|
3651
|
+
/** The current usage period of the entitlement. */
|
|
3652
|
+
currentUsagePeriod?: ClosedPeriod;
|
|
3653
|
+
/** The time from which the entitlement is active. */
|
|
3654
|
+
activeFrom: Date;
|
|
3655
|
+
/**
|
|
3656
|
+
* The time until which the entitlement is active. If not set, the entitlement is
|
|
3657
|
+
* active until deleted.
|
|
3658
|
+
*/
|
|
3659
|
+
activeTo?: Date;
|
|
3660
|
+
/** The time the entitlement was created. */
|
|
3661
|
+
createdAt: Date;
|
|
3662
|
+
/** The time the entitlement was last updated. */
|
|
3663
|
+
updatedAt: Date;
|
|
3664
|
+
/** The time the entitlement was deleted. */
|
|
3665
|
+
deletedAt?: Date;
|
|
3666
|
+
/**
|
|
3667
|
+
* The entitlement configuration as a JSON value. Returned when checking
|
|
3668
|
+
* entitlement access.
|
|
3669
|
+
*/
|
|
3670
|
+
config: unknown;
|
|
3671
|
+
}
|
|
3672
|
+
/** A boolean entitlement grants access to a feature. */
|
|
3673
|
+
export interface EntitlementBoolean {
|
|
3674
|
+
id: string;
|
|
3675
|
+
/** The type of the entitlement. */
|
|
3676
|
+
type: 'boolean';
|
|
3677
|
+
/** The feature the customer is entitled to use. */
|
|
3678
|
+
feature: FeatureReference;
|
|
3679
|
+
/** The customer the entitlement belongs to. */
|
|
3680
|
+
customer: CustomerReference;
|
|
3681
|
+
labels?: Labels;
|
|
3682
|
+
/** The usage period of the entitlement. */
|
|
3683
|
+
usagePeriod?: RecurringPeriod;
|
|
3684
|
+
/** The current usage period of the entitlement. */
|
|
3685
|
+
currentUsagePeriod?: ClosedPeriod;
|
|
3686
|
+
/** The time from which the entitlement is active. */
|
|
3687
|
+
activeFrom: Date;
|
|
3688
|
+
/**
|
|
3689
|
+
* The time until which the entitlement is active. If not set, the entitlement is
|
|
3690
|
+
* active until deleted.
|
|
3691
|
+
*/
|
|
3692
|
+
activeTo?: Date;
|
|
3693
|
+
/** The time the entitlement was created. */
|
|
3694
|
+
createdAt: Date;
|
|
3695
|
+
/** The time the entitlement was last updated. */
|
|
3696
|
+
updatedAt: Date;
|
|
3697
|
+
/** The time the entitlement was deleted. */
|
|
3698
|
+
deletedAt?: Date;
|
|
3699
|
+
}
|
|
3700
|
+
/**
|
|
3701
|
+
* A grant issued for a metered entitlement. Each grant adds its amount to the
|
|
3702
|
+
* entitlement's balance from its effective time until it expires, and usage is
|
|
3703
|
+
* deducted from the grants in priority order.
|
|
3704
|
+
*
|
|
3705
|
+
* Grants are immutable, so the balance is deterministic regardless of when it is
|
|
3706
|
+
* queried. Deleting a grant ends it at the time of the deletion.
|
|
3707
|
+
*/
|
|
3708
|
+
export interface EntitlementGrant {
|
|
3709
|
+
id: string;
|
|
3710
|
+
/** The ID of the entitlement the grant belongs to. */
|
|
3711
|
+
entitlementId: string;
|
|
3712
|
+
/** The granted amount, in the feature's unit. */
|
|
3713
|
+
amount: string;
|
|
3714
|
+
/**
|
|
3715
|
+
* The priority of the grant. Lower values are consumed first: a grant with
|
|
3716
|
+
* priority 1 is consumed before one with priority 2. Among equal priorities, the
|
|
3717
|
+
* grant closest to expiration is consumed first, then the earliest created.
|
|
3718
|
+
*/
|
|
3719
|
+
priority: number;
|
|
3720
|
+
/** The time the grant takes effect. */
|
|
3721
|
+
effectiveAt: Date;
|
|
3722
|
+
/**
|
|
3723
|
+
* The duration after which the grant expires, counted from `effective_at`. Always
|
|
3724
|
+
* a single-unit duration (for example `PT12H`, `P7D`, `P2W`, `P3M`, `P1Y`). Absent
|
|
3725
|
+
* when the grant never expires.
|
|
3726
|
+
*/
|
|
3727
|
+
expiresAfter?: string;
|
|
3129
3728
|
/**
|
|
3130
|
-
*
|
|
3131
|
-
*
|
|
3132
|
-
*
|
|
3729
|
+
* The time the grant expires, calculated from `effective_at` and `expires_after`.
|
|
3730
|
+
* The grant is no longer in effect from this time. Absent when the grant never
|
|
3731
|
+
* expires.
|
|
3133
3732
|
*/
|
|
3134
|
-
|
|
3135
|
-
/** Mapping to attribute metered usage to the customer by the event subject. */
|
|
3136
|
-
usageAttribution?: UpdateCustomerUsageAttribution;
|
|
3137
|
-
/** The billing address of the customer. Used for tax and invoicing. */
|
|
3138
|
-
billingAddress?: UpdateAddress;
|
|
3139
|
-
id: string;
|
|
3733
|
+
expiresAt?: Date;
|
|
3140
3734
|
/**
|
|
3141
|
-
*
|
|
3142
|
-
*
|
|
3143
|
-
* Omitted when the customer was created without a key. Unlike on the customer
|
|
3144
|
-
* resource itself, the key is optional here because the invoice snapshot may
|
|
3145
|
-
* predate or omit it.
|
|
3735
|
+
* The maximum balance the grant carries over at reset. The balance after a reset
|
|
3736
|
+
* is `MIN(max_rollover_amount, MAX(balance_before_reset, min_rollover_amount))`.
|
|
3146
3737
|
*/
|
|
3147
|
-
|
|
3148
|
-
}
|
|
3149
|
-
/** Checkout Session consent collection configuration. */
|
|
3150
|
-
export interface AppStripeCreateCheckoutSessionConsentCollection {
|
|
3151
|
-
/** Controls the visibility of payment method reuse agreement. */
|
|
3152
|
-
paymentMethodReuseAgreement?: AppStripeCreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement;
|
|
3738
|
+
maxRolloverAmount: string;
|
|
3153
3739
|
/**
|
|
3154
|
-
*
|
|
3155
|
-
*
|
|
3156
|
-
* Only available to US merchants. When set to "auto", Checkout determines whether
|
|
3157
|
-
* to show the option based on the customer's locale.
|
|
3740
|
+
* The minimum balance the grant carries over at reset. The balance after a reset
|
|
3741
|
+
* is `MIN(max_rollover_amount, MAX(balance_before_reset, min_rollover_amount))`.
|
|
3158
3742
|
*/
|
|
3159
|
-
|
|
3743
|
+
minRolloverAmount: string;
|
|
3160
3744
|
/**
|
|
3161
|
-
*
|
|
3162
|
-
*
|
|
3163
|
-
*
|
|
3745
|
+
* The recurrence of the grant. When set, the grant amount is re-issued every
|
|
3746
|
+
* interval from the anchor, which defaults to `effective_at`. Absent for
|
|
3747
|
+
* non-recurring grants.
|
|
3164
3748
|
*/
|
|
3165
|
-
|
|
3749
|
+
recurrence?: RecurringPeriod;
|
|
3750
|
+
/** The next time the grant recurs. Absent for non-recurring grants. */
|
|
3751
|
+
nextRecurrence?: Date;
|
|
3752
|
+
/**
|
|
3753
|
+
* The time the grant was voided. A voided grant is no longer in effect from this
|
|
3754
|
+
* time.
|
|
3755
|
+
*/
|
|
3756
|
+
voidedAt?: Date;
|
|
3757
|
+
labels?: Labels;
|
|
3758
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3759
|
+
createdAt: Date;
|
|
3760
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3761
|
+
updatedAt: Date;
|
|
3762
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3763
|
+
deletedAt?: Date;
|
|
3764
|
+
}
|
|
3765
|
+
/**
|
|
3766
|
+
* BillingWorkflowCollectionAlignmentAnchored specifies the alignment for
|
|
3767
|
+
* collecting the pending line items into an invoice.
|
|
3768
|
+
*/
|
|
3769
|
+
export interface WorkflowCollectionAlignmentAnchored {
|
|
3770
|
+
/** The type of alignment. */
|
|
3771
|
+
type: 'anchored';
|
|
3772
|
+
/** The recurring period for the alignment. */
|
|
3773
|
+
recurringPeriod: RecurringPeriod;
|
|
3166
3774
|
}
|
|
3167
3775
|
/**
|
|
3168
3776
|
* Add a new phase to the subscription. The phase is created without items; use
|
|
@@ -3174,15 +3782,33 @@ export interface SubscriptionEditAddPhase {
|
|
|
3174
3782
|
/** The phase to add. */
|
|
3175
3783
|
phase: SubscriptionPhaseCreate;
|
|
3176
3784
|
}
|
|
3177
|
-
/**
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
/**
|
|
3185
|
-
|
|
3785
|
+
/** Filters for the credit grant. */
|
|
3786
|
+
export interface CreateCreditGrantFilters {
|
|
3787
|
+
/**
|
|
3788
|
+
* Limit the credit grant to specific features. If no features are specified, the
|
|
3789
|
+
* credit grant can be used for any feature.
|
|
3790
|
+
*/
|
|
3791
|
+
features?: string[];
|
|
3792
|
+
/**
|
|
3793
|
+
* Limit credits to charges from these plans. Entries are alternatives; when
|
|
3794
|
+
* features are also specified, both dimensions must match. Omission or an empty
|
|
3795
|
+
* list leaves plans unrestricted.
|
|
3796
|
+
*/
|
|
3797
|
+
plans?: CreateCreditGrantPlanFilter[];
|
|
3798
|
+
}
|
|
3799
|
+
/** Filters for the credit grant. */
|
|
3800
|
+
export interface CreditGrantFilters {
|
|
3801
|
+
/**
|
|
3802
|
+
* Limit the credit grant to specific features. If no features are specified, the
|
|
3803
|
+
* credit grant can be used for any feature.
|
|
3804
|
+
*/
|
|
3805
|
+
features?: string[];
|
|
3806
|
+
/**
|
|
3807
|
+
* Limit credits to charges from these plans. Entries are alternatives; when
|
|
3808
|
+
* features are also specified, both dimensions must match. Omission or an empty
|
|
3809
|
+
* list leaves plans unrestricted.
|
|
3810
|
+
*/
|
|
3811
|
+
plans?: CreditGrantPlanFilter[];
|
|
3186
3812
|
}
|
|
3187
3813
|
/** Subscription fields without phases or the current billing period. */
|
|
3188
3814
|
export interface SubscriptionBase {
|
|
@@ -3463,6 +4089,11 @@ export interface EntitlementFeatureAccess {
|
|
|
3463
4089
|
*/
|
|
3464
4090
|
reason?: EntitlementFeatureAccessReason;
|
|
3465
4091
|
}
|
|
4092
|
+
/** Page paginated response. */
|
|
4093
|
+
export interface NotificationChannelPagePaginatedResponse {
|
|
4094
|
+
data: NotificationChannel[];
|
|
4095
|
+
meta: PaginatedMeta;
|
|
4096
|
+
}
|
|
3466
4097
|
/** Billing customer data. */
|
|
3467
4098
|
export interface CustomerData {
|
|
3468
4099
|
/**
|
|
@@ -3485,18 +4116,6 @@ export interface UpsertCustomerBillingDataRequest {
|
|
|
3485
4116
|
/** App customer data. */
|
|
3486
4117
|
appData?: AppCustomerData;
|
|
3487
4118
|
}
|
|
3488
|
-
/** The balances of the credits of a customer. */
|
|
3489
|
-
export interface CreditBalances {
|
|
3490
|
-
/** The timestamp of the balance retrieval. */
|
|
3491
|
-
retrievedAt: Date;
|
|
3492
|
-
/** The balances by currencies. */
|
|
3493
|
-
balances: CreditBalance[];
|
|
3494
|
-
}
|
|
3495
|
-
/** Cursor paginated response. */
|
|
3496
|
-
export interface CreditTransactionPaginatedResponse {
|
|
3497
|
-
data: CreditTransaction[];
|
|
3498
|
-
meta: CursorMeta;
|
|
3499
|
-
}
|
|
3500
4119
|
/**
|
|
3501
4120
|
* Flat fee intent fields from the system lifecycle controller shadowed by a manual
|
|
3502
4121
|
* override.
|
|
@@ -3540,7 +4159,7 @@ export interface ChargeFlatFeeSystemIntent {
|
|
|
3540
4159
|
/** List customer entitlement access response data. */
|
|
3541
4160
|
export interface ListCustomerEntitlementAccessResponseData {
|
|
3542
4161
|
/** The list of entitlement access results. */
|
|
3543
|
-
data:
|
|
4162
|
+
data: EntitlementValueResult[];
|
|
3544
4163
|
}
|
|
3545
4164
|
/**
|
|
3546
4165
|
* Graduated tiered price.
|
|
@@ -3762,6 +4381,18 @@ export interface WorkflowTaxSettings {
|
|
|
3762
4381
|
*/
|
|
3763
4382
|
defaultTaxConfig?: TaxConfig;
|
|
3764
4383
|
}
|
|
4384
|
+
/** The balances of the credits of a customer. */
|
|
4385
|
+
export interface CreditBalances {
|
|
4386
|
+
/** The timestamp of the balance retrieval. */
|
|
4387
|
+
retrievedAt: Date;
|
|
4388
|
+
/** The balances by currencies. */
|
|
4389
|
+
balances: CreditBalance[];
|
|
4390
|
+
}
|
|
4391
|
+
/** Cursor paginated response. */
|
|
4392
|
+
export interface CreditTransactionPaginatedResponse {
|
|
4393
|
+
data: CreditTransaction[];
|
|
4394
|
+
meta: CursorMeta;
|
|
4395
|
+
}
|
|
3765
4396
|
/** Page paginated response. */
|
|
3766
4397
|
export interface PlanAddonPagePaginatedResponse {
|
|
3767
4398
|
data: PlanAddon[];
|
|
@@ -3772,6 +4403,20 @@ export interface IngestedEventPaginatedResponse {
|
|
|
3772
4403
|
data: IngestedEvent[];
|
|
3773
4404
|
meta: CursorMeta;
|
|
3774
4405
|
}
|
|
4406
|
+
/** Balance and usage history of a metered entitlement. */
|
|
4407
|
+
export interface EntitlementHistory {
|
|
4408
|
+
/**
|
|
4409
|
+
* Usage in half-open windows of the requested size, aligned to the requested time
|
|
4410
|
+
* zone. Empty windows are included; windows before usage measurement began are
|
|
4411
|
+
* omitted.
|
|
4412
|
+
*/
|
|
4413
|
+
windowedHistory: EntitlementHistoryWindow[];
|
|
4414
|
+
/**
|
|
4415
|
+
* Periods in which grants were consumed in a fixed order. A new segment starts
|
|
4416
|
+
* whenever grant priorities change or a usage period starts.
|
|
4417
|
+
*/
|
|
4418
|
+
burndownHistory: EntitlementBurndownSegment[];
|
|
4419
|
+
}
|
|
3775
4420
|
/** The list of parameters that failed validation. */
|
|
3776
4421
|
export type InvalidParameters = InvalidParameter[];
|
|
3777
4422
|
/** A meter query request. */
|
|
@@ -3950,6 +4595,44 @@ export interface AppStripeCreateCheckoutSessionRequestOptions {
|
|
|
3950
4595
|
/** Configuration for collecting tax IDs during checkout. */
|
|
3951
4596
|
taxIdCollection?: AppStripeCreateCheckoutSessionTaxIdCollection;
|
|
3952
4597
|
}
|
|
4598
|
+
/** Metered entitlement create request. */
|
|
4599
|
+
export interface CreateEntitlementMeteredRequest {
|
|
4600
|
+
/** The type of the entitlement. */
|
|
4601
|
+
type: 'metered';
|
|
4602
|
+
/** The feature the customer is entitled to use. */
|
|
4603
|
+
feature: FeatureReference;
|
|
4604
|
+
labels?: Labels;
|
|
4605
|
+
/**
|
|
4606
|
+
* If true, the customer keeps access to the feature after the balance is
|
|
4607
|
+
* exhausted.
|
|
4608
|
+
*/
|
|
4609
|
+
isSoftLimit: boolean;
|
|
4610
|
+
/** Usage granted automatically after each reset. Cannot be combined with `grants`. */
|
|
4611
|
+
issue?: EntitlementIssueAfterReset;
|
|
4612
|
+
/** The amount granted automatically after each reset. */
|
|
4613
|
+
issueAfterReset?: string;
|
|
4614
|
+
/** The priority of the grant created after each reset. */
|
|
4615
|
+
issueAfterResetPriority: number;
|
|
4616
|
+
/** If true, the overage is preserved at reset. If false, the usage is reset to 0. */
|
|
4617
|
+
preserveOverageAtReset: boolean;
|
|
4618
|
+
/**
|
|
4619
|
+
* The usage period of the entitlement. The balance resets at the start of every
|
|
4620
|
+
* period. The anchor defaults to the entitlement creation time.
|
|
4621
|
+
*/
|
|
4622
|
+
usagePeriod: RecurringPeriodInput;
|
|
4623
|
+
/**
|
|
4624
|
+
* The time from which usage is measured. Defaults to the entitlement creation
|
|
4625
|
+
* time.
|
|
4626
|
+
*/
|
|
4627
|
+
measureUsageFrom?: EntitlementMeasureUsageFrom;
|
|
4628
|
+
/** Grants created together with the entitlement. Cannot be combined with `issue`. */
|
|
4629
|
+
grants?: EntitlementGrantCreateRequest[];
|
|
4630
|
+
}
|
|
4631
|
+
/** Page paginated response. */
|
|
4632
|
+
export interface EntitlementGrantPagePaginatedResponse {
|
|
4633
|
+
data: EntitlementGrant[];
|
|
4634
|
+
meta: PaginatedMeta;
|
|
4635
|
+
}
|
|
3953
4636
|
/** Snapshot of the billing workflow configuration captured at invoice creation. */
|
|
3954
4637
|
export interface InvoiceWorkflowSettings {
|
|
3955
4638
|
/** The apps that will be used to orchestrate the invoice's workflow. */
|
|
@@ -4428,7 +5111,7 @@ export interface CreateCreditGrantRequest {
|
|
|
4428
5111
|
* credit grant tax code is applied, if that's not set the global default taxcode
|
|
4429
5112
|
* is used.
|
|
4430
5113
|
*/
|
|
4431
|
-
taxConfig?:
|
|
5114
|
+
taxConfig?: CreateTaxCodeConfig;
|
|
4432
5115
|
filters?: CreateCreditGrantFilters;
|
|
4433
5116
|
/** Draw-down priority of the grant. Lower values have higher priority. */
|
|
4434
5117
|
priority: number;
|
|
@@ -4501,7 +5184,7 @@ export interface CreditGrant {
|
|
|
4501
5184
|
* credit grant tax code is applied, if that's not set the global default taxcode
|
|
4502
5185
|
* is used.
|
|
4503
5186
|
*/
|
|
4504
|
-
taxConfig?:
|
|
5187
|
+
taxConfig?: TaxCodeConfig;
|
|
4505
5188
|
/** Available when `funding_method` is `invoice`. */
|
|
4506
5189
|
invoice?: CreditGrantInvoiceReference;
|
|
4507
5190
|
filters?: CreditGrantFilters;
|
|
@@ -4616,6 +5299,11 @@ export interface CustomerStripeCreateCheckoutSessionRequest {
|
|
|
4616
5299
|
*/
|
|
4617
5300
|
stripeOptions: AppStripeCreateCheckoutSessionRequestOptions;
|
|
4618
5301
|
}
|
|
5302
|
+
/** Page paginated response. */
|
|
5303
|
+
export interface EntitlementPagePaginatedResponse {
|
|
5304
|
+
data: Entitlement[];
|
|
5305
|
+
meta: PaginatedMeta;
|
|
5306
|
+
}
|
|
4619
5307
|
/**
|
|
4620
5308
|
* Workflow collection specifies how to collect the pending line items for an
|
|
4621
5309
|
* invoice.
|
|
@@ -4775,7 +5463,7 @@ export interface RateCard {
|
|
|
4775
5463
|
/** The discounts of the rate card. */
|
|
4776
5464
|
discounts?: RateCardDiscounts;
|
|
4777
5465
|
/** The tax config of the rate card. */
|
|
4778
|
-
taxConfig?:
|
|
5466
|
+
taxConfig?: TaxCodeConfig;
|
|
4779
5467
|
/**
|
|
4780
5468
|
* The entitlement template granted to subscribers of a plan or addon containing
|
|
4781
5469
|
* this rate card. Requires `feature` to be set.
|
|
@@ -4787,7 +5475,7 @@ export interface InvoiceLineRateCard {
|
|
|
4787
5475
|
/** The price definition used to calculate charges for this line. */
|
|
4788
5476
|
price: Price;
|
|
4789
5477
|
/** Tax configuration snapshot for this line. */
|
|
4790
|
-
taxConfig?:
|
|
5478
|
+
taxConfig?: TaxCodeConfig;
|
|
4791
5479
|
/** The feature key associated with this line's rate card. */
|
|
4792
5480
|
featureKey?: string;
|
|
4793
5481
|
/** Discount configuration from the rate card. */
|
|
@@ -4927,7 +5615,7 @@ export interface UpdateInvoiceLineRateCard {
|
|
|
4927
5615
|
/** The price definition used to calculate charges for this line. */
|
|
4928
5616
|
price: UpdatePrice;
|
|
4929
5617
|
/** Tax configuration snapshot for this line. */
|
|
4930
|
-
taxConfig?:
|
|
5618
|
+
taxConfig?: UpdateTaxCodeConfig;
|
|
4931
5619
|
/** The feature key associated with this line's rate card. */
|
|
4932
5620
|
featureKey?: string;
|
|
4933
5621
|
/** Discount configuration from the rate card. */
|
|
@@ -6309,6 +6997,11 @@ export type MeterAggregation = 'sum' | 'count' | 'unique_count' | 'avg' | 'min'
|
|
|
6309
6997
|
* format.
|
|
6310
6998
|
*/
|
|
6311
6999
|
export type MeterQueryGranularity = 'PT1M' | 'PT1H' | 'P1D' | 'P1M';
|
|
7000
|
+
/**
|
|
7001
|
+
* The meter query granularities the usage history can be grouped into. Sub-hour
|
|
7002
|
+
* windows are too expensive to compute and monthly windows are not supported.
|
|
7003
|
+
*/
|
|
7004
|
+
export type EntitlementHistoryWindowSize = 'PT1H' | 'P1D';
|
|
6312
7005
|
/**
|
|
6313
7006
|
* Filters on the given string field value by exact match. All properties are
|
|
6314
7007
|
* optional; provide exactly one to specify the comparison.
|
|
@@ -6320,6 +7013,10 @@ export type StringFieldFilterExact = string | {
|
|
|
6320
7013
|
};
|
|
6321
7014
|
/** The payment term of a flat price. */
|
|
6322
7015
|
export type PricePaymentTerm = 'in_advance' | 'in_arrears';
|
|
7016
|
+
/** Filter by a boolean value (true/false). */
|
|
7017
|
+
export type BooleanFieldFilter = boolean | {
|
|
7018
|
+
eq: boolean;
|
|
7019
|
+
};
|
|
6323
7020
|
/** Fiat or custom currency code. */
|
|
6324
7021
|
export type BillingCurrencyCode = string | string;
|
|
6325
7022
|
/** Fiat or custom currency code. */
|
|
@@ -6344,6 +7041,8 @@ export type DateTimeFieldFilter = Date | {
|
|
|
6344
7041
|
gt?: Date;
|
|
6345
7042
|
gte?: Date;
|
|
6346
7043
|
};
|
|
7044
|
+
/** The time from which usage is measured, as a preset or an explicit timestamp. */
|
|
7045
|
+
export type EntitlementMeasureUsageFrom = 'current_period_start' | 'now' | Date;
|
|
6347
7046
|
/** Payment settings for a billing workflow. */
|
|
6348
7047
|
export type WorkflowPaymentSettings = WorkflowPaymentChargeAutomaticallySettings | WorkflowPaymentSendInvoiceSettings;
|
|
6349
7048
|
/**
|
|
@@ -6399,6 +7098,8 @@ export type ChargeRealizationDetailedLine = ChargeRealizationDetailedLineFlatFee
|
|
|
6399
7098
|
export type Currency = CurrencyFiat | CurrencyCustom;
|
|
6400
7099
|
/** Customer or reference. */
|
|
6401
7100
|
export type CustomerOrReference = Customer | CustomerReference;
|
|
7101
|
+
/** An entitlement grants a customer access to a feature. */
|
|
7102
|
+
export type Entitlement = EntitlementMetered | EntitlementStatic | EntitlementBoolean;
|
|
6402
7103
|
/**
|
|
6403
7104
|
* The alignment for collecting the pending line items into an invoice.
|
|
6404
7105
|
*
|
|
@@ -6418,6 +7119,8 @@ export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVo
|
|
|
6418
7119
|
export type PriceUsageBased = PriceUnit | PriceGraduated | PriceVolume;
|
|
6419
7120
|
/** Price. */
|
|
6420
7121
|
export type UpdatePrice = UpdatePriceFree | UpdatePriceFlat | UpdatePriceUnit | UpdatePriceGraduated | UpdatePriceVolume;
|
|
7122
|
+
/** Entitlement create request. */
|
|
7123
|
+
export type CreateEntitlementRequest = CreateEntitlementMeteredRequest | CreateEntitlementStaticRequest | CreateEntitlementBooleanRequest;
|
|
6421
7124
|
/** Installed application. */
|
|
6422
7125
|
export type App = AppStripe | AppSandbox | AppExternalInvoicing;
|
|
6423
7126
|
/** Response of the app install. */
|
|
@@ -6546,6 +7249,19 @@ export interface UpdateBillingWorkflowPaymentSendInvoiceSettingsInput {
|
|
|
6546
7249
|
*/
|
|
6547
7250
|
dueAfter?: string;
|
|
6548
7251
|
}
|
|
7252
|
+
/**
|
|
7253
|
+
* Usage granted automatically after each reset of a metered entitlement. The
|
|
7254
|
+
* balance returns to `amount` after every reset.
|
|
7255
|
+
*/
|
|
7256
|
+
export interface EntitlementIssueAfterResetInput {
|
|
7257
|
+
/** The amount granted after each reset, in the feature's unit. */
|
|
7258
|
+
amount: string;
|
|
7259
|
+
/**
|
|
7260
|
+
* The priority of the grant created after each reset. Lower values have higher
|
|
7261
|
+
* priority.
|
|
7262
|
+
*/
|
|
7263
|
+
priority?: number;
|
|
7264
|
+
}
|
|
6549
7265
|
/** Metering event following the CloudEvents specification. */
|
|
6550
7266
|
export interface EventInput {
|
|
6551
7267
|
/** Identifies the event. */
|
|
@@ -6576,6 +7292,24 @@ export interface EventInput {
|
|
|
6576
7292
|
/** The event payload. Optional, if present it must be a JSON object. */
|
|
6577
7293
|
data?: Record<string, unknown> | null;
|
|
6578
7294
|
}
|
|
7295
|
+
/** Request body for resetting the usage of a metered entitlement. */
|
|
7296
|
+
export interface ResetCustomerEntitlementUsageRequestInput {
|
|
7297
|
+
/**
|
|
7298
|
+
* The time the reset takes effect. Defaults to the current time and cannot be in
|
|
7299
|
+
* the future. Truncated to the minute.
|
|
7300
|
+
*/
|
|
7301
|
+
effectiveAt?: Date;
|
|
7302
|
+
/**
|
|
7303
|
+
* Whether the usage period anchor is kept. When false, the anchor moves to
|
|
7304
|
+
* `effective_at`.
|
|
7305
|
+
*/
|
|
7306
|
+
retainAnchor?: boolean;
|
|
7307
|
+
/**
|
|
7308
|
+
* Whether overage carries over into the new usage period. Defaults to the
|
|
7309
|
+
* entitlement's own setting.
|
|
7310
|
+
*/
|
|
7311
|
+
preserveOverage?: boolean;
|
|
7312
|
+
}
|
|
6579
7313
|
/** Unauthorized. */
|
|
6580
7314
|
export interface UnauthorizedInput extends BaseErrorInput {
|
|
6581
7315
|
}
|
|
@@ -6762,6 +7496,120 @@ export interface EntitlementAccessQueryRequestInput {
|
|
|
6762
7496
|
customer: EntitlementAccessQueryRequestCustomers;
|
|
6763
7497
|
feature?: EntitlementAccessQueryRequestFeatures;
|
|
6764
7498
|
}
|
|
7499
|
+
/**
|
|
7500
|
+
* A notification channel delivers notification events, such as entitlement balance
|
|
7501
|
+
* threshold crossings, to an external system. Today the only supported channel
|
|
7502
|
+
* type is a webhook delivered via Svix.
|
|
7503
|
+
*/
|
|
7504
|
+
export interface NotificationChannelInput {
|
|
7505
|
+
id: string;
|
|
7506
|
+
/**
|
|
7507
|
+
* Display name of the resource.
|
|
7508
|
+
*
|
|
7509
|
+
* Between 1 and 256 characters.
|
|
7510
|
+
*/
|
|
7511
|
+
name: string;
|
|
7512
|
+
labels?: Labels;
|
|
7513
|
+
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
7514
|
+
createdAt: Date;
|
|
7515
|
+
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
7516
|
+
updatedAt: Date;
|
|
7517
|
+
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
7518
|
+
deletedAt?: Date;
|
|
7519
|
+
/** The type of the channel. Immutable after creation. */
|
|
7520
|
+
type: 'webhook';
|
|
7521
|
+
/**
|
|
7522
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7523
|
+
* events.
|
|
7524
|
+
*/
|
|
7525
|
+
disabled?: boolean;
|
|
7526
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7527
|
+
url: string;
|
|
7528
|
+
/**
|
|
7529
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7530
|
+
* header name.
|
|
7531
|
+
*/
|
|
7532
|
+
customHeaders?: Record<string, string>;
|
|
7533
|
+
/**
|
|
7534
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7535
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7536
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7537
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7538
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7539
|
+
*/
|
|
7540
|
+
signingSecret?: string;
|
|
7541
|
+
}
|
|
7542
|
+
/** NotificationChannel create request. */
|
|
7543
|
+
export interface CreateNotificationChannelRequestInput {
|
|
7544
|
+
/**
|
|
7545
|
+
* Display name of the resource.
|
|
7546
|
+
*
|
|
7547
|
+
* Between 1 and 256 characters.
|
|
7548
|
+
*/
|
|
7549
|
+
name: string;
|
|
7550
|
+
labels?: Labels;
|
|
7551
|
+
/** The type of the channel. Immutable after creation. */
|
|
7552
|
+
type: 'webhook';
|
|
7553
|
+
/**
|
|
7554
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7555
|
+
* events.
|
|
7556
|
+
*/
|
|
7557
|
+
disabled?: boolean;
|
|
7558
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7559
|
+
url: string;
|
|
7560
|
+
/**
|
|
7561
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7562
|
+
* header name.
|
|
7563
|
+
*/
|
|
7564
|
+
customHeaders?: Record<string, string>;
|
|
7565
|
+
/**
|
|
7566
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7567
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7568
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7569
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7570
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7571
|
+
*/
|
|
7572
|
+
signingSecret?: string;
|
|
7573
|
+
}
|
|
7574
|
+
/**
|
|
7575
|
+
* Request body for updating a notification channel. Updates replace the channel's
|
|
7576
|
+
* mutable state rather than merging it: `type`, `name`, and `url` must always be
|
|
7577
|
+
* provided, and omitting `disabled`, `labels`, or `custom_headers` resets them to
|
|
7578
|
+
* their defaults (enabled, no labels, no custom headers). `signing_secret` is the
|
|
7579
|
+
* one exception: omitting it keeps the channel's current signing secret instead of
|
|
7580
|
+
* clearing the credential.
|
|
7581
|
+
*/
|
|
7582
|
+
export interface UpdateNotificationChannelRequestInput {
|
|
7583
|
+
/**
|
|
7584
|
+
* Display name of the resource.
|
|
7585
|
+
*
|
|
7586
|
+
* Between 1 and 256 characters.
|
|
7587
|
+
*/
|
|
7588
|
+
name: string;
|
|
7589
|
+
/** The type of the channel. Immutable after creation. */
|
|
7590
|
+
type: 'webhook';
|
|
7591
|
+
/** The URL that webhook notification events are delivered to. */
|
|
7592
|
+
url: string;
|
|
7593
|
+
labels?: Labels;
|
|
7594
|
+
/**
|
|
7595
|
+
* Whether the channel is disabled. Disabled channels do not receive notification
|
|
7596
|
+
* events.
|
|
7597
|
+
*/
|
|
7598
|
+
disabled?: boolean;
|
|
7599
|
+
/**
|
|
7600
|
+
* Custom HTTP headers to include on every webhook delivery request, keyed by
|
|
7601
|
+
* header name.
|
|
7602
|
+
*/
|
|
7603
|
+
customHeaders?: Record<string, string>;
|
|
7604
|
+
/**
|
|
7605
|
+
* Secret used to sign outgoing webhook payloads so recipients can verify their
|
|
7606
|
+
* authenticity. If omitted on create, a secret is generated automatically by the
|
|
7607
|
+
* delivery provider. This is a sensitive credential returned in responses (unlike
|
|
7608
|
+
* most secrets) specifically so clients can retrieve a server-generated value and
|
|
7609
|
+
* verify webhook signatures; handle it with the same care as any other credential.
|
|
7610
|
+
*/
|
|
7611
|
+
signingSecret?: string;
|
|
7612
|
+
}
|
|
6765
7613
|
/** An ingested metering event with ingestion metadata. */
|
|
6766
7614
|
export interface IngestedEventInput {
|
|
6767
7615
|
/** The original event ingested. */
|
|
@@ -6775,6 +7623,58 @@ export interface IngestedEventInput {
|
|
|
6775
7623
|
/** The validation errors of the ingested event. */
|
|
6776
7624
|
validationErrors?: IngestedEventValidationError[];
|
|
6777
7625
|
}
|
|
7626
|
+
/**
|
|
7627
|
+
* A metered entitlement grants a usage allowance for a feature. Access is
|
|
7628
|
+
* determined by the balance: the allowance provided by grants is burnt down by
|
|
7629
|
+
* usage.
|
|
7630
|
+
*/
|
|
7631
|
+
export interface EntitlementMeteredInput {
|
|
7632
|
+
id: string;
|
|
7633
|
+
/** The type of the entitlement. */
|
|
7634
|
+
type: 'metered';
|
|
7635
|
+
/** The feature the customer is entitled to use. */
|
|
7636
|
+
feature: FeatureReference;
|
|
7637
|
+
/** The customer the entitlement belongs to. */
|
|
7638
|
+
customer: CustomerReference;
|
|
7639
|
+
labels?: Labels;
|
|
7640
|
+
/** The time from which the entitlement is active. */
|
|
7641
|
+
activeFrom: Date;
|
|
7642
|
+
/**
|
|
7643
|
+
* The time until which the entitlement is active. If not set, the entitlement is
|
|
7644
|
+
* active until deleted.
|
|
7645
|
+
*/
|
|
7646
|
+
activeTo?: Date;
|
|
7647
|
+
/** The time the entitlement was created. */
|
|
7648
|
+
createdAt: Date;
|
|
7649
|
+
/** The time the entitlement was last updated. */
|
|
7650
|
+
updatedAt: Date;
|
|
7651
|
+
/** The time the entitlement was deleted. */
|
|
7652
|
+
deletedAt?: Date;
|
|
7653
|
+
/**
|
|
7654
|
+
* The usage period of the entitlement. The balance resets at the start of every
|
|
7655
|
+
* period.
|
|
7656
|
+
*/
|
|
7657
|
+
usagePeriod: RecurringPeriod;
|
|
7658
|
+
/** The current usage period of the entitlement. */
|
|
7659
|
+
currentUsagePeriod: ClosedPeriod;
|
|
7660
|
+
/**
|
|
7661
|
+
* If true, the customer keeps access to the feature after the balance is
|
|
7662
|
+
* exhausted.
|
|
7663
|
+
*/
|
|
7664
|
+
isSoftLimit?: boolean;
|
|
7665
|
+
/** Usage granted automatically after each reset. Cannot be combined with `grants`. */
|
|
7666
|
+
issue?: EntitlementIssueAfterResetInput;
|
|
7667
|
+
/** The amount granted automatically after each reset. */
|
|
7668
|
+
issueAfterReset?: string;
|
|
7669
|
+
/** The priority of the grant created after each reset. */
|
|
7670
|
+
issueAfterResetPriority?: number;
|
|
7671
|
+
/** If true, the overage is preserved at reset. If false, the usage is reset to 0. */
|
|
7672
|
+
preserveOverageAtReset?: boolean;
|
|
7673
|
+
/** The time from which usage is measured. */
|
|
7674
|
+
measureUsageFrom: Date;
|
|
7675
|
+
/** The time of the last reset. */
|
|
7676
|
+
lastReset: Date;
|
|
7677
|
+
}
|
|
6778
7678
|
/** Subscription fields without phases or the current billing period. */
|
|
6779
7679
|
export interface SubscriptionBaseInput {
|
|
6780
7680
|
id: string;
|
|
@@ -6906,6 +7806,11 @@ export interface UpdateBillingInvoiceWorkflowInput {
|
|
|
6906
7806
|
/** Payment settings for this invoice. */
|
|
6907
7807
|
payment?: UpdateBillingWorkflowPaymentSettingsInput;
|
|
6908
7808
|
}
|
|
7809
|
+
/** Page paginated response. */
|
|
7810
|
+
export interface NotificationChannelPagePaginatedResponseInput {
|
|
7811
|
+
data: NotificationChannelInput[];
|
|
7812
|
+
meta: PaginatedMeta;
|
|
7813
|
+
}
|
|
6909
7814
|
/** Purchase and payment terms of the grant. */
|
|
6910
7815
|
export interface CreateCreditGrantPurchaseInput {
|
|
6911
7816
|
/**
|
|
@@ -7130,6 +8035,39 @@ export interface AppStripeCreateCheckoutSessionRequestOptionsInput {
|
|
|
7130
8035
|
/** Configuration for collecting tax IDs during checkout. */
|
|
7131
8036
|
taxIdCollection?: AppStripeCreateCheckoutSessionTaxIdCollectionInput;
|
|
7132
8037
|
}
|
|
8038
|
+
/** Metered entitlement create request. */
|
|
8039
|
+
export interface CreateEntitlementMeteredRequestInput {
|
|
8040
|
+
/** The type of the entitlement. */
|
|
8041
|
+
type: 'metered';
|
|
8042
|
+
/** The feature the customer is entitled to use. */
|
|
8043
|
+
feature: FeatureReference;
|
|
8044
|
+
labels?: Labels;
|
|
8045
|
+
/**
|
|
8046
|
+
* If true, the customer keeps access to the feature after the balance is
|
|
8047
|
+
* exhausted.
|
|
8048
|
+
*/
|
|
8049
|
+
isSoftLimit?: boolean;
|
|
8050
|
+
/** Usage granted automatically after each reset. Cannot be combined with `grants`. */
|
|
8051
|
+
issue?: EntitlementIssueAfterResetInput;
|
|
8052
|
+
/** The amount granted automatically after each reset. */
|
|
8053
|
+
issueAfterReset?: string;
|
|
8054
|
+
/** The priority of the grant created after each reset. */
|
|
8055
|
+
issueAfterResetPriority?: number;
|
|
8056
|
+
/** If true, the overage is preserved at reset. If false, the usage is reset to 0. */
|
|
8057
|
+
preserveOverageAtReset?: boolean;
|
|
8058
|
+
/**
|
|
8059
|
+
* The usage period of the entitlement. The balance resets at the start of every
|
|
8060
|
+
* period. The anchor defaults to the entitlement creation time.
|
|
8061
|
+
*/
|
|
8062
|
+
usagePeriod: RecurringPeriodInput;
|
|
8063
|
+
/**
|
|
8064
|
+
* The time from which usage is measured. Defaults to the entitlement creation
|
|
8065
|
+
* time.
|
|
8066
|
+
*/
|
|
8067
|
+
measureUsageFrom?: EntitlementMeasureUsageFrom;
|
|
8068
|
+
/** Grants created together with the entitlement. Cannot be combined with `issue`. */
|
|
8069
|
+
grants?: EntitlementGrantCreateRequest[];
|
|
8070
|
+
}
|
|
7133
8071
|
/** Snapshot of the billing workflow configuration captured at invoice creation. */
|
|
7134
8072
|
export interface InvoiceWorkflowSettingsInput {
|
|
7135
8073
|
/** The apps that will be used to orchestrate the invoice's workflow. */
|
|
@@ -7238,7 +8176,7 @@ export interface CreateCreditGrantRequestInput {
|
|
|
7238
8176
|
* credit grant tax code is applied, if that's not set the global default taxcode
|
|
7239
8177
|
* is used.
|
|
7240
8178
|
*/
|
|
7241
|
-
taxConfig?:
|
|
8179
|
+
taxConfig?: CreateTaxCodeConfig;
|
|
7242
8180
|
filters?: CreateCreditGrantFilters;
|
|
7243
8181
|
/** Draw-down priority of the grant. Lower values have higher priority. */
|
|
7244
8182
|
priority?: number;
|
|
@@ -7311,7 +8249,7 @@ export interface CreditGrantInput {
|
|
|
7311
8249
|
* credit grant tax code is applied, if that's not set the global default taxcode
|
|
7312
8250
|
* is used.
|
|
7313
8251
|
*/
|
|
7314
|
-
taxConfig?:
|
|
8252
|
+
taxConfig?: TaxCodeConfig;
|
|
7315
8253
|
/** Available when `funding_method` is `invoice`. */
|
|
7316
8254
|
invoice?: CreditGrantInvoiceReference;
|
|
7317
8255
|
filters?: CreditGrantFilters;
|
|
@@ -7370,6 +8308,11 @@ export interface CustomerStripeCreateCheckoutSessionRequestInput {
|
|
|
7370
8308
|
*/
|
|
7371
8309
|
stripeOptions: AppStripeCreateCheckoutSessionRequestOptionsInput;
|
|
7372
8310
|
}
|
|
8311
|
+
/** Page paginated response. */
|
|
8312
|
+
export interface EntitlementPagePaginatedResponseInput {
|
|
8313
|
+
data: EntitlementInput[];
|
|
8314
|
+
meta: PaginatedMeta;
|
|
8315
|
+
}
|
|
7373
8316
|
/**
|
|
7374
8317
|
* Workflow collection specifies how to collect the pending line items for an
|
|
7375
8318
|
* invoice.
|
|
@@ -7517,7 +8460,7 @@ export interface RateCardInput {
|
|
|
7517
8460
|
/** The discounts of the rate card. */
|
|
7518
8461
|
discounts?: RateCardDiscounts;
|
|
7519
8462
|
/** The tax config of the rate card. */
|
|
7520
|
-
taxConfig?:
|
|
8463
|
+
taxConfig?: TaxCodeConfig;
|
|
7521
8464
|
/**
|
|
7522
8465
|
* The entitlement template granted to subscribers of a plan or addon containing
|
|
7523
8466
|
* this rate card. Requires `feature` to be set.
|
|
@@ -7529,7 +8472,7 @@ export interface InvoiceLineRateCardInput {
|
|
|
7529
8472
|
/** The price definition used to calculate charges for this line. */
|
|
7530
8473
|
price: Price;
|
|
7531
8474
|
/** Tax configuration snapshot for this line. */
|
|
7532
|
-
taxConfig?:
|
|
8475
|
+
taxConfig?: TaxCodeConfig;
|
|
7533
8476
|
/** The feature key associated with this line's rate card. */
|
|
7534
8477
|
featureKey?: string;
|
|
7535
8478
|
/** Discount configuration from the rate card. */
|
|
@@ -8965,6 +9908,10 @@ export type UpdateBillingWorkflowPaymentSettingsInput = UpdateBillingWorkflowPay
|
|
|
8965
9908
|
* rate card itself, so it is omitted here.
|
|
8966
9909
|
*/
|
|
8967
9910
|
export type RateCardEntitlementInput = RateCardMeteredEntitlementInput | RateCardStaticEntitlement | RateCardBooleanEntitlement;
|
|
9911
|
+
/** An entitlement grants a customer access to a feature. */
|
|
9912
|
+
export type EntitlementInput = EntitlementMeteredInput | EntitlementStatic | EntitlementBoolean;
|
|
9913
|
+
/** Entitlement create request. */
|
|
9914
|
+
export type CreateEntitlementRequestInput = CreateEntitlementMeteredRequestInput | CreateEntitlementStaticRequest | CreateEntitlementBooleanRequest;
|
|
8968
9915
|
/** ChargeRealizationInvoice or reference. */
|
|
8969
9916
|
export type ChargeRealizationInvoiceOrReferenceInput = ChargeRealizationInvoiceInput | ChargeRealizationInvoiceReference;
|
|
8970
9917
|
/** Customer charge. */
|