chargebee 3.35.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 +65 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +56 -0
- package/cjs/resources/webhook/eventType.js +2 -0
- 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 +16 -5
- package/cjs/schema/business_rule.schema.js +2 -2
- package/cjs/schema/business_ruleset.schema.js +2 -2
- package/cjs/schema/comment.schema.js +15 -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 +496 -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 +33 -4
- package/cjs/schema/entitlement_override.schema.js +17 -1
- package/cjs/schema/estimate.schema.js +581 -36
- package/cjs/schema/event.schema.js +1282 -633
- 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 +562 -66
- package/cjs/schema/index.js +3 -0
- package/cjs/schema/invoice.schema.js +821 -121
- 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_operation.schema.js +42 -15
- package/cjs/schema/metered_feature.schema.js +10 -1
- package/cjs/schema/omnichannel_one_time_order.schema.js +32 -2
- package/cjs/schema/omnichannel_subscription.schema.js +136 -30
- 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 +360 -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 +79 -14
- 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 +204 -12
- package/cjs/schema/quote.schema.js +901 -81
- package/cjs/schema/quote_entitlement.schema.js +6 -2
- package/cjs/schema/ramp.schema.js +238 -24
- package/cjs/schema/site_migration_detail.schema.js +50 -16
- package/cjs/schema/subscription.schema.js +998 -169
- 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 +55 -12
- package/cjs/schema/usage_event.schema.js +13 -1
- package/cjs/schema/virtual_bank_account.schema.js +42 -10
- package/cjs/schema/webhook_endpoint.schema.js +4 -0
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +56 -0
- package/esm/resources/webhook/eventType.js +2 -0
- 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 +16 -5
- package/esm/schema/business_rule.schema.js +2 -2
- package/esm/schema/business_ruleset.schema.js +2 -2
- package/esm/schema/comment.schema.js +15 -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 +496 -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 +33 -4
- package/esm/schema/entitlement_override.schema.js +17 -1
- package/esm/schema/estimate.schema.js +581 -36
- package/esm/schema/event.schema.js +1282 -633
- 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 +562 -66
- package/esm/schema/index.js +3 -0
- package/esm/schema/invoice.schema.js +821 -121
- 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_operation.schema.js +42 -15
- package/esm/schema/metered_feature.schema.js +10 -1
- package/esm/schema/omnichannel_one_time_order.schema.js +32 -2
- package/esm/schema/omnichannel_subscription.schema.js +136 -30
- 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 +360 -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 +79 -14
- 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 +204 -12
- package/esm/schema/quote.schema.js +901 -81
- package/esm/schema/quote_entitlement.schema.js +6 -2
- package/esm/schema/ramp.schema.js +238 -24
- package/esm/schema/site_migration_detail.schema.js +50 -16
- package/esm/schema/subscription.schema.js +998 -169
- 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 +55 -12
- package/esm/schema/usage_event.schema.js +13 -1
- package/esm/schema/virtual_bank_account.schema.js +42 -10
- package/esm/schema/webhook_endpoint.schema.js +4 -0
- package/package.json +1 -1
- package/types/core.d.ts +10 -6
- package/types/index.d.ts +8 -1
- package/types/resources/BillingLineItem.d.ts +10 -0
- package/types/resources/BillingMetadata.d.ts +9 -0
- package/types/resources/Content.d.ts +5 -0
- package/types/resources/Discount.d.ts +1 -0
- package/types/resources/DraftRequest.d.ts +1 -1
- package/types/resources/Estimate.d.ts +3 -0
- package/types/resources/Event.d.ts +2 -0
- 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/HostedPage.d.ts +18 -0
- package/types/resources/Invoice.d.ts +4 -0
- package/types/resources/OrganizationDetail.d.ts +84 -0
- package/types/resources/Subscription.d.ts +3 -0
- package/types/resources/Usage.d.ts +1 -0
- package/types/resources/WebhookEvent.d.ts +10 -0
|
@@ -113,6 +113,15 @@ const CreateSubscriptionEstimateContractTermSchema = zod_1.z.object({
|
|
|
113
113
|
action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
|
|
114
114
|
cancellation_cutoff_period: zod_1.z.number().int().optional(),
|
|
115
115
|
});
|
|
116
|
+
const CreateSubscriptionEstimateAddonsItemSchema = zod_1.z.object({
|
|
117
|
+
id: zod_1.z.string().max(100).optional(),
|
|
118
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
119
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
120
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
121
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
122
|
+
billing_cycles: zod_1.z.number().int().min(0).optional(),
|
|
123
|
+
trial_end: zod_1.z.number().int().optional(),
|
|
124
|
+
});
|
|
116
125
|
const CreateSubscriptionEstimateAddonsSchema = zod_1.z.object({
|
|
117
126
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
118
127
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -122,6 +131,25 @@ const CreateSubscriptionEstimateAddonsSchema = zod_1.z.object({
|
|
|
122
131
|
billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
123
132
|
trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
124
133
|
});
|
|
134
|
+
const CreateSubscriptionEstimateEventBasedAddonsItemSchema = zod_1.z.object({
|
|
135
|
+
id: zod_1.z.string().max(100).optional(),
|
|
136
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
137
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
138
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
139
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
140
|
+
service_period_in_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
141
|
+
on_event: zod_1.z
|
|
142
|
+
.enum([
|
|
143
|
+
'subscription_creation',
|
|
144
|
+
'subscription_trial_start',
|
|
145
|
+
'plan_activation',
|
|
146
|
+
'subscription_activation',
|
|
147
|
+
'contract_termination',
|
|
148
|
+
])
|
|
149
|
+
.optional(),
|
|
150
|
+
charge_once: zod_1.z.boolean().default(true).optional(),
|
|
151
|
+
charge_on: zod_1.z.enum(['immediately', 'on_event']).optional(),
|
|
152
|
+
});
|
|
125
153
|
const CreateSubscriptionEstimateEventBasedAddonsSchema = zod_1.z.object({
|
|
126
154
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
127
155
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -145,6 +173,11 @@ const CreateSubscriptionEstimateEventBasedAddonsSchema = zod_1.z.object({
|
|
|
145
173
|
charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
|
|
146
174
|
charge_on: zod_1.z.array(zod_1.z.enum(['immediately', 'on_event']).optional()).optional(),
|
|
147
175
|
});
|
|
176
|
+
const CreateSubscriptionEstimateTaxProvidersFieldsItemSchema = zod_1.z.object({
|
|
177
|
+
provider_name: zod_1.z.string().max(50).optional(),
|
|
178
|
+
field_id: zod_1.z.string().max(50).optional(),
|
|
179
|
+
field_value: zod_1.z.string().max(50).optional(),
|
|
180
|
+
});
|
|
148
181
|
const CreateSubscriptionEstimateTaxProvidersFieldsSchema = zod_1.z.object({
|
|
149
182
|
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
150
183
|
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
@@ -166,9 +199,24 @@ const CreateSubscriptionEstimateBodySchema = zod_1.z.looseObject({
|
|
|
166
199
|
shipping_address: CreateSubscriptionEstimateShippingAddressSchema.optional(),
|
|
167
200
|
customer: CreateSubscriptionEstimateCustomerSchema.optional(),
|
|
168
201
|
contract_term: CreateSubscriptionEstimateContractTermSchema.optional(),
|
|
169
|
-
addons:
|
|
170
|
-
|
|
171
|
-
|
|
202
|
+
addons: zod_1.z
|
|
203
|
+
.union([
|
|
204
|
+
zod_1.z.array(CreateSubscriptionEstimateAddonsItemSchema.optional()),
|
|
205
|
+
CreateSubscriptionEstimateAddonsSchema,
|
|
206
|
+
])
|
|
207
|
+
.optional(),
|
|
208
|
+
event_based_addons: zod_1.z
|
|
209
|
+
.union([
|
|
210
|
+
zod_1.z.array(CreateSubscriptionEstimateEventBasedAddonsItemSchema.optional()),
|
|
211
|
+
CreateSubscriptionEstimateEventBasedAddonsSchema,
|
|
212
|
+
])
|
|
213
|
+
.optional(),
|
|
214
|
+
tax_providers_fields: zod_1.z
|
|
215
|
+
.union([
|
|
216
|
+
zod_1.z.array(CreateSubscriptionEstimateTaxProvidersFieldsItemSchema.optional()),
|
|
217
|
+
CreateSubscriptionEstimateTaxProvidersFieldsSchema,
|
|
218
|
+
])
|
|
219
|
+
.optional(),
|
|
172
220
|
});
|
|
173
221
|
exports.CreateSubscriptionEstimateBodySchema = CreateSubscriptionEstimateBodySchema;
|
|
174
222
|
//Estimate.createSubItemEstimate
|
|
@@ -275,6 +323,29 @@ const CreateSubItemEstimateEstimateContractTermSchema = zod_1.z.object({
|
|
|
275
323
|
contract_start: zod_1.z.number().int().optional(),
|
|
276
324
|
cancellation_cutoff_period: zod_1.z.number().int().optional(),
|
|
277
325
|
});
|
|
326
|
+
const CreateSubItemEstimateEstimateSubscriptionItemsItemSchema = zod_1.z.object({
|
|
327
|
+
item_price_id: zod_1.z.string().max(100),
|
|
328
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
329
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
330
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
331
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
332
|
+
billing_cycles: zod_1.z.number().int().min(0).optional(),
|
|
333
|
+
trial_end: zod_1.z.number().int().optional(),
|
|
334
|
+
service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
335
|
+
charge_on_event: zod_1.z
|
|
336
|
+
.enum([
|
|
337
|
+
'subscription_creation',
|
|
338
|
+
'subscription_trial_start',
|
|
339
|
+
'plan_activation',
|
|
340
|
+
'subscription_activation',
|
|
341
|
+
'contract_termination',
|
|
342
|
+
])
|
|
343
|
+
.optional(),
|
|
344
|
+
charge_once: zod_1.z.boolean().optional(),
|
|
345
|
+
item_type: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
|
|
346
|
+
description: zod_1.z.string().max(2000).optional(),
|
|
347
|
+
charge_on_option: zod_1.z.enum(['immediately', 'on_event']).optional(),
|
|
348
|
+
});
|
|
278
349
|
const CreateSubItemEstimateEstimateSubscriptionItemsSchema = zod_1.z.object({
|
|
279
350
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
280
351
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -299,11 +370,23 @@ const CreateSubItemEstimateEstimateSubscriptionItemsSchema = zod_1.z.object({
|
|
|
299
370
|
.optional(),
|
|
300
371
|
charge_once: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
|
|
301
372
|
item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
302
|
-
description: zod_1.z.array(zod_1.z.string().max(
|
|
373
|
+
description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
|
|
303
374
|
charge_on_option: zod_1.z
|
|
304
375
|
.array(zod_1.z.enum(['immediately', 'on_event']).optional())
|
|
305
376
|
.optional(),
|
|
306
377
|
});
|
|
378
|
+
const CreateSubItemEstimateEstimateDiscountsItemSchema = zod_1.z.object({
|
|
379
|
+
apply_on: zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional(),
|
|
380
|
+
duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']),
|
|
381
|
+
percentage: zod_1.z.number().min(0.01).max(100).optional(),
|
|
382
|
+
amount: zod_1.z.number().int().min(0).optional(),
|
|
383
|
+
period: zod_1.z.number().int().min(1).optional(),
|
|
384
|
+
period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
385
|
+
included_in_mrr: zod_1.z.boolean().optional(),
|
|
386
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
387
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
388
|
+
description: zod_1.z.string().max(100).optional(),
|
|
389
|
+
});
|
|
307
390
|
const CreateSubItemEstimateEstimateDiscountsSchema = zod_1.z.object({
|
|
308
391
|
apply_on: zod_1.z
|
|
309
392
|
.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
|
|
@@ -318,6 +401,18 @@ const CreateSubItemEstimateEstimateDiscountsSchema = zod_1.z.object({
|
|
|
318
401
|
included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
|
|
319
402
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
320
403
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
404
|
+
description: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
405
|
+
});
|
|
406
|
+
const CreateSubItemEstimateEstimateItemTiersItemSchema = zod_1.z.object({
|
|
407
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
408
|
+
starting_unit: zod_1.z.number().int().min(1).optional(),
|
|
409
|
+
ending_unit: zod_1.z.number().int().optional(),
|
|
410
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
411
|
+
starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
412
|
+
ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
413
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
414
|
+
pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
415
|
+
package_size: zod_1.z.number().int().min(1).optional(),
|
|
321
416
|
});
|
|
322
417
|
const CreateSubItemEstimateEstimateItemTiersSchema = zod_1.z.object({
|
|
323
418
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
@@ -332,6 +427,11 @@ const CreateSubItemEstimateEstimateItemTiersSchema = zod_1.z.object({
|
|
|
332
427
|
.optional(),
|
|
333
428
|
package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
334
429
|
});
|
|
430
|
+
const CreateSubItemEstimateEstimateTaxProvidersFieldsItemSchema = zod_1.z.object({
|
|
431
|
+
provider_name: zod_1.z.string().max(50).optional(),
|
|
432
|
+
field_id: zod_1.z.string().max(50).optional(),
|
|
433
|
+
field_value: zod_1.z.string().max(50).optional(),
|
|
434
|
+
});
|
|
335
435
|
const CreateSubItemEstimateEstimateTaxProvidersFieldsSchema = zod_1.z.object({
|
|
336
436
|
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
337
437
|
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
@@ -351,10 +451,30 @@ const CreateSubItemEstimateEstimateBodySchema = zod_1.z.looseObject({
|
|
|
351
451
|
shipping_address: CreateSubItemEstimateEstimateShippingAddressSchema.optional(),
|
|
352
452
|
customer: CreateSubItemEstimateEstimateCustomerSchema.optional(),
|
|
353
453
|
contract_term: CreateSubItemEstimateEstimateContractTermSchema.optional(),
|
|
354
|
-
subscription_items:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
454
|
+
subscription_items: zod_1.z
|
|
455
|
+
.union([
|
|
456
|
+
zod_1.z.array(CreateSubItemEstimateEstimateSubscriptionItemsItemSchema.optional()),
|
|
457
|
+
CreateSubItemEstimateEstimateSubscriptionItemsSchema,
|
|
458
|
+
])
|
|
459
|
+
.optional(),
|
|
460
|
+
discounts: zod_1.z
|
|
461
|
+
.union([
|
|
462
|
+
zod_1.z.array(CreateSubItemEstimateEstimateDiscountsItemSchema.optional()),
|
|
463
|
+
CreateSubItemEstimateEstimateDiscountsSchema,
|
|
464
|
+
])
|
|
465
|
+
.optional(),
|
|
466
|
+
item_tiers: zod_1.z
|
|
467
|
+
.union([
|
|
468
|
+
zod_1.z.array(CreateSubItemEstimateEstimateItemTiersItemSchema.optional()),
|
|
469
|
+
CreateSubItemEstimateEstimateItemTiersSchema,
|
|
470
|
+
])
|
|
471
|
+
.optional(),
|
|
472
|
+
tax_providers_fields: zod_1.z
|
|
473
|
+
.union([
|
|
474
|
+
zod_1.z.array(CreateSubItemEstimateEstimateTaxProvidersFieldsItemSchema.optional()),
|
|
475
|
+
CreateSubItemEstimateEstimateTaxProvidersFieldsSchema,
|
|
476
|
+
])
|
|
477
|
+
.optional(),
|
|
358
478
|
});
|
|
359
479
|
exports.CreateSubItemEstimateEstimateBodySchema = CreateSubItemEstimateEstimateBodySchema;
|
|
360
480
|
//Estimate.createSubForCustomerEstimate
|
|
@@ -418,6 +538,15 @@ const CreateSubForCustomerEstimateEstimateContractTermSchema = zod_1.z.object({
|
|
|
418
538
|
action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
|
|
419
539
|
cancellation_cutoff_period: zod_1.z.number().int().optional(),
|
|
420
540
|
});
|
|
541
|
+
const CreateSubForCustomerEstimateEstimateAddonsItemSchema = zod_1.z.object({
|
|
542
|
+
id: zod_1.z.string().max(100).optional(),
|
|
543
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
544
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
545
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
546
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
547
|
+
billing_cycles: zod_1.z.number().int().min(0).optional(),
|
|
548
|
+
trial_end: zod_1.z.number().int().optional(),
|
|
549
|
+
});
|
|
421
550
|
const CreateSubForCustomerEstimateEstimateAddonsSchema = zod_1.z.object({
|
|
422
551
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
423
552
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -427,6 +556,25 @@ const CreateSubForCustomerEstimateEstimateAddonsSchema = zod_1.z.object({
|
|
|
427
556
|
billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
428
557
|
trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
429
558
|
});
|
|
559
|
+
const CreateSubForCustomerEstimateEstimateEventBasedAddonsItemSchema = zod_1.z.object({
|
|
560
|
+
id: zod_1.z.string().max(100).optional(),
|
|
561
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
562
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
563
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
564
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
565
|
+
service_period_in_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
566
|
+
on_event: zod_1.z
|
|
567
|
+
.enum([
|
|
568
|
+
'subscription_creation',
|
|
569
|
+
'subscription_trial_start',
|
|
570
|
+
'plan_activation',
|
|
571
|
+
'subscription_activation',
|
|
572
|
+
'contract_termination',
|
|
573
|
+
])
|
|
574
|
+
.optional(),
|
|
575
|
+
charge_once: zod_1.z.boolean().default(true).optional(),
|
|
576
|
+
charge_on: zod_1.z.enum(['immediately', 'on_event']).optional(),
|
|
577
|
+
});
|
|
430
578
|
const CreateSubForCustomerEstimateEstimateEventBasedAddonsSchema = zod_1.z.object({
|
|
431
579
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
432
580
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -464,8 +612,18 @@ const CreateSubForCustomerEstimateEstimateBodySchema = zod_1.z.looseObject({
|
|
|
464
612
|
subscription: CreateSubForCustomerEstimateEstimateSubscriptionSchema.optional(),
|
|
465
613
|
shipping_address: CreateSubForCustomerEstimateEstimateShippingAddressSchema.optional(),
|
|
466
614
|
contract_term: CreateSubForCustomerEstimateEstimateContractTermSchema.optional(),
|
|
467
|
-
addons:
|
|
468
|
-
|
|
615
|
+
addons: zod_1.z
|
|
616
|
+
.union([
|
|
617
|
+
zod_1.z.array(CreateSubForCustomerEstimateEstimateAddonsItemSchema.optional()),
|
|
618
|
+
CreateSubForCustomerEstimateEstimateAddonsSchema,
|
|
619
|
+
])
|
|
620
|
+
.optional(),
|
|
621
|
+
event_based_addons: zod_1.z
|
|
622
|
+
.union([
|
|
623
|
+
zod_1.z.array(CreateSubForCustomerEstimateEstimateEventBasedAddonsItemSchema.optional()),
|
|
624
|
+
CreateSubForCustomerEstimateEstimateEventBasedAddonsSchema,
|
|
625
|
+
])
|
|
626
|
+
.optional(),
|
|
469
627
|
});
|
|
470
628
|
exports.CreateSubForCustomerEstimateEstimateBodySchema = CreateSubForCustomerEstimateEstimateBodySchema;
|
|
471
629
|
//Estimate.createSubItemForCustomerEstimate
|
|
@@ -541,6 +699,29 @@ const CreateSubItemForCustomerEstimateEstimateBillingOverrideSchema = zod_1.z.ob
|
|
|
541
699
|
max_excess_payment_usage: zod_1.z.number().int().min(-1).optional(),
|
|
542
700
|
max_refundable_credits_usage: zod_1.z.number().int().min(-1).optional(),
|
|
543
701
|
});
|
|
702
|
+
const CreateSubItemForCustomerEstimateEstimateSubscriptionItemsItemSchema = zod_1.z.object({
|
|
703
|
+
item_price_id: zod_1.z.string().max(100),
|
|
704
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
705
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
706
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
707
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
708
|
+
billing_cycles: zod_1.z.number().int().min(0).optional(),
|
|
709
|
+
trial_end: zod_1.z.number().int().optional(),
|
|
710
|
+
service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
711
|
+
charge_on_event: zod_1.z
|
|
712
|
+
.enum([
|
|
713
|
+
'subscription_creation',
|
|
714
|
+
'subscription_trial_start',
|
|
715
|
+
'plan_activation',
|
|
716
|
+
'subscription_activation',
|
|
717
|
+
'contract_termination',
|
|
718
|
+
])
|
|
719
|
+
.optional(),
|
|
720
|
+
charge_once: zod_1.z.boolean().optional(),
|
|
721
|
+
item_type: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
|
|
722
|
+
description: zod_1.z.string().max(2000).optional(),
|
|
723
|
+
charge_on_option: zod_1.z.enum(['immediately', 'on_event']).optional(),
|
|
724
|
+
});
|
|
544
725
|
const CreateSubItemForCustomerEstimateEstimateSubscriptionItemsSchema = zod_1.z.object({
|
|
545
726
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
546
727
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -567,11 +748,23 @@ const CreateSubItemForCustomerEstimateEstimateSubscriptionItemsSchema = zod_1.z.
|
|
|
567
748
|
item_type: zod_1.z
|
|
568
749
|
.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional())
|
|
569
750
|
.optional(),
|
|
570
|
-
description: zod_1.z.array(zod_1.z.string().max(
|
|
751
|
+
description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
|
|
571
752
|
charge_on_option: zod_1.z
|
|
572
753
|
.array(zod_1.z.enum(['immediately', 'on_event']).optional())
|
|
573
754
|
.optional(),
|
|
574
755
|
});
|
|
756
|
+
const CreateSubItemForCustomerEstimateEstimateDiscountsItemSchema = zod_1.z.object({
|
|
757
|
+
apply_on: zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional(),
|
|
758
|
+
duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']),
|
|
759
|
+
percentage: zod_1.z.number().min(0.01).max(100).optional(),
|
|
760
|
+
amount: zod_1.z.number().int().min(0).optional(),
|
|
761
|
+
period: zod_1.z.number().int().min(1).optional(),
|
|
762
|
+
period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
763
|
+
included_in_mrr: zod_1.z.boolean().optional(),
|
|
764
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
765
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
766
|
+
description: zod_1.z.string().max(100).optional(),
|
|
767
|
+
});
|
|
575
768
|
const CreateSubItemForCustomerEstimateEstimateDiscountsSchema = zod_1.z.object({
|
|
576
769
|
apply_on: zod_1.z
|
|
577
770
|
.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
|
|
@@ -586,6 +779,18 @@ const CreateSubItemForCustomerEstimateEstimateDiscountsSchema = zod_1.z.object({
|
|
|
586
779
|
included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
|
|
587
780
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
588
781
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
782
|
+
description: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
783
|
+
});
|
|
784
|
+
const CreateSubItemForCustomerEstimateEstimateItemTiersItemSchema = zod_1.z.object({
|
|
785
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
786
|
+
starting_unit: zod_1.z.number().int().min(1).optional(),
|
|
787
|
+
ending_unit: zod_1.z.number().int().optional(),
|
|
788
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
789
|
+
starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
790
|
+
ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
791
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
792
|
+
pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
793
|
+
package_size: zod_1.z.number().int().min(1).optional(),
|
|
589
794
|
});
|
|
590
795
|
const CreateSubItemForCustomerEstimateEstimateItemTiersSchema = zod_1.z.object({
|
|
591
796
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
@@ -614,9 +819,24 @@ const CreateSubItemForCustomerEstimateEstimateBodySchema = zod_1.z.looseObject({
|
|
|
614
819
|
billing_address: CreateSubItemForCustomerEstimateEstimateBillingAddressSchema.optional(),
|
|
615
820
|
contract_term: CreateSubItemForCustomerEstimateEstimateContractTermSchema.optional(),
|
|
616
821
|
billing_override: CreateSubItemForCustomerEstimateEstimateBillingOverrideSchema.optional(),
|
|
617
|
-
subscription_items:
|
|
618
|
-
|
|
619
|
-
|
|
822
|
+
subscription_items: zod_1.z
|
|
823
|
+
.union([
|
|
824
|
+
zod_1.z.array(CreateSubItemForCustomerEstimateEstimateSubscriptionItemsItemSchema.optional()),
|
|
825
|
+
CreateSubItemForCustomerEstimateEstimateSubscriptionItemsSchema,
|
|
826
|
+
])
|
|
827
|
+
.optional(),
|
|
828
|
+
discounts: zod_1.z
|
|
829
|
+
.union([
|
|
830
|
+
zod_1.z.array(CreateSubItemForCustomerEstimateEstimateDiscountsItemSchema.optional()),
|
|
831
|
+
CreateSubItemForCustomerEstimateEstimateDiscountsSchema,
|
|
832
|
+
])
|
|
833
|
+
.optional(),
|
|
834
|
+
item_tiers: zod_1.z
|
|
835
|
+
.union([
|
|
836
|
+
zod_1.z.array(CreateSubItemForCustomerEstimateEstimateItemTiersItemSchema.optional()),
|
|
837
|
+
CreateSubItemForCustomerEstimateEstimateItemTiersSchema,
|
|
838
|
+
])
|
|
839
|
+
.optional(),
|
|
620
840
|
});
|
|
621
841
|
exports.CreateSubItemForCustomerEstimateEstimateBodySchema = CreateSubItemForCustomerEstimateEstimateBodySchema;
|
|
622
842
|
//Estimate.updateSubscription
|
|
@@ -690,6 +910,16 @@ const UpdateSubscriptionEstimateCustomerSchema = zod_1.z.object({
|
|
|
690
910
|
registered_for_gst: zod_1.z.boolean().optional(),
|
|
691
911
|
taxability: zod_1.z.enum(['taxable', 'exempt', 'zero_rated']).optional(),
|
|
692
912
|
});
|
|
913
|
+
const UpdateSubscriptionEstimateAddonsItemSchema = zod_1.z.object({
|
|
914
|
+
id: zod_1.z.string().max(100).optional(),
|
|
915
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
916
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
917
|
+
billing_cycles: zod_1.z.number().int().min(0).optional(),
|
|
918
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
919
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
920
|
+
trial_end: zod_1.z.number().int().optional(),
|
|
921
|
+
proration_type: zod_1.z.enum(['full_term', 'partial_term', 'none']).optional(),
|
|
922
|
+
});
|
|
693
923
|
const UpdateSubscriptionEstimateAddonsSchema = zod_1.z.object({
|
|
694
924
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
695
925
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -702,6 +932,25 @@ const UpdateSubscriptionEstimateAddonsSchema = zod_1.z.object({
|
|
|
702
932
|
.array(zod_1.z.enum(['full_term', 'partial_term', 'none']).optional())
|
|
703
933
|
.optional(),
|
|
704
934
|
});
|
|
935
|
+
const UpdateSubscriptionEstimateEventBasedAddonsItemSchema = zod_1.z.object({
|
|
936
|
+
id: zod_1.z.string().max(100).optional(),
|
|
937
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
938
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
939
|
+
service_period_in_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
940
|
+
charge_on: zod_1.z.enum(['immediately', 'on_event']).optional(),
|
|
941
|
+
on_event: zod_1.z
|
|
942
|
+
.enum([
|
|
943
|
+
'subscription_creation',
|
|
944
|
+
'subscription_trial_start',
|
|
945
|
+
'plan_activation',
|
|
946
|
+
'subscription_activation',
|
|
947
|
+
'contract_termination',
|
|
948
|
+
])
|
|
949
|
+
.optional(),
|
|
950
|
+
charge_once: zod_1.z.boolean().default(true).optional(),
|
|
951
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
952
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
953
|
+
});
|
|
705
954
|
const UpdateSubscriptionEstimateEventBasedAddonsSchema = zod_1.z.object({
|
|
706
955
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
707
956
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -752,8 +1001,18 @@ const UpdateSubscriptionEstimateBodySchema = zod_1.z.looseObject({
|
|
|
752
1001
|
billing_address: UpdateSubscriptionEstimateBillingAddressSchema.optional(),
|
|
753
1002
|
shipping_address: UpdateSubscriptionEstimateShippingAddressSchema.optional(),
|
|
754
1003
|
customer: UpdateSubscriptionEstimateCustomerSchema.optional(),
|
|
755
|
-
addons:
|
|
756
|
-
|
|
1004
|
+
addons: zod_1.z
|
|
1005
|
+
.union([
|
|
1006
|
+
zod_1.z.array(UpdateSubscriptionEstimateAddonsItemSchema.optional()),
|
|
1007
|
+
UpdateSubscriptionEstimateAddonsSchema,
|
|
1008
|
+
])
|
|
1009
|
+
.optional(),
|
|
1010
|
+
event_based_addons: zod_1.z
|
|
1011
|
+
.union([
|
|
1012
|
+
zod_1.z.array(UpdateSubscriptionEstimateEventBasedAddonsItemSchema.optional()),
|
|
1013
|
+
UpdateSubscriptionEstimateEventBasedAddonsSchema,
|
|
1014
|
+
])
|
|
1015
|
+
.optional(),
|
|
757
1016
|
});
|
|
758
1017
|
exports.UpdateSubscriptionEstimateBodySchema = UpdateSubscriptionEstimateBodySchema;
|
|
759
1018
|
//Estimate.updateSubscriptionForItems
|
|
@@ -826,6 +1085,30 @@ const UpdateSubscriptionForItemsEstimateBillingOverrideSchema = zod_1.z.object({
|
|
|
826
1085
|
max_excess_payment_usage: zod_1.z.number().int().min(-1).optional(),
|
|
827
1086
|
max_refundable_credits_usage: zod_1.z.number().int().min(-1).optional(),
|
|
828
1087
|
});
|
|
1088
|
+
const UpdateSubscriptionForItemsEstimateSubscriptionItemsItemSchema = zod_1.z.object({
|
|
1089
|
+
item_price_id: zod_1.z.string().max(100),
|
|
1090
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1091
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1092
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
1093
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1094
|
+
billing_cycles: zod_1.z.number().int().min(0).optional(),
|
|
1095
|
+
trial_end: zod_1.z.number().int().optional(),
|
|
1096
|
+
service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
1097
|
+
charge_on_event: zod_1.z
|
|
1098
|
+
.enum([
|
|
1099
|
+
'subscription_creation',
|
|
1100
|
+
'subscription_trial_start',
|
|
1101
|
+
'plan_activation',
|
|
1102
|
+
'subscription_activation',
|
|
1103
|
+
'contract_termination',
|
|
1104
|
+
])
|
|
1105
|
+
.optional(),
|
|
1106
|
+
charge_once: zod_1.z.boolean().optional(),
|
|
1107
|
+
charge_on_option: zod_1.z.enum(['immediately', 'on_event']).optional(),
|
|
1108
|
+
item_type: zod_1.z.enum(['plan', 'addon', 'charge']).optional(),
|
|
1109
|
+
description: zod_1.z.string().max(2000).optional(),
|
|
1110
|
+
proration_type: zod_1.z.enum(['full_term', 'partial_term', 'none']).optional(),
|
|
1111
|
+
});
|
|
829
1112
|
const UpdateSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object({
|
|
830
1113
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
831
1114
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -853,11 +1136,25 @@ const UpdateSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object
|
|
|
853
1136
|
.array(zod_1.z.enum(['immediately', 'on_event']).optional())
|
|
854
1137
|
.optional(),
|
|
855
1138
|
item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
856
|
-
description: zod_1.z.array(zod_1.z.string().max(
|
|
1139
|
+
description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
|
|
857
1140
|
proration_type: zod_1.z
|
|
858
1141
|
.array(zod_1.z.enum(['full_term', 'partial_term', 'none']).optional())
|
|
859
1142
|
.optional(),
|
|
860
1143
|
});
|
|
1144
|
+
const UpdateSubscriptionForItemsEstimateDiscountsItemSchema = zod_1.z.object({
|
|
1145
|
+
apply_on: zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional(),
|
|
1146
|
+
duration_type: zod_1.z.enum(['one_time', 'forever', 'limited_period']),
|
|
1147
|
+
percentage: zod_1.z.number().min(0.01).max(100).optional(),
|
|
1148
|
+
amount: zod_1.z.number().int().min(0).optional(),
|
|
1149
|
+
period: zod_1.z.number().int().min(1).optional(),
|
|
1150
|
+
period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
1151
|
+
included_in_mrr: zod_1.z.boolean().optional(),
|
|
1152
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
1153
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1154
|
+
operation_type: zod_1.z.enum(['add', 'remove']),
|
|
1155
|
+
id: zod_1.z.string().max(50).optional(),
|
|
1156
|
+
description: zod_1.z.string().max(100).optional(),
|
|
1157
|
+
});
|
|
861
1158
|
const UpdateSubscriptionForItemsEstimateDiscountsSchema = zod_1.z.object({
|
|
862
1159
|
apply_on: zod_1.z
|
|
863
1160
|
.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
|
|
@@ -874,6 +1171,18 @@ const UpdateSubscriptionForItemsEstimateDiscountsSchema = zod_1.z.object({
|
|
|
874
1171
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
875
1172
|
operation_type: zod_1.z.array(zod_1.z.enum(['add', 'remove']).optional()),
|
|
876
1173
|
id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
1174
|
+
description: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1175
|
+
});
|
|
1176
|
+
const UpdateSubscriptionForItemsEstimateItemTiersItemSchema = zod_1.z.object({
|
|
1177
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
1178
|
+
starting_unit: zod_1.z.number().int().min(1).optional(),
|
|
1179
|
+
ending_unit: zod_1.z.number().int().optional(),
|
|
1180
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
1181
|
+
starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1182
|
+
ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1183
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1184
|
+
pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
1185
|
+
package_size: zod_1.z.number().int().min(1).optional(),
|
|
877
1186
|
});
|
|
878
1187
|
const UpdateSubscriptionForItemsEstimateItemTiersSchema = zod_1.z.object({
|
|
879
1188
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
@@ -915,9 +1224,24 @@ const UpdateSubscriptionForItemsEstimateBodySchema = zod_1.z.looseObject({
|
|
|
915
1224
|
shipping_address: UpdateSubscriptionForItemsEstimateShippingAddressSchema.optional(),
|
|
916
1225
|
customer: UpdateSubscriptionForItemsEstimateCustomerSchema.optional(),
|
|
917
1226
|
billing_override: UpdateSubscriptionForItemsEstimateBillingOverrideSchema.optional(),
|
|
918
|
-
subscription_items:
|
|
919
|
-
|
|
920
|
-
|
|
1227
|
+
subscription_items: zod_1.z
|
|
1228
|
+
.union([
|
|
1229
|
+
zod_1.z.array(UpdateSubscriptionForItemsEstimateSubscriptionItemsItemSchema.optional()),
|
|
1230
|
+
UpdateSubscriptionForItemsEstimateSubscriptionItemsSchema,
|
|
1231
|
+
])
|
|
1232
|
+
.optional(),
|
|
1233
|
+
discounts: zod_1.z
|
|
1234
|
+
.union([
|
|
1235
|
+
zod_1.z.array(UpdateSubscriptionForItemsEstimateDiscountsItemSchema.optional()),
|
|
1236
|
+
UpdateSubscriptionForItemsEstimateDiscountsSchema,
|
|
1237
|
+
])
|
|
1238
|
+
.optional(),
|
|
1239
|
+
item_tiers: zod_1.z
|
|
1240
|
+
.union([
|
|
1241
|
+
zod_1.z.array(UpdateSubscriptionForItemsEstimateItemTiersItemSchema.optional()),
|
|
1242
|
+
UpdateSubscriptionForItemsEstimateItemTiersSchema,
|
|
1243
|
+
])
|
|
1244
|
+
.optional(),
|
|
921
1245
|
});
|
|
922
1246
|
exports.UpdateSubscriptionForItemsEstimateBodySchema = UpdateSubscriptionForItemsEstimateBodySchema;
|
|
923
1247
|
//Estimate.renewalEstimate
|
|
@@ -938,6 +1262,10 @@ const AdvanceInvoiceEstimateEstimateFixedIntervalScheduleSchema = zod_1.z.object
|
|
|
938
1262
|
.optional(),
|
|
939
1263
|
end_date: zod_1.z.number().int().optional(),
|
|
940
1264
|
});
|
|
1265
|
+
const AdvanceInvoiceEstimateEstimateSpecificDatesScheduleItemSchema = zod_1.z.object({
|
|
1266
|
+
terms_to_charge: zod_1.z.number().int().optional(),
|
|
1267
|
+
date: zod_1.z.number().int().optional(),
|
|
1268
|
+
});
|
|
941
1269
|
const AdvanceInvoiceEstimateEstimateSpecificDatesScheduleSchema = zod_1.z.object({
|
|
942
1270
|
terms_to_charge: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
943
1271
|
date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
@@ -949,7 +1277,12 @@ const AdvanceInvoiceEstimateEstimateBodySchema = zod_1.z.looseObject({
|
|
|
949
1277
|
.enum(['immediate', 'specific_dates', 'fixed_intervals'])
|
|
950
1278
|
.optional(),
|
|
951
1279
|
fixed_interval_schedule: AdvanceInvoiceEstimateEstimateFixedIntervalScheduleSchema.optional(),
|
|
952
|
-
specific_dates_schedule:
|
|
1280
|
+
specific_dates_schedule: zod_1.z
|
|
1281
|
+
.union([
|
|
1282
|
+
zod_1.z.array(AdvanceInvoiceEstimateEstimateSpecificDatesScheduleItemSchema.optional()),
|
|
1283
|
+
AdvanceInvoiceEstimateEstimateSpecificDatesScheduleSchema,
|
|
1284
|
+
])
|
|
1285
|
+
.optional(),
|
|
953
1286
|
});
|
|
954
1287
|
exports.AdvanceInvoiceEstimateEstimateBodySchema = AdvanceInvoiceEstimateEstimateBodySchema;
|
|
955
1288
|
//Estimate.regenerateInvoiceEstimate
|
|
@@ -973,6 +1306,12 @@ const ChangeTermEndEstimateBodySchema = zod_1.z.looseObject({
|
|
|
973
1306
|
});
|
|
974
1307
|
exports.ChangeTermEndEstimateBodySchema = ChangeTermEndEstimateBodySchema;
|
|
975
1308
|
//Estimate.cancelSubscription
|
|
1309
|
+
const CancelSubscriptionEstimateEventBasedAddonsItemSchema = zod_1.z.object({
|
|
1310
|
+
id: zod_1.z.string().max(100).optional(),
|
|
1311
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1312
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
1313
|
+
service_period_in_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
1314
|
+
});
|
|
976
1315
|
const CancelSubscriptionEstimateEventBasedAddonsSchema = zod_1.z.object({
|
|
977
1316
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
978
1317
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1012,10 +1351,23 @@ const CancelSubscriptionEstimateBodySchema = zod_1.z.looseObject({
|
|
|
1012
1351
|
.optional(),
|
|
1013
1352
|
invoice_date: zod_1.z.number().int().optional(),
|
|
1014
1353
|
cancel_reason_code: zod_1.z.string().max(100).optional(),
|
|
1015
|
-
event_based_addons:
|
|
1354
|
+
event_based_addons: zod_1.z
|
|
1355
|
+
.union([
|
|
1356
|
+
zod_1.z.array(CancelSubscriptionEstimateEventBasedAddonsItemSchema.optional()),
|
|
1357
|
+
CancelSubscriptionEstimateEventBasedAddonsSchema,
|
|
1358
|
+
])
|
|
1359
|
+
.optional(),
|
|
1016
1360
|
});
|
|
1017
1361
|
exports.CancelSubscriptionEstimateBodySchema = CancelSubscriptionEstimateBodySchema;
|
|
1018
1362
|
//Estimate.cancelSubscriptionForItems
|
|
1363
|
+
const CancelSubscriptionForItemsEstimateSubscriptionItemsItemSchema = zod_1.z.object({
|
|
1364
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
1365
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1366
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1367
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
1368
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1369
|
+
service_period_days: zod_1.z.number().int().min(1).max(4000).optional(),
|
|
1370
|
+
});
|
|
1019
1371
|
const CancelSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object({
|
|
1020
1372
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1021
1373
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1058,7 +1410,12 @@ const CancelSubscriptionForItemsEstimateBodySchema = zod_1.z.looseObject({
|
|
|
1058
1410
|
invoice_date: zod_1.z.number().int().optional(),
|
|
1059
1411
|
include_cancellation_day_in_billing: zod_1.z.boolean().optional(),
|
|
1060
1412
|
cancel_reason_code: zod_1.z.string().max(100).optional(),
|
|
1061
|
-
subscription_items:
|
|
1413
|
+
subscription_items: zod_1.z
|
|
1414
|
+
.union([
|
|
1415
|
+
zod_1.z.array(CancelSubscriptionForItemsEstimateSubscriptionItemsItemSchema.optional()),
|
|
1416
|
+
CancelSubscriptionForItemsEstimateSubscriptionItemsSchema,
|
|
1417
|
+
])
|
|
1418
|
+
.optional(),
|
|
1062
1419
|
});
|
|
1063
1420
|
exports.CancelSubscriptionForItemsEstimateBodySchema = CancelSubscriptionForItemsEstimateBodySchema;
|
|
1064
1421
|
//Estimate.pauseSubscription
|
|
@@ -1207,6 +1564,11 @@ const GiftSubscriptionEstimateSubscriptionSchema = zod_1.z.object({
|
|
|
1207
1564
|
plan_quantity: zod_1.z.number().int().min(1).optional(),
|
|
1208
1565
|
plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1209
1566
|
});
|
|
1567
|
+
const GiftSubscriptionEstimateAddonsItemSchema = zod_1.z.object({
|
|
1568
|
+
id: zod_1.z.string().max(100).optional(),
|
|
1569
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1570
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1571
|
+
});
|
|
1210
1572
|
const GiftSubscriptionEstimateAddonsSchema = zod_1.z.object({
|
|
1211
1573
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1212
1574
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1220,7 +1582,12 @@ const GiftSubscriptionEstimateBodySchema = zod_1.z.looseObject({
|
|
|
1220
1582
|
payment_intent: GiftSubscriptionEstimatePaymentIntentSchema.optional(),
|
|
1221
1583
|
shipping_address: GiftSubscriptionEstimateShippingAddressSchema.optional(),
|
|
1222
1584
|
subscription: GiftSubscriptionEstimateSubscriptionSchema.optional(),
|
|
1223
|
-
addons:
|
|
1585
|
+
addons: zod_1.z
|
|
1586
|
+
.union([
|
|
1587
|
+
zod_1.z.array(GiftSubscriptionEstimateAddonsItemSchema.optional()),
|
|
1588
|
+
GiftSubscriptionEstimateAddonsSchema,
|
|
1589
|
+
])
|
|
1590
|
+
.optional(),
|
|
1224
1591
|
});
|
|
1225
1592
|
exports.GiftSubscriptionEstimateBodySchema = GiftSubscriptionEstimateBodySchema;
|
|
1226
1593
|
//Estimate.giftSubscriptionForItems
|
|
@@ -1338,6 +1705,13 @@ const GiftSubscriptionForItemsEstimateShippingAddressSchema = zod_1.z.object({
|
|
|
1338
1705
|
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
1339
1706
|
.optional(),
|
|
1340
1707
|
});
|
|
1708
|
+
const GiftSubscriptionForItemsEstimateSubscriptionItemsItemSchema = zod_1.z.object({
|
|
1709
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
1710
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1711
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1712
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
1713
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1714
|
+
});
|
|
1341
1715
|
const GiftSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object({
|
|
1342
1716
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1343
1717
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1345,6 +1719,15 @@ const GiftSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object({
|
|
|
1345
1719
|
unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
1346
1720
|
unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
|
|
1347
1721
|
});
|
|
1722
|
+
const GiftSubscriptionForItemsEstimateItemTiersItemSchema = zod_1.z.object({
|
|
1723
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
1724
|
+
starting_unit: zod_1.z.number().int().min(1).optional(),
|
|
1725
|
+
ending_unit: zod_1.z.number().int().optional(),
|
|
1726
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
1727
|
+
starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1728
|
+
ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1729
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1730
|
+
});
|
|
1348
1731
|
const GiftSubscriptionForItemsEstimateItemTiersSchema = zod_1.z.object({
|
|
1349
1732
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1350
1733
|
starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1361,8 +1744,18 @@ const GiftSubscriptionForItemsEstimateBodySchema = zod_1.z.looseObject({
|
|
|
1361
1744
|
gift_receiver: GiftSubscriptionForItemsEstimateGiftReceiverSchema.optional(),
|
|
1362
1745
|
payment_intent: GiftSubscriptionForItemsEstimatePaymentIntentSchema.optional(),
|
|
1363
1746
|
shipping_address: GiftSubscriptionForItemsEstimateShippingAddressSchema.optional(),
|
|
1364
|
-
subscription_items:
|
|
1365
|
-
|
|
1747
|
+
subscription_items: zod_1.z
|
|
1748
|
+
.union([
|
|
1749
|
+
zod_1.z.array(GiftSubscriptionForItemsEstimateSubscriptionItemsItemSchema.optional()),
|
|
1750
|
+
GiftSubscriptionForItemsEstimateSubscriptionItemsSchema,
|
|
1751
|
+
])
|
|
1752
|
+
.optional(),
|
|
1753
|
+
item_tiers: zod_1.z
|
|
1754
|
+
.union([
|
|
1755
|
+
zod_1.z.array(GiftSubscriptionForItemsEstimateItemTiersItemSchema.optional()),
|
|
1756
|
+
GiftSubscriptionForItemsEstimateItemTiersSchema,
|
|
1757
|
+
])
|
|
1758
|
+
.optional(),
|
|
1366
1759
|
});
|
|
1367
1760
|
exports.GiftSubscriptionForItemsEstimateBodySchema = GiftSubscriptionForItemsEstimateBodySchema;
|
|
1368
1761
|
//Estimate.createInvoice
|
|
@@ -1389,6 +1782,15 @@ const CreateInvoiceEstimateShippingAddressSchema = zod_1.z.object({
|
|
|
1389
1782
|
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
1390
1783
|
.optional(),
|
|
1391
1784
|
});
|
|
1785
|
+
const CreateInvoiceEstimateAddonsItemSchema = zod_1.z.object({
|
|
1786
|
+
id: zod_1.z.string().max(100).optional(),
|
|
1787
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1788
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1789
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
1790
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1791
|
+
date_from: zod_1.z.number().int().optional(),
|
|
1792
|
+
date_to: zod_1.z.number().int().optional(),
|
|
1793
|
+
});
|
|
1392
1794
|
const CreateInvoiceEstimateAddonsSchema = zod_1.z.object({
|
|
1393
1795
|
id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1394
1796
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1398,6 +1800,23 @@ const CreateInvoiceEstimateAddonsSchema = zod_1.z.object({
|
|
|
1398
1800
|
date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
1399
1801
|
date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
1400
1802
|
});
|
|
1803
|
+
const CreateInvoiceEstimateChargesItemSchema = zod_1.z.object({
|
|
1804
|
+
amount: zod_1.z.number().int().min(1).optional(),
|
|
1805
|
+
amount_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1806
|
+
description: zod_1.z.string().max(250).optional(),
|
|
1807
|
+
taxable: zod_1.z.boolean().default(true).optional(),
|
|
1808
|
+
tax_profile_id: zod_1.z.string().max(50).optional(),
|
|
1809
|
+
avalara_tax_code: zod_1.z.string().max(50).optional(),
|
|
1810
|
+
hsn_code: zod_1.z.string().max(50).optional(),
|
|
1811
|
+
taxjar_product_code: zod_1.z.string().max(50).optional(),
|
|
1812
|
+
avalara_sale_type: zod_1.z
|
|
1813
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
1814
|
+
.optional(),
|
|
1815
|
+
avalara_transaction_type: zod_1.z.number().int().optional(),
|
|
1816
|
+
avalara_service_type: zod_1.z.number().int().optional(),
|
|
1817
|
+
date_from: zod_1.z.number().int().optional(),
|
|
1818
|
+
date_to: zod_1.z.number().int().optional(),
|
|
1819
|
+
});
|
|
1401
1820
|
const CreateInvoiceEstimateChargesSchema = zod_1.z.object({
|
|
1402
1821
|
amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
1403
1822
|
amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
|
|
@@ -1415,6 +1834,12 @@ const CreateInvoiceEstimateChargesSchema = zod_1.z.object({
|
|
|
1415
1834
|
date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
1416
1835
|
date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
1417
1836
|
});
|
|
1837
|
+
const CreateInvoiceEstimateNotesToRemoveItemSchema = zod_1.z.object({
|
|
1838
|
+
entity_type: zod_1.z
|
|
1839
|
+
.enum(['plan', 'addon', 'customer', 'subscription', 'coupon'])
|
|
1840
|
+
.optional(),
|
|
1841
|
+
entity_id: zod_1.z.string().max(100).optional(),
|
|
1842
|
+
});
|
|
1418
1843
|
const CreateInvoiceEstimateNotesToRemoveSchema = zod_1.z.object({
|
|
1419
1844
|
entity_type: zod_1.z
|
|
1420
1845
|
.array(zod_1.z
|
|
@@ -1423,6 +1848,11 @@ const CreateInvoiceEstimateNotesToRemoveSchema = zod_1.z.object({
|
|
|
1423
1848
|
.optional(),
|
|
1424
1849
|
entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1425
1850
|
});
|
|
1851
|
+
const CreateInvoiceEstimateTaxProvidersFieldsItemSchema = zod_1.z.object({
|
|
1852
|
+
provider_name: zod_1.z.string().max(50).optional(),
|
|
1853
|
+
field_id: zod_1.z.string().max(50).optional(),
|
|
1854
|
+
field_value: zod_1.z.string().max(50).optional(),
|
|
1855
|
+
});
|
|
1426
1856
|
const CreateInvoiceEstimateTaxProvidersFieldsSchema = zod_1.z.object({
|
|
1427
1857
|
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
1428
1858
|
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
@@ -1440,10 +1870,30 @@ const CreateInvoiceEstimateBodySchema = zod_1.z.looseObject({
|
|
|
1440
1870
|
invoice_date: zod_1.z.number().int().optional(),
|
|
1441
1871
|
invoice: CreateInvoiceEstimateInvoiceSchema.optional(),
|
|
1442
1872
|
shipping_address: CreateInvoiceEstimateShippingAddressSchema.optional(),
|
|
1443
|
-
addons:
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1873
|
+
addons: zod_1.z
|
|
1874
|
+
.union([
|
|
1875
|
+
zod_1.z.array(CreateInvoiceEstimateAddonsItemSchema.optional()),
|
|
1876
|
+
CreateInvoiceEstimateAddonsSchema,
|
|
1877
|
+
])
|
|
1878
|
+
.optional(),
|
|
1879
|
+
charges: zod_1.z
|
|
1880
|
+
.union([
|
|
1881
|
+
zod_1.z.array(CreateInvoiceEstimateChargesItemSchema.optional()),
|
|
1882
|
+
CreateInvoiceEstimateChargesSchema,
|
|
1883
|
+
])
|
|
1884
|
+
.optional(),
|
|
1885
|
+
notes_to_remove: zod_1.z
|
|
1886
|
+
.union([
|
|
1887
|
+
zod_1.z.array(CreateInvoiceEstimateNotesToRemoveItemSchema.optional()),
|
|
1888
|
+
CreateInvoiceEstimateNotesToRemoveSchema,
|
|
1889
|
+
])
|
|
1890
|
+
.optional(),
|
|
1891
|
+
tax_providers_fields: zod_1.z
|
|
1892
|
+
.union([
|
|
1893
|
+
zod_1.z.array(CreateInvoiceEstimateTaxProvidersFieldsItemSchema.optional()),
|
|
1894
|
+
CreateInvoiceEstimateTaxProvidersFieldsSchema,
|
|
1895
|
+
])
|
|
1896
|
+
.optional(),
|
|
1447
1897
|
});
|
|
1448
1898
|
exports.CreateInvoiceEstimateBodySchema = CreateInvoiceEstimateBodySchema;
|
|
1449
1899
|
//Estimate.createInvoiceForItems
|
|
@@ -1482,6 +1932,17 @@ const CreateInvoiceForItemsEstimateBillingAddressSchema = zod_1.z.object({
|
|
|
1482
1932
|
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
1483
1933
|
.optional(),
|
|
1484
1934
|
});
|
|
1935
|
+
const CreateInvoiceForItemsEstimateItemPricesItemSchema = zod_1.z.object({
|
|
1936
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
1937
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
1938
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1939
|
+
unit_price: zod_1.z.number().int().min(0).optional(),
|
|
1940
|
+
unit_price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1941
|
+
date_from: zod_1.z.number().int().optional(),
|
|
1942
|
+
date_to: zod_1.z.number().int().optional(),
|
|
1943
|
+
description: zod_1.z.string().max(250).optional(),
|
|
1944
|
+
entity_description: zod_1.z.string().max(2000).optional(),
|
|
1945
|
+
});
|
|
1485
1946
|
const CreateInvoiceForItemsEstimateItemPricesSchema = zod_1.z.object({
|
|
1486
1947
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1487
1948
|
quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1493,6 +1954,17 @@ const CreateInvoiceForItemsEstimateItemPricesSchema = zod_1.z.object({
|
|
|
1493
1954
|
description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
|
|
1494
1955
|
entity_description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
|
|
1495
1956
|
});
|
|
1957
|
+
const CreateInvoiceForItemsEstimateItemTiersItemSchema = zod_1.z.object({
|
|
1958
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
1959
|
+
starting_unit: zod_1.z.number().int().min(1).optional(),
|
|
1960
|
+
ending_unit: zod_1.z.number().int().optional(),
|
|
1961
|
+
price: zod_1.z.number().int().min(0).optional(),
|
|
1962
|
+
starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1963
|
+
ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
1964
|
+
price_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1965
|
+
pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
1966
|
+
package_size: zod_1.z.number().int().min(1).optional(),
|
|
1967
|
+
});
|
|
1496
1968
|
const CreateInvoiceForItemsEstimateItemTiersSchema = zod_1.z.object({
|
|
1497
1969
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1498
1970
|
starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
@@ -1506,6 +1978,24 @@ const CreateInvoiceForItemsEstimateItemTiersSchema = zod_1.z.object({
|
|
|
1506
1978
|
.optional(),
|
|
1507
1979
|
package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
1508
1980
|
});
|
|
1981
|
+
const CreateInvoiceForItemsEstimateChargesItemSchema = zod_1.z.object({
|
|
1982
|
+
amount: zod_1.z.number().int().min(1).optional(),
|
|
1983
|
+
amount_in_decimal: zod_1.z.string().max(39).optional(),
|
|
1984
|
+
description: zod_1.z.string().max(250).optional(),
|
|
1985
|
+
taxable: zod_1.z.boolean().default(true).optional(),
|
|
1986
|
+
tax_profile_id: zod_1.z.string().max(50).optional(),
|
|
1987
|
+
avalara_tax_code: zod_1.z.string().max(50).optional(),
|
|
1988
|
+
hsn_code: zod_1.z.string().max(50).optional(),
|
|
1989
|
+
taxjar_product_code: zod_1.z.string().max(50).optional(),
|
|
1990
|
+
avalara_sale_type: zod_1.z
|
|
1991
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
1992
|
+
.optional(),
|
|
1993
|
+
avalara_transaction_type: zod_1.z.number().int().optional(),
|
|
1994
|
+
avalara_service_type: zod_1.z.number().int().optional(),
|
|
1995
|
+
date_from: zod_1.z.number().int().optional(),
|
|
1996
|
+
date_to: zod_1.z.number().int().optional(),
|
|
1997
|
+
entity_description: zod_1.z.string().max(2000).optional(),
|
|
1998
|
+
});
|
|
1509
1999
|
const CreateInvoiceForItemsEstimateChargesSchema = zod_1.z.object({
|
|
1510
2000
|
amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
|
|
1511
2001
|
amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
|
|
@@ -1524,6 +2014,19 @@ const CreateInvoiceForItemsEstimateChargesSchema = zod_1.z.object({
|
|
|
1524
2014
|
date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
1525
2015
|
entity_description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
|
|
1526
2016
|
});
|
|
2017
|
+
const CreateInvoiceForItemsEstimateNotesToRemoveItemSchema = zod_1.z.object({
|
|
2018
|
+
entity_type: zod_1.z
|
|
2019
|
+
.enum([
|
|
2020
|
+
'customer',
|
|
2021
|
+
'subscription',
|
|
2022
|
+
'coupon',
|
|
2023
|
+
'plan_item_price',
|
|
2024
|
+
'addon_item_price',
|
|
2025
|
+
'charge_item_price',
|
|
2026
|
+
])
|
|
2027
|
+
.optional(),
|
|
2028
|
+
entity_id: zod_1.z.string().max(100).optional(),
|
|
2029
|
+
});
|
|
1527
2030
|
const CreateInvoiceForItemsEstimateNotesToRemoveSchema = zod_1.z.object({
|
|
1528
2031
|
entity_type: zod_1.z
|
|
1529
2032
|
.array(zod_1.z
|
|
@@ -1539,6 +2042,13 @@ const CreateInvoiceForItemsEstimateNotesToRemoveSchema = zod_1.z.object({
|
|
|
1539
2042
|
.optional(),
|
|
1540
2043
|
entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1541
2044
|
});
|
|
2045
|
+
const CreateInvoiceForItemsEstimateDiscountsItemSchema = zod_1.z.object({
|
|
2046
|
+
percentage: zod_1.z.number().min(0.01).max(100).optional(),
|
|
2047
|
+
amount: zod_1.z.number().int().min(0).optional(),
|
|
2048
|
+
quantity: zod_1.z.number().int().min(1).optional(),
|
|
2049
|
+
apply_on: zod_1.z.enum(['invoice_amount', 'specific_item_price']),
|
|
2050
|
+
item_price_id: zod_1.z.string().max(100).optional(),
|
|
2051
|
+
});
|
|
1542
2052
|
const CreateInvoiceForItemsEstimateDiscountsSchema = zod_1.z.object({
|
|
1543
2053
|
percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
|
|
1544
2054
|
amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
@@ -1546,6 +2056,11 @@ const CreateInvoiceForItemsEstimateDiscountsSchema = zod_1.z.object({
|
|
|
1546
2056
|
apply_on: zod_1.z.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional()),
|
|
1547
2057
|
item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
|
|
1548
2058
|
});
|
|
2059
|
+
const CreateInvoiceForItemsEstimateTaxProvidersFieldsItemSchema = zod_1.z.object({
|
|
2060
|
+
provider_name: zod_1.z.string().max(50).optional(),
|
|
2061
|
+
field_id: zod_1.z.string().max(50).optional(),
|
|
2062
|
+
field_value: zod_1.z.string().max(50).optional(),
|
|
2063
|
+
});
|
|
1549
2064
|
const CreateInvoiceForItemsEstimateTaxProvidersFieldsSchema = zod_1.z.object({
|
|
1550
2065
|
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
1551
2066
|
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
|
|
@@ -1564,12 +2079,42 @@ const CreateInvoiceForItemsEstimateBodySchema = zod_1.z.looseObject({
|
|
|
1564
2079
|
invoice: CreateInvoiceForItemsEstimateInvoiceSchema.optional(),
|
|
1565
2080
|
shipping_address: CreateInvoiceForItemsEstimateShippingAddressSchema.optional(),
|
|
1566
2081
|
billing_address: CreateInvoiceForItemsEstimateBillingAddressSchema.optional(),
|
|
1567
|
-
item_prices:
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
2082
|
+
item_prices: zod_1.z
|
|
2083
|
+
.union([
|
|
2084
|
+
zod_1.z.array(CreateInvoiceForItemsEstimateItemPricesItemSchema.optional()),
|
|
2085
|
+
CreateInvoiceForItemsEstimateItemPricesSchema,
|
|
2086
|
+
])
|
|
2087
|
+
.optional(),
|
|
2088
|
+
item_tiers: zod_1.z
|
|
2089
|
+
.union([
|
|
2090
|
+
zod_1.z.array(CreateInvoiceForItemsEstimateItemTiersItemSchema.optional()),
|
|
2091
|
+
CreateInvoiceForItemsEstimateItemTiersSchema,
|
|
2092
|
+
])
|
|
2093
|
+
.optional(),
|
|
2094
|
+
charges: zod_1.z
|
|
2095
|
+
.union([
|
|
2096
|
+
zod_1.z.array(CreateInvoiceForItemsEstimateChargesItemSchema.optional()),
|
|
2097
|
+
CreateInvoiceForItemsEstimateChargesSchema,
|
|
2098
|
+
])
|
|
2099
|
+
.optional(),
|
|
2100
|
+
notes_to_remove: zod_1.z
|
|
2101
|
+
.union([
|
|
2102
|
+
zod_1.z.array(CreateInvoiceForItemsEstimateNotesToRemoveItemSchema.optional()),
|
|
2103
|
+
CreateInvoiceForItemsEstimateNotesToRemoveSchema,
|
|
2104
|
+
])
|
|
2105
|
+
.optional(),
|
|
2106
|
+
discounts: zod_1.z
|
|
2107
|
+
.union([
|
|
2108
|
+
zod_1.z.array(CreateInvoiceForItemsEstimateDiscountsItemSchema.optional()),
|
|
2109
|
+
CreateInvoiceForItemsEstimateDiscountsSchema,
|
|
2110
|
+
])
|
|
2111
|
+
.optional(),
|
|
2112
|
+
tax_providers_fields: zod_1.z
|
|
2113
|
+
.union([
|
|
2114
|
+
zod_1.z.array(CreateInvoiceForItemsEstimateTaxProvidersFieldsItemSchema.optional()),
|
|
2115
|
+
CreateInvoiceForItemsEstimateTaxProvidersFieldsSchema,
|
|
2116
|
+
])
|
|
2117
|
+
.optional(),
|
|
1573
2118
|
});
|
|
1574
2119
|
exports.CreateInvoiceForItemsEstimateBodySchema = CreateInvoiceForItemsEstimateBodySchema;
|
|
1575
2120
|
//Estimate.paymentSchedules
|