chargebee 3.25.0-beta.1 → 3.25.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.
Files changed (166) hide show
  1. package/CHANGELOG.md +66 -4
  2. package/README.md +0 -39
  3. package/cjs/RequestWrapper.js +1 -28
  4. package/cjs/chargebee.cjs.js +0 -3
  5. package/cjs/chargebee.cjs.worker.js +0 -2
  6. package/cjs/createChargebee.js +0 -5
  7. package/cjs/environment.js +1 -1
  8. package/cjs/resources/api_endpoints.js +1 -2
  9. package/cjs/resources/webhook/eventType.js +2 -0
  10. package/esm/RequestWrapper.js +1 -28
  11. package/esm/chargebee.esm.js +0 -2
  12. package/esm/chargebee.esm.worker.js +0 -1
  13. package/esm/createChargebee.js +0 -5
  14. package/esm/environment.js +1 -1
  15. package/esm/resources/api_endpoints.js +1 -2
  16. package/esm/resources/webhook/eventType.js +2 -0
  17. package/package.json +1 -4
  18. package/types/core.d.ts +23 -6
  19. package/types/index.d.ts +0 -17
  20. package/types/resources/Content.d.ts +0 -1
  21. package/types/resources/Customer.d.ts +14 -4
  22. package/types/resources/Estimate.d.ts +14 -4
  23. package/types/resources/Event.d.ts +2 -0
  24. package/types/resources/Gift.d.ts +23 -6
  25. package/types/resources/HostedPage.d.ts +1 -0
  26. package/types/resources/Invoice.d.ts +14 -5
  27. package/types/resources/OmnichannelSubscription.d.ts +6 -0
  28. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  29. package/types/resources/PaymentIntent.d.ts +35 -10
  30. package/types/resources/PaymentSource.d.ts +7 -2
  31. package/types/resources/Purchase.d.ts +7 -2
  32. package/types/resources/Subscription.d.ts +49 -14
  33. package/types/resources/WebhookEvent.d.ts +22 -4
  34. package/cjs/chargebeeZodValidationError.js +0 -18
  35. package/cjs/schema/addon.schema.js +0 -153
  36. package/cjs/schema/address.schema.js +0 -35
  37. package/cjs/schema/alert.schema.js +0 -38
  38. package/cjs/schema/attached_item.schema.js +0 -58
  39. package/cjs/schema/business_entity.schema.js +0 -46
  40. package/cjs/schema/card.schema.js +0 -165
  41. package/cjs/schema/comment.schema.js +0 -69
  42. package/cjs/schema/coupon.schema.js +0 -209
  43. package/cjs/schema/coupon_code.schema.js +0 -14
  44. package/cjs/schema/coupon_set.schema.js +0 -28
  45. package/cjs/schema/credit_note.schema.js +0 -288
  46. package/cjs/schema/currency.schema.js +0 -32
  47. package/cjs/schema/customer.schema.js +0 -986
  48. package/cjs/schema/customer_entitlement.schema.js +0 -14
  49. package/cjs/schema/differential_price.schema.js +0 -68
  50. package/cjs/schema/entitlement.schema.js +0 -27
  51. package/cjs/schema/entitlement_override.schema.js +0 -33
  52. package/cjs/schema/estimate.schema.js +0 -1525
  53. package/cjs/schema/export.schema.js +0 -1545
  54. package/cjs/schema/feature.schema.js +0 -37
  55. package/cjs/schema/gift.schema.js +0 -277
  56. package/cjs/schema/hosted_page.schema.js +0 -1649
  57. package/cjs/schema/in_app_subscription.schema.js +0 -68
  58. package/cjs/schema/index.js +0 -80
  59. package/cjs/schema/invoice.schema.js +0 -1467
  60. package/cjs/schema/item.schema.js +0 -91
  61. package/cjs/schema/item_entitlement.schema.js +0 -45
  62. package/cjs/schema/item_family.schema.js +0 -21
  63. package/cjs/schema/item_price.schema.js +0 -190
  64. package/cjs/schema/non_subscription.schema.js +0 -28
  65. package/cjs/schema/offer_event.schema.js +0 -13
  66. package/cjs/schema/offer_fulfillment.schema.js +0 -20
  67. package/cjs/schema/omnichannel_one_time_order.schema.js +0 -26
  68. package/cjs/schema/omnichannel_subscription.schema.js +0 -89
  69. package/cjs/schema/omnichannel_subscription_item.schema.js +0 -13
  70. package/cjs/schema/order.schema.js +0 -273
  71. package/cjs/schema/payment_intent.schema.js +0 -117
  72. package/cjs/schema/payment_schedule_scheme.schema.js +0 -20
  73. package/cjs/schema/payment_source.schema.js +0 -358
  74. package/cjs/schema/payment_voucher.schema.js +0 -57
  75. package/cjs/schema/personalized_offer.schema.js +0 -28
  76. package/cjs/schema/plan.schema.js +0 -225
  77. package/cjs/schema/portal_session.schema.js +0 -22
  78. package/cjs/schema/price_variant.schema.js +0 -36
  79. package/cjs/schema/pricing_page_session.schema.js +0 -135
  80. package/cjs/schema/promotional_credit.schema.js +0 -78
  81. package/cjs/schema/purchase.schema.js +0 -272
  82. package/cjs/schema/quote.schema.js +0 -1557
  83. package/cjs/schema/ramp.schema.js +0 -209
  84. package/cjs/schema/recorded_purchase.schema.js +0 -32
  85. package/cjs/schema/resource_migration.schema.js +0 -14
  86. package/cjs/schema/site_migration_detail.schema.js +0 -81
  87. package/cjs/schema/subscription.schema.js +0 -2993
  88. package/cjs/schema/subscription_entitlement.schema.js +0 -25
  89. package/cjs/schema/time_machine.schema.js +0 -17
  90. package/cjs/schema/transaction.schema.js +0 -70
  91. package/cjs/schema/unbilled_charge.schema.js +0 -113
  92. package/cjs/schema/usage.schema.js +0 -93
  93. package/cjs/schema/usage_charge.schema.js +0 -17
  94. package/cjs/schema/usage_event.schema.js +0 -28
  95. package/cjs/schema/usage_file.schema.js +0 -13
  96. package/cjs/schema/usage_summary.schema.js +0 -17
  97. package/cjs/schema/virtual_bank_account.schema.js +0 -43
  98. package/cjs/schema/webhook_endpoint.schema.js +0 -504
  99. package/cjs/validationLoader.js +0 -59
  100. package/esm/chargebeeZodValidationError.js +0 -14
  101. package/esm/schema/addon.schema.js +0 -150
  102. package/esm/schema/address.schema.js +0 -32
  103. package/esm/schema/alert.schema.js +0 -35
  104. package/esm/schema/attached_item.schema.js +0 -55
  105. package/esm/schema/business_entity.schema.js +0 -43
  106. package/esm/schema/card.schema.js +0 -162
  107. package/esm/schema/comment.schema.js +0 -66
  108. package/esm/schema/coupon.schema.js +0 -206
  109. package/esm/schema/coupon_code.schema.js +0 -11
  110. package/esm/schema/coupon_set.schema.js +0 -25
  111. package/esm/schema/credit_note.schema.js +0 -285
  112. package/esm/schema/currency.schema.js +0 -29
  113. package/esm/schema/customer.schema.js +0 -983
  114. package/esm/schema/customer_entitlement.schema.js +0 -11
  115. package/esm/schema/differential_price.schema.js +0 -65
  116. package/esm/schema/entitlement.schema.js +0 -24
  117. package/esm/schema/entitlement_override.schema.js +0 -30
  118. package/esm/schema/estimate.schema.js +0 -1522
  119. package/esm/schema/export.schema.js +0 -1542
  120. package/esm/schema/feature.schema.js +0 -34
  121. package/esm/schema/gift.schema.js +0 -274
  122. package/esm/schema/hosted_page.schema.js +0 -1646
  123. package/esm/schema/in_app_subscription.schema.js +0 -65
  124. package/esm/schema/index.js +0 -64
  125. package/esm/schema/invoice.schema.js +0 -1464
  126. package/esm/schema/item.schema.js +0 -88
  127. package/esm/schema/item_entitlement.schema.js +0 -42
  128. package/esm/schema/item_family.schema.js +0 -18
  129. package/esm/schema/item_price.schema.js +0 -187
  130. package/esm/schema/non_subscription.schema.js +0 -25
  131. package/esm/schema/offer_event.schema.js +0 -10
  132. package/esm/schema/offer_fulfillment.schema.js +0 -17
  133. package/esm/schema/omnichannel_one_time_order.schema.js +0 -23
  134. package/esm/schema/omnichannel_subscription.schema.js +0 -86
  135. package/esm/schema/omnichannel_subscription_item.schema.js +0 -10
  136. package/esm/schema/order.schema.js +0 -270
  137. package/esm/schema/payment_intent.schema.js +0 -114
  138. package/esm/schema/payment_schedule_scheme.schema.js +0 -17
  139. package/esm/schema/payment_source.schema.js +0 -355
  140. package/esm/schema/payment_voucher.schema.js +0 -54
  141. package/esm/schema/personalized_offer.schema.js +0 -25
  142. package/esm/schema/plan.schema.js +0 -222
  143. package/esm/schema/portal_session.schema.js +0 -19
  144. package/esm/schema/price_variant.schema.js +0 -33
  145. package/esm/schema/pricing_page_session.schema.js +0 -132
  146. package/esm/schema/promotional_credit.schema.js +0 -75
  147. package/esm/schema/purchase.schema.js +0 -269
  148. package/esm/schema/quote.schema.js +0 -1554
  149. package/esm/schema/ramp.schema.js +0 -206
  150. package/esm/schema/recorded_purchase.schema.js +0 -29
  151. package/esm/schema/resource_migration.schema.js +0 -11
  152. package/esm/schema/site_migration_detail.schema.js +0 -78
  153. package/esm/schema/subscription.schema.js +0 -2990
  154. package/esm/schema/subscription_entitlement.schema.js +0 -22
  155. package/esm/schema/time_machine.schema.js +0 -14
  156. package/esm/schema/transaction.schema.js +0 -67
  157. package/esm/schema/unbilled_charge.schema.js +0 -110
  158. package/esm/schema/usage.schema.js +0 -90
  159. package/esm/schema/usage_charge.schema.js +0 -14
  160. package/esm/schema/usage_event.schema.js +0 -25
  161. package/esm/schema/usage_file.schema.js +0 -10
  162. package/esm/schema/usage_summary.schema.js +0 -14
  163. package/esm/schema/virtual_bank_account.schema.js +0 -40
  164. package/esm/schema/webhook_endpoint.schema.js +0 -501
  165. package/esm/validationLoader.js +0 -56
  166. package/types/resources/QuoteEntitlement.d.ts +0 -16
@@ -1,1554 +0,0 @@
1
- // Generated Zod schemas: Quote
2
- // Actions: createSubForCustomerQuote, editCreateSubForCustomerQuote, updateSubscriptionQuote, editUpdateSubscriptionQuote, createForOnetimeCharges, editOneTimeQuote, createSubItemsForCustomerQuote, editCreateSubCustomerQuoteForItems, updateSubscriptionQuoteForItems, editUpdateSubscriptionQuoteForItems, createForChargeItemsAndCharges, editForChargeItemsAndCharges, quoteLineGroupsForQuote, convert, updateStatus, extendExpiryDate, delete, pdf, updateSignatureStatus
3
- // Do not edit manually – regenerate via sdk-generator
4
- import { z } from 'zod';
5
- //Quote.createSubForCustomerQuote
6
- const CreateSubForCustomerQuoteQuoteSubscriptionSchema = z.object({
7
- id: z.string().max(50).optional(),
8
- po_number: z.string().max(100).optional(),
9
- plan_id: z.string().max(100),
10
- plan_quantity: z.number().int().min(1).optional(),
11
- plan_quantity_in_decimal: z.string().max(33).optional(),
12
- plan_unit_price: z.number().int().min(0).optional(),
13
- plan_unit_price_in_decimal: z.string().max(39).optional(),
14
- setup_fee: z.number().int().min(0).optional(),
15
- trial_end: z.number().int().optional(),
16
- start_date: z.number().int().optional(),
17
- offline_payment_method: z
18
- .enum([
19
- 'no_preference',
20
- 'cash',
21
- 'check',
22
- 'bank_transfer',
23
- 'ach_credit',
24
- 'sepa_credit',
25
- 'boleto',
26
- 'us_automated_bank_transfer',
27
- 'eu_automated_bank_transfer',
28
- 'uk_automated_bank_transfer',
29
- 'jp_automated_bank_transfer',
30
- 'mx_automated_bank_transfer',
31
- 'custom',
32
- ])
33
- .optional(),
34
- contract_term_billing_cycle_on_renewal: z
35
- .number()
36
- .int()
37
- .min(1)
38
- .max(100)
39
- .optional(),
40
- });
41
- const CreateSubForCustomerQuoteQuoteShippingAddressSchema = z.object({
42
- first_name: z.string().max(150).optional(),
43
- last_name: z.string().max(150).optional(),
44
- email: z.string().email().max(70).optional(),
45
- company: z.string().max(250).optional(),
46
- phone: z.string().max(50).optional(),
47
- line1: z.string().max(150).optional(),
48
- line2: z.string().max(150).optional(),
49
- line3: z.string().max(150).optional(),
50
- city: z.string().max(50).optional(),
51
- state_code: z.string().max(50).optional(),
52
- state: z.string().max(50).optional(),
53
- zip: z.string().max(20).optional(),
54
- country: z.string().max(50).optional(),
55
- validation_status: z
56
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
57
- .optional(),
58
- });
59
- const CreateSubForCustomerQuoteQuoteContractTermSchema = z.object({
60
- action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
61
- cancellation_cutoff_period: z.number().int().optional(),
62
- });
63
- const CreateSubForCustomerQuoteQuoteAddonsSchema = z.object({
64
- id: z.array(z.string().max(100).optional()).optional(),
65
- quantity: z.array(z.number().int().min(1).optional()).optional(),
66
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
67
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
68
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
69
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
70
- trial_end: z.array(z.number().int().optional()).optional(),
71
- });
72
- const CreateSubForCustomerQuoteQuoteEventBasedAddonsSchema = z.object({
73
- id: z.array(z.string().max(100).optional()).optional(),
74
- quantity: z.array(z.number().int().min(1).optional()).optional(),
75
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
76
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
77
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
78
- service_period_in_days: z
79
- .array(z.number().int().min(1).max(4000).optional())
80
- .optional(),
81
- on_event: z
82
- .array(z
83
- .enum([
84
- 'subscription_creation',
85
- 'subscription_trial_start',
86
- 'plan_activation',
87
- 'subscription_activation',
88
- 'contract_termination',
89
- ])
90
- .optional())
91
- .optional(),
92
- charge_once: z.array(z.boolean().default(true).optional()).optional(),
93
- charge_on: z.array(z.enum(['immediately', 'on_event']).optional()).optional(),
94
- });
95
- const CreateSubForCustomerQuoteQuoteBodySchema = z.looseObject({
96
- name: z.string().max(100).optional(),
97
- notes: z.string().max(10000).optional(),
98
- expires_at: z.number().int().optional(),
99
- billing_cycles: z.number().int().min(0).optional(),
100
- mandatory_addons_to_remove: z
101
- .array(z.string().max(100).optional())
102
- .optional(),
103
- terms_to_charge: z.number().int().min(1).optional(),
104
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
105
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
106
- subscription: CreateSubForCustomerQuoteQuoteSubscriptionSchema.optional(),
107
- shipping_address: CreateSubForCustomerQuoteQuoteShippingAddressSchema.optional(),
108
- contract_term: CreateSubForCustomerQuoteQuoteContractTermSchema.optional(),
109
- addons: CreateSubForCustomerQuoteQuoteAddonsSchema.optional(),
110
- event_based_addons: CreateSubForCustomerQuoteQuoteEventBasedAddonsSchema.optional(),
111
- });
112
- export { CreateSubForCustomerQuoteQuoteBodySchema };
113
- //Quote.editCreateSubForCustomerQuote
114
- const EditCreateSubForCustomerQuoteQuoteSubscriptionSchema = z.object({
115
- id: z.string().max(50).optional(),
116
- po_number: z.string().max(100).optional(),
117
- plan_id: z.string().max(100),
118
- plan_quantity: z.number().int().min(1).optional(),
119
- plan_quantity_in_decimal: z.string().max(33).optional(),
120
- plan_unit_price: z.number().int().min(0).optional(),
121
- plan_unit_price_in_decimal: z.string().max(39).optional(),
122
- setup_fee: z.number().int().min(0).optional(),
123
- trial_end: z.number().int().optional(),
124
- start_date: z.number().int().optional(),
125
- offline_payment_method: z
126
- .enum([
127
- 'no_preference',
128
- 'cash',
129
- 'check',
130
- 'bank_transfer',
131
- 'ach_credit',
132
- 'sepa_credit',
133
- 'boleto',
134
- 'us_automated_bank_transfer',
135
- 'eu_automated_bank_transfer',
136
- 'uk_automated_bank_transfer',
137
- 'jp_automated_bank_transfer',
138
- 'mx_automated_bank_transfer',
139
- 'custom',
140
- ])
141
- .optional(),
142
- contract_term_billing_cycle_on_renewal: z
143
- .number()
144
- .int()
145
- .min(1)
146
- .max(100)
147
- .optional(),
148
- });
149
- const EditCreateSubForCustomerQuoteQuoteShippingAddressSchema = z.object({
150
- first_name: z.string().max(150).optional(),
151
- last_name: z.string().max(150).optional(),
152
- email: z.string().email().max(70).optional(),
153
- company: z.string().max(250).optional(),
154
- phone: z.string().max(50).optional(),
155
- line1: z.string().max(150).optional(),
156
- line2: z.string().max(150).optional(),
157
- line3: z.string().max(150).optional(),
158
- city: z.string().max(50).optional(),
159
- state_code: z.string().max(50).optional(),
160
- state: z.string().max(50).optional(),
161
- zip: z.string().max(20).optional(),
162
- country: z.string().max(50).optional(),
163
- validation_status: z
164
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
165
- .optional(),
166
- });
167
- const EditCreateSubForCustomerQuoteQuoteContractTermSchema = z.object({
168
- action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
169
- cancellation_cutoff_period: z.number().int().optional(),
170
- });
171
- const EditCreateSubForCustomerQuoteQuoteAddonsSchema = z.object({
172
- id: z.array(z.string().max(100).optional()).optional(),
173
- quantity: z.array(z.number().int().min(1).optional()).optional(),
174
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
175
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
176
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
177
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
178
- trial_end: z.array(z.number().int().optional()).optional(),
179
- });
180
- const EditCreateSubForCustomerQuoteQuoteEventBasedAddonsSchema = z.object({
181
- id: z.array(z.string().max(100).optional()).optional(),
182
- quantity: z.array(z.number().int().min(1).optional()).optional(),
183
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
184
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
185
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
186
- service_period_in_days: z
187
- .array(z.number().int().min(1).max(4000).optional())
188
- .optional(),
189
- on_event: z
190
- .array(z
191
- .enum([
192
- 'subscription_creation',
193
- 'subscription_trial_start',
194
- 'plan_activation',
195
- 'subscription_activation',
196
- 'contract_termination',
197
- ])
198
- .optional())
199
- .optional(),
200
- charge_once: z.array(z.boolean().default(true).optional()).optional(),
201
- charge_on: z.array(z.enum(['immediately', 'on_event']).optional()).optional(),
202
- });
203
- const EditCreateSubForCustomerQuoteQuoteBodySchema = z.looseObject({
204
- notes: z.string().max(10000).optional(),
205
- expires_at: z.number().int().optional(),
206
- billing_cycles: z.number().int().min(0).optional(),
207
- mandatory_addons_to_remove: z
208
- .array(z.string().max(100).optional())
209
- .optional(),
210
- terms_to_charge: z.number().int().min(1).optional(),
211
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
212
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
213
- subscription: EditCreateSubForCustomerQuoteQuoteSubscriptionSchema.optional(),
214
- shipping_address: EditCreateSubForCustomerQuoteQuoteShippingAddressSchema.optional(),
215
- contract_term: EditCreateSubForCustomerQuoteQuoteContractTermSchema.optional(),
216
- addons: EditCreateSubForCustomerQuoteQuoteAddonsSchema.optional(),
217
- event_based_addons: EditCreateSubForCustomerQuoteQuoteEventBasedAddonsSchema.optional(),
218
- });
219
- export { EditCreateSubForCustomerQuoteQuoteBodySchema };
220
- //Quote.updateSubscriptionQuote
221
- const UpdateSubscriptionQuoteQuoteSubscriptionSchema = z.object({
222
- id: z.string().max(50),
223
- plan_id: z.string().max(100).optional(),
224
- plan_quantity: z.number().int().min(1).optional(),
225
- plan_unit_price: z.number().int().min(0).optional(),
226
- setup_fee: z.number().int().min(0).optional(),
227
- plan_quantity_in_decimal: z.string().max(33).optional(),
228
- plan_unit_price_in_decimal: z.string().max(39).optional(),
229
- start_date: z.number().int().optional(),
230
- trial_end: z.number().int().optional(),
231
- coupon: z.string().max(100).optional(),
232
- auto_collection: z.enum(['on', 'off']).optional(),
233
- offline_payment_method: z
234
- .enum([
235
- 'no_preference',
236
- 'cash',
237
- 'check',
238
- 'bank_transfer',
239
- 'ach_credit',
240
- 'sepa_credit',
241
- 'boleto',
242
- 'us_automated_bank_transfer',
243
- 'eu_automated_bank_transfer',
244
- 'uk_automated_bank_transfer',
245
- 'jp_automated_bank_transfer',
246
- 'mx_automated_bank_transfer',
247
- 'custom',
248
- ])
249
- .optional(),
250
- contract_term_billing_cycle_on_renewal: z
251
- .number()
252
- .int()
253
- .min(1)
254
- .max(100)
255
- .optional(),
256
- });
257
- const UpdateSubscriptionQuoteQuoteBillingAddressSchema = z.object({
258
- first_name: z.string().max(150).optional(),
259
- last_name: z.string().max(150).optional(),
260
- email: z.string().email().max(70).optional(),
261
- company: z.string().max(250).optional(),
262
- phone: z.string().max(50).optional(),
263
- line1: z.string().max(150).optional(),
264
- line2: z.string().max(150).optional(),
265
- line3: z.string().max(150).optional(),
266
- city: z.string().max(50).optional(),
267
- state_code: z.string().max(50).optional(),
268
- state: z.string().max(50).optional(),
269
- zip: z.string().max(20).optional(),
270
- country: z.string().max(50).optional(),
271
- validation_status: z
272
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
273
- .optional(),
274
- });
275
- const UpdateSubscriptionQuoteQuoteShippingAddressSchema = z.object({
276
- first_name: z.string().max(150).optional(),
277
- last_name: z.string().max(150).optional(),
278
- email: z.string().email().max(70).optional(),
279
- company: z.string().max(250).optional(),
280
- phone: z.string().max(50).optional(),
281
- line1: z.string().max(150).optional(),
282
- line2: z.string().max(150).optional(),
283
- line3: z.string().max(150).optional(),
284
- city: z.string().max(50).optional(),
285
- state_code: z.string().max(50).optional(),
286
- state: z.string().max(50).optional(),
287
- zip: z.string().max(20).optional(),
288
- country: z.string().max(50).optional(),
289
- validation_status: z
290
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
291
- .optional(),
292
- });
293
- const UpdateSubscriptionQuoteQuoteCustomerSchema = z.object({
294
- vat_number: z.string().max(20).optional(),
295
- vat_number_prefix: z.string().max(10).optional(),
296
- registered_for_gst: z.boolean().optional(),
297
- });
298
- const UpdateSubscriptionQuoteQuoteContractTermSchema = z.object({
299
- action_at_term_end: z
300
- .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
301
- .optional(),
302
- cancellation_cutoff_period: z.number().int().optional(),
303
- });
304
- const UpdateSubscriptionQuoteQuoteAddonsSchema = z.object({
305
- id: z.array(z.string().max(100).optional()).optional(),
306
- quantity: z.array(z.number().int().min(1).optional()).optional(),
307
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
308
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
309
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
310
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
311
- trial_end: z.array(z.number().int().optional()).optional(),
312
- });
313
- const UpdateSubscriptionQuoteQuoteEventBasedAddonsSchema = z.object({
314
- id: z.array(z.string().max(100).optional()).optional(),
315
- quantity: z.array(z.number().int().min(1).optional()).optional(),
316
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
317
- service_period_in_days: z
318
- .array(z.number().int().min(1).max(4000).optional())
319
- .optional(),
320
- charge_on: z.array(z.enum(['immediately', 'on_event']).optional()).optional(),
321
- on_event: z
322
- .array(z
323
- .enum([
324
- 'subscription_creation',
325
- 'subscription_trial_start',
326
- 'plan_activation',
327
- 'subscription_activation',
328
- 'contract_termination',
329
- ])
330
- .optional())
331
- .optional(),
332
- charge_once: z.array(z.boolean().default(true).optional()).optional(),
333
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
334
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
335
- });
336
- const UpdateSubscriptionQuoteQuoteBodySchema = z.looseObject({
337
- name: z.string().max(100).optional(),
338
- notes: z.string().max(10000).optional(),
339
- expires_at: z.number().int().optional(),
340
- replace_addon_list: z.boolean().default(false).optional(),
341
- mandatory_addons_to_remove: z
342
- .array(z.string().max(100).optional())
343
- .optional(),
344
- billing_cycles: z.number().int().min(0).optional(),
345
- terms_to_charge: z.number().int().min(1).optional(),
346
- reactivate_from: z.number().int().optional(),
347
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
348
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
349
- replace_coupon_list: z.boolean().default(false).optional(),
350
- change_option: z.enum(['immediately', 'specific_date']).optional(),
351
- changes_scheduled_at: z.number().int().optional(),
352
- force_term_reset: z.boolean().default(false).optional(),
353
- reactivate: z.boolean().optional(),
354
- subscription: UpdateSubscriptionQuoteQuoteSubscriptionSchema.optional(),
355
- billing_address: UpdateSubscriptionQuoteQuoteBillingAddressSchema.optional(),
356
- shipping_address: UpdateSubscriptionQuoteQuoteShippingAddressSchema.optional(),
357
- customer: UpdateSubscriptionQuoteQuoteCustomerSchema.optional(),
358
- contract_term: UpdateSubscriptionQuoteQuoteContractTermSchema.optional(),
359
- addons: UpdateSubscriptionQuoteQuoteAddonsSchema.optional(),
360
- event_based_addons: UpdateSubscriptionQuoteQuoteEventBasedAddonsSchema.optional(),
361
- });
362
- export { UpdateSubscriptionQuoteQuoteBodySchema };
363
- //Quote.editUpdateSubscriptionQuote
364
- const EditUpdateSubscriptionQuoteQuoteSubscriptionSchema = z.object({
365
- plan_id: z.string().max(100).optional(),
366
- plan_quantity: z.number().int().min(1).optional(),
367
- plan_unit_price: z.number().int().min(0).optional(),
368
- setup_fee: z.number().int().min(0).optional(),
369
- plan_quantity_in_decimal: z.string().max(33).optional(),
370
- plan_unit_price_in_decimal: z.string().max(39).optional(),
371
- start_date: z.number().int().optional(),
372
- trial_end: z.number().int().optional(),
373
- coupon: z.string().max(100).optional(),
374
- auto_collection: z.enum(['on', 'off']).optional(),
375
- offline_payment_method: z
376
- .enum([
377
- 'no_preference',
378
- 'cash',
379
- 'check',
380
- 'bank_transfer',
381
- 'ach_credit',
382
- 'sepa_credit',
383
- 'boleto',
384
- 'us_automated_bank_transfer',
385
- 'eu_automated_bank_transfer',
386
- 'uk_automated_bank_transfer',
387
- 'jp_automated_bank_transfer',
388
- 'mx_automated_bank_transfer',
389
- 'custom',
390
- ])
391
- .optional(),
392
- contract_term_billing_cycle_on_renewal: z
393
- .number()
394
- .int()
395
- .min(1)
396
- .max(100)
397
- .optional(),
398
- });
399
- const EditUpdateSubscriptionQuoteQuoteBillingAddressSchema = z.object({
400
- first_name: z.string().max(150).optional(),
401
- last_name: z.string().max(150).optional(),
402
- email: z.string().email().max(70).optional(),
403
- company: z.string().max(250).optional(),
404
- phone: z.string().max(50).optional(),
405
- line1: z.string().max(150).optional(),
406
- line2: z.string().max(150).optional(),
407
- line3: z.string().max(150).optional(),
408
- city: z.string().max(50).optional(),
409
- state_code: z.string().max(50).optional(),
410
- state: z.string().max(50).optional(),
411
- zip: z.string().max(20).optional(),
412
- country: z.string().max(50).optional(),
413
- validation_status: z
414
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
415
- .optional(),
416
- });
417
- const EditUpdateSubscriptionQuoteQuoteShippingAddressSchema = z.object({
418
- first_name: z.string().max(150).optional(),
419
- last_name: z.string().max(150).optional(),
420
- email: z.string().email().max(70).optional(),
421
- company: z.string().max(250).optional(),
422
- phone: z.string().max(50).optional(),
423
- line1: z.string().max(150).optional(),
424
- line2: z.string().max(150).optional(),
425
- line3: z.string().max(150).optional(),
426
- city: z.string().max(50).optional(),
427
- state_code: z.string().max(50).optional(),
428
- state: z.string().max(50).optional(),
429
- zip: z.string().max(20).optional(),
430
- country: z.string().max(50).optional(),
431
- validation_status: z
432
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
433
- .optional(),
434
- });
435
- const EditUpdateSubscriptionQuoteQuoteCustomerSchema = z.object({
436
- vat_number: z.string().max(20).optional(),
437
- vat_number_prefix: z.string().max(10).optional(),
438
- registered_for_gst: z.boolean().optional(),
439
- });
440
- const EditUpdateSubscriptionQuoteQuoteContractTermSchema = z.object({
441
- action_at_term_end: z
442
- .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
443
- .optional(),
444
- cancellation_cutoff_period: z.number().int().optional(),
445
- });
446
- const EditUpdateSubscriptionQuoteQuoteAddonsSchema = z.object({
447
- id: z.array(z.string().max(100).optional()).optional(),
448
- quantity: z.array(z.number().int().min(1).optional()).optional(),
449
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
450
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
451
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
452
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
453
- trial_end: z.array(z.number().int().optional()).optional(),
454
- });
455
- const EditUpdateSubscriptionQuoteQuoteEventBasedAddonsSchema = z.object({
456
- id: z.array(z.string().max(100).optional()).optional(),
457
- quantity: z.array(z.number().int().min(1).optional()).optional(),
458
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
459
- service_period_in_days: z
460
- .array(z.number().int().min(1).max(4000).optional())
461
- .optional(),
462
- charge_on: z.array(z.enum(['immediately', 'on_event']).optional()).optional(),
463
- on_event: z
464
- .array(z
465
- .enum([
466
- 'subscription_creation',
467
- 'subscription_trial_start',
468
- 'plan_activation',
469
- 'subscription_activation',
470
- 'contract_termination',
471
- ])
472
- .optional())
473
- .optional(),
474
- charge_once: z.array(z.boolean().default(true).optional()).optional(),
475
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
476
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
477
- });
478
- const EditUpdateSubscriptionQuoteQuoteBodySchema = z.looseObject({
479
- notes: z.string().max(10000).optional(),
480
- expires_at: z.number().int().optional(),
481
- replace_addon_list: z.boolean().default(false).optional(),
482
- mandatory_addons_to_remove: z
483
- .array(z.string().max(100).optional())
484
- .optional(),
485
- billing_cycles: z.number().int().min(0).optional(),
486
- terms_to_charge: z.number().int().min(1).optional(),
487
- reactivate_from: z.number().int().optional(),
488
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
489
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
490
- replace_coupon_list: z.boolean().default(false).optional(),
491
- change_option: z.enum(['immediately', 'specific_date']).optional(),
492
- changes_scheduled_at: z.number().int().optional(),
493
- force_term_reset: z.boolean().default(false).optional(),
494
- reactivate: z.boolean().optional(),
495
- subscription: EditUpdateSubscriptionQuoteQuoteSubscriptionSchema.optional(),
496
- billing_address: EditUpdateSubscriptionQuoteQuoteBillingAddressSchema.optional(),
497
- shipping_address: EditUpdateSubscriptionQuoteQuoteShippingAddressSchema.optional(),
498
- customer: EditUpdateSubscriptionQuoteQuoteCustomerSchema.optional(),
499
- contract_term: EditUpdateSubscriptionQuoteQuoteContractTermSchema.optional(),
500
- addons: EditUpdateSubscriptionQuoteQuoteAddonsSchema.optional(),
501
- event_based_addons: EditUpdateSubscriptionQuoteQuoteEventBasedAddonsSchema.optional(),
502
- });
503
- export { EditUpdateSubscriptionQuoteQuoteBodySchema };
504
- //Quote.createForOnetimeCharges
505
- const CreateForOnetimeChargesQuoteShippingAddressSchema = z.object({
506
- first_name: z.string().max(150).optional(),
507
- last_name: z.string().max(150).optional(),
508
- email: z.string().email().max(70).optional(),
509
- company: z.string().max(250).optional(),
510
- phone: z.string().max(50).optional(),
511
- line1: z.string().max(150).optional(),
512
- line2: z.string().max(150).optional(),
513
- line3: z.string().max(150).optional(),
514
- city: z.string().max(50).optional(),
515
- state_code: z.string().max(50).optional(),
516
- state: z.string().max(50).optional(),
517
- zip: z.string().max(20).optional(),
518
- country: z.string().max(50).optional(),
519
- validation_status: z
520
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
521
- .optional(),
522
- });
523
- const CreateForOnetimeChargesQuoteAddonsSchema = z.object({
524
- id: z.array(z.string().max(100).optional()).optional(),
525
- quantity: z.array(z.number().int().min(1).optional()).optional(),
526
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
527
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
528
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
529
- service_period: z.array(z.number().int().optional()).optional(),
530
- });
531
- const CreateForOnetimeChargesQuoteChargesSchema = z.object({
532
- amount: z.array(z.number().int().min(1).optional()).optional(),
533
- amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
534
- description: z.array(z.string().max(250).optional()).optional(),
535
- avalara_sale_type: z
536
- .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
537
- .optional(),
538
- avalara_transaction_type: z.array(z.number().int().optional()).optional(),
539
- avalara_service_type: z.array(z.number().int().optional()).optional(),
540
- service_period: z.array(z.number().int().optional()).optional(),
541
- });
542
- const CreateForOnetimeChargesQuoteTaxProvidersFieldsSchema = z.object({
543
- provider_name: z.array(z.string().max(50).optional()).optional(),
544
- field_id: z.array(z.string().max(50).optional()).optional(),
545
- field_value: z.array(z.string().max(50).optional()).optional(),
546
- });
547
- const CreateForOnetimeChargesQuoteBodySchema = z.looseObject({
548
- name: z.string().max(100).optional(),
549
- customer_id: z.string().max(50),
550
- po_number: z.string().max(100).optional(),
551
- notes: z.string().max(10000).optional(),
552
- expires_at: z.number().int().optional(),
553
- currency_code: z.string().max(3).optional(),
554
- coupon: z.string().max(100).optional(),
555
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
556
- shipping_address: CreateForOnetimeChargesQuoteShippingAddressSchema.optional(),
557
- addons: CreateForOnetimeChargesQuoteAddonsSchema.optional(),
558
- charges: CreateForOnetimeChargesQuoteChargesSchema.optional(),
559
- tax_providers_fields: CreateForOnetimeChargesQuoteTaxProvidersFieldsSchema.optional(),
560
- });
561
- export { CreateForOnetimeChargesQuoteBodySchema };
562
- //Quote.editOneTimeQuote
563
- const EditOneTimeQuoteQuoteShippingAddressSchema = z.object({
564
- first_name: z.string().max(150).optional(),
565
- last_name: z.string().max(150).optional(),
566
- email: z.string().email().max(70).optional(),
567
- company: z.string().max(250).optional(),
568
- phone: z.string().max(50).optional(),
569
- line1: z.string().max(150).optional(),
570
- line2: z.string().max(150).optional(),
571
- line3: z.string().max(150).optional(),
572
- city: z.string().max(50).optional(),
573
- state_code: z.string().max(50).optional(),
574
- state: z.string().max(50).optional(),
575
- zip: z.string().max(20).optional(),
576
- country: z.string().max(50).optional(),
577
- validation_status: z
578
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
579
- .optional(),
580
- });
581
- const EditOneTimeQuoteQuoteAddonsSchema = z.object({
582
- id: z.array(z.string().max(100).optional()).optional(),
583
- quantity: z.array(z.number().int().min(1).optional()).optional(),
584
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
585
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
586
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
587
- service_period: z.array(z.number().int().optional()).optional(),
588
- });
589
- const EditOneTimeQuoteQuoteChargesSchema = z.object({
590
- amount: z.array(z.number().int().min(1).optional()).optional(),
591
- amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
592
- description: z.array(z.string().max(250).optional()).optional(),
593
- avalara_sale_type: z
594
- .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
595
- .optional(),
596
- avalara_transaction_type: z.array(z.number().int().optional()).optional(),
597
- avalara_service_type: z.array(z.number().int().optional()).optional(),
598
- service_period: z.array(z.number().int().optional()).optional(),
599
- });
600
- const EditOneTimeQuoteQuoteTaxProvidersFieldsSchema = z.object({
601
- provider_name: z.array(z.string().max(50).optional()).optional(),
602
- field_id: z.array(z.string().max(50).optional()).optional(),
603
- field_value: z.array(z.string().max(50).optional()).optional(),
604
- });
605
- const EditOneTimeQuoteQuoteBodySchema = z.looseObject({
606
- po_number: z.string().max(100).optional(),
607
- notes: z.string().max(10000).optional(),
608
- expires_at: z.number().int().optional(),
609
- currency_code: z.string().max(3).optional(),
610
- coupon: z.string().max(100).optional(),
611
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
612
- shipping_address: EditOneTimeQuoteQuoteShippingAddressSchema.optional(),
613
- addons: EditOneTimeQuoteQuoteAddonsSchema.optional(),
614
- charges: EditOneTimeQuoteQuoteChargesSchema.optional(),
615
- tax_providers_fields: EditOneTimeQuoteQuoteTaxProvidersFieldsSchema.optional(),
616
- });
617
- export { EditOneTimeQuoteQuoteBodySchema };
618
- //Quote.createSubItemsForCustomerQuote
619
- const CreateSubItemsForCustomerQuoteQuoteSubscriptionSchema = z.looseObject({
620
- id: z.string().max(50).optional(),
621
- po_number: z.string().max(100).optional(),
622
- trial_end: z.number().int().optional(),
623
- setup_fee: z.number().int().min(0).optional(),
624
- start_date: z.number().int().optional(),
625
- offline_payment_method: z
626
- .enum([
627
- 'no_preference',
628
- 'cash',
629
- 'check',
630
- 'bank_transfer',
631
- 'ach_credit',
632
- 'sepa_credit',
633
- 'boleto',
634
- 'us_automated_bank_transfer',
635
- 'eu_automated_bank_transfer',
636
- 'uk_automated_bank_transfer',
637
- 'jp_automated_bank_transfer',
638
- 'mx_automated_bank_transfer',
639
- 'custom',
640
- ])
641
- .optional(),
642
- contract_term_billing_cycle_on_renewal: z
643
- .number()
644
- .int()
645
- .min(1)
646
- .max(100)
647
- .optional(),
648
- free_period: z.number().int().min(1).optional(),
649
- free_period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
650
- });
651
- const CreateSubItemsForCustomerQuoteQuoteShippingAddressSchema = z.object({
652
- first_name: z.string().max(150).optional(),
653
- last_name: z.string().max(150).optional(),
654
- email: z.string().email().max(70).optional(),
655
- company: z.string().max(250).optional(),
656
- phone: z.string().max(50).optional(),
657
- line1: z.string().max(150).optional(),
658
- line2: z.string().max(150).optional(),
659
- line3: z.string().max(150).optional(),
660
- city: z.string().max(50).optional(),
661
- state_code: z.string().max(50).optional(),
662
- state: z.string().max(50).optional(),
663
- zip: z.string().max(20).optional(),
664
- country: z.string().max(50).optional(),
665
- validation_status: z
666
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
667
- .optional(),
668
- });
669
- const CreateSubItemsForCustomerQuoteQuoteContractTermSchema = z.object({
670
- action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
671
- cancellation_cutoff_period: z.number().int().optional(),
672
- });
673
- const CreateSubItemsForCustomerQuoteQuoteBillingAddressSchema = z.object({
674
- first_name: z.string().max(150).optional(),
675
- last_name: z.string().max(150).optional(),
676
- email: z.string().email().max(70).optional(),
677
- company: z.string().max(250).optional(),
678
- phone: z.string().max(50).optional(),
679
- line1: z.string().max(150).optional(),
680
- line2: z.string().max(150).optional(),
681
- line3: z.string().max(150).optional(),
682
- city: z.string().max(50).optional(),
683
- state_code: z.string().max(50).optional(),
684
- state: z.string().max(50).optional(),
685
- zip: z.string().max(20).optional(),
686
- country: z.string().max(50).optional(),
687
- validation_status: z
688
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
689
- .optional(),
690
- });
691
- const CreateSubItemsForCustomerQuoteQuoteSubscriptionItemsSchema = z.object({
692
- item_price_id: z.array(z.string().max(100).optional()),
693
- quantity: z.array(z.number().int().min(1).optional()).optional(),
694
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
695
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
696
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
697
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
698
- trial_end: z.array(z.number().int().optional()).optional(),
699
- service_period_days: z
700
- .array(z.number().int().min(1).max(730).optional())
701
- .optional(),
702
- charge_on_event: z
703
- .array(z
704
- .enum([
705
- 'subscription_creation',
706
- 'subscription_trial_start',
707
- 'plan_activation',
708
- 'subscription_activation',
709
- 'contract_termination',
710
- ])
711
- .optional())
712
- .optional(),
713
- charge_once: z.array(z.boolean().optional()).optional(),
714
- item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
715
- charge_on_option: z
716
- .array(z.enum(['immediately', 'on_event']).optional())
717
- .optional(),
718
- start_date: z.array(z.number().int().optional()).optional(),
719
- end_date: z.array(z.number().int().optional()).optional(),
720
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
721
- });
722
- const CreateSubItemsForCustomerQuoteQuoteDiscountsSchema = z.object({
723
- apply_on: z
724
- .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
725
- .optional(),
726
- duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
727
- percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
728
- amount: z.array(z.number().int().min(0).optional()).optional(),
729
- period: z.array(z.number().int().min(1).optional()).optional(),
730
- period_unit: z
731
- .array(z.enum(['day', 'week', 'month', 'year']).optional())
732
- .optional(),
733
- included_in_mrr: z.array(z.boolean().optional()).optional(),
734
- item_price_id: z.array(z.string().max(100).optional()).optional(),
735
- quantity: z.array(z.number().int().min(1).optional()).optional(),
736
- start_date: z.array(z.number().int().optional()).optional(),
737
- end_date: z.array(z.number().int().optional()).optional(),
738
- });
739
- const CreateSubItemsForCustomerQuoteQuoteItemTiersSchema = z.object({
740
- item_price_id: z.array(z.string().max(100).optional()).optional(),
741
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
742
- ending_unit: z.array(z.number().int().optional()).optional(),
743
- price: z.array(z.number().int().min(0).optional()).optional(),
744
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
745
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
746
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
747
- pricing_type: z
748
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
749
- .optional(),
750
- package_size: z.array(z.number().int().min(1).optional()).optional(),
751
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
752
- });
753
- const CreateSubItemsForCustomerQuoteQuoteCouponsSchema = z.object({
754
- id: z.array(z.string().max(100).optional()).optional(),
755
- start_date: z.array(z.number().int().optional()).optional(),
756
- end_date: z.array(z.number().int().optional()).optional(),
757
- });
758
- const CreateSubItemsForCustomerQuoteQuoteBodySchema = z.looseObject({
759
- name: z.string().max(100).optional(),
760
- notes: z.string().max(10000).optional(),
761
- expires_at: z.number().int().optional(),
762
- billing_cycles: z.number().int().min(0).optional(),
763
- mandatory_items_to_remove: z.array(z.string().max(100).optional()).optional(),
764
- terms_to_charge: z.number().int().min(1).optional(),
765
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
766
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
767
- billing_start_option: z.enum(['immediately', 'on_specific_date']).optional(),
768
- net_term_days: z.number().int().optional(),
769
- subscription: CreateSubItemsForCustomerQuoteQuoteSubscriptionSchema.optional(),
770
- shipping_address: CreateSubItemsForCustomerQuoteQuoteShippingAddressSchema.optional(),
771
- contract_term: CreateSubItemsForCustomerQuoteQuoteContractTermSchema.optional(),
772
- billing_address: CreateSubItemsForCustomerQuoteQuoteBillingAddressSchema.optional(),
773
- subscription_items: CreateSubItemsForCustomerQuoteQuoteSubscriptionItemsSchema.optional(),
774
- discounts: CreateSubItemsForCustomerQuoteQuoteDiscountsSchema.optional(),
775
- item_tiers: CreateSubItemsForCustomerQuoteQuoteItemTiersSchema.optional(),
776
- coupons: CreateSubItemsForCustomerQuoteQuoteCouponsSchema.optional(),
777
- });
778
- export { CreateSubItemsForCustomerQuoteQuoteBodySchema };
779
- //Quote.editCreateSubCustomerQuoteForItems
780
- const EditCreateSubCustomerQuoteForItemsQuoteSubscriptionSchema = z.looseObject({
781
- id: z.string().max(50).optional(),
782
- po_number: z.string().max(100).optional(),
783
- trial_end: z.number().int().optional(),
784
- setup_fee: z.number().int().min(0).optional(),
785
- start_date: z.number().int().optional(),
786
- offline_payment_method: z
787
- .enum([
788
- 'no_preference',
789
- 'cash',
790
- 'check',
791
- 'bank_transfer',
792
- 'ach_credit',
793
- 'sepa_credit',
794
- 'boleto',
795
- 'us_automated_bank_transfer',
796
- 'eu_automated_bank_transfer',
797
- 'uk_automated_bank_transfer',
798
- 'jp_automated_bank_transfer',
799
- 'mx_automated_bank_transfer',
800
- 'custom',
801
- ])
802
- .optional(),
803
- contract_term_billing_cycle_on_renewal: z
804
- .number()
805
- .int()
806
- .min(1)
807
- .max(100)
808
- .optional(),
809
- free_period: z.number().int().min(1).optional(),
810
- free_period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
811
- });
812
- const EditCreateSubCustomerQuoteForItemsQuoteShippingAddressSchema = z.object({
813
- first_name: z.string().max(150).optional(),
814
- last_name: z.string().max(150).optional(),
815
- email: z.string().email().max(70).optional(),
816
- company: z.string().max(250).optional(),
817
- phone: z.string().max(50).optional(),
818
- line1: z.string().max(150).optional(),
819
- line2: z.string().max(150).optional(),
820
- line3: z.string().max(150).optional(),
821
- city: z.string().max(50).optional(),
822
- state_code: z.string().max(50).optional(),
823
- state: z.string().max(50).optional(),
824
- zip: z.string().max(20).optional(),
825
- country: z.string().max(50).optional(),
826
- validation_status: z
827
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
828
- .optional(),
829
- });
830
- const EditCreateSubCustomerQuoteForItemsQuoteContractTermSchema = z.object({
831
- action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
832
- cancellation_cutoff_period: z.number().int().optional(),
833
- });
834
- const EditCreateSubCustomerQuoteForItemsQuoteBillingAddressSchema = z.object({
835
- first_name: z.string().max(150).optional(),
836
- last_name: z.string().max(150).optional(),
837
- email: z.string().email().max(70).optional(),
838
- company: z.string().max(250).optional(),
839
- phone: z.string().max(50).optional(),
840
- line1: z.string().max(150).optional(),
841
- line2: z.string().max(150).optional(),
842
- line3: z.string().max(150).optional(),
843
- city: z.string().max(50).optional(),
844
- state_code: z.string().max(50).optional(),
845
- state: z.string().max(50).optional(),
846
- zip: z.string().max(20).optional(),
847
- country: z.string().max(50).optional(),
848
- validation_status: z
849
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
850
- .optional(),
851
- });
852
- const EditCreateSubCustomerQuoteForItemsQuoteSubscriptionItemsSchema = z.object({
853
- item_price_id: z.array(z.string().max(100).optional()),
854
- quantity: z.array(z.number().int().min(1).optional()).optional(),
855
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
856
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
857
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
858
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
859
- trial_end: z.array(z.number().int().optional()).optional(),
860
- service_period_days: z
861
- .array(z.number().int().min(1).max(730).optional())
862
- .optional(),
863
- charge_on_event: z
864
- .array(z
865
- .enum([
866
- 'subscription_creation',
867
- 'subscription_trial_start',
868
- 'plan_activation',
869
- 'subscription_activation',
870
- 'contract_termination',
871
- ])
872
- .optional())
873
- .optional(),
874
- charge_once: z.array(z.boolean().optional()).optional(),
875
- item_type: z
876
- .array(z.enum(['plan', 'addon', 'charge']).optional())
877
- .optional(),
878
- charge_on_option: z
879
- .array(z.enum(['immediately', 'on_event']).optional())
880
- .optional(),
881
- start_date: z.array(z.number().int().optional()).optional(),
882
- end_date: z.array(z.number().int().optional()).optional(),
883
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
884
- });
885
- const EditCreateSubCustomerQuoteForItemsQuoteDiscountsSchema = z.object({
886
- apply_on: z
887
- .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
888
- .optional(),
889
- duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
890
- percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
891
- amount: z.array(z.number().int().min(0).optional()).optional(),
892
- period: z.array(z.number().int().min(1).optional()).optional(),
893
- period_unit: z
894
- .array(z.enum(['day', 'week', 'month', 'year']).optional())
895
- .optional(),
896
- included_in_mrr: z.array(z.boolean().optional()).optional(),
897
- item_price_id: z.array(z.string().max(100).optional()).optional(),
898
- quantity: z.array(z.number().int().min(1).optional()).optional(),
899
- start_date: z.array(z.number().int().optional()).optional(),
900
- end_date: z.array(z.number().int().optional()).optional(),
901
- });
902
- const EditCreateSubCustomerQuoteForItemsQuoteItemTiersSchema = z.object({
903
- item_price_id: z.array(z.string().max(100).optional()).optional(),
904
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
905
- ending_unit: z.array(z.number().int().optional()).optional(),
906
- price: z.array(z.number().int().min(0).optional()).optional(),
907
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
908
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
909
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
910
- pricing_type: z
911
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
912
- .optional(),
913
- package_size: z.array(z.number().int().min(1).optional()).optional(),
914
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
915
- });
916
- const EditCreateSubCustomerQuoteForItemsQuoteCouponsSchema = z.object({
917
- id: z.array(z.string().max(100).optional()).optional(),
918
- start_date: z.array(z.number().int().optional()).optional(),
919
- end_date: z.array(z.number().int().optional()).optional(),
920
- });
921
- const EditCreateSubCustomerQuoteForItemsQuoteBodySchema = z.looseObject({
922
- notes: z.string().max(10000).optional(),
923
- expires_at: z.number().int().optional(),
924
- billing_cycles: z.number().int().min(0).optional(),
925
- mandatory_items_to_remove: z.array(z.string().max(100).optional()).optional(),
926
- terms_to_charge: z.number().int().min(1).optional(),
927
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
928
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
929
- billing_start_option: z.enum(['immediately', 'on_specific_date']).optional(),
930
- net_term_days: z.number().int().optional(),
931
- subscription: EditCreateSubCustomerQuoteForItemsQuoteSubscriptionSchema.optional(),
932
- shipping_address: EditCreateSubCustomerQuoteForItemsQuoteShippingAddressSchema.optional(),
933
- contract_term: EditCreateSubCustomerQuoteForItemsQuoteContractTermSchema.optional(),
934
- billing_address: EditCreateSubCustomerQuoteForItemsQuoteBillingAddressSchema.optional(),
935
- subscription_items: EditCreateSubCustomerQuoteForItemsQuoteSubscriptionItemsSchema.optional(),
936
- discounts: EditCreateSubCustomerQuoteForItemsQuoteDiscountsSchema.optional(),
937
- item_tiers: EditCreateSubCustomerQuoteForItemsQuoteItemTiersSchema.optional(),
938
- coupons: EditCreateSubCustomerQuoteForItemsQuoteCouponsSchema.optional(),
939
- });
940
- export { EditCreateSubCustomerQuoteForItemsQuoteBodySchema };
941
- //Quote.updateSubscriptionQuoteForItems
942
- const UpdateSubscriptionQuoteForItemsQuoteSubscriptionSchema = z.looseObject({
943
- id: z.string().max(50),
944
- setup_fee: z.number().int().min(0).optional(),
945
- start_date: z.number().int().optional(),
946
- trial_end: z.number().int().optional(),
947
- coupon: z.string().max(100).optional(),
948
- auto_collection: z.enum(['on', 'off']).optional(),
949
- offline_payment_method: z
950
- .enum([
951
- 'no_preference',
952
- 'cash',
953
- 'check',
954
- 'bank_transfer',
955
- 'ach_credit',
956
- 'sepa_credit',
957
- 'boleto',
958
- 'us_automated_bank_transfer',
959
- 'eu_automated_bank_transfer',
960
- 'uk_automated_bank_transfer',
961
- 'jp_automated_bank_transfer',
962
- 'mx_automated_bank_transfer',
963
- 'custom',
964
- ])
965
- .optional(),
966
- contract_term_billing_cycle_on_renewal: z
967
- .number()
968
- .int()
969
- .min(1)
970
- .max(100)
971
- .optional(),
972
- });
973
- const UpdateSubscriptionQuoteForItemsQuoteBillingAddressSchema = z.object({
974
- first_name: z.string().max(150).optional(),
975
- last_name: z.string().max(150).optional(),
976
- email: z.string().email().max(70).optional(),
977
- company: z.string().max(250).optional(),
978
- phone: z.string().max(50).optional(),
979
- line1: z.string().max(150).optional(),
980
- line2: z.string().max(150).optional(),
981
- line3: z.string().max(150).optional(),
982
- city: z.string().max(50).optional(),
983
- state_code: z.string().max(50).optional(),
984
- state: z.string().max(50).optional(),
985
- zip: z.string().max(20).optional(),
986
- country: z.string().max(50).optional(),
987
- validation_status: z
988
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
989
- .optional(),
990
- });
991
- const UpdateSubscriptionQuoteForItemsQuoteShippingAddressSchema = z.object({
992
- first_name: z.string().max(150).optional(),
993
- last_name: z.string().max(150).optional(),
994
- email: z.string().email().max(70).optional(),
995
- company: z.string().max(250).optional(),
996
- phone: z.string().max(50).optional(),
997
- line1: z.string().max(150).optional(),
998
- line2: z.string().max(150).optional(),
999
- line3: z.string().max(150).optional(),
1000
- city: z.string().max(50).optional(),
1001
- state_code: z.string().max(50).optional(),
1002
- state: z.string().max(50).optional(),
1003
- zip: z.string().max(20).optional(),
1004
- country: z.string().max(50).optional(),
1005
- validation_status: z
1006
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1007
- .optional(),
1008
- });
1009
- const UpdateSubscriptionQuoteForItemsQuoteCustomerSchema = z.object({
1010
- vat_number: z.string().max(20).optional(),
1011
- vat_number_prefix: z.string().max(10).optional(),
1012
- registered_for_gst: z.boolean().optional(),
1013
- });
1014
- const UpdateSubscriptionQuoteForItemsQuoteContractTermSchema = z.object({
1015
- action_at_term_end: z
1016
- .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
1017
- .optional(),
1018
- cancellation_cutoff_period: z.number().int().optional(),
1019
- });
1020
- const UpdateSubscriptionQuoteForItemsQuoteSubscriptionItemsSchema = z.object({
1021
- item_price_id: z.array(z.string().max(100).optional()),
1022
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1023
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
1024
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
1025
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1026
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
1027
- trial_end: z.array(z.number().int().optional()).optional(),
1028
- service_period_days: z
1029
- .array(z.number().int().min(1).max(730).optional())
1030
- .optional(),
1031
- charge_on_event: z
1032
- .array(z
1033
- .enum([
1034
- 'subscription_creation',
1035
- 'subscription_trial_start',
1036
- 'plan_activation',
1037
- 'subscription_activation',
1038
- 'contract_termination',
1039
- ])
1040
- .optional())
1041
- .optional(),
1042
- charge_once: z.array(z.boolean().optional()).optional(),
1043
- charge_on_option: z
1044
- .array(z.enum(['immediately', 'on_event']).optional())
1045
- .optional(),
1046
- item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
1047
- start_date: z.array(z.number().int().optional()).optional(),
1048
- end_date: z.array(z.number().int().optional()).optional(),
1049
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
1050
- });
1051
- const UpdateSubscriptionQuoteForItemsQuoteDiscountsSchema = z.object({
1052
- apply_on: z
1053
- .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
1054
- .optional(),
1055
- duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
1056
- percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
1057
- amount: z.array(z.number().int().min(0).optional()).optional(),
1058
- period: z.array(z.number().int().min(1).optional()).optional(),
1059
- period_unit: z
1060
- .array(z.enum(['day', 'week', 'month', 'year']).optional())
1061
- .optional(),
1062
- included_in_mrr: z.array(z.boolean().optional()).optional(),
1063
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1064
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1065
- operation_type: z.array(z.enum(['add', 'remove']).optional()),
1066
- id: z.array(z.string().max(50).optional()).optional(),
1067
- start_date: z.array(z.number().int().optional()).optional(),
1068
- end_date: z.array(z.number().int().optional()).optional(),
1069
- });
1070
- const UpdateSubscriptionQuoteForItemsQuoteItemTiersSchema = z.object({
1071
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1072
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
1073
- ending_unit: z.array(z.number().int().optional()).optional(),
1074
- price: z.array(z.number().int().min(0).optional()).optional(),
1075
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1076
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1077
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1078
- pricing_type: z
1079
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
1080
- .optional(),
1081
- package_size: z.array(z.number().int().min(1).optional()).optional(),
1082
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
1083
- });
1084
- const UpdateSubscriptionQuoteForItemsQuoteCouponsSchema = z.object({
1085
- id: z.array(z.string().max(100).optional()).optional(),
1086
- start_date: z.array(z.number().int().optional()).optional(),
1087
- end_date: z.array(z.number().int().optional()).optional(),
1088
- });
1089
- const UpdateSubscriptionQuoteForItemsQuoteBodySchema = z.looseObject({
1090
- name: z.string().max(100).optional(),
1091
- notes: z.string().max(10000).optional(),
1092
- expires_at: z.number().int().optional(),
1093
- mandatory_items_to_remove: z.array(z.string().max(100).optional()).optional(),
1094
- replace_items_list: z.boolean().default(false).optional(),
1095
- billing_cycles: z.number().int().min(0).optional(),
1096
- terms_to_charge: z.number().int().min(1).optional(),
1097
- reactivate_from: z.number().int().optional(),
1098
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
1099
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
1100
- replace_coupon_list: z.boolean().default(false).optional(),
1101
- change_option: z.enum(['immediately', 'specific_date']).optional(),
1102
- changes_scheduled_at: z.number().int().optional(),
1103
- force_term_reset: z.boolean().default(false).optional(),
1104
- reactivate: z.boolean().optional(),
1105
- net_term_days: z.number().int().optional(),
1106
- subscription: UpdateSubscriptionQuoteForItemsQuoteSubscriptionSchema.optional(),
1107
- billing_address: UpdateSubscriptionQuoteForItemsQuoteBillingAddressSchema.optional(),
1108
- shipping_address: UpdateSubscriptionQuoteForItemsQuoteShippingAddressSchema.optional(),
1109
- customer: UpdateSubscriptionQuoteForItemsQuoteCustomerSchema.optional(),
1110
- contract_term: UpdateSubscriptionQuoteForItemsQuoteContractTermSchema.optional(),
1111
- subscription_items: UpdateSubscriptionQuoteForItemsQuoteSubscriptionItemsSchema.optional(),
1112
- discounts: UpdateSubscriptionQuoteForItemsQuoteDiscountsSchema.optional(),
1113
- item_tiers: UpdateSubscriptionQuoteForItemsQuoteItemTiersSchema.optional(),
1114
- coupons: UpdateSubscriptionQuoteForItemsQuoteCouponsSchema.optional(),
1115
- });
1116
- export { UpdateSubscriptionQuoteForItemsQuoteBodySchema };
1117
- //Quote.editUpdateSubscriptionQuoteForItems
1118
- const EditUpdateSubscriptionQuoteForItemsQuoteSubscriptionSchema = z.looseObject({
1119
- setup_fee: z.number().int().min(0).optional(),
1120
- start_date: z.number().int().optional(),
1121
- trial_end: z.number().int().optional(),
1122
- coupon: z.string().max(100).optional(),
1123
- auto_collection: z.enum(['on', 'off']).optional(),
1124
- offline_payment_method: z
1125
- .enum([
1126
- 'no_preference',
1127
- 'cash',
1128
- 'check',
1129
- 'bank_transfer',
1130
- 'ach_credit',
1131
- 'sepa_credit',
1132
- 'boleto',
1133
- 'us_automated_bank_transfer',
1134
- 'eu_automated_bank_transfer',
1135
- 'uk_automated_bank_transfer',
1136
- 'jp_automated_bank_transfer',
1137
- 'mx_automated_bank_transfer',
1138
- 'custom',
1139
- ])
1140
- .optional(),
1141
- contract_term_billing_cycle_on_renewal: z
1142
- .number()
1143
- .int()
1144
- .min(1)
1145
- .max(100)
1146
- .optional(),
1147
- });
1148
- const EditUpdateSubscriptionQuoteForItemsQuoteBillingAddressSchema = z.object({
1149
- first_name: z.string().max(150).optional(),
1150
- last_name: z.string().max(150).optional(),
1151
- email: z.string().email().max(70).optional(),
1152
- company: z.string().max(250).optional(),
1153
- phone: z.string().max(50).optional(),
1154
- line1: z.string().max(150).optional(),
1155
- line2: z.string().max(150).optional(),
1156
- line3: z.string().max(150).optional(),
1157
- city: z.string().max(50).optional(),
1158
- state_code: z.string().max(50).optional(),
1159
- state: z.string().max(50).optional(),
1160
- zip: z.string().max(20).optional(),
1161
- country: z.string().max(50).optional(),
1162
- validation_status: z
1163
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1164
- .optional(),
1165
- });
1166
- const EditUpdateSubscriptionQuoteForItemsQuoteShippingAddressSchema = z.object({
1167
- first_name: z.string().max(150).optional(),
1168
- last_name: z.string().max(150).optional(),
1169
- email: z.string().email().max(70).optional(),
1170
- company: z.string().max(250).optional(),
1171
- phone: z.string().max(50).optional(),
1172
- line1: z.string().max(150).optional(),
1173
- line2: z.string().max(150).optional(),
1174
- line3: z.string().max(150).optional(),
1175
- city: z.string().max(50).optional(),
1176
- state_code: z.string().max(50).optional(),
1177
- state: z.string().max(50).optional(),
1178
- zip: z.string().max(20).optional(),
1179
- country: z.string().max(50).optional(),
1180
- validation_status: z
1181
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1182
- .optional(),
1183
- });
1184
- const EditUpdateSubscriptionQuoteForItemsQuoteCustomerSchema = z.object({
1185
- vat_number: z.string().max(20).optional(),
1186
- vat_number_prefix: z.string().max(10).optional(),
1187
- registered_for_gst: z.boolean().optional(),
1188
- });
1189
- const EditUpdateSubscriptionQuoteForItemsQuoteContractTermSchema = z.object({
1190
- action_at_term_end: z
1191
- .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
1192
- .optional(),
1193
- cancellation_cutoff_period: z.number().int().optional(),
1194
- });
1195
- const EditUpdateSubscriptionQuoteForItemsQuoteSubscriptionItemsSchema = z.object({
1196
- item_price_id: z.array(z.string().max(100).optional()),
1197
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1198
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
1199
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
1200
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1201
- billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
1202
- trial_end: z.array(z.number().int().optional()).optional(),
1203
- service_period_days: z
1204
- .array(z.number().int().min(1).max(730).optional())
1205
- .optional(),
1206
- charge_on_event: z
1207
- .array(z
1208
- .enum([
1209
- 'subscription_creation',
1210
- 'subscription_trial_start',
1211
- 'plan_activation',
1212
- 'subscription_activation',
1213
- 'contract_termination',
1214
- ])
1215
- .optional())
1216
- .optional(),
1217
- charge_once: z.array(z.boolean().optional()).optional(),
1218
- charge_on_option: z
1219
- .array(z.enum(['immediately', 'on_event']).optional())
1220
- .optional(),
1221
- item_type: z
1222
- .array(z.enum(['plan', 'addon', 'charge']).optional())
1223
- .optional(),
1224
- start_date: z.array(z.number().int().optional()).optional(),
1225
- end_date: z.array(z.number().int().optional()).optional(),
1226
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
1227
- });
1228
- const EditUpdateSubscriptionQuoteForItemsQuoteDiscountsSchema = z.object({
1229
- apply_on: z
1230
- .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
1231
- .optional(),
1232
- duration_type: z.array(z.enum(['one_time', 'forever', 'limited_period']).optional()),
1233
- percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
1234
- amount: z.array(z.number().int().min(0).optional()).optional(),
1235
- period: z.array(z.number().int().min(1).optional()).optional(),
1236
- period_unit: z
1237
- .array(z.enum(['day', 'week', 'month', 'year']).optional())
1238
- .optional(),
1239
- included_in_mrr: z.array(z.boolean().optional()).optional(),
1240
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1241
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1242
- operation_type: z.array(z.enum(['add', 'remove']).optional()),
1243
- id: z.array(z.string().max(50).optional()).optional(),
1244
- start_date: z.array(z.number().int().optional()).optional(),
1245
- end_date: z.array(z.number().int().optional()).optional(),
1246
- });
1247
- const EditUpdateSubscriptionQuoteForItemsQuoteItemTiersSchema = z.object({
1248
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1249
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
1250
- ending_unit: z.array(z.number().int().optional()).optional(),
1251
- price: z.array(z.number().int().min(0).optional()).optional(),
1252
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1253
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1254
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1255
- pricing_type: z
1256
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
1257
- .optional(),
1258
- package_size: z.array(z.number().int().min(1).optional()).optional(),
1259
- ramp_tier_id: z.array(z.string().max(105).optional()).optional(),
1260
- });
1261
- const EditUpdateSubscriptionQuoteForItemsQuoteCouponsSchema = z.object({
1262
- id: z.array(z.string().max(100).optional()).optional(),
1263
- start_date: z.array(z.number().int().optional()).optional(),
1264
- end_date: z.array(z.number().int().optional()).optional(),
1265
- });
1266
- const EditUpdateSubscriptionQuoteForItemsQuoteBodySchema = z.looseObject({
1267
- notes: z.string().max(10000).optional(),
1268
- expires_at: z.number().int().optional(),
1269
- mandatory_items_to_remove: z.array(z.string().max(100).optional()).optional(),
1270
- replace_items_list: z.boolean().default(false).optional(),
1271
- billing_cycles: z.number().int().min(0).optional(),
1272
- terms_to_charge: z.number().int().min(1).optional(),
1273
- reactivate_from: z.number().int().optional(),
1274
- billing_alignment_mode: z.enum(['immediate', 'delayed']).optional(),
1275
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
1276
- replace_coupon_list: z.boolean().default(false).optional(),
1277
- change_option: z.enum(['immediately', 'specific_date']).optional(),
1278
- changes_scheduled_at: z.number().int().optional(),
1279
- force_term_reset: z.boolean().default(false).optional(),
1280
- reactivate: z.boolean().optional(),
1281
- net_term_days: z.number().int().optional(),
1282
- subscription: EditUpdateSubscriptionQuoteForItemsQuoteSubscriptionSchema.optional(),
1283
- billing_address: EditUpdateSubscriptionQuoteForItemsQuoteBillingAddressSchema.optional(),
1284
- shipping_address: EditUpdateSubscriptionQuoteForItemsQuoteShippingAddressSchema.optional(),
1285
- customer: EditUpdateSubscriptionQuoteForItemsQuoteCustomerSchema.optional(),
1286
- contract_term: EditUpdateSubscriptionQuoteForItemsQuoteContractTermSchema.optional(),
1287
- subscription_items: EditUpdateSubscriptionQuoteForItemsQuoteSubscriptionItemsSchema.optional(),
1288
- discounts: EditUpdateSubscriptionQuoteForItemsQuoteDiscountsSchema.optional(),
1289
- item_tiers: EditUpdateSubscriptionQuoteForItemsQuoteItemTiersSchema.optional(),
1290
- coupons: EditUpdateSubscriptionQuoteForItemsQuoteCouponsSchema.optional(),
1291
- });
1292
- export { EditUpdateSubscriptionQuoteForItemsQuoteBodySchema };
1293
- //Quote.createForChargeItemsAndCharges
1294
- const CreateForChargeItemsAndChargesQuoteBillingAddressSchema = z.object({
1295
- first_name: z.string().max(150).optional(),
1296
- last_name: z.string().max(150).optional(),
1297
- email: z.string().email().max(70).optional(),
1298
- company: z.string().max(250).optional(),
1299
- phone: z.string().max(50).optional(),
1300
- line1: z.string().max(150).optional(),
1301
- line2: z.string().max(150).optional(),
1302
- line3: z.string().max(150).optional(),
1303
- city: z.string().max(50).optional(),
1304
- state_code: z.string().max(50).optional(),
1305
- state: z.string().max(50).optional(),
1306
- zip: z.string().max(20).optional(),
1307
- country: z.string().max(50).optional(),
1308
- validation_status: z
1309
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1310
- .optional(),
1311
- });
1312
- const CreateForChargeItemsAndChargesQuoteShippingAddressSchema = z.object({
1313
- first_name: z.string().max(150).optional(),
1314
- last_name: z.string().max(150).optional(),
1315
- email: z.string().email().max(70).optional(),
1316
- company: z.string().max(250).optional(),
1317
- phone: z.string().max(50).optional(),
1318
- line1: z.string().max(150).optional(),
1319
- line2: z.string().max(150).optional(),
1320
- line3: z.string().max(150).optional(),
1321
- city: z.string().max(50).optional(),
1322
- state_code: z.string().max(50).optional(),
1323
- state: z.string().max(50).optional(),
1324
- zip: z.string().max(20).optional(),
1325
- country: z.string().max(50).optional(),
1326
- validation_status: z
1327
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1328
- .optional(),
1329
- });
1330
- const CreateForChargeItemsAndChargesQuoteItemPricesSchema = z.object({
1331
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1332
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1333
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
1334
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
1335
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1336
- service_period_days: z
1337
- .array(z.number().int().min(1).max(730).optional())
1338
- .optional(),
1339
- });
1340
- const CreateForChargeItemsAndChargesQuoteItemTiersSchema = z.object({
1341
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1342
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
1343
- ending_unit: z.array(z.number().int().optional()).optional(),
1344
- price: z.array(z.number().int().min(0).optional()).optional(),
1345
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1346
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1347
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1348
- pricing_type: z
1349
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
1350
- .optional(),
1351
- package_size: z.array(z.number().int().min(1).optional()).optional(),
1352
- });
1353
- const CreateForChargeItemsAndChargesQuoteChargesSchema = z.object({
1354
- amount: z.array(z.number().int().min(1).optional()).optional(),
1355
- amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
1356
- description: z.array(z.string().max(250).optional()).optional(),
1357
- avalara_sale_type: z
1358
- .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
1359
- .optional(),
1360
- avalara_transaction_type: z.array(z.number().int().optional()).optional(),
1361
- avalara_service_type: z.array(z.number().int().optional()).optional(),
1362
- service_period: z.array(z.number().int().optional()).optional(),
1363
- });
1364
- const CreateForChargeItemsAndChargesQuoteDiscountsSchema = z.object({
1365
- percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
1366
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1367
- amount: z.array(z.number().int().min(0).optional()).optional(),
1368
- apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
1369
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1370
- });
1371
- const CreateForChargeItemsAndChargesQuoteTaxProvidersFieldsSchema = z.object({
1372
- provider_name: z.array(z.string().max(50).optional()).optional(),
1373
- field_id: z.array(z.string().max(50).optional()).optional(),
1374
- field_value: z.array(z.string().max(50).optional()).optional(),
1375
- });
1376
- const CreateForChargeItemsAndChargesQuoteBodySchema = z.looseObject({
1377
- name: z.string().max(100).optional(),
1378
- customer_id: z.string().max(50),
1379
- po_number: z.string().max(100).optional(),
1380
- notes: z.string().max(10000).optional(),
1381
- expires_at: z.number().int().optional(),
1382
- currency_code: z.string().max(3).optional(),
1383
- coupon: z.string().max(100).optional(),
1384
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
1385
- net_term_days: z.number().int().optional(),
1386
- billing_address: CreateForChargeItemsAndChargesQuoteBillingAddressSchema.optional(),
1387
- shipping_address: CreateForChargeItemsAndChargesQuoteShippingAddressSchema.optional(),
1388
- item_prices: CreateForChargeItemsAndChargesQuoteItemPricesSchema.optional(),
1389
- item_tiers: CreateForChargeItemsAndChargesQuoteItemTiersSchema.optional(),
1390
- charges: CreateForChargeItemsAndChargesQuoteChargesSchema.optional(),
1391
- discounts: CreateForChargeItemsAndChargesQuoteDiscountsSchema.optional(),
1392
- tax_providers_fields: CreateForChargeItemsAndChargesQuoteTaxProvidersFieldsSchema.optional(),
1393
- });
1394
- export { CreateForChargeItemsAndChargesQuoteBodySchema };
1395
- //Quote.editForChargeItemsAndCharges
1396
- const EditForChargeItemsAndChargesQuoteBillingAddressSchema = z.object({
1397
- first_name: z.string().max(150).optional(),
1398
- last_name: z.string().max(150).optional(),
1399
- email: z.string().email().max(70).optional(),
1400
- company: z.string().max(250).optional(),
1401
- phone: z.string().max(50).optional(),
1402
- line1: z.string().max(150).optional(),
1403
- line2: z.string().max(150).optional(),
1404
- line3: z.string().max(150).optional(),
1405
- city: z.string().max(50).optional(),
1406
- state_code: z.string().max(50).optional(),
1407
- state: z.string().max(50).optional(),
1408
- zip: z.string().max(20).optional(),
1409
- country: z.string().max(50).optional(),
1410
- validation_status: z
1411
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1412
- .optional(),
1413
- });
1414
- const EditForChargeItemsAndChargesQuoteShippingAddressSchema = z.object({
1415
- first_name: z.string().max(150).optional(),
1416
- last_name: z.string().max(150).optional(),
1417
- email: z.string().email().max(70).optional(),
1418
- company: z.string().max(250).optional(),
1419
- phone: z.string().max(50).optional(),
1420
- line1: z.string().max(150).optional(),
1421
- line2: z.string().max(150).optional(),
1422
- line3: z.string().max(150).optional(),
1423
- city: z.string().max(50).optional(),
1424
- state_code: z.string().max(50).optional(),
1425
- state: z.string().max(50).optional(),
1426
- zip: z.string().max(20).optional(),
1427
- country: z.string().max(50).optional(),
1428
- validation_status: z
1429
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1430
- .optional(),
1431
- });
1432
- const EditForChargeItemsAndChargesQuoteItemPricesSchema = z.object({
1433
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1434
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1435
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
1436
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
1437
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1438
- service_period_days: z
1439
- .array(z.number().int().min(1).max(730).optional())
1440
- .optional(),
1441
- });
1442
- const EditForChargeItemsAndChargesQuoteItemTiersSchema = z.object({
1443
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1444
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
1445
- ending_unit: z.array(z.number().int().optional()).optional(),
1446
- price: z.array(z.number().int().min(0).optional()).optional(),
1447
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1448
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1449
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1450
- pricing_type: z
1451
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
1452
- .optional(),
1453
- package_size: z.array(z.number().int().min(1).optional()).optional(),
1454
- });
1455
- const EditForChargeItemsAndChargesQuoteChargesSchema = z.object({
1456
- amount: z.array(z.number().int().min(1).optional()).optional(),
1457
- amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
1458
- description: z.array(z.string().max(250).optional()).optional(),
1459
- avalara_sale_type: z
1460
- .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
1461
- .optional(),
1462
- avalara_transaction_type: z.array(z.number().int().optional()).optional(),
1463
- avalara_service_type: z.array(z.number().int().optional()).optional(),
1464
- service_period: z.array(z.number().int().optional()).optional(),
1465
- });
1466
- const EditForChargeItemsAndChargesQuoteDiscountsSchema = z.object({
1467
- percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
1468
- quantity: z.array(z.number().int().min(1).optional()).optional(),
1469
- amount: z.array(z.number().int().min(0).optional()).optional(),
1470
- apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
1471
- item_price_id: z.array(z.string().max(100).optional()).optional(),
1472
- });
1473
- const EditForChargeItemsAndChargesQuoteTaxProvidersFieldsSchema = z.object({
1474
- provider_name: z.array(z.string().max(50).optional()).optional(),
1475
- field_id: z.array(z.string().max(50).optional()).optional(),
1476
- field_value: z.array(z.string().max(50).optional()).optional(),
1477
- });
1478
- const EditForChargeItemsAndChargesQuoteBodySchema = z.looseObject({
1479
- po_number: z.string().max(100).optional(),
1480
- notes: z.string().max(10000).optional(),
1481
- expires_at: z.number().int().optional(),
1482
- currency_code: z.string().max(3).optional(),
1483
- coupon: z.string().max(100).optional(),
1484
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
1485
- net_term_days: z.number().int().optional(),
1486
- billing_address: EditForChargeItemsAndChargesQuoteBillingAddressSchema.optional(),
1487
- shipping_address: EditForChargeItemsAndChargesQuoteShippingAddressSchema.optional(),
1488
- item_prices: EditForChargeItemsAndChargesQuoteItemPricesSchema.optional(),
1489
- item_tiers: EditForChargeItemsAndChargesQuoteItemTiersSchema.optional(),
1490
- charges: EditForChargeItemsAndChargesQuoteChargesSchema.optional(),
1491
- discounts: EditForChargeItemsAndChargesQuoteDiscountsSchema.optional(),
1492
- tax_providers_fields: EditForChargeItemsAndChargesQuoteTaxProvidersFieldsSchema.optional(),
1493
- });
1494
- export { EditForChargeItemsAndChargesQuoteBodySchema };
1495
- //Quote.quoteLineGroupsForQuote
1496
- const QuoteLineGroupsForQuoteQuoteBodySchema = z.looseObject({
1497
- limit: z.number().int().min(1).max(100).optional(),
1498
- offset: z.string().max(1000).optional(),
1499
- });
1500
- export { QuoteLineGroupsForQuoteQuoteBodySchema };
1501
- //Quote.convert
1502
- const ConvertQuoteSubscriptionSchema = z.object({
1503
- id: z.string().max(50).optional(),
1504
- auto_collection: z.enum(['on', 'off']).optional(),
1505
- po_number: z.string().max(100).optional(),
1506
- auto_close_invoices: z.boolean().optional(),
1507
- });
1508
- const ConvertQuoteBodySchema = z.looseObject({
1509
- invoice_date: z.number().int().optional(),
1510
- invoice_immediately: z.boolean().optional(),
1511
- create_pending_invoices: z.boolean().optional(),
1512
- first_invoice_pending: z.boolean().default(false).optional(),
1513
- subscription: ConvertQuoteSubscriptionSchema.optional(),
1514
- });
1515
- export { ConvertQuoteBodySchema };
1516
- //Quote.updateStatus
1517
- const UpdateStatusQuoteBodySchema = z.looseObject({
1518
- status: z.enum([
1519
- 'open',
1520
- 'accepted',
1521
- 'declined',
1522
- 'proposed',
1523
- 'voided',
1524
- 'closed',
1525
- ]),
1526
- comment: z.string().max(300).optional(),
1527
- });
1528
- export { UpdateStatusQuoteBodySchema };
1529
- //Quote.extendExpiryDate
1530
- const ExtendExpiryDateQuoteBodySchema = z.looseObject({
1531
- valid_till: z.number().int(),
1532
- });
1533
- export { ExtendExpiryDateQuoteBodySchema };
1534
- //Quote.delete
1535
- const DeleteQuoteBodySchema = z.looseObject({
1536
- comment: z.string().max(300).optional(),
1537
- });
1538
- export { DeleteQuoteBodySchema };
1539
- //Quote.pdf
1540
- const PdfQuoteBodySchema = z.looseObject({
1541
- consolidated_view: z.boolean().default(false).optional(),
1542
- disposition_type: z.enum(['attachment', 'inline']).optional(),
1543
- });
1544
- export { PdfQuoteBodySchema };
1545
- //Quote.updateSignatureStatus
1546
- const UpdateSignatureStatusQuoteCpqQuoteSignatureSchema = z.object({
1547
- status: z
1548
- .enum(['draft', 'active', 'signed', 'expired', 'cancelled', 'declined'])
1549
- .optional(),
1550
- });
1551
- const UpdateSignatureStatusQuoteBodySchema = z.looseObject({
1552
- cpq_quote_signature: UpdateSignatureStatusQuoteCpqQuoteSignatureSchema.optional(),
1553
- });
1554
- export { UpdateSignatureStatusQuoteBodySchema };