chargebee 3.34.0 → 3.36.0
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/CHANGELOG.md +237 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +230 -2
- package/cjs/resources/webhook/eventType.js +25 -1
- package/cjs/schema/addon.schema.js +221 -40
- package/cjs/schema/alert.schema.js +17 -2
- package/cjs/schema/alert_status.schema.js +6 -1
- package/cjs/schema/attached_item.schema.js +101 -26
- package/cjs/schema/business_entity.schema.js +43 -6
- package/cjs/schema/business_rule.schema.js +2 -2
- package/cjs/schema/business_ruleset.schema.js +2 -2
- package/cjs/schema/collections_payment_promise.schema.js +43 -0
- package/cjs/schema/comment.schema.js +17 -4
- package/cjs/schema/coupon.schema.js +218 -37
- package/cjs/schema/coupon_code.schema.js +36 -6
- package/cjs/schema/coupon_set.schema.js +108 -27
- package/cjs/schema/credit_note.schema.js +497 -105
- package/cjs/schema/credit_unit.schema.js +12 -2
- package/cjs/schema/customer.schema.js +212 -62
- package/cjs/schema/differential_price.schema.js +100 -12
- package/cjs/schema/dispute.schema.js +125 -33
- package/cjs/schema/einvoice.schema.js +27 -6
- package/cjs/schema/email_log.schema.js +15 -4
- package/cjs/schema/entitlement.schema.js +35 -6
- package/cjs/schema/entitlement_override.schema.js +17 -1
- package/cjs/schema/estimate.schema.js +585 -40
- package/cjs/schema/event.schema.js +1334 -585
- package/cjs/schema/export.schema.js +4459 -1412
- package/cjs/schema/feature.schema.js +73 -11
- package/cjs/schema/gateway_request_log.schema.js +309 -0
- package/cjs/schema/gateway_webhook_log.schema.js +257 -0
- package/cjs/schema/gift.schema.js +51 -5
- package/cjs/schema/grant_block.schema.js +45 -12
- package/cjs/schema/hosted_page.schema.js +564 -68
- package/cjs/schema/index.js +6 -0
- package/cjs/schema/invoice.schema.js +843 -123
- package/cjs/schema/item.schema.js +151 -28
- package/cjs/schema/item_entitlement.schema.js +23 -2
- package/cjs/schema/item_family.schema.js +29 -8
- package/cjs/schema/item_price.schema.js +263 -48
- package/cjs/schema/ledger_account_balance.schema.js +11 -2
- package/cjs/schema/ledger_operation.schema.js +44 -17
- package/cjs/schema/metered_feature.schema.js +10 -1
- package/cjs/schema/omnichannel_one_time_order.schema.js +42 -4
- package/cjs/schema/omnichannel_subscription.schema.js +146 -32
- package/cjs/schema/order.schema.js +233 -61
- package/cjs/schema/organization_detail.schema.js +36 -0
- package/cjs/schema/payment_schedule.schema.js +39 -8
- package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
- package/cjs/schema/payment_source.schema.js +375 -148
- package/cjs/schema/payment_voucher.schema.js +33 -5
- package/cjs/schema/plan.schema.js +345 -57
- package/cjs/schema/price_ramp.schema.js +153 -0
- package/cjs/schema/price_variant.schema.js +88 -18
- package/cjs/schema/pricing_page_session.schema.js +36 -2
- package/cjs/schema/promotional_credit.schema.js +27 -6
- package/cjs/schema/purchase.schema.js +210 -12
- package/cjs/schema/quote.schema.js +907 -87
- package/cjs/schema/quote_entitlement.schema.js +6 -2
- package/cjs/schema/ramp.schema.js +242 -24
- package/cjs/schema/retry_segment.schema.js +12 -0
- package/cjs/schema/site_migration_detail.schema.js +50 -16
- package/cjs/schema/subscription.schema.js +1002 -173
- package/cjs/schema/subscription_entitlement.schema.js +9 -1
- package/cjs/schema/transaction.schema.js +780 -342
- package/cjs/schema/unbilled_charge.schema.js +141 -13
- package/cjs/schema/usage.schema.js +59 -11
- package/cjs/schema/usage_event.schema.js +13 -1
- package/cjs/schema/usage_summary.schema.js +1 -0
- package/cjs/schema/virtual_bank_account.schema.js +42 -10
- package/cjs/schema/webhook_endpoint.schema.js +50 -2
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +230 -2
- package/esm/resources/webhook/eventType.js +25 -1
- package/esm/schema/addon.schema.js +221 -40
- package/esm/schema/alert.schema.js +17 -2
- package/esm/schema/alert_status.schema.js +6 -1
- package/esm/schema/attached_item.schema.js +101 -26
- package/esm/schema/business_entity.schema.js +42 -5
- package/esm/schema/business_rule.schema.js +2 -2
- package/esm/schema/business_ruleset.schema.js +2 -2
- package/esm/schema/collections_payment_promise.schema.js +40 -0
- package/esm/schema/comment.schema.js +17 -4
- package/esm/schema/coupon.schema.js +218 -37
- package/esm/schema/coupon_code.schema.js +36 -6
- package/esm/schema/coupon_set.schema.js +108 -27
- package/esm/schema/credit_note.schema.js +497 -105
- package/esm/schema/credit_unit.schema.js +12 -2
- package/esm/schema/customer.schema.js +212 -62
- package/esm/schema/differential_price.schema.js +100 -12
- package/esm/schema/dispute.schema.js +125 -33
- package/esm/schema/einvoice.schema.js +27 -6
- package/esm/schema/email_log.schema.js +15 -4
- package/esm/schema/entitlement.schema.js +35 -6
- package/esm/schema/entitlement_override.schema.js +17 -1
- package/esm/schema/estimate.schema.js +585 -40
- package/esm/schema/event.schema.js +1334 -585
- package/esm/schema/export.schema.js +4459 -1412
- package/esm/schema/feature.schema.js +73 -11
- package/esm/schema/gateway_request_log.schema.js +306 -0
- package/esm/schema/gateway_webhook_log.schema.js +254 -0
- package/esm/schema/gift.schema.js +51 -5
- package/esm/schema/grant_block.schema.js +45 -12
- package/esm/schema/hosted_page.schema.js +564 -68
- package/esm/schema/index.js +6 -0
- package/esm/schema/invoice.schema.js +842 -122
- package/esm/schema/item.schema.js +151 -28
- package/esm/schema/item_entitlement.schema.js +23 -2
- package/esm/schema/item_family.schema.js +29 -8
- package/esm/schema/item_price.schema.js +263 -48
- package/esm/schema/ledger_account_balance.schema.js +10 -1
- package/esm/schema/ledger_operation.schema.js +44 -17
- package/esm/schema/metered_feature.schema.js +10 -1
- package/esm/schema/omnichannel_one_time_order.schema.js +42 -4
- package/esm/schema/omnichannel_subscription.schema.js +146 -32
- package/esm/schema/order.schema.js +233 -61
- package/esm/schema/organization_detail.schema.js +33 -0
- package/esm/schema/payment_schedule.schema.js +39 -8
- package/esm/schema/payment_schedule_scheme.schema.js +37 -7
- package/esm/schema/payment_source.schema.js +375 -148
- package/esm/schema/payment_voucher.schema.js +33 -5
- package/esm/schema/plan.schema.js +345 -57
- package/esm/schema/price_ramp.schema.js +150 -0
- package/esm/schema/price_variant.schema.js +88 -18
- package/esm/schema/pricing_page_session.schema.js +36 -2
- package/esm/schema/promotional_credit.schema.js +27 -6
- package/esm/schema/purchase.schema.js +210 -12
- package/esm/schema/quote.schema.js +907 -87
- package/esm/schema/quote_entitlement.schema.js +6 -2
- package/esm/schema/ramp.schema.js +242 -24
- package/esm/schema/retry_segment.schema.js +9 -0
- package/esm/schema/site_migration_detail.schema.js +50 -16
- package/esm/schema/subscription.schema.js +1002 -173
- package/esm/schema/subscription_entitlement.schema.js +9 -1
- package/esm/schema/transaction.schema.js +780 -342
- package/esm/schema/unbilled_charge.schema.js +141 -13
- package/esm/schema/usage.schema.js +59 -11
- package/esm/schema/usage_event.schema.js +13 -1
- package/esm/schema/usage_summary.schema.js +1 -0
- package/esm/schema/virtual_bank_account.schema.js +42 -10
- package/esm/schema/webhook_endpoint.schema.js +50 -2
- package/package.json +1 -1
- package/types/core.d.ts +63 -74
- package/types/index.d.ts +29 -1
- package/types/resources/BillingLineItem.d.ts +10 -0
- package/types/resources/BillingMetadata.d.ts +9 -0
- package/types/resources/BusinessEntity.d.ts +52 -0
- package/types/resources/Citation.d.ts +13 -0
- package/types/resources/CollectionsDispute.d.ts +24 -0
- package/types/resources/CollectionsPaymentPromise.d.ts +93 -0
- package/types/resources/CollectionsReminderSequence.d.ts +35 -0
- package/types/resources/Comment.d.ts +2 -1
- package/types/resources/Content.d.ts +23 -1
- package/types/resources/CreditNote.d.ts +1 -0
- package/types/resources/CustomData.d.ts +14 -0
- package/types/resources/Discount.d.ts +1 -0
- package/types/resources/DraftEstimate.d.ts +13 -0
- package/types/resources/DraftRequest.d.ts +45 -0
- package/types/resources/EmailAttachment.d.ts +16 -0
- package/types/resources/EmailConversation.d.ts +18 -0
- package/types/resources/EmailLog.d.ts +1 -0
- package/types/resources/EmailMessage.d.ts +40 -0
- package/types/resources/Estimate.d.ts +3 -0
- package/types/resources/Event.d.ts +25 -1
- package/types/resources/Execution.d.ts +12 -0
- package/types/resources/GatewayPaymentMethodToken.d.ts +2 -2
- package/types/resources/GatewayRequestLog.d.ts +82 -0
- package/types/resources/GatewayWebhookLog.d.ts +74 -0
- package/types/resources/GrantBlock.d.ts +5 -0
- package/types/resources/GroupByAttribute.d.ts +15 -0
- package/types/resources/GroupByRecommendation.d.ts +10 -0
- package/types/resources/HostedPage.d.ts +18 -0
- package/types/resources/Invoice.d.ts +19 -0
- package/types/resources/ItemPrice.d.ts +1 -0
- package/types/resources/LedgerAccountBalance.d.ts +19 -0
- package/types/resources/Meter.d.ts +1 -0
- package/types/resources/MeteredFeature.d.ts +1 -0
- package/types/resources/OmnichannelOneTimeOrder.d.ts +5 -1
- package/types/resources/OmnichannelSubscription.d.ts +6 -1
- package/types/resources/OmnichannelSubscriptionItem.d.ts +4 -1
- package/types/resources/OrganizationDetail.d.ts +84 -0
- package/types/resources/PaymentSchedule.d.ts +1 -1
- package/types/resources/PaymentScheduleEstimate.d.ts +1 -1
- package/types/resources/PaymentSource.d.ts +19 -0
- package/types/resources/PreferenceVariant.d.ts +10 -0
- package/types/resources/PriceRamp.d.ts +113 -0
- package/types/resources/PrivateNote.d.ts +18 -0
- package/types/resources/Purchase.d.ts +6 -0
- package/types/resources/Ramp.d.ts +6 -0
- package/types/resources/RampInterval.d.ts +12 -0
- package/types/resources/RecordedPurchase.d.ts +5 -1
- package/types/resources/RetrySegment.d.ts +36 -0
- package/types/resources/Subscription.d.ts +3 -0
- package/types/resources/Transaction.d.ts +4 -0
- package/types/resources/Usage.d.ts +7 -0
- package/types/resources/UsageSummary.d.ts +2 -0
- package/types/resources/WebhookEvent.d.ts +159 -5
- package/types/resources/AppliedBusinessRule.d.ts +0 -15
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
// Do not edit manually – regenerate via sdk-generator
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
//UnbilledCharge.createUnbilledCharge
|
|
6
|
+
const CreateUnbilledChargeUnbilledChargeAddonsItemSchema = z.object({
|
|
7
|
+
id: z.string().max(100).optional(),
|
|
8
|
+
quantity: z.number().int().min(1).optional(),
|
|
9
|
+
unit_price: z.number().int().min(0).optional(),
|
|
10
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
11
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
12
|
+
date_from: z.number().int().optional(),
|
|
13
|
+
date_to: z.number().int().optional(),
|
|
14
|
+
});
|
|
6
15
|
const CreateUnbilledChargeUnbilledChargeAddonsSchema = z.object({
|
|
7
16
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
8
17
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -12,6 +21,23 @@ const CreateUnbilledChargeUnbilledChargeAddonsSchema = z.object({
|
|
|
12
21
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
13
22
|
date_to: z.array(z.number().int().optional()).optional(),
|
|
14
23
|
});
|
|
24
|
+
const CreateUnbilledChargeUnbilledChargeChargesItemSchema = z.object({
|
|
25
|
+
amount: z.number().int().min(1).optional(),
|
|
26
|
+
amount_in_decimal: z.string().max(39).optional(),
|
|
27
|
+
description: z.string().max(250).optional(),
|
|
28
|
+
taxable: z.boolean().default(true).optional(),
|
|
29
|
+
tax_profile_id: z.string().max(50).optional(),
|
|
30
|
+
avalara_tax_code: z.string().max(50).optional(),
|
|
31
|
+
hsn_code: z.string().max(50).optional(),
|
|
32
|
+
taxjar_product_code: z.string().max(50).optional(),
|
|
33
|
+
avalara_sale_type: z
|
|
34
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
35
|
+
.optional(),
|
|
36
|
+
avalara_transaction_type: z.number().int().optional(),
|
|
37
|
+
avalara_service_type: z.number().int().optional(),
|
|
38
|
+
date_from: z.number().int().optional(),
|
|
39
|
+
date_to: z.number().int().optional(),
|
|
40
|
+
});
|
|
15
41
|
const CreateUnbilledChargeUnbilledChargeChargesSchema = z.object({
|
|
16
42
|
amount: z.array(z.number().int().min(1).optional()).optional(),
|
|
17
43
|
amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
@@ -29,6 +55,11 @@ const CreateUnbilledChargeUnbilledChargeChargesSchema = z.object({
|
|
|
29
55
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
30
56
|
date_to: z.array(z.number().int().optional()).optional(),
|
|
31
57
|
});
|
|
58
|
+
const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema = z.object({
|
|
59
|
+
provider_name: z.string().max(50).optional(),
|
|
60
|
+
field_id: z.string().max(50).optional(),
|
|
61
|
+
field_value: z.string().max(50).optional(),
|
|
62
|
+
});
|
|
32
63
|
const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = z.object({
|
|
33
64
|
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
34
65
|
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
@@ -37,12 +68,36 @@ const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = z.object({
|
|
|
37
68
|
const CreateUnbilledChargeUnbilledChargeBodySchema = z.looseObject({
|
|
38
69
|
subscription_id: z.string().max(50),
|
|
39
70
|
currency_code: z.string().max(3).optional(),
|
|
40
|
-
addons:
|
|
41
|
-
|
|
42
|
-
|
|
71
|
+
addons: z
|
|
72
|
+
.union([
|
|
73
|
+
z.array(CreateUnbilledChargeUnbilledChargeAddonsItemSchema.optional()),
|
|
74
|
+
CreateUnbilledChargeUnbilledChargeAddonsSchema,
|
|
75
|
+
])
|
|
76
|
+
.optional(),
|
|
77
|
+
charges: z
|
|
78
|
+
.union([
|
|
79
|
+
z.array(CreateUnbilledChargeUnbilledChargeChargesItemSchema.optional()),
|
|
80
|
+
CreateUnbilledChargeUnbilledChargeChargesSchema,
|
|
81
|
+
])
|
|
82
|
+
.optional(),
|
|
83
|
+
tax_providers_fields: z
|
|
84
|
+
.union([
|
|
85
|
+
z.array(CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
|
|
86
|
+
CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema,
|
|
87
|
+
])
|
|
88
|
+
.optional(),
|
|
43
89
|
});
|
|
44
90
|
export { CreateUnbilledChargeUnbilledChargeBodySchema };
|
|
45
91
|
//UnbilledCharge.create
|
|
92
|
+
const CreateUnbilledChargeItemPricesItemSchema = z.object({
|
|
93
|
+
item_price_id: z.string().max(100).optional(),
|
|
94
|
+
quantity: z.number().int().min(1).optional(),
|
|
95
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
96
|
+
unit_price: z.number().int().min(0).optional(),
|
|
97
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
98
|
+
date_from: z.number().int().optional(),
|
|
99
|
+
date_to: z.number().int().optional(),
|
|
100
|
+
});
|
|
46
101
|
const CreateUnbilledChargeItemPricesSchema = z.object({
|
|
47
102
|
item_price_id: z.array(z.string().max(100).optional()).optional(),
|
|
48
103
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -52,6 +107,17 @@ const CreateUnbilledChargeItemPricesSchema = z.object({
|
|
|
52
107
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
53
108
|
date_to: z.array(z.number().int().optional()).optional(),
|
|
54
109
|
});
|
|
110
|
+
const CreateUnbilledChargeItemTiersItemSchema = z.object({
|
|
111
|
+
item_price_id: z.string().max(100).optional(),
|
|
112
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
113
|
+
ending_unit: z.number().int().optional(),
|
|
114
|
+
price: z.number().int().min(0).optional(),
|
|
115
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
116
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
117
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
118
|
+
pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
119
|
+
package_size: z.number().int().min(1).optional(),
|
|
120
|
+
});
|
|
55
121
|
const CreateUnbilledChargeItemTiersSchema = z.object({
|
|
56
122
|
item_price_id: z.array(z.string().max(100).optional()).optional(),
|
|
57
123
|
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -65,6 +131,23 @@ const CreateUnbilledChargeItemTiersSchema = z.object({
|
|
|
65
131
|
.optional(),
|
|
66
132
|
package_size: z.array(z.number().int().min(1).optional()).optional(),
|
|
67
133
|
});
|
|
134
|
+
const CreateUnbilledChargeChargesItemSchema = z.object({
|
|
135
|
+
amount: z.number().int().min(1).optional(),
|
|
136
|
+
amount_in_decimal: z.string().max(39).optional(),
|
|
137
|
+
description: z.string().max(250).optional(),
|
|
138
|
+
taxable: z.boolean().default(true).optional(),
|
|
139
|
+
tax_profile_id: z.string().max(50).optional(),
|
|
140
|
+
avalara_tax_code: z.string().max(50).optional(),
|
|
141
|
+
hsn_code: z.string().max(50).optional(),
|
|
142
|
+
taxjar_product_code: z.string().max(50).optional(),
|
|
143
|
+
avalara_sale_type: z
|
|
144
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
145
|
+
.optional(),
|
|
146
|
+
avalara_transaction_type: z.number().int().optional(),
|
|
147
|
+
avalara_service_type: z.number().int().optional(),
|
|
148
|
+
date_from: z.number().int().optional(),
|
|
149
|
+
date_to: z.number().int().optional(),
|
|
150
|
+
});
|
|
68
151
|
const CreateUnbilledChargeChargesSchema = z.object({
|
|
69
152
|
amount: z.array(z.number().int().min(1).optional()).optional(),
|
|
70
153
|
amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
@@ -82,6 +165,11 @@ const CreateUnbilledChargeChargesSchema = z.object({
|
|
|
82
165
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
83
166
|
date_to: z.array(z.number().int().optional()).optional(),
|
|
84
167
|
});
|
|
168
|
+
const CreateUnbilledChargeTaxProvidersFieldsItemSchema = z.object({
|
|
169
|
+
provider_name: z.string().max(50).optional(),
|
|
170
|
+
field_id: z.string().max(50).optional(),
|
|
171
|
+
field_value: z.string().max(50).optional(),
|
|
172
|
+
});
|
|
85
173
|
const CreateUnbilledChargeTaxProvidersFieldsSchema = z.object({
|
|
86
174
|
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
87
175
|
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
@@ -90,10 +178,30 @@ const CreateUnbilledChargeTaxProvidersFieldsSchema = z.object({
|
|
|
90
178
|
const CreateUnbilledChargeBodySchema = z.looseObject({
|
|
91
179
|
subscription_id: z.string().max(50),
|
|
92
180
|
currency_code: z.string().max(3).optional(),
|
|
93
|
-
item_prices:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
181
|
+
item_prices: z
|
|
182
|
+
.union([
|
|
183
|
+
z.array(CreateUnbilledChargeItemPricesItemSchema.optional()),
|
|
184
|
+
CreateUnbilledChargeItemPricesSchema,
|
|
185
|
+
])
|
|
186
|
+
.optional(),
|
|
187
|
+
item_tiers: z
|
|
188
|
+
.union([
|
|
189
|
+
z.array(CreateUnbilledChargeItemTiersItemSchema.optional()),
|
|
190
|
+
CreateUnbilledChargeItemTiersSchema,
|
|
191
|
+
])
|
|
192
|
+
.optional(),
|
|
193
|
+
charges: z
|
|
194
|
+
.union([
|
|
195
|
+
z.array(CreateUnbilledChargeChargesItemSchema.optional()),
|
|
196
|
+
CreateUnbilledChargeChargesSchema,
|
|
197
|
+
])
|
|
198
|
+
.optional(),
|
|
199
|
+
tax_providers_fields: z
|
|
200
|
+
.union([
|
|
201
|
+
z.array(CreateUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
|
|
202
|
+
CreateUnbilledChargeTaxProvidersFieldsSchema,
|
|
203
|
+
])
|
|
204
|
+
.optional(),
|
|
97
205
|
});
|
|
98
206
|
export { CreateUnbilledChargeBodySchema };
|
|
99
207
|
//UnbilledCharge.invoiceUnbilledCharges
|
|
@@ -107,17 +215,37 @@ const ListUnbilledChargeSubscriptionIdSchema = z.object({
|
|
|
107
215
|
is: z.string().min(1).optional(),
|
|
108
216
|
is_not: z.string().min(1).optional(),
|
|
109
217
|
starts_with: z.string().min(1).optional(),
|
|
110
|
-
is_present: z.enum(['true', 'false']).optional(),
|
|
111
|
-
in: z
|
|
112
|
-
|
|
218
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
219
|
+
in: z
|
|
220
|
+
.union([
|
|
221
|
+
z.array(z.string().optional()),
|
|
222
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
223
|
+
])
|
|
224
|
+
.optional(),
|
|
225
|
+
not_in: z
|
|
226
|
+
.union([
|
|
227
|
+
z.array(z.string().optional()),
|
|
228
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
229
|
+
])
|
|
230
|
+
.optional(),
|
|
113
231
|
});
|
|
114
232
|
const ListUnbilledChargeCustomerIdSchema = z.object({
|
|
115
233
|
is: z.string().min(1).optional(),
|
|
116
234
|
is_not: z.string().min(1).optional(),
|
|
117
235
|
starts_with: z.string().min(1).optional(),
|
|
118
|
-
is_present: z.enum(['true', 'false']).optional(),
|
|
119
|
-
in: z
|
|
120
|
-
|
|
236
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
237
|
+
in: z
|
|
238
|
+
.union([
|
|
239
|
+
z.array(z.string().optional()),
|
|
240
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
241
|
+
])
|
|
242
|
+
.optional(),
|
|
243
|
+
not_in: z
|
|
244
|
+
.union([
|
|
245
|
+
z.array(z.string().optional()),
|
|
246
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
247
|
+
])
|
|
248
|
+
.optional(),
|
|
121
249
|
});
|
|
122
250
|
const ListUnbilledChargeBodySchema = z.looseObject({
|
|
123
251
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -34,16 +34,38 @@ const ListUsageSubscriptionIdSchema = z.object({
|
|
|
34
34
|
starts_with: z.string().min(1).optional(),
|
|
35
35
|
});
|
|
36
36
|
const ListUsageUsageDateSchema = z.object({
|
|
37
|
-
after: z
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
after: z
|
|
38
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
39
|
+
.optional(),
|
|
40
|
+
before: z
|
|
41
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
42
|
+
.optional(),
|
|
43
|
+
on: z
|
|
44
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
45
|
+
.optional(),
|
|
46
|
+
between: z
|
|
47
|
+
.union([
|
|
48
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
49
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
50
|
+
])
|
|
51
|
+
.optional(),
|
|
41
52
|
});
|
|
42
53
|
const ListUsageUpdatedAtSchema = z.object({
|
|
43
|
-
after: z
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
after: z
|
|
55
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
56
|
+
.optional(),
|
|
57
|
+
before: z
|
|
58
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
59
|
+
.optional(),
|
|
60
|
+
on: z
|
|
61
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
62
|
+
.optional(),
|
|
63
|
+
between: z
|
|
64
|
+
.union([
|
|
65
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
66
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
67
|
+
])
|
|
68
|
+
.optional(),
|
|
47
69
|
});
|
|
48
70
|
const ListUsageItemPriceIdSchema = z.object({
|
|
49
71
|
is: z.string().min(1).optional(),
|
|
@@ -54,13 +76,23 @@ const ListUsageInvoiceIdSchema = z.object({
|
|
|
54
76
|
is: z.string().min(1).optional(),
|
|
55
77
|
is_not: z.string().min(1).optional(),
|
|
56
78
|
starts_with: z.string().min(1).optional(),
|
|
57
|
-
is_present: z.enum(['true', 'false']).optional(),
|
|
79
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
58
80
|
});
|
|
59
81
|
const ListUsageSourceSchema = z.object({
|
|
60
82
|
is: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
|
|
61
83
|
is_not: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
|
|
62
|
-
in: z
|
|
63
|
-
|
|
84
|
+
in: z
|
|
85
|
+
.union([
|
|
86
|
+
z.array(z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
|
|
87
|
+
z.enum(['admin_console', 'api', 'bulk_operation']),
|
|
88
|
+
])
|
|
89
|
+
.optional(),
|
|
90
|
+
not_in: z
|
|
91
|
+
.union([
|
|
92
|
+
z.array(z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
|
|
93
|
+
z.enum(['admin_console', 'api', 'bulk_operation']),
|
|
94
|
+
])
|
|
95
|
+
.optional(),
|
|
64
96
|
});
|
|
65
97
|
const ListUsageSortBySchema = z.looseObject({
|
|
66
98
|
asc: z.enum(['usage_date', 'updated_at']).optional(),
|
|
@@ -83,8 +115,24 @@ export { ListUsageBodySchema };
|
|
|
83
115
|
const PdfUsageInvoiceSchema = z.object({
|
|
84
116
|
id: z.string().max(50),
|
|
85
117
|
});
|
|
118
|
+
const PdfUsageGroupByItemSchema = z.object({
|
|
119
|
+
feature_id: z.string().max(100).optional(),
|
|
120
|
+
attributes: z.array(z.string().optional()).optional(),
|
|
121
|
+
window_size: z.enum(['day', 'none']).optional(),
|
|
122
|
+
});
|
|
123
|
+
const PdfUsageGroupBySchema = z.object({
|
|
124
|
+
feature_id: z.array(z.string().max(100).optional()).optional(),
|
|
125
|
+
attributes: z.array(z.array(z.string().optional()).optional()).optional(),
|
|
126
|
+
window_size: z.array(z.enum(['day', 'none']).optional()).optional(),
|
|
127
|
+
});
|
|
86
128
|
const PdfUsageBodySchema = z.looseObject({
|
|
87
129
|
disposition_type: z.enum(['attachment', 'inline']).optional(),
|
|
88
130
|
invoice: PdfUsageInvoiceSchema.optional(),
|
|
131
|
+
group_by: z
|
|
132
|
+
.union([
|
|
133
|
+
z.array(PdfUsageGroupByItemSchema.optional()),
|
|
134
|
+
PdfUsageGroupBySchema,
|
|
135
|
+
])
|
|
136
|
+
.optional(),
|
|
89
137
|
});
|
|
90
138
|
export { PdfUsageBodySchema };
|
|
@@ -12,6 +12,13 @@ const CreateUsageEventBodySchema = z.looseObject({
|
|
|
12
12
|
});
|
|
13
13
|
export { CreateUsageEventBodySchema };
|
|
14
14
|
//UsageEvent.batchIngest
|
|
15
|
+
const BatchIngestUsageEventPropertiesSchema = z.looseObject({});
|
|
16
|
+
const BatchIngestUsageEventEventsItemSchema = z.object({
|
|
17
|
+
deduplication_id: z.string().max(36),
|
|
18
|
+
subscription_id: z.string().max(50),
|
|
19
|
+
usage_timestamp: z.number().int(),
|
|
20
|
+
properties: BatchIngestUsageEventPropertiesSchema,
|
|
21
|
+
});
|
|
15
22
|
const BatchIngestUsageEventPropertiesItemSchema = z.looseObject({});
|
|
16
23
|
const BatchIngestUsageEventEventsSchema = z.object({
|
|
17
24
|
deduplication_id: z.array(z.string().max(36).optional()),
|
|
@@ -20,6 +27,11 @@ const BatchIngestUsageEventEventsSchema = z.object({
|
|
|
20
27
|
properties: z.array(BatchIngestUsageEventPropertiesItemSchema.optional()),
|
|
21
28
|
});
|
|
22
29
|
const BatchIngestUsageEventBodySchema = z.looseObject({
|
|
23
|
-
events:
|
|
30
|
+
events: z
|
|
31
|
+
.union([
|
|
32
|
+
z.array(BatchIngestUsageEventEventsItemSchema.optional()),
|
|
33
|
+
BatchIngestUsageEventEventsSchema,
|
|
34
|
+
])
|
|
35
|
+
.optional(),
|
|
24
36
|
});
|
|
25
37
|
export { BatchIngestUsageEventBodySchema };
|
|
@@ -10,5 +10,6 @@ const RetrieveUsageSummaryForSubscriptionUsageSummaryBodySchema = z.looseObject(
|
|
|
10
10
|
window_size: z.enum(['month', 'week', 'day', 'hour', 'minute']).optional(),
|
|
11
11
|
timeframe_start: z.number().int().optional(),
|
|
12
12
|
timeframe_end: z.number().int().optional(),
|
|
13
|
+
group_by: z.array(z.string().max(100).optional()).optional(),
|
|
13
14
|
});
|
|
14
15
|
export { RetrieveUsageSummaryForSubscriptionUsageSummaryBodySchema };
|
|
@@ -43,20 +43,52 @@ const ListVirtualBankAccountCustomerIdSchema = z.object({
|
|
|
43
43
|
is: z.string().min(1).optional(),
|
|
44
44
|
is_not: z.string().min(1).optional(),
|
|
45
45
|
starts_with: z.string().min(1).optional(),
|
|
46
|
-
in: z
|
|
47
|
-
|
|
46
|
+
in: z
|
|
47
|
+
.union([
|
|
48
|
+
z.array(z.string().optional()),
|
|
49
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
50
|
+
])
|
|
51
|
+
.optional(),
|
|
52
|
+
not_in: z
|
|
53
|
+
.union([
|
|
54
|
+
z.array(z.string().optional()),
|
|
55
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
56
|
+
])
|
|
57
|
+
.optional(),
|
|
48
58
|
});
|
|
49
59
|
const ListVirtualBankAccountUpdatedAtSchema = z.object({
|
|
50
|
-
after: z
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
after: z
|
|
61
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
62
|
+
.optional(),
|
|
63
|
+
before: z
|
|
64
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
65
|
+
.optional(),
|
|
66
|
+
on: z
|
|
67
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
68
|
+
.optional(),
|
|
69
|
+
between: z
|
|
70
|
+
.union([
|
|
71
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
72
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
73
|
+
])
|
|
74
|
+
.optional(),
|
|
54
75
|
});
|
|
55
76
|
const ListVirtualBankAccountCreatedAtSchema = z.object({
|
|
56
|
-
after: z
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
77
|
+
after: z
|
|
78
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
79
|
+
.optional(),
|
|
80
|
+
before: z
|
|
81
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
82
|
+
.optional(),
|
|
83
|
+
on: z
|
|
84
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
85
|
+
.optional(),
|
|
86
|
+
between: z
|
|
87
|
+
.union([
|
|
88
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
89
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
90
|
+
])
|
|
91
|
+
.optional(),
|
|
60
92
|
});
|
|
61
93
|
const ListVirtualBankAccountBodySchema = z.looseObject({
|
|
62
94
|
limit: z.number().int().min(1).max(100).optional(),
|
|
@@ -82,6 +82,7 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
|
|
|
82
82
|
'payment_schedules_updated',
|
|
83
83
|
'payment_schedule_scheme_created',
|
|
84
84
|
'payment_schedule_scheme_deleted',
|
|
85
|
+
'payment_schedules_cancelled',
|
|
85
86
|
'subscription_renewal_reminder',
|
|
86
87
|
'add_usages_reminder',
|
|
87
88
|
'payment_due_reminder',
|
|
@@ -92,6 +93,7 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
|
|
|
92
93
|
'payment_failed',
|
|
93
94
|
'dunning_updated',
|
|
94
95
|
'payment_refunded',
|
|
96
|
+
'refund_failed',
|
|
95
97
|
'payment_initiated',
|
|
96
98
|
'refund_initiated',
|
|
97
99
|
'netd_payment_due_reminder',
|
|
@@ -182,6 +184,8 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
|
|
|
182
184
|
'customer_business_entity_changed',
|
|
183
185
|
'subscription_business_entity_changed',
|
|
184
186
|
'payment_source_business_entity_changed',
|
|
187
|
+
'organization_details_created',
|
|
188
|
+
'organization_details_updated',
|
|
185
189
|
'purchase_created',
|
|
186
190
|
'voucher_created',
|
|
187
191
|
'voucher_expired',
|
|
@@ -243,6 +247,9 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
|
|
|
243
247
|
'alert_status_changed',
|
|
244
248
|
'omnichannel_subscription_item_updated',
|
|
245
249
|
'omnichannel_subscription_item_recovered',
|
|
250
|
+
'price_ramp_created',
|
|
251
|
+
'price_ramp_updated',
|
|
252
|
+
'price_ramp_deleted',
|
|
246
253
|
'omnichannel_subscription_item_mrr_updated',
|
|
247
254
|
'ledger_account_balance_updated',
|
|
248
255
|
'grant_blocks_created',
|
|
@@ -257,12 +264,29 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
|
|
|
257
264
|
'vault_token_created',
|
|
258
265
|
'vault_token_updated',
|
|
259
266
|
'vault_token_deleted',
|
|
260
|
-
'
|
|
267
|
+
'chargeback_initiated',
|
|
268
|
+
'chargeback_won',
|
|
269
|
+
'chargeback_lost',
|
|
261
270
|
'business_ruleset_created',
|
|
262
271
|
'business_ruleset_updated',
|
|
263
272
|
'business_ruleset_activated',
|
|
264
273
|
'business_ruleset_deactivated',
|
|
265
274
|
'business_ruleset_deleted',
|
|
275
|
+
'collections_reminder_sequence_created',
|
|
276
|
+
'collections_reminder_sequence_paused',
|
|
277
|
+
'collections_reminder_sequence_resumed',
|
|
278
|
+
'collections_reminder_sequence_completed',
|
|
279
|
+
'collections_payment_promise_created',
|
|
280
|
+
'collections_payment_promise_updated',
|
|
281
|
+
'collections_payment_promise_fulfilled',
|
|
282
|
+
'collections_payment_promise_cancelled',
|
|
283
|
+
'collections_payment_promise_broken',
|
|
284
|
+
'collections_dispute_created',
|
|
285
|
+
'collections_dispute_updated',
|
|
286
|
+
'collections_dispute_resolved',
|
|
287
|
+
'collections_dispute_withdrawn',
|
|
288
|
+
'email_message_received',
|
|
289
|
+
'private_note_added',
|
|
266
290
|
'plan_created',
|
|
267
291
|
'plan_updated',
|
|
268
292
|
'plan_deleted',
|
|
@@ -351,6 +375,7 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
|
|
|
351
375
|
'payment_schedules_updated',
|
|
352
376
|
'payment_schedule_scheme_created',
|
|
353
377
|
'payment_schedule_scheme_deleted',
|
|
378
|
+
'payment_schedules_cancelled',
|
|
354
379
|
'subscription_renewal_reminder',
|
|
355
380
|
'add_usages_reminder',
|
|
356
381
|
'payment_due_reminder',
|
|
@@ -361,6 +386,7 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
|
|
|
361
386
|
'payment_failed',
|
|
362
387
|
'dunning_updated',
|
|
363
388
|
'payment_refunded',
|
|
389
|
+
'refund_failed',
|
|
364
390
|
'payment_initiated',
|
|
365
391
|
'refund_initiated',
|
|
366
392
|
'netd_payment_due_reminder',
|
|
@@ -451,6 +477,8 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
|
|
|
451
477
|
'customer_business_entity_changed',
|
|
452
478
|
'subscription_business_entity_changed',
|
|
453
479
|
'payment_source_business_entity_changed',
|
|
480
|
+
'organization_details_created',
|
|
481
|
+
'organization_details_updated',
|
|
454
482
|
'purchase_created',
|
|
455
483
|
'voucher_created',
|
|
456
484
|
'voucher_expired',
|
|
@@ -512,6 +540,9 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
|
|
|
512
540
|
'alert_status_changed',
|
|
513
541
|
'omnichannel_subscription_item_updated',
|
|
514
542
|
'omnichannel_subscription_item_recovered',
|
|
543
|
+
'price_ramp_created',
|
|
544
|
+
'price_ramp_updated',
|
|
545
|
+
'price_ramp_deleted',
|
|
515
546
|
'omnichannel_subscription_item_mrr_updated',
|
|
516
547
|
'ledger_account_balance_updated',
|
|
517
548
|
'grant_blocks_created',
|
|
@@ -526,12 +557,29 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
|
|
|
526
557
|
'vault_token_created',
|
|
527
558
|
'vault_token_updated',
|
|
528
559
|
'vault_token_deleted',
|
|
529
|
-
'
|
|
560
|
+
'chargeback_initiated',
|
|
561
|
+
'chargeback_won',
|
|
562
|
+
'chargeback_lost',
|
|
530
563
|
'business_ruleset_created',
|
|
531
564
|
'business_ruleset_updated',
|
|
532
565
|
'business_ruleset_activated',
|
|
533
566
|
'business_ruleset_deactivated',
|
|
534
567
|
'business_ruleset_deleted',
|
|
568
|
+
'collections_reminder_sequence_created',
|
|
569
|
+
'collections_reminder_sequence_paused',
|
|
570
|
+
'collections_reminder_sequence_resumed',
|
|
571
|
+
'collections_reminder_sequence_completed',
|
|
572
|
+
'collections_payment_promise_created',
|
|
573
|
+
'collections_payment_promise_updated',
|
|
574
|
+
'collections_payment_promise_fulfilled',
|
|
575
|
+
'collections_payment_promise_cancelled',
|
|
576
|
+
'collections_payment_promise_broken',
|
|
577
|
+
'collections_dispute_created',
|
|
578
|
+
'collections_dispute_updated',
|
|
579
|
+
'collections_dispute_resolved',
|
|
580
|
+
'collections_dispute_withdrawn',
|
|
581
|
+
'email_message_received',
|
|
582
|
+
'private_note_added',
|
|
535
583
|
'plan_created',
|
|
536
584
|
'plan_updated',
|
|
537
585
|
'plan_deleted',
|