@openmeter/client 1.0.0-beta-fda362f409dd → 1.0.0-beta-d8b5c0006ffd
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 +1 -0
- package/dist/funcs/customers.d.ts +2 -1
- package/dist/funcs/customers.js +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/models/operations/customers.d.ts +8 -1
- package/dist/models/operations/subscriptions.d.ts +3 -3
- package/dist/models/schemas.d.ts +1089 -408
- package/dist/models/schemas.js +93 -16
- package/dist/models/types.d.ts +87 -85
- package/dist/sdk/customers.d.ts +2 -1
- package/dist/sdk/customers.js +4 -1
- package/package.json +1 -1
package/dist/models/schemas.js
CHANGED
|
@@ -423,11 +423,6 @@ export const resourceManagedBy = z
|
|
|
423
423
|
export const chargeStatus = z
|
|
424
424
|
.enum(['created', 'active', 'final', 'deleted'])
|
|
425
425
|
.describe('Lifecycle status of a charge. Values: - `created`: The charge has been created but is not active yet. - `active`: The charge is active. - `final`: The charge is fully finalized and no further changes are expected. - `deleted`: The charge has been deleted.');
|
|
426
|
-
export const priceFree = z
|
|
427
|
-
.object({
|
|
428
|
-
type: z.literal('free').describe('The type of the price.'),
|
|
429
|
-
})
|
|
430
|
-
.describe('Free price.');
|
|
431
426
|
export const settlementMode = z
|
|
432
427
|
.enum(['credit_then_invoice', 'credit_only'])
|
|
433
428
|
.describe('Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits.');
|
|
@@ -463,6 +458,11 @@ export const flatFeeDiscounts = z
|
|
|
463
458
|
export const rateCardProrationMode = z
|
|
464
459
|
.enum(['no_proration', 'prorate_prices'])
|
|
465
460
|
.describe('The proration mode of the rate card. Values: - `no_proration`: No proration. - `prorate_prices`: Prorate the price based on the time remaining in the billing period.');
|
|
461
|
+
export const priceFree = z
|
|
462
|
+
.object({
|
|
463
|
+
type: z.literal('free').describe('The type of the price.'),
|
|
464
|
+
})
|
|
465
|
+
.describe('Free price.');
|
|
466
466
|
export const subscriptionStatus = z
|
|
467
467
|
.enum(['active', 'inactive', 'canceled', 'scheduled'])
|
|
468
468
|
.describe('Subscription status.');
|
|
@@ -889,6 +889,12 @@ export const listCostBasesParamsFilter = z
|
|
|
889
889
|
fiat_code: currencyCode.optional(),
|
|
890
890
|
})
|
|
891
891
|
.describe('Filter options for listing cost bases.');
|
|
892
|
+
export const currencyAmount = z
|
|
893
|
+
.object({
|
|
894
|
+
amount: numeric,
|
|
895
|
+
currency: currencyCode,
|
|
896
|
+
})
|
|
897
|
+
.describe('Monetary amount in a specific currency.');
|
|
892
898
|
export const priceFlat = z
|
|
893
899
|
.object({
|
|
894
900
|
type: z.literal('flat').describe('The type of the price.'),
|
|
@@ -901,12 +907,6 @@ export const priceUnit = z
|
|
|
901
907
|
amount: numeric,
|
|
902
908
|
})
|
|
903
909
|
.describe('Unit price. Charges a fixed rate per billing unit. When UnitConfig is present on the rate card, billing units are the converted quantities (e.g. GB instead of bytes).');
|
|
904
|
-
export const currencyAmount = z
|
|
905
|
-
.object({
|
|
906
|
-
amount: numeric,
|
|
907
|
-
currency: currencyCode,
|
|
908
|
-
})
|
|
909
|
-
.describe('Monetary amount in a specific currency.');
|
|
910
910
|
export const rateCardDiscounts = z
|
|
911
911
|
.object({
|
|
912
912
|
percentage: z
|
|
@@ -1774,7 +1774,7 @@ export const listPlansParamsFilter = z
|
|
|
1774
1774
|
export const subscriptionCreate = z
|
|
1775
1775
|
.object({
|
|
1776
1776
|
labels: labels.optional(),
|
|
1777
|
-
settlement_mode: settlementMode.optional()
|
|
1777
|
+
settlement_mode: settlementMode.optional(),
|
|
1778
1778
|
customer: z
|
|
1779
1779
|
.object({
|
|
1780
1780
|
id: ulid.optional(),
|
|
@@ -1811,7 +1811,7 @@ export const subscription = z
|
|
|
1811
1811
|
plan_id: ulid.optional(),
|
|
1812
1812
|
billing_anchor: dateTime,
|
|
1813
1813
|
status: subscriptionStatus,
|
|
1814
|
-
settlement_mode: settlementMode.optional()
|
|
1814
|
+
settlement_mode: settlementMode.optional(),
|
|
1815
1815
|
})
|
|
1816
1816
|
.describe('Subscription.');
|
|
1817
1817
|
export const subscriptionEditTiming = z
|
|
@@ -2485,7 +2485,7 @@ export const subscriptionCancel = z
|
|
|
2485
2485
|
export const subscriptionChange = z
|
|
2486
2486
|
.object({
|
|
2487
2487
|
labels: labels.optional(),
|
|
2488
|
-
settlement_mode: settlementMode.optional()
|
|
2488
|
+
settlement_mode: settlementMode.optional(),
|
|
2489
2489
|
customer: z
|
|
2490
2490
|
.object({
|
|
2491
2491
|
id: ulid.optional(),
|
|
@@ -2794,6 +2794,41 @@ export const creditGrant = z
|
|
|
2794
2794
|
status: creditGrantStatus,
|
|
2795
2795
|
})
|
|
2796
2796
|
.describe('A credit grant allocates credits to a customer. Credits are drawn down against charges according to the settlement mode configured on the rate card.');
|
|
2797
|
+
export const createFlatFeeChargeRequest = z
|
|
2798
|
+
.object({
|
|
2799
|
+
name: z
|
|
2800
|
+
.string()
|
|
2801
|
+
.min(1)
|
|
2802
|
+
.max(256)
|
|
2803
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
2804
|
+
description: z
|
|
2805
|
+
.string()
|
|
2806
|
+
.max(1024)
|
|
2807
|
+
.optional()
|
|
2808
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
2809
|
+
labels: labels.optional(),
|
|
2810
|
+
type: z.literal('flat_fee').describe('The type of the charge.'),
|
|
2811
|
+
currency: currencyCode,
|
|
2812
|
+
invoice_at: dateTime,
|
|
2813
|
+
service_period: closedPeriod,
|
|
2814
|
+
unique_reference_id: z
|
|
2815
|
+
.string()
|
|
2816
|
+
.optional()
|
|
2817
|
+
.describe('Unique reference ID of the charge.'),
|
|
2818
|
+
settlement_mode: settlementMode,
|
|
2819
|
+
tax_config: taxConfig.optional(),
|
|
2820
|
+
payment_term: pricePaymentTerm,
|
|
2821
|
+
discounts: flatFeeDiscounts.optional(),
|
|
2822
|
+
feature_key: z
|
|
2823
|
+
.string()
|
|
2824
|
+
.optional()
|
|
2825
|
+
.describe('The feature associated with the charge, when applicable.'),
|
|
2826
|
+
proration_configuration: rateCardProrationConfiguration,
|
|
2827
|
+
amount_before_proration: currencyAmount,
|
|
2828
|
+
full_service_period: closedPeriod.optional(),
|
|
2829
|
+
billing_period: closedPeriod.optional(),
|
|
2830
|
+
})
|
|
2831
|
+
.describe('Flat fee charge create request.');
|
|
2797
2832
|
export const workflowTaxSettings = z
|
|
2798
2833
|
.object({
|
|
2799
2834
|
enabled: z
|
|
@@ -3088,7 +3123,6 @@ export const flatFeeCharge = z
|
|
|
3088
3123
|
full_service_period: closedPeriod,
|
|
3089
3124
|
billing_period: closedPeriod,
|
|
3090
3125
|
advance_after: dateTime.optional(),
|
|
3091
|
-
price: price,
|
|
3092
3126
|
unique_reference_id: z
|
|
3093
3127
|
.string()
|
|
3094
3128
|
.optional()
|
|
@@ -3102,7 +3136,9 @@ export const flatFeeCharge = z
|
|
|
3102
3136
|
.optional()
|
|
3103
3137
|
.describe('The feature associated with the charge, when applicable.'),
|
|
3104
3138
|
proration_configuration: rateCardProrationConfiguration,
|
|
3139
|
+
amount_before_proration: currencyAmount,
|
|
3105
3140
|
amount_after_proration: currencyAmount,
|
|
3141
|
+
price: price,
|
|
3106
3142
|
})
|
|
3107
3143
|
.describe('A flat fee charge for a customer.');
|
|
3108
3144
|
export const usageBasedCharge = z
|
|
@@ -3133,7 +3169,6 @@ export const usageBasedCharge = z
|
|
|
3133
3169
|
full_service_period: closedPeriod,
|
|
3134
3170
|
billing_period: closedPeriod,
|
|
3135
3171
|
advance_after: dateTime.optional(),
|
|
3136
|
-
price: price,
|
|
3137
3172
|
unique_reference_id: z
|
|
3138
3173
|
.string()
|
|
3139
3174
|
.optional()
|
|
@@ -3143,8 +3178,39 @@ export const usageBasedCharge = z
|
|
|
3143
3178
|
discounts: rateCardDiscounts.optional(),
|
|
3144
3179
|
feature_key: z.string().describe('The feature associated with the charge.'),
|
|
3145
3180
|
totals: chargeTotals,
|
|
3181
|
+
price: price,
|
|
3146
3182
|
})
|
|
3147
3183
|
.describe('A usage-based charge for a customer.');
|
|
3184
|
+
export const createUsageBasedChargeRequest = z
|
|
3185
|
+
.object({
|
|
3186
|
+
name: z
|
|
3187
|
+
.string()
|
|
3188
|
+
.min(1)
|
|
3189
|
+
.max(256)
|
|
3190
|
+
.describe('Display name of the resource. Between 1 and 256 characters.'),
|
|
3191
|
+
description: z
|
|
3192
|
+
.string()
|
|
3193
|
+
.max(1024)
|
|
3194
|
+
.optional()
|
|
3195
|
+
.describe('Optional description of the resource. Maximum 1024 characters.'),
|
|
3196
|
+
labels: labels.optional(),
|
|
3197
|
+
type: z.literal('usage_based').describe('The type of the charge.'),
|
|
3198
|
+
currency: currencyCode,
|
|
3199
|
+
invoice_at: dateTime,
|
|
3200
|
+
service_period: closedPeriod,
|
|
3201
|
+
unique_reference_id: z
|
|
3202
|
+
.string()
|
|
3203
|
+
.optional()
|
|
3204
|
+
.describe('Unique reference ID of the charge.'),
|
|
3205
|
+
settlement_mode: settlementMode,
|
|
3206
|
+
tax_config: taxConfig.optional(),
|
|
3207
|
+
discounts: rateCardDiscounts.optional(),
|
|
3208
|
+
feature_key: z.string().describe('The feature associated with the charge.'),
|
|
3209
|
+
price: price,
|
|
3210
|
+
full_service_period: closedPeriod.optional(),
|
|
3211
|
+
billing_period: closedPeriod.optional(),
|
|
3212
|
+
})
|
|
3213
|
+
.describe('Usage-based charge create request.');
|
|
3148
3214
|
export const rateCard = z
|
|
3149
3215
|
.object({
|
|
3150
3216
|
name: z
|
|
@@ -3186,6 +3252,12 @@ export const workflow = z
|
|
|
3186
3252
|
export const charge = z
|
|
3187
3253
|
.discriminatedUnion('type', [flatFeeCharge, usageBasedCharge])
|
|
3188
3254
|
.describe('Customer charge.');
|
|
3255
|
+
export const createChargeRequest = z
|
|
3256
|
+
.discriminatedUnion('type', [
|
|
3257
|
+
createFlatFeeChargeRequest,
|
|
3258
|
+
createUsageBasedChargeRequest,
|
|
3259
|
+
])
|
|
3260
|
+
.describe('Customer charge.');
|
|
3189
3261
|
export const planPhase = z
|
|
3190
3262
|
.object({
|
|
3191
3263
|
name: z
|
|
@@ -3656,6 +3728,11 @@ export const listCustomerChargesResponse = z.object({
|
|
|
3656
3728
|
data: z.array(charge),
|
|
3657
3729
|
meta: paginatedMeta,
|
|
3658
3730
|
});
|
|
3731
|
+
export const createCustomerChargesPathParams = z.object({
|
|
3732
|
+
customerId: ulid,
|
|
3733
|
+
});
|
|
3734
|
+
export const createCustomerChargesBody = createChargeRequest;
|
|
3735
|
+
export const createCustomerChargesResponse = charge;
|
|
3659
3736
|
export const createSubscriptionBody = subscriptionCreate;
|
|
3660
3737
|
export const createSubscriptionResponse = subscription;
|
|
3661
3738
|
export const listSubscriptionsQueryParams = z.object({
|
package/dist/models/types.d.ts
CHANGED
|
@@ -110,11 +110,6 @@ export interface AppStripeCreateCustomerPortalSessionOptions {
|
|
|
110
110
|
}
|
|
111
111
|
/** Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "\_". */
|
|
112
112
|
export type CreateLabels = Record<string, string>;
|
|
113
|
-
/** Free price. */
|
|
114
|
-
export interface PriceFree {
|
|
115
|
-
/** The type of the price. */
|
|
116
|
-
type: 'free';
|
|
117
|
-
}
|
|
118
113
|
/** The tax config for Stripe. */
|
|
119
114
|
export interface TaxConfigStripe {
|
|
120
115
|
/** Product [tax code](https://docs.stripe.com/tax/tax-codes). */
|
|
@@ -130,6 +125,11 @@ export interface FlatFeeDiscounts {
|
|
|
130
125
|
/** Percentage discount applied to the price (0–100). */
|
|
131
126
|
percentage?: number;
|
|
132
127
|
}
|
|
128
|
+
/** Free price. */
|
|
129
|
+
export interface PriceFree {
|
|
130
|
+
/** The type of the price. */
|
|
131
|
+
type: 'free';
|
|
132
|
+
}
|
|
133
133
|
/** BillingWorkflowCollectionAlignmentSubscription specifies the alignment for collecting the pending line items into an invoice. */
|
|
134
134
|
export interface WorkflowCollectionAlignmentSubscription {
|
|
135
135
|
/** The type of alignment. */
|
|
@@ -306,6 +306,11 @@ export interface ListCostBasesParamsFilter {
|
|
|
306
306
|
/** Filter cost bases by fiat currency code. */
|
|
307
307
|
fiat_code?: string;
|
|
308
308
|
}
|
|
309
|
+
/** Monetary amount in a specific currency. */
|
|
310
|
+
export interface CurrencyAmount {
|
|
311
|
+
amount: string;
|
|
312
|
+
currency: string;
|
|
313
|
+
}
|
|
309
314
|
/** Flat price. */
|
|
310
315
|
export interface PriceFlat {
|
|
311
316
|
/** The type of the price. */
|
|
@@ -320,11 +325,6 @@ export interface PriceUnit {
|
|
|
320
325
|
/** The amount of the unit price. */
|
|
321
326
|
amount: string;
|
|
322
327
|
}
|
|
323
|
-
/** Monetary amount in a specific currency. */
|
|
324
|
-
export interface CurrencyAmount {
|
|
325
|
-
amount: string;
|
|
326
|
-
currency: string;
|
|
327
|
-
}
|
|
328
328
|
/** Discount configuration for a rate card. */
|
|
329
329
|
export interface RateCardDiscounts {
|
|
330
330
|
/** Percentage discount applied to the price (0–100). */
|
|
@@ -1168,7 +1168,7 @@ export interface ListPlansParamsFilter {
|
|
|
1168
1168
|
export interface SubscriptionCreate {
|
|
1169
1169
|
labels?: Labels;
|
|
1170
1170
|
/** Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits. */
|
|
1171
|
-
settlement_mode
|
|
1171
|
+
settlement_mode?: 'credit_then_invoice' | 'credit_only';
|
|
1172
1172
|
/** The customer to create the subscription for. */
|
|
1173
1173
|
customer: {
|
|
1174
1174
|
id?: string;
|
|
@@ -1207,7 +1207,7 @@ export interface Subscription {
|
|
|
1207
1207
|
/** The status of the subscription. */
|
|
1208
1208
|
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
1209
1209
|
/** Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits. */
|
|
1210
|
-
settlement_mode
|
|
1210
|
+
settlement_mode?: 'credit_then_invoice' | 'credit_only';
|
|
1211
1211
|
}
|
|
1212
1212
|
/** Available apps for billing integrations to connect with third-party services. Apps can have various capabilities like syncing data from or to external systems, integrating with third-party services for tax calculation, delivery of invoices, collection of payments, etc. */
|
|
1213
1213
|
export interface AppCatalogItem {
|
|
@@ -2079,7 +2079,7 @@ export interface SubscriptionCancel {
|
|
|
2079
2079
|
export interface SubscriptionChange {
|
|
2080
2080
|
labels?: Labels;
|
|
2081
2081
|
/** Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits. */
|
|
2082
|
-
settlement_mode
|
|
2082
|
+
settlement_mode?: 'credit_then_invoice' | 'credit_only';
|
|
2083
2083
|
/** The customer to create the subscription for. */
|
|
2084
2084
|
customer: {
|
|
2085
2085
|
id?: string;
|
|
@@ -2336,6 +2336,42 @@ export interface CreditGrant {
|
|
|
2336
2336
|
/** Current lifecycle status of the grant. */
|
|
2337
2337
|
status: 'pending' | 'active' | 'expired' | 'voided';
|
|
2338
2338
|
}
|
|
2339
|
+
/** Flat fee charge create request. */
|
|
2340
|
+
export interface CreateFlatFeeChargeRequest {
|
|
2341
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2342
|
+
name: string;
|
|
2343
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2344
|
+
description?: string;
|
|
2345
|
+
labels?: Labels;
|
|
2346
|
+
/** The type of the charge. */
|
|
2347
|
+
type: 'flat_fee';
|
|
2348
|
+
/** The currency of the charge. */
|
|
2349
|
+
currency: string;
|
|
2350
|
+
/** The timestamp when the charge is intended to be invoiced. */
|
|
2351
|
+
invoice_at: string;
|
|
2352
|
+
/** The effective service period covered by the charge. */
|
|
2353
|
+
service_period: ClosedPeriod;
|
|
2354
|
+
/** Unique reference ID of the charge. */
|
|
2355
|
+
unique_reference_id?: string;
|
|
2356
|
+
/** Settlement mode of the charge. */
|
|
2357
|
+
settlement_mode: 'credit_then_invoice' | 'credit_only';
|
|
2358
|
+
/** Tax configuration of the charge. */
|
|
2359
|
+
tax_config?: TaxConfig;
|
|
2360
|
+
/** Payment term of the flat fee charge. */
|
|
2361
|
+
payment_term: 'in_advance' | 'in_arrears';
|
|
2362
|
+
/** The discounts applied to the charge. */
|
|
2363
|
+
discounts?: FlatFeeDiscounts;
|
|
2364
|
+
/** The feature associated with the charge, when applicable. */
|
|
2365
|
+
feature_key?: string;
|
|
2366
|
+
/** The proration configuration of the charge. */
|
|
2367
|
+
proration_configuration: RateCardProrationConfiguration;
|
|
2368
|
+
/** The amount before proration of the charge. */
|
|
2369
|
+
amount_before_proration: CurrencyAmount;
|
|
2370
|
+
/** The full, unprorated service period of the charge. */
|
|
2371
|
+
full_service_period?: ClosedPeriod;
|
|
2372
|
+
/** The billing period the charge belongs to. */
|
|
2373
|
+
billing_period?: ClosedPeriod;
|
|
2374
|
+
}
|
|
2339
2375
|
/** Tax settings for a billing workflow. */
|
|
2340
2376
|
export interface WorkflowTaxSettings {
|
|
2341
2377
|
/** Enable automatic tax calculation when tax is supported by the app. For example, with Stripe Invoicing when enabled, tax is calculated via Stripe Tax. */
|
|
@@ -2570,8 +2606,6 @@ export interface FlatFeeCharge {
|
|
|
2570
2606
|
billing_period: ClosedPeriod;
|
|
2571
2607
|
/** The earliest time when the charge should be advanced again by background processing. */
|
|
2572
2608
|
advance_after?: string;
|
|
2573
|
-
/** The price of the charge. */
|
|
2574
|
-
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2575
2609
|
/** Unique reference ID of the charge. */
|
|
2576
2610
|
unique_reference_id?: string;
|
|
2577
2611
|
/** Settlement mode of the charge. */
|
|
@@ -2586,8 +2620,12 @@ export interface FlatFeeCharge {
|
|
|
2586
2620
|
feature_key?: string;
|
|
2587
2621
|
/** The proration configuration of the charge. */
|
|
2588
2622
|
proration_configuration: RateCardProrationConfiguration;
|
|
2623
|
+
/** The amount before proration of the charge. */
|
|
2624
|
+
amount_before_proration: CurrencyAmount;
|
|
2589
2625
|
/** The amount after proration of the charge. */
|
|
2590
2626
|
amount_after_proration: CurrencyAmount;
|
|
2627
|
+
/** The price of the charge. */
|
|
2628
|
+
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2591
2629
|
}
|
|
2592
2630
|
/** A usage-based charge for a customer. */
|
|
2593
2631
|
export interface UsageBasedCharge {
|
|
@@ -2625,8 +2663,6 @@ export interface UsageBasedCharge {
|
|
|
2625
2663
|
billing_period: ClosedPeriod;
|
|
2626
2664
|
/** The earliest time when the charge should be advanced again by background processing. */
|
|
2627
2665
|
advance_after?: string;
|
|
2628
|
-
/** The price of the charge. */
|
|
2629
|
-
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2630
2666
|
/** Unique reference ID of the charge. */
|
|
2631
2667
|
unique_reference_id?: string;
|
|
2632
2668
|
/** Settlement mode of the charge. */
|
|
@@ -2639,6 +2675,40 @@ export interface UsageBasedCharge {
|
|
|
2639
2675
|
feature_key: string;
|
|
2640
2676
|
/** Aggregated booked and realtime totals for the charge. */
|
|
2641
2677
|
totals: ChargeTotals;
|
|
2678
|
+
/** The price of the charge. */
|
|
2679
|
+
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2680
|
+
}
|
|
2681
|
+
/** Usage-based charge create request. */
|
|
2682
|
+
export interface CreateUsageBasedChargeRequest {
|
|
2683
|
+
/** Display name of the resource. Between 1 and 256 characters. */
|
|
2684
|
+
name: string;
|
|
2685
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
2686
|
+
description?: string;
|
|
2687
|
+
labels?: Labels;
|
|
2688
|
+
/** The type of the charge. */
|
|
2689
|
+
type: 'usage_based';
|
|
2690
|
+
/** The currency of the charge. */
|
|
2691
|
+
currency: string;
|
|
2692
|
+
/** The timestamp when the charge is intended to be invoiced. */
|
|
2693
|
+
invoice_at: string;
|
|
2694
|
+
/** The effective service period covered by the charge. */
|
|
2695
|
+
service_period: ClosedPeriod;
|
|
2696
|
+
/** Unique reference ID of the charge. */
|
|
2697
|
+
unique_reference_id?: string;
|
|
2698
|
+
/** Settlement mode of the charge. */
|
|
2699
|
+
settlement_mode: 'credit_then_invoice' | 'credit_only';
|
|
2700
|
+
/** Tax configuration of the charge. */
|
|
2701
|
+
tax_config?: TaxConfig;
|
|
2702
|
+
/** Discounts applied to the usage-based charge. */
|
|
2703
|
+
discounts?: RateCardDiscounts;
|
|
2704
|
+
/** The feature associated with the charge. */
|
|
2705
|
+
feature_key: string;
|
|
2706
|
+
/** The price of the charge. */
|
|
2707
|
+
price: PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
2708
|
+
/** The full, unprorated service period of the charge. */
|
|
2709
|
+
full_service_period?: ClosedPeriod;
|
|
2710
|
+
/** The billing period the charge belongs to. */
|
|
2711
|
+
billing_period?: ClosedPeriod;
|
|
2642
2712
|
}
|
|
2643
2713
|
/** A rate card defines the pricing and entitlement of a feature or service. */
|
|
2644
2714
|
export interface RateCard {
|
|
@@ -3016,44 +3086,6 @@ export interface CreditGrantPurchaseInput {
|
|
|
3016
3086
|
/** Current payment settlement status. */
|
|
3017
3087
|
settlement_status?: 'pending' | 'authorized' | 'settled';
|
|
3018
3088
|
}
|
|
3019
|
-
export interface SubscriptionCreateInput {
|
|
3020
|
-
labels?: Labels;
|
|
3021
|
-
/** Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits. */
|
|
3022
|
-
settlement_mode?: 'credit_then_invoice' | 'credit_only';
|
|
3023
|
-
/** The customer to create the subscription for. */
|
|
3024
|
-
customer: {
|
|
3025
|
-
id?: string;
|
|
3026
|
-
key?: string;
|
|
3027
|
-
};
|
|
3028
|
-
/** The plan reference of the subscription. */
|
|
3029
|
-
plan: {
|
|
3030
|
-
id?: string;
|
|
3031
|
-
key?: string;
|
|
3032
|
-
version?: number;
|
|
3033
|
-
};
|
|
3034
|
-
/** A billing anchor is the fixed point in time that determines the subscription's recurring billing cycle. It affects when charges occur and how prorations are calculated. Common anchors: - Calendar month (1st of each month): `2025-01-01T00:00:00Z` - Subscription anniversary (day customer signed up) - Custom date (customer-specified day) If not provided, the subscription will be created with the subscription's creation time as the billing anchor. */
|
|
3035
|
-
billing_anchor?: string;
|
|
3036
|
-
}
|
|
3037
|
-
export interface SubscriptionInput {
|
|
3038
|
-
id: string;
|
|
3039
|
-
labels?: Labels;
|
|
3040
|
-
/** An ISO-8601 timestamp representation of entity creation date. */
|
|
3041
|
-
created_at: string;
|
|
3042
|
-
/** An ISO-8601 timestamp representation of entity last update date. */
|
|
3043
|
-
updated_at: string;
|
|
3044
|
-
/** An ISO-8601 timestamp representation of entity deletion date. */
|
|
3045
|
-
deleted_at?: string;
|
|
3046
|
-
/** The customer ID of the subscription. */
|
|
3047
|
-
customer_id: string;
|
|
3048
|
-
/** The plan ID of the subscription. Set if subscription is created from a plan. */
|
|
3049
|
-
plan_id?: string;
|
|
3050
|
-
/** A billing anchor is the fixed point in time that determines the subscription's recurring billing cycle. It affects when charges occur and how prorations are calculated. Common anchors: - Calendar month (1st of each month): `2025-01-01T00:00:00Z` - Subscription anniversary (day customer signed up) - Custom date (customer-specified day) */
|
|
3051
|
-
billing_anchor: string;
|
|
3052
|
-
/** The status of the subscription. */
|
|
3053
|
-
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
3054
|
-
/** Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits. */
|
|
3055
|
-
settlement_mode?: 'credit_then_invoice' | 'credit_only';
|
|
3056
|
-
}
|
|
3057
3089
|
export interface GovernanceQueryRequestInput {
|
|
3058
3090
|
/** Whether to include credit balance availability for each resolved customer. When true, each feature evaluation includes credit balance checks. Defaults to `false`. */
|
|
3059
3091
|
include_credits?: boolean;
|
|
@@ -3084,40 +3116,10 @@ export interface IngestedEventInput {
|
|
|
3084
3116
|
/** The validation errors of the ingested event. */
|
|
3085
3117
|
validation_errors?: IngestedEventValidationError[];
|
|
3086
3118
|
}
|
|
3087
|
-
export interface SubscriptionPagePaginatedResponseInput {
|
|
3088
|
-
data: SubscriptionInput[];
|
|
3089
|
-
meta: PaginatedMeta;
|
|
3090
|
-
}
|
|
3091
|
-
export interface SubscriptionChangeResponseInput {
|
|
3092
|
-
/** The current subscription before the change. */
|
|
3093
|
-
current: SubscriptionInput;
|
|
3094
|
-
/** The new state of the subscription after the change. */
|
|
3095
|
-
next: SubscriptionInput;
|
|
3096
|
-
}
|
|
3097
3119
|
export interface SubscriptionCancelInput {
|
|
3098
3120
|
/** If not provided the subscription is canceled immediately. */
|
|
3099
3121
|
timing?: 'immediate' | 'next_billing_cycle' | string;
|
|
3100
3122
|
}
|
|
3101
|
-
export interface SubscriptionChangeInput {
|
|
3102
|
-
labels?: Labels;
|
|
3103
|
-
/** Settlement mode for billing. Values: - `credit_then_invoice`: Credits are applied first, then any remainder is invoiced. - `credit_only`: Usage is settled exclusively against credits. */
|
|
3104
|
-
settlement_mode?: 'credit_then_invoice' | 'credit_only';
|
|
3105
|
-
/** The customer to create the subscription for. */
|
|
3106
|
-
customer: {
|
|
3107
|
-
id?: string;
|
|
3108
|
-
key?: string;
|
|
3109
|
-
};
|
|
3110
|
-
/** The plan reference of the subscription. */
|
|
3111
|
-
plan: {
|
|
3112
|
-
id?: string;
|
|
3113
|
-
key?: string;
|
|
3114
|
-
version?: number;
|
|
3115
|
-
};
|
|
3116
|
-
/** A billing anchor is the fixed point in time that determines the subscription's recurring billing cycle. It affects when charges occur and how prorations are calculated. Common anchors: - Calendar month (1st of each month): `2025-01-01T00:00:00Z` - Subscription anniversary (day customer signed up) - Custom date (customer-specified day) If not provided, the subscription will be created with the subscription's creation time as the billing anchor. */
|
|
3117
|
-
billing_anchor?: string;
|
|
3118
|
-
/** Timing configuration for the change, when the change should take effect. For changing a subscription, the accepted values depend on the subscription configuration. */
|
|
3119
|
-
timing: 'immediate' | 'next_billing_cycle' | string;
|
|
3120
|
-
}
|
|
3121
3123
|
export interface InvoiceUsageQuantityDetailInput {
|
|
3122
3124
|
/** The raw quantity as reported by the meter (native units). */
|
|
3123
3125
|
raw_quantity: string;
|
package/dist/sdk/customers.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Client } from '../core.js';
|
|
2
2
|
import { type RequestOptions } from '../lib/types.js';
|
|
3
|
-
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse } from '../models/operations/customers.js';
|
|
3
|
+
import type { CreateCustomerRequest, CreateCustomerResponse, GetCustomerRequest, GetCustomerResponse, ListCustomersRequest, ListCustomersResponse, UpsertCustomerRequest, UpsertCustomerResponse, DeleteCustomerRequest, DeleteCustomerResponse, GetCustomerBillingRequest, GetCustomerBillingResponse, UpdateCustomerBillingRequest, UpdateCustomerBillingResponse, UpdateCustomerBillingAppDataRequest, UpdateCustomerBillingAppDataResponse, CreateCustomerStripeCheckoutSessionRequest, CreateCustomerStripeCheckoutSessionResponse, CreateCustomerStripePortalSessionRequest, CreateCustomerStripePortalSessionResponse, CreateCreditGrantRequest, CreateCreditGrantResponse, GetCreditGrantRequest, GetCreditGrantResponse, ListCreditGrantsRequest, ListCreditGrantsResponse, GetCustomerCreditBalanceRequest, GetCustomerCreditBalanceResponse, CreateCreditAdjustmentRequest, CreateCreditAdjustmentResponse, UpdateCreditGrantExternalSettlementRequest, UpdateCreditGrantExternalSettlementResponse, ListCreditTransactionsRequest, ListCreditTransactionsResponse, ListCustomerChargesRequest, ListCustomerChargesResponse, CreateCustomerChargesRequest, CreateCustomerChargesResponse } from '../models/operations/customers.js';
|
|
4
4
|
export declare class Customers {
|
|
5
5
|
private readonly _client;
|
|
6
6
|
constructor(_client: Client);
|
|
@@ -64,5 +64,6 @@ export declare class CustomersCharges {
|
|
|
64
64
|
private readonly _client;
|
|
65
65
|
constructor(_client: Client);
|
|
66
66
|
list(request: ListCustomerChargesRequest, options?: RequestOptions): Promise<ListCustomerChargesResponse>;
|
|
67
|
+
create(request: CreateCustomerChargesRequest, options?: RequestOptions): Promise<CreateCustomerChargesResponse>;
|
|
67
68
|
}
|
|
68
69
|
//# sourceMappingURL=customers.d.ts.map
|
package/dist/sdk/customers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { unwrap } from '../lib/types.js';
|
|
2
|
-
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, } from '../funcs/customers.js';
|
|
2
|
+
import { createCustomer, getCustomer, listCustomers, upsertCustomer, deleteCustomer, getCustomerBilling, updateCustomerBilling, updateCustomerBillingAppData, createCustomerStripeCheckoutSession, createCustomerStripePortalSession, createCreditGrant, getCreditGrant, listCreditGrants, getCustomerCreditBalance, createCreditAdjustment, updateCreditGrantExternalSettlement, listCreditTransactions, listCustomerCharges, createCustomerCharges, } from '../funcs/customers.js';
|
|
3
3
|
export class Customers {
|
|
4
4
|
_client;
|
|
5
5
|
constructor(_client) {
|
|
@@ -129,5 +129,8 @@ export class CustomersCharges {
|
|
|
129
129
|
async list(request, options) {
|
|
130
130
|
return unwrap(await listCustomerCharges(this._client, request, options));
|
|
131
131
|
}
|
|
132
|
+
async create(request, options) {
|
|
133
|
+
return unwrap(await createCustomerCharges(this._client, request, options));
|
|
134
|
+
}
|
|
132
135
|
}
|
|
133
136
|
//# sourceMappingURL=customers.js.map
|