chargebee 3.24.0 → 3.25.0-beta.1

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 (147) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +39 -0
  3. package/cjs/RequestWrapper.js +27 -0
  4. package/cjs/chargebee.cjs.js +3 -0
  5. package/cjs/chargebee.cjs.worker.js +2 -0
  6. package/cjs/chargebeeZodValidationError.js +18 -0
  7. package/cjs/createChargebee.js +5 -0
  8. package/cjs/environment.js +1 -1
  9. package/cjs/schema/addon.schema.js +153 -0
  10. package/cjs/schema/address.schema.js +35 -0
  11. package/cjs/schema/alert.schema.js +38 -0
  12. package/cjs/schema/attached_item.schema.js +58 -0
  13. package/cjs/schema/business_entity.schema.js +46 -0
  14. package/cjs/schema/card.schema.js +165 -0
  15. package/cjs/schema/comment.schema.js +69 -0
  16. package/cjs/schema/coupon.schema.js +209 -0
  17. package/cjs/schema/coupon_code.schema.js +14 -0
  18. package/cjs/schema/coupon_set.schema.js +28 -0
  19. package/cjs/schema/credit_note.schema.js +288 -0
  20. package/cjs/schema/currency.schema.js +32 -0
  21. package/cjs/schema/customer.schema.js +986 -0
  22. package/cjs/schema/customer_entitlement.schema.js +14 -0
  23. package/cjs/schema/differential_price.schema.js +68 -0
  24. package/cjs/schema/entitlement.schema.js +27 -0
  25. package/cjs/schema/entitlement_override.schema.js +33 -0
  26. package/cjs/schema/estimate.schema.js +1525 -0
  27. package/cjs/schema/export.schema.js +1545 -0
  28. package/cjs/schema/feature.schema.js +37 -0
  29. package/cjs/schema/gift.schema.js +277 -0
  30. package/cjs/schema/hosted_page.schema.js +1649 -0
  31. package/cjs/schema/in_app_subscription.schema.js +68 -0
  32. package/cjs/schema/index.js +80 -0
  33. package/cjs/schema/invoice.schema.js +1467 -0
  34. package/cjs/schema/item.schema.js +91 -0
  35. package/cjs/schema/item_entitlement.schema.js +45 -0
  36. package/cjs/schema/item_family.schema.js +21 -0
  37. package/cjs/schema/item_price.schema.js +190 -0
  38. package/cjs/schema/non_subscription.schema.js +28 -0
  39. package/cjs/schema/offer_event.schema.js +13 -0
  40. package/cjs/schema/offer_fulfillment.schema.js +20 -0
  41. package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
  42. package/cjs/schema/omnichannel_subscription.schema.js +89 -0
  43. package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
  44. package/cjs/schema/order.schema.js +273 -0
  45. package/cjs/schema/payment_intent.schema.js +117 -0
  46. package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
  47. package/cjs/schema/payment_source.schema.js +358 -0
  48. package/cjs/schema/payment_voucher.schema.js +57 -0
  49. package/cjs/schema/personalized_offer.schema.js +28 -0
  50. package/cjs/schema/plan.schema.js +225 -0
  51. package/cjs/schema/portal_session.schema.js +22 -0
  52. package/cjs/schema/price_variant.schema.js +36 -0
  53. package/cjs/schema/pricing_page_session.schema.js +135 -0
  54. package/cjs/schema/promotional_credit.schema.js +78 -0
  55. package/cjs/schema/purchase.schema.js +272 -0
  56. package/cjs/schema/quote.schema.js +1557 -0
  57. package/cjs/schema/ramp.schema.js +209 -0
  58. package/cjs/schema/recorded_purchase.schema.js +32 -0
  59. package/cjs/schema/resource_migration.schema.js +14 -0
  60. package/cjs/schema/site_migration_detail.schema.js +81 -0
  61. package/cjs/schema/subscription.schema.js +2993 -0
  62. package/cjs/schema/subscription_entitlement.schema.js +25 -0
  63. package/cjs/schema/time_machine.schema.js +17 -0
  64. package/cjs/schema/transaction.schema.js +70 -0
  65. package/cjs/schema/unbilled_charge.schema.js +113 -0
  66. package/cjs/schema/usage.schema.js +93 -0
  67. package/cjs/schema/usage_charge.schema.js +17 -0
  68. package/cjs/schema/usage_event.schema.js +28 -0
  69. package/cjs/schema/usage_file.schema.js +13 -0
  70. package/cjs/schema/usage_summary.schema.js +17 -0
  71. package/cjs/schema/virtual_bank_account.schema.js +43 -0
  72. package/cjs/schema/webhook_endpoint.schema.js +504 -0
  73. package/cjs/validationLoader.js +59 -0
  74. package/esm/RequestWrapper.js +27 -0
  75. package/esm/chargebee.esm.js +2 -0
  76. package/esm/chargebee.esm.worker.js +1 -0
  77. package/esm/chargebeeZodValidationError.js +14 -0
  78. package/esm/createChargebee.js +5 -0
  79. package/esm/environment.js +1 -1
  80. package/esm/schema/addon.schema.js +150 -0
  81. package/esm/schema/address.schema.js +32 -0
  82. package/esm/schema/alert.schema.js +35 -0
  83. package/esm/schema/attached_item.schema.js +55 -0
  84. package/esm/schema/business_entity.schema.js +43 -0
  85. package/esm/schema/card.schema.js +162 -0
  86. package/esm/schema/comment.schema.js +66 -0
  87. package/esm/schema/coupon.schema.js +206 -0
  88. package/esm/schema/coupon_code.schema.js +11 -0
  89. package/esm/schema/coupon_set.schema.js +25 -0
  90. package/esm/schema/credit_note.schema.js +285 -0
  91. package/esm/schema/currency.schema.js +29 -0
  92. package/esm/schema/customer.schema.js +983 -0
  93. package/esm/schema/customer_entitlement.schema.js +11 -0
  94. package/esm/schema/differential_price.schema.js +65 -0
  95. package/esm/schema/entitlement.schema.js +24 -0
  96. package/esm/schema/entitlement_override.schema.js +30 -0
  97. package/esm/schema/estimate.schema.js +1522 -0
  98. package/esm/schema/export.schema.js +1542 -0
  99. package/esm/schema/feature.schema.js +34 -0
  100. package/esm/schema/gift.schema.js +274 -0
  101. package/esm/schema/hosted_page.schema.js +1646 -0
  102. package/esm/schema/in_app_subscription.schema.js +65 -0
  103. package/esm/schema/index.js +64 -0
  104. package/esm/schema/invoice.schema.js +1464 -0
  105. package/esm/schema/item.schema.js +88 -0
  106. package/esm/schema/item_entitlement.schema.js +42 -0
  107. package/esm/schema/item_family.schema.js +18 -0
  108. package/esm/schema/item_price.schema.js +187 -0
  109. package/esm/schema/non_subscription.schema.js +25 -0
  110. package/esm/schema/offer_event.schema.js +10 -0
  111. package/esm/schema/offer_fulfillment.schema.js +17 -0
  112. package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
  113. package/esm/schema/omnichannel_subscription.schema.js +86 -0
  114. package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
  115. package/esm/schema/order.schema.js +270 -0
  116. package/esm/schema/payment_intent.schema.js +114 -0
  117. package/esm/schema/payment_schedule_scheme.schema.js +17 -0
  118. package/esm/schema/payment_source.schema.js +355 -0
  119. package/esm/schema/payment_voucher.schema.js +54 -0
  120. package/esm/schema/personalized_offer.schema.js +25 -0
  121. package/esm/schema/plan.schema.js +222 -0
  122. package/esm/schema/portal_session.schema.js +19 -0
  123. package/esm/schema/price_variant.schema.js +33 -0
  124. package/esm/schema/pricing_page_session.schema.js +132 -0
  125. package/esm/schema/promotional_credit.schema.js +75 -0
  126. package/esm/schema/purchase.schema.js +269 -0
  127. package/esm/schema/quote.schema.js +1554 -0
  128. package/esm/schema/ramp.schema.js +206 -0
  129. package/esm/schema/recorded_purchase.schema.js +29 -0
  130. package/esm/schema/resource_migration.schema.js +11 -0
  131. package/esm/schema/site_migration_detail.schema.js +78 -0
  132. package/esm/schema/subscription.schema.js +2990 -0
  133. package/esm/schema/subscription_entitlement.schema.js +22 -0
  134. package/esm/schema/time_machine.schema.js +14 -0
  135. package/esm/schema/transaction.schema.js +67 -0
  136. package/esm/schema/unbilled_charge.schema.js +110 -0
  137. package/esm/schema/usage.schema.js +90 -0
  138. package/esm/schema/usage_charge.schema.js +14 -0
  139. package/esm/schema/usage_event.schema.js +25 -0
  140. package/esm/schema/usage_file.schema.js +10 -0
  141. package/esm/schema/usage_summary.schema.js +14 -0
  142. package/esm/schema/virtual_bank_account.schema.js +40 -0
  143. package/esm/schema/webhook_endpoint.schema.js +501 -0
  144. package/esm/validationLoader.js +56 -0
  145. package/package.json +4 -1
  146. package/types/core.d.ts +2 -0
  147. package/types/index.d.ts +16 -0
@@ -0,0 +1,2993 @@
1
+ "use strict";
2
+ // Generated Zod schemas: Subscription
3
+ // Actions: create, createForCustomer, createWithItems, subscriptionsForCustomer, contractTermsForSubscription, listDiscounts, removeScheduledCancellation, removeCoupons, update, updateForItems, changeTermEnd, reactivate, addChargeAtTermEnd, chargeAddonAtTermEnd, chargeFutureRenewals, editAdvanceInvoiceSchedule, removeAdvanceInvoiceSchedule, regenerateInvoice, importSubscription, importForCustomer, importContractTerm, importUnbilledCharges, importForItems, overrideBillingProfile, pause, cancel, cancelForItems, resume, move
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MoveSubscriptionBodySchema = exports.ResumeSubscriptionBodySchema = exports.CancelForItemsSubscriptionBodySchema = exports.CancelSubscriptionBodySchema = exports.PauseSubscriptionBodySchema = exports.OverrideBillingProfileSubscriptionBodySchema = exports.ImportForItemsSubscriptionBodySchema = exports.ImportUnbilledChargesSubscriptionBodySchema = exports.ImportContractTermSubscriptionBodySchema = exports.ImportForCustomerSubscriptionBodySchema = exports.ImportSubscriptionSubscriptionBodySchema = exports.RegenerateInvoiceSubscriptionBodySchema = exports.RemoveAdvanceInvoiceScheduleSubscriptionBodySchema = exports.EditAdvanceInvoiceScheduleSubscriptionBodySchema = exports.ChargeFutureRenewalsSubscriptionBodySchema = exports.ChargeAddonAtTermEndSubscriptionBodySchema = exports.AddChargeAtTermEndSubscriptionBodySchema = exports.ReactivateSubscriptionBodySchema = exports.ChangeTermEndSubscriptionBodySchema = exports.UpdateForItemsSubscriptionBodySchema = exports.UpdateSubscriptionBodySchema = exports.RemoveCouponsSubscriptionBodySchema = exports.RemoveScheduledCancellationSubscriptionBodySchema = exports.ListDiscountsSubscriptionBodySchema = exports.ContractTermsForSubscriptionSubscriptionBodySchema = exports.SubscriptionsForCustomerSubscriptionBodySchema = exports.CreateWithItemsSubscriptionBodySchema = exports.CreateForCustomerSubscriptionBodySchema = exports.CreateSubscriptionBodySchema = void 0;
7
+ const zod_1 = require("zod");
8
+ //Subscription.create
9
+ const CreateSubscriptionMetaDataSchema = zod_1.z.looseObject({});
10
+ const CreateSubscriptionCustomerSchema = zod_1.z.looseObject({
11
+ id: zod_1.z.string().max(50).optional(),
12
+ email: zod_1.z.string().email().max(70).optional(),
13
+ first_name: zod_1.z.string().max(150).optional(),
14
+ last_name: zod_1.z.string().max(150).optional(),
15
+ company: zod_1.z.string().max(250).optional(),
16
+ phone: zod_1.z.string().max(50).optional(),
17
+ locale: zod_1.z.string().max(50).optional(),
18
+ taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
19
+ entity_code: zod_1.z
20
+ .enum([
21
+ 'a',
22
+ 'b',
23
+ 'c',
24
+ 'd',
25
+ 'e',
26
+ 'f',
27
+ 'g',
28
+ 'h',
29
+ 'i',
30
+ 'j',
31
+ 'k',
32
+ 'l',
33
+ 'm',
34
+ 'n',
35
+ 'p',
36
+ 'q',
37
+ 'r',
38
+ 'med1',
39
+ 'med2',
40
+ ])
41
+ .optional(),
42
+ exempt_number: zod_1.z.string().max(100).optional(),
43
+ net_term_days: zod_1.z.number().int().optional(),
44
+ taxjar_exemption_category: zod_1.z
45
+ .enum(['wholesale', 'government', 'other'])
46
+ .optional(),
47
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
48
+ offline_payment_method: zod_1.z
49
+ .enum([
50
+ 'no_preference',
51
+ 'cash',
52
+ 'check',
53
+ 'bank_transfer',
54
+ 'ach_credit',
55
+ 'sepa_credit',
56
+ 'boleto',
57
+ 'us_automated_bank_transfer',
58
+ 'eu_automated_bank_transfer',
59
+ 'uk_automated_bank_transfer',
60
+ 'jp_automated_bank_transfer',
61
+ 'mx_automated_bank_transfer',
62
+ 'custom',
63
+ ])
64
+ .optional(),
65
+ allow_direct_debit: zod_1.z.boolean().default(false).optional(),
66
+ consolidated_invoicing: zod_1.z.boolean().optional(),
67
+ vat_number: zod_1.z.string().max(20).optional(),
68
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
69
+ entity_identifier_scheme: zod_1.z.string().max(50).optional(),
70
+ entity_identifier_standard: zod_1.z.string().max(50).optional(),
71
+ is_einvoice_enabled: zod_1.z.boolean().optional(),
72
+ einvoicing_method: zod_1.z.enum(['automatic', 'manual', 'site_default']).optional(),
73
+ registered_for_gst: zod_1.z.boolean().optional(),
74
+ business_customer_without_vat_number: zod_1.z.boolean().optional(),
75
+ exemption_details: zod_1.z.array(zod_1.z.string().optional()).optional(),
76
+ customer_type: zod_1.z
77
+ .enum(['residential', 'business', 'senior_citizen', 'industrial'])
78
+ .optional(),
79
+ });
80
+ const CreateSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
81
+ const CreateSubscriptionCardSchema = zod_1.z.object({
82
+ gateway: zod_1.z
83
+ .enum([
84
+ 'chargebee',
85
+ 'chargebee_payments',
86
+ 'adyen',
87
+ 'stripe',
88
+ 'wepay',
89
+ 'braintree',
90
+ 'authorize_net',
91
+ 'paypal_pro',
92
+ 'pin',
93
+ 'eway',
94
+ 'eway_rapid',
95
+ 'worldpay',
96
+ 'balanced_payments',
97
+ 'beanstream',
98
+ 'bluepay',
99
+ 'elavon',
100
+ 'first_data_global',
101
+ 'hdfc',
102
+ 'migs',
103
+ 'nmi',
104
+ 'ogone',
105
+ 'paymill',
106
+ 'paypal_payflow_pro',
107
+ 'sage_pay',
108
+ 'tco',
109
+ 'wirecard',
110
+ 'amazon_payments',
111
+ 'paypal_express_checkout',
112
+ 'orbital',
113
+ 'moneris_us',
114
+ 'moneris',
115
+ 'bluesnap',
116
+ 'cybersource',
117
+ 'vantiv',
118
+ 'checkout_com',
119
+ 'paypal',
120
+ 'ingenico_direct',
121
+ 'exact',
122
+ 'mollie',
123
+ 'quickbooks',
124
+ 'razorpay',
125
+ 'global_payments',
126
+ 'bank_of_america',
127
+ 'ecentric',
128
+ 'metrics_global',
129
+ 'windcave',
130
+ 'pay_com',
131
+ 'ebanx',
132
+ 'dlocal',
133
+ 'nuvei',
134
+ 'solidgate',
135
+ 'paystack',
136
+ 'jp_morgan',
137
+ 'deutsche_bank',
138
+ 'ezidebit',
139
+ 'twikey',
140
+ 'tempus',
141
+ 'moyasar',
142
+ 'payway',
143
+ ])
144
+ .optional(),
145
+ gateway_account_id: zod_1.z.string().max(50).optional(),
146
+ tmp_token: zod_1.z.string().max(300).optional(),
147
+ first_name: zod_1.z.string().max(50).optional(),
148
+ last_name: zod_1.z.string().max(50).optional(),
149
+ number: zod_1.z.string().max(1500).optional(),
150
+ expiry_month: zod_1.z.number().int().min(1).max(12).optional(),
151
+ expiry_year: zod_1.z.number().int().optional(),
152
+ cvv: zod_1.z.string().max(520).optional(),
153
+ preferred_scheme: zod_1.z
154
+ .enum(['cartes_bancaires', 'mastercard', 'visa'])
155
+ .optional(),
156
+ billing_addr1: zod_1.z.string().max(150).optional(),
157
+ billing_addr2: zod_1.z.string().max(150).optional(),
158
+ billing_city: zod_1.z.string().max(50).optional(),
159
+ billing_state_code: zod_1.z.string().max(50).optional(),
160
+ billing_state: zod_1.z.string().max(50).optional(),
161
+ billing_zip: zod_1.z.string().max(20).optional(),
162
+ billing_country: zod_1.z.string().max(50).optional(),
163
+ ip_address: zod_1.z.string().max(50).optional(),
164
+ additional_information: CreateSubscriptionAdditionalInformationSchema.optional(),
165
+ });
166
+ const CreateSubscriptionBillingAddressSchema = zod_1.z.looseObject({});
167
+ const CreateSubscriptionBankAccountSchema = zod_1.z.object({
168
+ gateway_account_id: zod_1.z.string().max(50).optional(),
169
+ iban: zod_1.z.string().max(50).min(10).optional(),
170
+ first_name: zod_1.z.string().max(150).optional(),
171
+ last_name: zod_1.z.string().max(150).optional(),
172
+ company: zod_1.z.string().max(250).optional(),
173
+ email: zod_1.z.string().email().max(70).optional(),
174
+ phone: zod_1.z.string().max(50).optional(),
175
+ bank_name: zod_1.z.string().max(100).optional(),
176
+ account_number: zod_1.z.string().max(17).min(4).optional(),
177
+ routing_number: zod_1.z.string().max(9).min(3).optional(),
178
+ bank_code: zod_1.z.string().max(20).optional(),
179
+ account_type: zod_1.z
180
+ .enum(['checking', 'savings', 'business_checking', 'current'])
181
+ .optional(),
182
+ account_holder_type: zod_1.z.enum(['individual', 'company']).optional(),
183
+ echeck_type: zod_1.z.enum(['web', 'ppd', 'ccd']).optional(),
184
+ issuing_country: zod_1.z.string().max(50).optional(),
185
+ swedish_identity_number: zod_1.z.string().max(12).min(10).optional(),
186
+ billing_address: CreateSubscriptionBillingAddressSchema.optional(),
187
+ });
188
+ const CreateSubscriptionPaymentMethodSchema = zod_1.z.object({
189
+ type: zod_1.z
190
+ .enum([
191
+ 'card',
192
+ 'paypal_express_checkout',
193
+ 'amazon_payments',
194
+ 'direct_debit',
195
+ 'generic',
196
+ 'alipay',
197
+ 'unionpay',
198
+ 'apple_pay',
199
+ 'wechat_pay',
200
+ 'ideal',
201
+ 'google_pay',
202
+ 'sofort',
203
+ 'bancontact',
204
+ 'giropay',
205
+ 'dotpay',
206
+ 'upi',
207
+ 'netbanking_emandates',
208
+ 'venmo',
209
+ 'pay_to',
210
+ 'faster_payments',
211
+ 'sepa_instant_transfer',
212
+ 'automated_bank_transfer',
213
+ 'klarna_pay_now',
214
+ 'online_banking_poland',
215
+ 'payconiq_by_bancontact',
216
+ 'electronic_payment_standard',
217
+ 'kbc_payment_button',
218
+ 'pay_by_bank',
219
+ 'trustly',
220
+ 'stablecoin',
221
+ 'kakao_pay',
222
+ 'naver_pay',
223
+ 'revolut_pay',
224
+ 'cash_app_pay',
225
+ 'pix',
226
+ 'twint',
227
+ 'go_pay',
228
+ 'grab_pay',
229
+ 'pay_co',
230
+ 'after_pay',
231
+ 'swish',
232
+ 'payme',
233
+ ])
234
+ .optional(),
235
+ gateway: zod_1.z
236
+ .enum([
237
+ 'chargebee_payments',
238
+ 'adyen',
239
+ 'stripe',
240
+ 'wepay',
241
+ 'braintree',
242
+ 'authorize_net',
243
+ 'paypal_pro',
244
+ 'pin',
245
+ 'eway',
246
+ 'eway_rapid',
247
+ 'worldpay',
248
+ 'balanced_payments',
249
+ 'beanstream',
250
+ 'bluepay',
251
+ 'elavon',
252
+ 'first_data_global',
253
+ 'hdfc',
254
+ 'migs',
255
+ 'nmi',
256
+ 'ogone',
257
+ 'paymill',
258
+ 'paypal_payflow_pro',
259
+ 'sage_pay',
260
+ 'tco',
261
+ 'wirecard',
262
+ 'amazon_payments',
263
+ 'paypal_express_checkout',
264
+ 'gocardless',
265
+ 'orbital',
266
+ 'moneris_us',
267
+ 'moneris',
268
+ 'bluesnap',
269
+ 'cybersource',
270
+ 'vantiv',
271
+ 'checkout_com',
272
+ 'paypal',
273
+ 'ingenico_direct',
274
+ 'exact',
275
+ 'mollie',
276
+ 'quickbooks',
277
+ 'razorpay',
278
+ 'global_payments',
279
+ 'bank_of_america',
280
+ 'ecentric',
281
+ 'metrics_global',
282
+ 'windcave',
283
+ 'pay_com',
284
+ 'ebanx',
285
+ 'dlocal',
286
+ 'nuvei',
287
+ 'solidgate',
288
+ 'paystack',
289
+ 'jp_morgan',
290
+ 'deutsche_bank',
291
+ 'ezidebit',
292
+ 'twikey',
293
+ 'tempus',
294
+ 'moyasar',
295
+ 'payway',
296
+ ])
297
+ .optional(),
298
+ gateway_account_id: zod_1.z.string().max(50).optional(),
299
+ reference_id: zod_1.z.string().max(200).optional(),
300
+ tmp_token: zod_1.z.string().max(65000).optional(),
301
+ issuing_country: zod_1.z.string().max(50).optional(),
302
+ additional_information: CreateSubscriptionAdditionalInformationSchema.optional(),
303
+ });
304
+ const CreateSubscriptionPaymentIntentSchema = zod_1.z.object({
305
+ id: zod_1.z.string().max(150).optional(),
306
+ gateway_account_id: zod_1.z.string().max(50).optional(),
307
+ gw_token: zod_1.z.string().max(65000).optional(),
308
+ payment_method_type: zod_1.z
309
+ .enum([
310
+ 'card',
311
+ 'ideal',
312
+ 'sofort',
313
+ 'bancontact',
314
+ 'google_pay',
315
+ 'dotpay',
316
+ 'giropay',
317
+ 'apple_pay',
318
+ 'upi',
319
+ 'netbanking_emandates',
320
+ 'paypal_express_checkout',
321
+ 'direct_debit',
322
+ 'boleto',
323
+ 'venmo',
324
+ 'amazon_payments',
325
+ 'pay_to',
326
+ 'faster_payments',
327
+ 'sepa_instant_transfer',
328
+ 'klarna_pay_now',
329
+ 'online_banking_poland',
330
+ 'payconiq_by_bancontact',
331
+ 'electronic_payment_standard',
332
+ 'kbc_payment_button',
333
+ 'pay_by_bank',
334
+ 'trustly',
335
+ 'stablecoin',
336
+ 'kakao_pay',
337
+ 'naver_pay',
338
+ 'revolut_pay',
339
+ 'cash_app_pay',
340
+ 'wechat_pay',
341
+ 'alipay',
342
+ 'pix',
343
+ 'twint',
344
+ 'go_pay',
345
+ 'grab_pay',
346
+ 'pay_co',
347
+ 'after_pay',
348
+ 'swish',
349
+ 'payme',
350
+ ])
351
+ .optional(),
352
+ reference_id: zod_1.z.string().max(65000).optional(),
353
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
354
+ additional_information: CreateSubscriptionAdditionalInformationSchema.optional(),
355
+ });
356
+ const CreateSubscriptionShippingAddressSchema = zod_1.z.object({
357
+ first_name: zod_1.z.string().max(150).optional(),
358
+ last_name: zod_1.z.string().max(150).optional(),
359
+ email: zod_1.z.string().email().max(70).optional(),
360
+ company: zod_1.z.string().max(250).optional(),
361
+ phone: zod_1.z.string().max(50).optional(),
362
+ line1: zod_1.z.string().max(150).optional(),
363
+ line2: zod_1.z.string().max(150).optional(),
364
+ line3: zod_1.z.string().max(150).optional(),
365
+ city: zod_1.z.string().max(50).optional(),
366
+ state_code: zod_1.z.string().max(50).optional(),
367
+ state: zod_1.z.string().max(50).optional(),
368
+ zip: zod_1.z.string().max(20).optional(),
369
+ country: zod_1.z.string().max(50).optional(),
370
+ validation_status: zod_1.z
371
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
372
+ .optional(),
373
+ });
374
+ const CreateSubscriptionStatementDescriptorSchema = zod_1.z.object({
375
+ descriptor: zod_1.z.string().max(65000).optional(),
376
+ });
377
+ const CreateSubscriptionContractTermSchema = zod_1.z.object({
378
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
379
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
380
+ });
381
+ const CreateSubscriptionEntityIdentifiersSchema = zod_1.z.object({
382
+ id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
383
+ scheme: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
384
+ value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
385
+ standard: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
386
+ });
387
+ const CreateSubscriptionTaxProvidersFieldsSchema = zod_1.z.object({
388
+ provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
389
+ field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
390
+ field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
391
+ });
392
+ const CreateSubscriptionAddonsSchema = zod_1.z.object({
393
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
394
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
395
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
396
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
397
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
398
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
399
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
400
+ });
401
+ const CreateSubscriptionEventBasedAddonsSchema = zod_1.z.object({
402
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
403
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
404
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
405
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
406
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
407
+ service_period_in_days: zod_1.z
408
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
409
+ .optional(),
410
+ on_event: zod_1.z
411
+ .array(zod_1.z
412
+ .enum([
413
+ 'subscription_creation',
414
+ 'subscription_trial_start',
415
+ 'plan_activation',
416
+ 'subscription_activation',
417
+ 'contract_termination',
418
+ ])
419
+ .optional())
420
+ .optional(),
421
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
422
+ charge_on: zod_1.z.array(zod_1.z.enum(['immediately', 'on_event']).optional()).optional(),
423
+ });
424
+ const CreateSubscriptionCouponsSchema = zod_1.z.object({
425
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
426
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
427
+ });
428
+ const CreateSubscriptionBodySchema = zod_1.z.looseObject({
429
+ id: zod_1.z.string().max(50).optional(),
430
+ plan_id: zod_1.z.string().max(100),
431
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
432
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
433
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
434
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
435
+ setup_fee: zod_1.z.number().int().min(0).optional(),
436
+ trial_end: zod_1.z.number().int().optional(),
437
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
438
+ mandatory_addons_to_remove: zod_1.z
439
+ .array(zod_1.z.string().max(100).optional())
440
+ .optional(),
441
+ start_date: zod_1.z.number().int().optional(),
442
+ coupon: zod_1.z.string().max(100).optional(),
443
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
444
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
445
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
446
+ offline_payment_method: zod_1.z
447
+ .enum([
448
+ 'no_preference',
449
+ 'cash',
450
+ 'check',
451
+ 'bank_transfer',
452
+ 'ach_credit',
453
+ 'sepa_credit',
454
+ 'boleto',
455
+ 'us_automated_bank_transfer',
456
+ 'eu_automated_bank_transfer',
457
+ 'uk_automated_bank_transfer',
458
+ 'jp_automated_bank_transfer',
459
+ 'mx_automated_bank_transfer',
460
+ 'custom',
461
+ ])
462
+ .optional(),
463
+ po_number: zod_1.z.string().max(100).optional(),
464
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
465
+ token_id: zod_1.z.string().max(40).optional(),
466
+ affiliate_token: zod_1.z.string().max(250).optional(),
467
+ created_from_ip: zod_1.z.string().max(50).optional(),
468
+ invoice_notes: zod_1.z.string().max(2000).optional(),
469
+ invoice_date: zod_1.z.number().int().optional(),
470
+ meta_data: CreateSubscriptionMetaDataSchema.optional(),
471
+ invoice_immediately: zod_1.z.boolean().optional(),
472
+ free_period: zod_1.z.number().int().min(1).optional(),
473
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
474
+ contract_term_billing_cycle_on_renewal: zod_1.z
475
+ .number()
476
+ .int()
477
+ .min(1)
478
+ .max(100)
479
+ .optional(),
480
+ trial_end_action: zod_1.z
481
+ .enum([
482
+ 'site_default',
483
+ 'plan_default',
484
+ 'activate_subscription',
485
+ 'cancel_subscription',
486
+ ])
487
+ .optional(),
488
+ client_profile_id: zod_1.z.string().max(50).optional(),
489
+ payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
490
+ customer: CreateSubscriptionCustomerSchema.optional(),
491
+ card: CreateSubscriptionCardSchema.optional(),
492
+ bank_account: CreateSubscriptionBankAccountSchema.optional(),
493
+ payment_method: CreateSubscriptionPaymentMethodSchema.optional(),
494
+ payment_intent: CreateSubscriptionPaymentIntentSchema.optional(),
495
+ billing_address: CreateSubscriptionBillingAddressSchema.optional(),
496
+ shipping_address: CreateSubscriptionShippingAddressSchema.optional(),
497
+ statement_descriptor: CreateSubscriptionStatementDescriptorSchema.optional(),
498
+ contract_term: CreateSubscriptionContractTermSchema.optional(),
499
+ entity_identifiers: CreateSubscriptionEntityIdentifiersSchema.optional(),
500
+ tax_providers_fields: CreateSubscriptionTaxProvidersFieldsSchema.optional(),
501
+ addons: CreateSubscriptionAddonsSchema.optional(),
502
+ event_based_addons: CreateSubscriptionEventBasedAddonsSchema.optional(),
503
+ coupons: CreateSubscriptionCouponsSchema.optional(),
504
+ });
505
+ exports.CreateSubscriptionBodySchema = CreateSubscriptionBodySchema;
506
+ //Subscription.createForCustomer
507
+ const CreateForCustomerSubscriptionMetaDataSchema = zod_1.z.looseObject({});
508
+ const CreateForCustomerSubscriptionShippingAddressSchema = zod_1.z.object({
509
+ first_name: zod_1.z.string().max(150).optional(),
510
+ last_name: zod_1.z.string().max(150).optional(),
511
+ email: zod_1.z.string().email().max(70).optional(),
512
+ company: zod_1.z.string().max(250).optional(),
513
+ phone: zod_1.z.string().max(50).optional(),
514
+ line1: zod_1.z.string().max(150).optional(),
515
+ line2: zod_1.z.string().max(150).optional(),
516
+ line3: zod_1.z.string().max(150).optional(),
517
+ city: zod_1.z.string().max(50).optional(),
518
+ state_code: zod_1.z.string().max(50).optional(),
519
+ state: zod_1.z.string().max(50).optional(),
520
+ zip: zod_1.z.string().max(20).optional(),
521
+ country: zod_1.z.string().max(50).optional(),
522
+ validation_status: zod_1.z
523
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
524
+ .optional(),
525
+ });
526
+ const CreateForCustomerSubscriptionStatementDescriptorSchema = zod_1.z.object({
527
+ descriptor: zod_1.z.string().max(65000).optional(),
528
+ });
529
+ const CreateForCustomerSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
530
+ const CreateForCustomerSubscriptionPaymentIntentSchema = zod_1.z.object({
531
+ id: zod_1.z.string().max(150).optional(),
532
+ gateway_account_id: zod_1.z.string().max(50).optional(),
533
+ gw_token: zod_1.z.string().max(65000).optional(),
534
+ payment_method_type: zod_1.z
535
+ .enum([
536
+ 'card',
537
+ 'ideal',
538
+ 'sofort',
539
+ 'bancontact',
540
+ 'google_pay',
541
+ 'dotpay',
542
+ 'giropay',
543
+ 'apple_pay',
544
+ 'upi',
545
+ 'netbanking_emandates',
546
+ 'paypal_express_checkout',
547
+ 'direct_debit',
548
+ 'boleto',
549
+ 'venmo',
550
+ 'amazon_payments',
551
+ 'pay_to',
552
+ 'faster_payments',
553
+ 'sepa_instant_transfer',
554
+ 'klarna_pay_now',
555
+ 'online_banking_poland',
556
+ 'payconiq_by_bancontact',
557
+ 'electronic_payment_standard',
558
+ 'kbc_payment_button',
559
+ 'pay_by_bank',
560
+ 'trustly',
561
+ 'stablecoin',
562
+ 'kakao_pay',
563
+ 'naver_pay',
564
+ 'revolut_pay',
565
+ 'cash_app_pay',
566
+ 'wechat_pay',
567
+ 'alipay',
568
+ 'pix',
569
+ 'twint',
570
+ 'go_pay',
571
+ 'grab_pay',
572
+ 'pay_co',
573
+ 'after_pay',
574
+ 'swish',
575
+ 'payme',
576
+ ])
577
+ .optional(),
578
+ reference_id: zod_1.z.string().max(65000).optional(),
579
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
580
+ additional_information: CreateForCustomerSubscriptionAdditionalInformationSchema.optional(),
581
+ });
582
+ const CreateForCustomerSubscriptionContractTermSchema = zod_1.z.object({
583
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
584
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
585
+ });
586
+ const CreateForCustomerSubscriptionAddonsSchema = zod_1.z.object({
587
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
588
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
589
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
590
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
591
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
592
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
593
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
594
+ });
595
+ const CreateForCustomerSubscriptionEventBasedAddonsSchema = zod_1.z.object({
596
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
597
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
598
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
599
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
600
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
601
+ service_period_in_days: zod_1.z
602
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
603
+ .optional(),
604
+ on_event: zod_1.z
605
+ .array(zod_1.z
606
+ .enum([
607
+ 'subscription_creation',
608
+ 'subscription_trial_start',
609
+ 'plan_activation',
610
+ 'subscription_activation',
611
+ 'contract_termination',
612
+ ])
613
+ .optional())
614
+ .optional(),
615
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
616
+ charge_on: zod_1.z.array(zod_1.z.enum(['immediately', 'on_event']).optional()).optional(),
617
+ });
618
+ const CreateForCustomerSubscriptionCouponsSchema = zod_1.z.object({
619
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
620
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
621
+ });
622
+ const CreateForCustomerSubscriptionBodySchema = zod_1.z.looseObject({
623
+ id: zod_1.z.string().max(50).optional(),
624
+ plan_id: zod_1.z.string().max(100),
625
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
626
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
627
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
628
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
629
+ setup_fee: zod_1.z.number().int().min(0).optional(),
630
+ trial_end: zod_1.z.number().int().optional(),
631
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
632
+ mandatory_addons_to_remove: zod_1.z
633
+ .array(zod_1.z.string().max(100).optional())
634
+ .optional(),
635
+ start_date: zod_1.z.number().int().optional(),
636
+ coupon: zod_1.z.string().max(100).optional(),
637
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
638
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
639
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
640
+ offline_payment_method: zod_1.z
641
+ .enum([
642
+ 'no_preference',
643
+ 'cash',
644
+ 'check',
645
+ 'bank_transfer',
646
+ 'ach_credit',
647
+ 'sepa_credit',
648
+ 'boleto',
649
+ 'us_automated_bank_transfer',
650
+ 'eu_automated_bank_transfer',
651
+ 'uk_automated_bank_transfer',
652
+ 'jp_automated_bank_transfer',
653
+ 'mx_automated_bank_transfer',
654
+ 'custom',
655
+ ])
656
+ .optional(),
657
+ po_number: zod_1.z.string().max(100).optional(),
658
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
659
+ payment_source_id: zod_1.z.string().max(40).optional(),
660
+ override_relationship: zod_1.z.boolean().optional(),
661
+ invoice_notes: zod_1.z.string().max(2000).optional(),
662
+ invoice_date: zod_1.z.number().int().optional(),
663
+ meta_data: CreateForCustomerSubscriptionMetaDataSchema.optional(),
664
+ invoice_immediately: zod_1.z.boolean().optional(),
665
+ replace_primary_payment_source: zod_1.z.boolean().default(true).optional(),
666
+ free_period: zod_1.z.number().int().min(1).optional(),
667
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
668
+ contract_term_billing_cycle_on_renewal: zod_1.z
669
+ .number()
670
+ .int()
671
+ .min(1)
672
+ .max(100)
673
+ .optional(),
674
+ trial_end_action: zod_1.z
675
+ .enum([
676
+ 'site_default',
677
+ 'plan_default',
678
+ 'activate_subscription',
679
+ 'cancel_subscription',
680
+ ])
681
+ .optional(),
682
+ payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
683
+ shipping_address: CreateForCustomerSubscriptionShippingAddressSchema.optional(),
684
+ statement_descriptor: CreateForCustomerSubscriptionStatementDescriptorSchema.optional(),
685
+ payment_intent: CreateForCustomerSubscriptionPaymentIntentSchema.optional(),
686
+ contract_term: CreateForCustomerSubscriptionContractTermSchema.optional(),
687
+ addons: CreateForCustomerSubscriptionAddonsSchema.optional(),
688
+ event_based_addons: CreateForCustomerSubscriptionEventBasedAddonsSchema.optional(),
689
+ coupons: CreateForCustomerSubscriptionCouponsSchema.optional(),
690
+ });
691
+ exports.CreateForCustomerSubscriptionBodySchema = CreateForCustomerSubscriptionBodySchema;
692
+ //Subscription.createWithItems
693
+ const CreateWithItemsSubscriptionMetaDataSchema = zod_1.z.looseObject({});
694
+ const CreateWithItemsSubscriptionShippingAddressSchema = zod_1.z.object({
695
+ first_name: zod_1.z.string().max(150).optional(),
696
+ last_name: zod_1.z.string().max(150).optional(),
697
+ email: zod_1.z.string().email().max(70).optional(),
698
+ company: zod_1.z.string().max(250).optional(),
699
+ phone: zod_1.z.string().max(50).optional(),
700
+ line1: zod_1.z.string().max(150).optional(),
701
+ line2: zod_1.z.string().max(150).optional(),
702
+ line3: zod_1.z.string().max(150).optional(),
703
+ city: zod_1.z.string().max(50).optional(),
704
+ state_code: zod_1.z.string().max(50).optional(),
705
+ state: zod_1.z.string().max(50).optional(),
706
+ zip: zod_1.z.string().max(20).optional(),
707
+ country: zod_1.z.string().max(50).optional(),
708
+ validation_status: zod_1.z
709
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
710
+ .optional(),
711
+ });
712
+ const CreateWithItemsSubscriptionStatementDescriptorSchema = zod_1.z.object({
713
+ descriptor: zod_1.z.string().max(65000).optional(),
714
+ });
715
+ const CreateWithItemsSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
716
+ const CreateWithItemsSubscriptionPaymentIntentSchema = zod_1.z.object({
717
+ id: zod_1.z.string().max(150).optional(),
718
+ gateway_account_id: zod_1.z.string().max(50).optional(),
719
+ gw_token: zod_1.z.string().max(65000).optional(),
720
+ payment_method_type: zod_1.z
721
+ .enum([
722
+ 'card',
723
+ 'ideal',
724
+ 'sofort',
725
+ 'bancontact',
726
+ 'google_pay',
727
+ 'dotpay',
728
+ 'giropay',
729
+ 'apple_pay',
730
+ 'upi',
731
+ 'netbanking_emandates',
732
+ 'paypal_express_checkout',
733
+ 'direct_debit',
734
+ 'boleto',
735
+ 'venmo',
736
+ 'amazon_payments',
737
+ 'pay_to',
738
+ 'faster_payments',
739
+ 'sepa_instant_transfer',
740
+ 'klarna_pay_now',
741
+ 'online_banking_poland',
742
+ 'payconiq_by_bancontact',
743
+ 'electronic_payment_standard',
744
+ 'kbc_payment_button',
745
+ 'pay_by_bank',
746
+ 'trustly',
747
+ 'stablecoin',
748
+ 'kakao_pay',
749
+ 'naver_pay',
750
+ 'revolut_pay',
751
+ 'cash_app_pay',
752
+ 'wechat_pay',
753
+ 'alipay',
754
+ 'pix',
755
+ 'twint',
756
+ 'go_pay',
757
+ 'grab_pay',
758
+ 'pay_co',
759
+ 'after_pay',
760
+ 'swish',
761
+ 'payme',
762
+ ])
763
+ .optional(),
764
+ reference_id: zod_1.z.string().max(65000).optional(),
765
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
766
+ additional_information: CreateWithItemsSubscriptionAdditionalInformationSchema.optional(),
767
+ });
768
+ const CreateWithItemsSubscriptionContractTermSchema = zod_1.z.object({
769
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
770
+ contract_start: zod_1.z.number().int().optional(),
771
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
772
+ });
773
+ const CreateWithItemsSubscriptionBillingOverrideSchema = zod_1.z.object({
774
+ max_excess_payment_usage: zod_1.z.number().int().min(-1).optional(),
775
+ max_refundable_credits_usage: zod_1.z.number().int().min(-1).optional(),
776
+ });
777
+ const CreateWithItemsSubscriptionSubscriptionItemsSchema = zod_1.z.object({
778
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
779
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
780
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
781
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
782
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
783
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
784
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
785
+ service_period_days: zod_1.z
786
+ .array(zod_1.z.number().int().min(1).max(730).optional())
787
+ .optional(),
788
+ charge_on_event: zod_1.z
789
+ .array(zod_1.z
790
+ .enum([
791
+ 'subscription_creation',
792
+ 'subscription_trial_start',
793
+ 'plan_activation',
794
+ 'subscription_activation',
795
+ 'contract_termination',
796
+ ])
797
+ .optional())
798
+ .optional(),
799
+ charge_once: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
800
+ item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
801
+ charge_on_option: zod_1.z
802
+ .array(zod_1.z.enum(['immediately', 'on_event']).optional())
803
+ .optional(),
804
+ usage_accumulation_reset_frequency: zod_1.z
805
+ .array(zod_1.z.enum(['never', 'subscription_billing_frequency']).optional())
806
+ .optional(),
807
+ });
808
+ const CreateWithItemsSubscriptionDiscountsSchema = zod_1.z.object({
809
+ apply_on: zod_1.z
810
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
811
+ .optional(),
812
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
813
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
814
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
815
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
816
+ period_unit: zod_1.z
817
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
818
+ .optional(),
819
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
820
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
821
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
822
+ });
823
+ const CreateWithItemsSubscriptionItemTiersSchema = zod_1.z.object({
824
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
825
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
826
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
827
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
828
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
829
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
830
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
831
+ pricing_type: zod_1.z
832
+ .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional())
833
+ .optional(),
834
+ package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
835
+ });
836
+ const CreateWithItemsSubscriptionCouponsSchema = zod_1.z.object({
837
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
838
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
839
+ });
840
+ const CreateWithItemsSubscriptionBodySchema = zod_1.z.looseObject({
841
+ id: zod_1.z.string().max(50).optional(),
842
+ business_entity_id: zod_1.z.string().max(50).optional(),
843
+ trial_end: zod_1.z.number().int().optional(),
844
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
845
+ setup_fee: zod_1.z.number().int().min(0).optional(),
846
+ mandatory_items_to_remove: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
847
+ net_term_days: zod_1.z.number().int().optional(),
848
+ start_date: zod_1.z.number().int().optional(),
849
+ coupon: zod_1.z.string().max(100).optional(),
850
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
851
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
852
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
853
+ offline_payment_method: zod_1.z
854
+ .enum([
855
+ 'no_preference',
856
+ 'cash',
857
+ 'check',
858
+ 'bank_transfer',
859
+ 'ach_credit',
860
+ 'sepa_credit',
861
+ 'boleto',
862
+ 'us_automated_bank_transfer',
863
+ 'eu_automated_bank_transfer',
864
+ 'uk_automated_bank_transfer',
865
+ 'jp_automated_bank_transfer',
866
+ 'mx_automated_bank_transfer',
867
+ 'custom',
868
+ ])
869
+ .optional(),
870
+ po_number: zod_1.z.string().max(100).optional(),
871
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
872
+ payment_source_id: zod_1.z.string().max(40).optional(),
873
+ override_relationship: zod_1.z.boolean().optional(),
874
+ invoice_notes: zod_1.z.string().max(2000).optional(),
875
+ invoice_date: zod_1.z.number().int().optional(),
876
+ meta_data: CreateWithItemsSubscriptionMetaDataSchema.optional(),
877
+ invoice_immediately: zod_1.z.boolean().optional(),
878
+ replace_primary_payment_source: zod_1.z.boolean().default(true).optional(),
879
+ free_period: zod_1.z.number().int().min(1).optional(),
880
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
881
+ contract_term_billing_cycle_on_renewal: zod_1.z
882
+ .number()
883
+ .int()
884
+ .min(1)
885
+ .max(100)
886
+ .optional(),
887
+ create_pending_invoices: zod_1.z.boolean().optional(),
888
+ auto_close_invoices: zod_1.z.boolean().optional(),
889
+ first_invoice_pending: zod_1.z.boolean().default(false).optional(),
890
+ trial_end_action: zod_1.z
891
+ .enum([
892
+ 'site_default',
893
+ 'plan_default',
894
+ 'activate_subscription',
895
+ 'cancel_subscription',
896
+ ])
897
+ .optional(),
898
+ payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
899
+ shipping_address: CreateWithItemsSubscriptionShippingAddressSchema.optional(),
900
+ statement_descriptor: CreateWithItemsSubscriptionStatementDescriptorSchema.optional(),
901
+ payment_intent: CreateWithItemsSubscriptionPaymentIntentSchema.optional(),
902
+ contract_term: CreateWithItemsSubscriptionContractTermSchema.optional(),
903
+ billing_override: CreateWithItemsSubscriptionBillingOverrideSchema.optional(),
904
+ subscription_items: CreateWithItemsSubscriptionSubscriptionItemsSchema.optional(),
905
+ discounts: CreateWithItemsSubscriptionDiscountsSchema.optional(),
906
+ item_tiers: CreateWithItemsSubscriptionItemTiersSchema.optional(),
907
+ coupons: CreateWithItemsSubscriptionCouponsSchema.optional(),
908
+ });
909
+ exports.CreateWithItemsSubscriptionBodySchema = CreateWithItemsSubscriptionBodySchema;
910
+ //Subscription.subscriptionsForCustomer
911
+ const SubscriptionsForCustomerSubscriptionBodySchema = zod_1.z.looseObject({
912
+ limit: zod_1.z.number().int().min(1).max(100).optional(),
913
+ offset: zod_1.z.string().max(1000).optional(),
914
+ });
915
+ exports.SubscriptionsForCustomerSubscriptionBodySchema = SubscriptionsForCustomerSubscriptionBodySchema;
916
+ //Subscription.contractTermsForSubscription
917
+ const ContractTermsForSubscriptionSubscriptionSortBySchema = zod_1.z.looseObject({
918
+ asc: zod_1.z.enum(['created_at']).optional(),
919
+ desc: zod_1.z.enum(['created_at']).optional(),
920
+ });
921
+ const ContractTermsForSubscriptionSubscriptionBodySchema = zod_1.z.looseObject({
922
+ limit: zod_1.z.number().int().min(1).max(100).optional(),
923
+ offset: zod_1.z.string().max(1000).optional(),
924
+ sort_by: ContractTermsForSubscriptionSubscriptionSortBySchema.optional(),
925
+ });
926
+ exports.ContractTermsForSubscriptionSubscriptionBodySchema = ContractTermsForSubscriptionSubscriptionBodySchema;
927
+ //Subscription.listDiscounts
928
+ const ListDiscountsSubscriptionBodySchema = zod_1.z.looseObject({
929
+ limit: zod_1.z.number().int().min(1).max(100).optional(),
930
+ offset: zod_1.z.string().max(1000).optional(),
931
+ });
932
+ exports.ListDiscountsSubscriptionBodySchema = ListDiscountsSubscriptionBodySchema;
933
+ //Subscription.removeScheduledCancellation
934
+ const RemoveScheduledCancellationSubscriptionContractTermSchema = zod_1.z.object({
935
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
936
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
937
+ });
938
+ const RemoveScheduledCancellationSubscriptionBodySchema = zod_1.z.looseObject({
939
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
940
+ contract_term_billing_cycle_on_renewal: zod_1.z
941
+ .number()
942
+ .int()
943
+ .min(1)
944
+ .max(100)
945
+ .optional(),
946
+ contract_term: RemoveScheduledCancellationSubscriptionContractTermSchema.optional(),
947
+ });
948
+ exports.RemoveScheduledCancellationSubscriptionBodySchema = RemoveScheduledCancellationSubscriptionBodySchema;
949
+ //Subscription.removeCoupons
950
+ const RemoveCouponsSubscriptionBodySchema = zod_1.z.looseObject({
951
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
952
+ });
953
+ exports.RemoveCouponsSubscriptionBodySchema = RemoveCouponsSubscriptionBodySchema;
954
+ //Subscription.update
955
+ const UpdateSubscriptionMetaDataSchema = zod_1.z.looseObject({});
956
+ const UpdateSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
957
+ const UpdateSubscriptionCardSchema = zod_1.z.object({
958
+ gateway: zod_1.z
959
+ .enum([
960
+ 'chargebee',
961
+ 'chargebee_payments',
962
+ 'adyen',
963
+ 'stripe',
964
+ 'wepay',
965
+ 'braintree',
966
+ 'authorize_net',
967
+ 'paypal_pro',
968
+ 'pin',
969
+ 'eway',
970
+ 'eway_rapid',
971
+ 'worldpay',
972
+ 'balanced_payments',
973
+ 'beanstream',
974
+ 'bluepay',
975
+ 'elavon',
976
+ 'first_data_global',
977
+ 'hdfc',
978
+ 'migs',
979
+ 'nmi',
980
+ 'ogone',
981
+ 'paymill',
982
+ 'paypal_payflow_pro',
983
+ 'sage_pay',
984
+ 'tco',
985
+ 'wirecard',
986
+ 'amazon_payments',
987
+ 'paypal_express_checkout',
988
+ 'orbital',
989
+ 'moneris_us',
990
+ 'moneris',
991
+ 'bluesnap',
992
+ 'cybersource',
993
+ 'vantiv',
994
+ 'checkout_com',
995
+ 'paypal',
996
+ 'ingenico_direct',
997
+ 'exact',
998
+ 'mollie',
999
+ 'quickbooks',
1000
+ 'razorpay',
1001
+ 'global_payments',
1002
+ 'bank_of_america',
1003
+ 'ecentric',
1004
+ 'metrics_global',
1005
+ 'windcave',
1006
+ 'pay_com',
1007
+ 'ebanx',
1008
+ 'dlocal',
1009
+ 'nuvei',
1010
+ 'solidgate',
1011
+ 'paystack',
1012
+ 'jp_morgan',
1013
+ 'deutsche_bank',
1014
+ 'ezidebit',
1015
+ 'twikey',
1016
+ 'tempus',
1017
+ 'moyasar',
1018
+ 'payway',
1019
+ ])
1020
+ .optional(),
1021
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1022
+ tmp_token: zod_1.z.string().max(300).optional(),
1023
+ first_name: zod_1.z.string().max(50).optional(),
1024
+ last_name: zod_1.z.string().max(50).optional(),
1025
+ number: zod_1.z.string().max(1500).optional(),
1026
+ expiry_month: zod_1.z.number().int().min(1).max(12).optional(),
1027
+ expiry_year: zod_1.z.number().int().optional(),
1028
+ cvv: zod_1.z.string().max(520).optional(),
1029
+ preferred_scheme: zod_1.z
1030
+ .enum(['cartes_bancaires', 'mastercard', 'visa'])
1031
+ .optional(),
1032
+ billing_addr1: zod_1.z.string().max(150).optional(),
1033
+ billing_addr2: zod_1.z.string().max(150).optional(),
1034
+ billing_city: zod_1.z.string().max(50).optional(),
1035
+ billing_state_code: zod_1.z.string().max(50).optional(),
1036
+ billing_state: zod_1.z.string().max(50).optional(),
1037
+ billing_zip: zod_1.z.string().max(20).optional(),
1038
+ billing_country: zod_1.z.string().max(50).optional(),
1039
+ ip_address: zod_1.z.string().max(50).optional(),
1040
+ additional_information: UpdateSubscriptionAdditionalInformationSchema.optional(),
1041
+ });
1042
+ const UpdateSubscriptionPaymentMethodSchema = zod_1.z.object({
1043
+ type: zod_1.z
1044
+ .enum([
1045
+ 'card',
1046
+ 'paypal_express_checkout',
1047
+ 'amazon_payments',
1048
+ 'direct_debit',
1049
+ 'generic',
1050
+ 'alipay',
1051
+ 'unionpay',
1052
+ 'apple_pay',
1053
+ 'wechat_pay',
1054
+ 'ideal',
1055
+ 'google_pay',
1056
+ 'sofort',
1057
+ 'bancontact',
1058
+ 'giropay',
1059
+ 'dotpay',
1060
+ 'upi',
1061
+ 'netbanking_emandates',
1062
+ 'venmo',
1063
+ 'pay_to',
1064
+ 'faster_payments',
1065
+ 'sepa_instant_transfer',
1066
+ 'automated_bank_transfer',
1067
+ 'klarna_pay_now',
1068
+ 'online_banking_poland',
1069
+ 'payconiq_by_bancontact',
1070
+ 'electronic_payment_standard',
1071
+ 'kbc_payment_button',
1072
+ 'pay_by_bank',
1073
+ 'trustly',
1074
+ 'stablecoin',
1075
+ 'kakao_pay',
1076
+ 'naver_pay',
1077
+ 'revolut_pay',
1078
+ 'cash_app_pay',
1079
+ 'pix',
1080
+ 'twint',
1081
+ 'go_pay',
1082
+ 'grab_pay',
1083
+ 'pay_co',
1084
+ 'after_pay',
1085
+ 'swish',
1086
+ 'payme',
1087
+ ])
1088
+ .optional(),
1089
+ gateway: zod_1.z
1090
+ .enum([
1091
+ 'chargebee_payments',
1092
+ 'adyen',
1093
+ 'stripe',
1094
+ 'wepay',
1095
+ 'braintree',
1096
+ 'authorize_net',
1097
+ 'paypal_pro',
1098
+ 'pin',
1099
+ 'eway',
1100
+ 'eway_rapid',
1101
+ 'worldpay',
1102
+ 'balanced_payments',
1103
+ 'beanstream',
1104
+ 'bluepay',
1105
+ 'elavon',
1106
+ 'first_data_global',
1107
+ 'hdfc',
1108
+ 'migs',
1109
+ 'nmi',
1110
+ 'ogone',
1111
+ 'paymill',
1112
+ 'paypal_payflow_pro',
1113
+ 'sage_pay',
1114
+ 'tco',
1115
+ 'wirecard',
1116
+ 'amazon_payments',
1117
+ 'paypal_express_checkout',
1118
+ 'gocardless',
1119
+ 'orbital',
1120
+ 'moneris_us',
1121
+ 'moneris',
1122
+ 'bluesnap',
1123
+ 'cybersource',
1124
+ 'vantiv',
1125
+ 'checkout_com',
1126
+ 'paypal',
1127
+ 'ingenico_direct',
1128
+ 'exact',
1129
+ 'mollie',
1130
+ 'quickbooks',
1131
+ 'razorpay',
1132
+ 'global_payments',
1133
+ 'bank_of_america',
1134
+ 'ecentric',
1135
+ 'metrics_global',
1136
+ 'windcave',
1137
+ 'pay_com',
1138
+ 'ebanx',
1139
+ 'dlocal',
1140
+ 'nuvei',
1141
+ 'solidgate',
1142
+ 'paystack',
1143
+ 'jp_morgan',
1144
+ 'deutsche_bank',
1145
+ 'ezidebit',
1146
+ 'twikey',
1147
+ 'tempus',
1148
+ 'moyasar',
1149
+ 'payway',
1150
+ ])
1151
+ .optional(),
1152
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1153
+ reference_id: zod_1.z.string().max(200).optional(),
1154
+ tmp_token: zod_1.z.string().max(65000).optional(),
1155
+ issuing_country: zod_1.z.string().max(50).optional(),
1156
+ additional_information: UpdateSubscriptionAdditionalInformationSchema.optional(),
1157
+ });
1158
+ const UpdateSubscriptionPaymentIntentSchema = zod_1.z.object({
1159
+ id: zod_1.z.string().max(150).optional(),
1160
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1161
+ gw_token: zod_1.z.string().max(65000).optional(),
1162
+ payment_method_type: zod_1.z
1163
+ .enum([
1164
+ 'card',
1165
+ 'ideal',
1166
+ 'sofort',
1167
+ 'bancontact',
1168
+ 'google_pay',
1169
+ 'dotpay',
1170
+ 'giropay',
1171
+ 'apple_pay',
1172
+ 'upi',
1173
+ 'netbanking_emandates',
1174
+ 'paypal_express_checkout',
1175
+ 'direct_debit',
1176
+ 'boleto',
1177
+ 'venmo',
1178
+ 'amazon_payments',
1179
+ 'pay_to',
1180
+ 'faster_payments',
1181
+ 'sepa_instant_transfer',
1182
+ 'klarna_pay_now',
1183
+ 'online_banking_poland',
1184
+ 'payconiq_by_bancontact',
1185
+ 'electronic_payment_standard',
1186
+ 'kbc_payment_button',
1187
+ 'pay_by_bank',
1188
+ 'trustly',
1189
+ 'stablecoin',
1190
+ 'kakao_pay',
1191
+ 'naver_pay',
1192
+ 'revolut_pay',
1193
+ 'cash_app_pay',
1194
+ 'wechat_pay',
1195
+ 'alipay',
1196
+ 'pix',
1197
+ 'twint',
1198
+ 'go_pay',
1199
+ 'grab_pay',
1200
+ 'pay_co',
1201
+ 'after_pay',
1202
+ 'swish',
1203
+ 'payme',
1204
+ ])
1205
+ .optional(),
1206
+ reference_id: zod_1.z.string().max(65000).optional(),
1207
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
1208
+ additional_information: UpdateSubscriptionAdditionalInformationSchema.optional(),
1209
+ });
1210
+ const UpdateSubscriptionBillingAddressSchema = zod_1.z.object({
1211
+ first_name: zod_1.z.string().max(150).optional(),
1212
+ last_name: zod_1.z.string().max(150).optional(),
1213
+ email: zod_1.z.string().email().max(70).optional(),
1214
+ company: zod_1.z.string().max(250).optional(),
1215
+ phone: zod_1.z.string().max(50).optional(),
1216
+ line1: zod_1.z.string().max(150).optional(),
1217
+ line2: zod_1.z.string().max(150).optional(),
1218
+ line3: zod_1.z.string().max(150).optional(),
1219
+ city: zod_1.z.string().max(50).optional(),
1220
+ state_code: zod_1.z.string().max(50).optional(),
1221
+ state: zod_1.z.string().max(50).optional(),
1222
+ zip: zod_1.z.string().max(20).optional(),
1223
+ country: zod_1.z.string().max(50).optional(),
1224
+ validation_status: zod_1.z
1225
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1226
+ .optional(),
1227
+ });
1228
+ const UpdateSubscriptionShippingAddressSchema = zod_1.z.object({
1229
+ first_name: zod_1.z.string().max(150).optional(),
1230
+ last_name: zod_1.z.string().max(150).optional(),
1231
+ email: zod_1.z.string().email().max(70).optional(),
1232
+ company: zod_1.z.string().max(250).optional(),
1233
+ phone: zod_1.z.string().max(50).optional(),
1234
+ line1: zod_1.z.string().max(150).optional(),
1235
+ line2: zod_1.z.string().max(150).optional(),
1236
+ line3: zod_1.z.string().max(150).optional(),
1237
+ city: zod_1.z.string().max(50).optional(),
1238
+ state_code: zod_1.z.string().max(50).optional(),
1239
+ state: zod_1.z.string().max(50).optional(),
1240
+ zip: zod_1.z.string().max(20).optional(),
1241
+ country: zod_1.z.string().max(50).optional(),
1242
+ validation_status: zod_1.z
1243
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1244
+ .optional(),
1245
+ });
1246
+ const UpdateSubscriptionStatementDescriptorSchema = zod_1.z.object({
1247
+ descriptor: zod_1.z.string().max(65000).optional(),
1248
+ });
1249
+ const UpdateSubscriptionCustomerSchema = zod_1.z.object({
1250
+ vat_number: zod_1.z.string().max(20).optional(),
1251
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
1252
+ entity_identifier_scheme: zod_1.z.string().max(50).optional(),
1253
+ is_einvoice_enabled: zod_1.z.boolean().optional(),
1254
+ einvoicing_method: zod_1.z.enum(['automatic', 'manual', 'site_default']).optional(),
1255
+ entity_identifier_standard: zod_1.z.string().max(50).optional(),
1256
+ business_customer_without_vat_number: zod_1.z.boolean().optional(),
1257
+ registered_for_gst: zod_1.z.boolean().optional(),
1258
+ });
1259
+ const UpdateSubscriptionContractTermSchema = zod_1.z.object({
1260
+ action_at_term_end: zod_1.z
1261
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
1262
+ .optional(),
1263
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
1264
+ });
1265
+ const UpdateSubscriptionAddonsSchema = zod_1.z.object({
1266
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1267
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1268
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1269
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1270
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1271
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1272
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1273
+ proration_type: zod_1.z
1274
+ .array(zod_1.z.enum(['full_term', 'partial_term', 'none']).optional())
1275
+ .optional(),
1276
+ });
1277
+ const UpdateSubscriptionEventBasedAddonsSchema = zod_1.z.object({
1278
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1279
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1280
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1281
+ service_period_in_days: zod_1.z
1282
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
1283
+ .optional(),
1284
+ charge_on: zod_1.z.array(zod_1.z.enum(['immediately', 'on_event']).optional()).optional(),
1285
+ on_event: zod_1.z
1286
+ .array(zod_1.z
1287
+ .enum([
1288
+ 'subscription_creation',
1289
+ 'subscription_trial_start',
1290
+ 'plan_activation',
1291
+ 'subscription_activation',
1292
+ 'contract_termination',
1293
+ ])
1294
+ .optional())
1295
+ .optional(),
1296
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
1297
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1298
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1299
+ });
1300
+ const UpdateSubscriptionCouponsSchema = zod_1.z.object({
1301
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1302
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1303
+ });
1304
+ const UpdateSubscriptionBodySchema = zod_1.z.looseObject({
1305
+ plan_id: zod_1.z.string().max(100).optional(),
1306
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
1307
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
1308
+ setup_fee: zod_1.z.number().int().min(0).optional(),
1309
+ replace_addon_list: zod_1.z.boolean().default(false).optional(),
1310
+ mandatory_addons_to_remove: zod_1.z
1311
+ .array(zod_1.z.string().max(100).optional())
1312
+ .optional(),
1313
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
1314
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
1315
+ invoice_date: zod_1.z.number().int().optional(),
1316
+ start_date: zod_1.z.number().int().optional(),
1317
+ trial_end: zod_1.z.number().int().optional(),
1318
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
1319
+ coupon: zod_1.z.string().max(100).optional(),
1320
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
1321
+ reactivate_from: zod_1.z.number().int().optional(),
1322
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
1323
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
1324
+ offline_payment_method: zod_1.z
1325
+ .enum([
1326
+ 'no_preference',
1327
+ 'cash',
1328
+ 'check',
1329
+ 'bank_transfer',
1330
+ 'ach_credit',
1331
+ 'sepa_credit',
1332
+ 'boleto',
1333
+ 'us_automated_bank_transfer',
1334
+ 'eu_automated_bank_transfer',
1335
+ 'uk_automated_bank_transfer',
1336
+ 'jp_automated_bank_transfer',
1337
+ 'mx_automated_bank_transfer',
1338
+ 'custom',
1339
+ ])
1340
+ .optional(),
1341
+ po_number: zod_1.z.string().max(100).optional(),
1342
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1343
+ replace_coupon_list: zod_1.z.boolean().default(false).optional(),
1344
+ prorate: zod_1.z.boolean().optional(),
1345
+ end_of_term: zod_1.z.boolean().default(false).optional(),
1346
+ force_term_reset: zod_1.z.boolean().default(false).optional(),
1347
+ reactivate: zod_1.z.boolean().optional(),
1348
+ token_id: zod_1.z.string().max(40).optional(),
1349
+ invoice_notes: zod_1.z.string().max(2000).optional(),
1350
+ meta_data: UpdateSubscriptionMetaDataSchema.optional(),
1351
+ invoice_immediately: zod_1.z.boolean().optional(),
1352
+ override_relationship: zod_1.z.boolean().optional(),
1353
+ changes_scheduled_at: zod_1.z.number().int().optional(),
1354
+ change_option: zod_1.z
1355
+ .enum(['immediately', 'end_of_term', 'specific_date'])
1356
+ .optional(),
1357
+ contract_term_billing_cycle_on_renewal: zod_1.z
1358
+ .number()
1359
+ .int()
1360
+ .min(1)
1361
+ .max(100)
1362
+ .optional(),
1363
+ free_period: zod_1.z.number().int().min(1).optional(),
1364
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
1365
+ trial_end_action: zod_1.z
1366
+ .enum([
1367
+ 'site_default',
1368
+ 'plan_default',
1369
+ 'activate_subscription',
1370
+ 'cancel_subscription',
1371
+ ])
1372
+ .optional(),
1373
+ card: UpdateSubscriptionCardSchema.optional(),
1374
+ payment_method: UpdateSubscriptionPaymentMethodSchema.optional(),
1375
+ payment_intent: UpdateSubscriptionPaymentIntentSchema.optional(),
1376
+ billing_address: UpdateSubscriptionBillingAddressSchema.optional(),
1377
+ shipping_address: UpdateSubscriptionShippingAddressSchema.optional(),
1378
+ statement_descriptor: UpdateSubscriptionStatementDescriptorSchema.optional(),
1379
+ customer: UpdateSubscriptionCustomerSchema.optional(),
1380
+ contract_term: UpdateSubscriptionContractTermSchema.optional(),
1381
+ addons: UpdateSubscriptionAddonsSchema.optional(),
1382
+ event_based_addons: UpdateSubscriptionEventBasedAddonsSchema.optional(),
1383
+ coupons: UpdateSubscriptionCouponsSchema.optional(),
1384
+ });
1385
+ exports.UpdateSubscriptionBodySchema = UpdateSubscriptionBodySchema;
1386
+ //Subscription.updateForItems
1387
+ const UpdateForItemsSubscriptionMetaDataSchema = zod_1.z.looseObject({});
1388
+ const UpdateForItemsSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
1389
+ const UpdateForItemsSubscriptionCardSchema = zod_1.z.object({
1390
+ gateway: zod_1.z
1391
+ .enum([
1392
+ 'chargebee',
1393
+ 'chargebee_payments',
1394
+ 'adyen',
1395
+ 'stripe',
1396
+ 'wepay',
1397
+ 'braintree',
1398
+ 'authorize_net',
1399
+ 'paypal_pro',
1400
+ 'pin',
1401
+ 'eway',
1402
+ 'eway_rapid',
1403
+ 'worldpay',
1404
+ 'balanced_payments',
1405
+ 'beanstream',
1406
+ 'bluepay',
1407
+ 'elavon',
1408
+ 'first_data_global',
1409
+ 'hdfc',
1410
+ 'migs',
1411
+ 'nmi',
1412
+ 'ogone',
1413
+ 'paymill',
1414
+ 'paypal_payflow_pro',
1415
+ 'sage_pay',
1416
+ 'tco',
1417
+ 'wirecard',
1418
+ 'amazon_payments',
1419
+ 'paypal_express_checkout',
1420
+ 'orbital',
1421
+ 'moneris_us',
1422
+ 'moneris',
1423
+ 'bluesnap',
1424
+ 'cybersource',
1425
+ 'vantiv',
1426
+ 'checkout_com',
1427
+ 'paypal',
1428
+ 'ingenico_direct',
1429
+ 'exact',
1430
+ 'mollie',
1431
+ 'quickbooks',
1432
+ 'razorpay',
1433
+ 'global_payments',
1434
+ 'bank_of_america',
1435
+ 'ecentric',
1436
+ 'metrics_global',
1437
+ 'windcave',
1438
+ 'pay_com',
1439
+ 'ebanx',
1440
+ 'dlocal',
1441
+ 'nuvei',
1442
+ 'solidgate',
1443
+ 'paystack',
1444
+ 'jp_morgan',
1445
+ 'deutsche_bank',
1446
+ 'ezidebit',
1447
+ 'twikey',
1448
+ 'tempus',
1449
+ 'moyasar',
1450
+ 'payway',
1451
+ ])
1452
+ .optional(),
1453
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1454
+ tmp_token: zod_1.z.string().max(300).optional(),
1455
+ first_name: zod_1.z.string().max(50).optional(),
1456
+ last_name: zod_1.z.string().max(50).optional(),
1457
+ number: zod_1.z.string().max(1500).optional(),
1458
+ expiry_month: zod_1.z.number().int().min(1).max(12).optional(),
1459
+ expiry_year: zod_1.z.number().int().optional(),
1460
+ cvv: zod_1.z.string().max(520).optional(),
1461
+ preferred_scheme: zod_1.z
1462
+ .enum(['cartes_bancaires', 'mastercard', 'visa'])
1463
+ .optional(),
1464
+ billing_addr1: zod_1.z.string().max(150).optional(),
1465
+ billing_addr2: zod_1.z.string().max(150).optional(),
1466
+ billing_city: zod_1.z.string().max(50).optional(),
1467
+ billing_state_code: zod_1.z.string().max(50).optional(),
1468
+ billing_state: zod_1.z.string().max(50).optional(),
1469
+ billing_zip: zod_1.z.string().max(20).optional(),
1470
+ billing_country: zod_1.z.string().max(50).optional(),
1471
+ ip_address: zod_1.z.string().max(50).optional(),
1472
+ additional_information: UpdateForItemsSubscriptionAdditionalInformationSchema.optional(),
1473
+ });
1474
+ const UpdateForItemsSubscriptionPaymentMethodSchema = zod_1.z.object({
1475
+ type: zod_1.z
1476
+ .enum([
1477
+ 'card',
1478
+ 'paypal_express_checkout',
1479
+ 'amazon_payments',
1480
+ 'direct_debit',
1481
+ 'generic',
1482
+ 'alipay',
1483
+ 'unionpay',
1484
+ 'apple_pay',
1485
+ 'wechat_pay',
1486
+ 'ideal',
1487
+ 'google_pay',
1488
+ 'sofort',
1489
+ 'bancontact',
1490
+ 'giropay',
1491
+ 'dotpay',
1492
+ 'upi',
1493
+ 'netbanking_emandates',
1494
+ 'venmo',
1495
+ 'pay_to',
1496
+ 'faster_payments',
1497
+ 'sepa_instant_transfer',
1498
+ 'automated_bank_transfer',
1499
+ 'klarna_pay_now',
1500
+ 'online_banking_poland',
1501
+ 'payconiq_by_bancontact',
1502
+ 'electronic_payment_standard',
1503
+ 'kbc_payment_button',
1504
+ 'pay_by_bank',
1505
+ 'trustly',
1506
+ 'stablecoin',
1507
+ 'kakao_pay',
1508
+ 'naver_pay',
1509
+ 'revolut_pay',
1510
+ 'cash_app_pay',
1511
+ 'pix',
1512
+ 'twint',
1513
+ 'go_pay',
1514
+ 'grab_pay',
1515
+ 'pay_co',
1516
+ 'after_pay',
1517
+ 'swish',
1518
+ 'payme',
1519
+ ])
1520
+ .optional(),
1521
+ gateway: zod_1.z
1522
+ .enum([
1523
+ 'chargebee_payments',
1524
+ 'adyen',
1525
+ 'stripe',
1526
+ 'wepay',
1527
+ 'braintree',
1528
+ 'authorize_net',
1529
+ 'paypal_pro',
1530
+ 'pin',
1531
+ 'eway',
1532
+ 'eway_rapid',
1533
+ 'worldpay',
1534
+ 'balanced_payments',
1535
+ 'beanstream',
1536
+ 'bluepay',
1537
+ 'elavon',
1538
+ 'first_data_global',
1539
+ 'hdfc',
1540
+ 'migs',
1541
+ 'nmi',
1542
+ 'ogone',
1543
+ 'paymill',
1544
+ 'paypal_payflow_pro',
1545
+ 'sage_pay',
1546
+ 'tco',
1547
+ 'wirecard',
1548
+ 'amazon_payments',
1549
+ 'paypal_express_checkout',
1550
+ 'gocardless',
1551
+ 'orbital',
1552
+ 'moneris_us',
1553
+ 'moneris',
1554
+ 'bluesnap',
1555
+ 'cybersource',
1556
+ 'vantiv',
1557
+ 'checkout_com',
1558
+ 'paypal',
1559
+ 'ingenico_direct',
1560
+ 'exact',
1561
+ 'mollie',
1562
+ 'quickbooks',
1563
+ 'razorpay',
1564
+ 'global_payments',
1565
+ 'bank_of_america',
1566
+ 'ecentric',
1567
+ 'metrics_global',
1568
+ 'windcave',
1569
+ 'pay_com',
1570
+ 'ebanx',
1571
+ 'dlocal',
1572
+ 'nuvei',
1573
+ 'solidgate',
1574
+ 'paystack',
1575
+ 'jp_morgan',
1576
+ 'deutsche_bank',
1577
+ 'ezidebit',
1578
+ 'twikey',
1579
+ 'tempus',
1580
+ 'moyasar',
1581
+ 'payway',
1582
+ ])
1583
+ .optional(),
1584
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1585
+ reference_id: zod_1.z.string().max(200).optional(),
1586
+ tmp_token: zod_1.z.string().max(65000).optional(),
1587
+ issuing_country: zod_1.z.string().max(50).optional(),
1588
+ additional_information: UpdateForItemsSubscriptionAdditionalInformationSchema.optional(),
1589
+ });
1590
+ const UpdateForItemsSubscriptionPaymentIntentSchema = zod_1.z.object({
1591
+ id: zod_1.z.string().max(150).optional(),
1592
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1593
+ gw_token: zod_1.z.string().max(65000).optional(),
1594
+ payment_method_type: zod_1.z
1595
+ .enum([
1596
+ 'card',
1597
+ 'ideal',
1598
+ 'sofort',
1599
+ 'bancontact',
1600
+ 'google_pay',
1601
+ 'dotpay',
1602
+ 'giropay',
1603
+ 'apple_pay',
1604
+ 'upi',
1605
+ 'netbanking_emandates',
1606
+ 'paypal_express_checkout',
1607
+ 'direct_debit',
1608
+ 'boleto',
1609
+ 'venmo',
1610
+ 'amazon_payments',
1611
+ 'pay_to',
1612
+ 'faster_payments',
1613
+ 'sepa_instant_transfer',
1614
+ 'klarna_pay_now',
1615
+ 'online_banking_poland',
1616
+ 'payconiq_by_bancontact',
1617
+ 'electronic_payment_standard',
1618
+ 'kbc_payment_button',
1619
+ 'pay_by_bank',
1620
+ 'trustly',
1621
+ 'stablecoin',
1622
+ 'kakao_pay',
1623
+ 'naver_pay',
1624
+ 'revolut_pay',
1625
+ 'cash_app_pay',
1626
+ 'wechat_pay',
1627
+ 'alipay',
1628
+ 'pix',
1629
+ 'twint',
1630
+ 'go_pay',
1631
+ 'grab_pay',
1632
+ 'pay_co',
1633
+ 'after_pay',
1634
+ 'swish',
1635
+ 'payme',
1636
+ ])
1637
+ .optional(),
1638
+ reference_id: zod_1.z.string().max(65000).optional(),
1639
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
1640
+ additional_information: UpdateForItemsSubscriptionAdditionalInformationSchema.optional(),
1641
+ });
1642
+ const UpdateForItemsSubscriptionBillingAddressSchema = zod_1.z.object({
1643
+ first_name: zod_1.z.string().max(150).optional(),
1644
+ last_name: zod_1.z.string().max(150).optional(),
1645
+ email: zod_1.z.string().email().max(70).optional(),
1646
+ company: zod_1.z.string().max(250).optional(),
1647
+ phone: zod_1.z.string().max(50).optional(),
1648
+ line1: zod_1.z.string().max(150).optional(),
1649
+ line2: zod_1.z.string().max(150).optional(),
1650
+ line3: zod_1.z.string().max(150).optional(),
1651
+ city: zod_1.z.string().max(50).optional(),
1652
+ state_code: zod_1.z.string().max(50).optional(),
1653
+ state: zod_1.z.string().max(50).optional(),
1654
+ zip: zod_1.z.string().max(20).optional(),
1655
+ country: zod_1.z.string().max(50).optional(),
1656
+ validation_status: zod_1.z
1657
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1658
+ .optional(),
1659
+ });
1660
+ const UpdateForItemsSubscriptionShippingAddressSchema = zod_1.z.object({
1661
+ first_name: zod_1.z.string().max(150).optional(),
1662
+ last_name: zod_1.z.string().max(150).optional(),
1663
+ email: zod_1.z.string().email().max(70).optional(),
1664
+ company: zod_1.z.string().max(250).optional(),
1665
+ phone: zod_1.z.string().max(50).optional(),
1666
+ line1: zod_1.z.string().max(150).optional(),
1667
+ line2: zod_1.z.string().max(150).optional(),
1668
+ line3: zod_1.z.string().max(150).optional(),
1669
+ city: zod_1.z.string().max(50).optional(),
1670
+ state_code: zod_1.z.string().max(50).optional(),
1671
+ state: zod_1.z.string().max(50).optional(),
1672
+ zip: zod_1.z.string().max(20).optional(),
1673
+ country: zod_1.z.string().max(50).optional(),
1674
+ validation_status: zod_1.z
1675
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1676
+ .optional(),
1677
+ });
1678
+ const UpdateForItemsSubscriptionStatementDescriptorSchema = zod_1.z.object({
1679
+ descriptor: zod_1.z.string().max(65000).optional(),
1680
+ });
1681
+ const UpdateForItemsSubscriptionCustomerSchema = zod_1.z.object({
1682
+ vat_number: zod_1.z.string().max(20).optional(),
1683
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
1684
+ entity_identifier_scheme: zod_1.z.string().max(50).optional(),
1685
+ is_einvoice_enabled: zod_1.z.boolean().optional(),
1686
+ einvoicing_method: zod_1.z.enum(['automatic', 'manual', 'site_default']).optional(),
1687
+ entity_identifier_standard: zod_1.z.string().max(50).optional(),
1688
+ business_customer_without_vat_number: zod_1.z.boolean().optional(),
1689
+ registered_for_gst: zod_1.z.boolean().optional(),
1690
+ });
1691
+ const UpdateForItemsSubscriptionContractTermSchema = zod_1.z.object({
1692
+ action_at_term_end: zod_1.z
1693
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
1694
+ .optional(),
1695
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
1696
+ contract_start: zod_1.z.number().int().optional(),
1697
+ });
1698
+ const UpdateForItemsSubscriptionBillingOverrideSchema = zod_1.z.object({
1699
+ max_excess_payment_usage: zod_1.z.number().int().min(-1).optional(),
1700
+ max_refundable_credits_usage: zod_1.z.number().int().min(-1).optional(),
1701
+ });
1702
+ const UpdateForItemsSubscriptionSubscriptionItemsSchema = zod_1.z.object({
1703
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
1704
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1705
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1706
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1707
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1708
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1709
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1710
+ service_period_days: zod_1.z
1711
+ .array(zod_1.z.number().int().min(1).max(730).optional())
1712
+ .optional(),
1713
+ charge_on_event: zod_1.z
1714
+ .array(zod_1.z
1715
+ .enum([
1716
+ 'subscription_creation',
1717
+ 'subscription_trial_start',
1718
+ 'plan_activation',
1719
+ 'subscription_activation',
1720
+ 'contract_termination',
1721
+ ])
1722
+ .optional())
1723
+ .optional(),
1724
+ charge_once: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
1725
+ charge_on_option: zod_1.z
1726
+ .array(zod_1.z.enum(['immediately', 'on_event']).optional())
1727
+ .optional(),
1728
+ item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
1729
+ proration_type: zod_1.z
1730
+ .array(zod_1.z.enum(['full_term', 'partial_term', 'none']).optional())
1731
+ .optional(),
1732
+ usage_accumulation_reset_frequency: zod_1.z
1733
+ .array(zod_1.z.enum(['never', 'subscription_billing_frequency']).optional())
1734
+ .optional(),
1735
+ });
1736
+ const UpdateForItemsSubscriptionDiscountsSchema = zod_1.z.object({
1737
+ apply_on: zod_1.z
1738
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
1739
+ .optional(),
1740
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
1741
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
1742
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1743
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1744
+ period_unit: zod_1.z
1745
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
1746
+ .optional(),
1747
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
1748
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1749
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1750
+ operation_type: zod_1.z.array(zod_1.z.enum(['add', 'remove']).optional()),
1751
+ id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1752
+ });
1753
+ const UpdateForItemsSubscriptionItemTiersSchema = zod_1.z.object({
1754
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1755
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1756
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1757
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1758
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1759
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1760
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1761
+ pricing_type: zod_1.z
1762
+ .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional())
1763
+ .optional(),
1764
+ package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1765
+ });
1766
+ const UpdateForItemsSubscriptionCouponsSchema = zod_1.z.object({
1767
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1768
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1769
+ });
1770
+ const UpdateForItemsSubscriptionBodySchema = zod_1.z.looseObject({
1771
+ mandatory_items_to_remove: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1772
+ replace_items_list: zod_1.z.boolean().default(false).optional(),
1773
+ setup_fee: zod_1.z.number().int().min(0).optional(),
1774
+ net_term_days: zod_1.z.number().int().optional(),
1775
+ invoice_date: zod_1.z.number().int().optional(),
1776
+ start_date: zod_1.z.number().int().optional(),
1777
+ trial_end: zod_1.z.number().int().optional(),
1778
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
1779
+ coupon: zod_1.z.string().max(100).optional(),
1780
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
1781
+ reactivate_from: zod_1.z.number().int().optional(),
1782
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
1783
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
1784
+ offline_payment_method: zod_1.z
1785
+ .enum([
1786
+ 'no_preference',
1787
+ 'cash',
1788
+ 'check',
1789
+ 'bank_transfer',
1790
+ 'ach_credit',
1791
+ 'sepa_credit',
1792
+ 'boleto',
1793
+ 'us_automated_bank_transfer',
1794
+ 'eu_automated_bank_transfer',
1795
+ 'uk_automated_bank_transfer',
1796
+ 'jp_automated_bank_transfer',
1797
+ 'mx_automated_bank_transfer',
1798
+ 'custom',
1799
+ ])
1800
+ .optional(),
1801
+ po_number: zod_1.z.string().max(100).optional(),
1802
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1803
+ replace_coupon_list: zod_1.z.boolean().default(false).optional(),
1804
+ prorate: zod_1.z.boolean().optional(),
1805
+ end_of_term: zod_1.z.boolean().default(false).optional(),
1806
+ force_term_reset: zod_1.z.boolean().default(false).optional(),
1807
+ reactivate: zod_1.z.boolean().optional(),
1808
+ token_id: zod_1.z.string().max(40).optional(),
1809
+ invoice_notes: zod_1.z.string().max(2000).optional(),
1810
+ meta_data: UpdateForItemsSubscriptionMetaDataSchema.optional(),
1811
+ invoice_immediately: zod_1.z.boolean().optional(),
1812
+ override_relationship: zod_1.z.boolean().optional(),
1813
+ changes_scheduled_at: zod_1.z.number().int().optional(),
1814
+ change_option: zod_1.z
1815
+ .enum(['immediately', 'end_of_term', 'specific_date'])
1816
+ .optional(),
1817
+ contract_term_billing_cycle_on_renewal: zod_1.z
1818
+ .number()
1819
+ .int()
1820
+ .min(1)
1821
+ .max(100)
1822
+ .optional(),
1823
+ free_period: zod_1.z.number().int().min(1).optional(),
1824
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
1825
+ create_pending_invoices: zod_1.z.boolean().optional(),
1826
+ auto_close_invoices: zod_1.z.boolean().optional(),
1827
+ trial_end_action: zod_1.z
1828
+ .enum([
1829
+ 'site_default',
1830
+ 'plan_default',
1831
+ 'activate_subscription',
1832
+ 'cancel_subscription',
1833
+ ])
1834
+ .optional(),
1835
+ payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
1836
+ invoice_usages: zod_1.z.boolean().default(false).optional(),
1837
+ card: UpdateForItemsSubscriptionCardSchema.optional(),
1838
+ payment_method: UpdateForItemsSubscriptionPaymentMethodSchema.optional(),
1839
+ payment_intent: UpdateForItemsSubscriptionPaymentIntentSchema.optional(),
1840
+ billing_address: UpdateForItemsSubscriptionBillingAddressSchema.optional(),
1841
+ shipping_address: UpdateForItemsSubscriptionShippingAddressSchema.optional(),
1842
+ statement_descriptor: UpdateForItemsSubscriptionStatementDescriptorSchema.optional(),
1843
+ customer: UpdateForItemsSubscriptionCustomerSchema.optional(),
1844
+ contract_term: UpdateForItemsSubscriptionContractTermSchema.optional(),
1845
+ billing_override: UpdateForItemsSubscriptionBillingOverrideSchema.optional(),
1846
+ subscription_items: UpdateForItemsSubscriptionSubscriptionItemsSchema.optional(),
1847
+ discounts: UpdateForItemsSubscriptionDiscountsSchema.optional(),
1848
+ item_tiers: UpdateForItemsSubscriptionItemTiersSchema.optional(),
1849
+ coupons: UpdateForItemsSubscriptionCouponsSchema.optional(),
1850
+ });
1851
+ exports.UpdateForItemsSubscriptionBodySchema = UpdateForItemsSubscriptionBodySchema;
1852
+ //Subscription.changeTermEnd
1853
+ const ChangeTermEndSubscriptionBodySchema = zod_1.z.looseObject({
1854
+ term_ends_at: zod_1.z.number().int(),
1855
+ prorate: zod_1.z.boolean().optional(),
1856
+ invoice_immediately: zod_1.z.boolean().optional(),
1857
+ });
1858
+ exports.ChangeTermEndSubscriptionBodySchema = ChangeTermEndSubscriptionBodySchema;
1859
+ //Subscription.reactivate
1860
+ const ReactivateSubscriptionContractTermSchema = zod_1.z.object({
1861
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
1862
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
1863
+ });
1864
+ const ReactivateSubscriptionStatementDescriptorSchema = zod_1.z.object({
1865
+ descriptor: zod_1.z.string().max(65000).optional(),
1866
+ });
1867
+ const ReactivateSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
1868
+ const ReactivateSubscriptionPaymentIntentSchema = zod_1.z.object({
1869
+ id: zod_1.z.string().max(150).optional(),
1870
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1871
+ gw_token: zod_1.z.string().max(65000).optional(),
1872
+ payment_method_type: zod_1.z
1873
+ .enum([
1874
+ 'card',
1875
+ 'ideal',
1876
+ 'sofort',
1877
+ 'bancontact',
1878
+ 'google_pay',
1879
+ 'dotpay',
1880
+ 'giropay',
1881
+ 'apple_pay',
1882
+ 'upi',
1883
+ 'netbanking_emandates',
1884
+ 'paypal_express_checkout',
1885
+ 'direct_debit',
1886
+ 'boleto',
1887
+ 'venmo',
1888
+ 'amazon_payments',
1889
+ 'pay_to',
1890
+ 'faster_payments',
1891
+ 'sepa_instant_transfer',
1892
+ 'klarna_pay_now',
1893
+ 'online_banking_poland',
1894
+ 'payconiq_by_bancontact',
1895
+ 'electronic_payment_standard',
1896
+ 'kbc_payment_button',
1897
+ 'pay_by_bank',
1898
+ 'trustly',
1899
+ 'stablecoin',
1900
+ 'kakao_pay',
1901
+ 'naver_pay',
1902
+ 'revolut_pay',
1903
+ 'cash_app_pay',
1904
+ 'wechat_pay',
1905
+ 'alipay',
1906
+ 'pix',
1907
+ 'twint',
1908
+ 'go_pay',
1909
+ 'grab_pay',
1910
+ 'pay_co',
1911
+ 'after_pay',
1912
+ 'swish',
1913
+ 'payme',
1914
+ ])
1915
+ .optional(),
1916
+ reference_id: zod_1.z.string().max(65000).optional(),
1917
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
1918
+ additional_information: ReactivateSubscriptionAdditionalInformationSchema.optional(),
1919
+ });
1920
+ const ReactivateSubscriptionBodySchema = zod_1.z.looseObject({
1921
+ trial_end: zod_1.z.number().int().optional(),
1922
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
1923
+ trial_period_days: zod_1.z.number().int().min(1).max(365).optional(),
1924
+ reactivate_from: zod_1.z.number().int().optional(),
1925
+ invoice_immediately: zod_1.z.boolean().optional(),
1926
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
1927
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
1928
+ invoice_date: zod_1.z.number().int().optional(),
1929
+ contract_term_billing_cycle_on_renewal: zod_1.z
1930
+ .number()
1931
+ .int()
1932
+ .min(1)
1933
+ .max(100)
1934
+ .optional(),
1935
+ payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
1936
+ contract_term: ReactivateSubscriptionContractTermSchema.optional(),
1937
+ statement_descriptor: ReactivateSubscriptionStatementDescriptorSchema.optional(),
1938
+ payment_intent: ReactivateSubscriptionPaymentIntentSchema.optional(),
1939
+ });
1940
+ exports.ReactivateSubscriptionBodySchema = ReactivateSubscriptionBodySchema;
1941
+ //Subscription.addChargeAtTermEnd
1942
+ const AddChargeAtTermEndSubscriptionBodySchema = zod_1.z.looseObject({
1943
+ amount: zod_1.z.number().int().min(1).optional(),
1944
+ description: zod_1.z.string().max(250),
1945
+ amount_in_decimal: zod_1.z.string().max(39).optional(),
1946
+ avalara_sale_type: zod_1.z
1947
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
1948
+ .optional(),
1949
+ avalara_transaction_type: zod_1.z.number().int().optional(),
1950
+ avalara_service_type: zod_1.z.number().int().optional(),
1951
+ date_from: zod_1.z.number().int().optional(),
1952
+ date_to: zod_1.z.number().int().optional(),
1953
+ });
1954
+ exports.AddChargeAtTermEndSubscriptionBodySchema = AddChargeAtTermEndSubscriptionBodySchema;
1955
+ //Subscription.chargeAddonAtTermEnd
1956
+ const ChargeAddonAtTermEndSubscriptionBodySchema = zod_1.z.looseObject({
1957
+ addon_id: zod_1.z.string().max(100),
1958
+ addon_quantity: zod_1.z.number().int().min(1).optional(),
1959
+ addon_unit_price: zod_1.z.number().int().min(0).optional(),
1960
+ addon_quantity_in_decimal: zod_1.z.string().max(33).optional(),
1961
+ addon_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
1962
+ date_from: zod_1.z.number().int().optional(),
1963
+ date_to: zod_1.z.number().int().optional(),
1964
+ });
1965
+ exports.ChargeAddonAtTermEndSubscriptionBodySchema = ChargeAddonAtTermEndSubscriptionBodySchema;
1966
+ //Subscription.chargeFutureRenewals
1967
+ const ChargeFutureRenewalsSubscriptionFixedIntervalScheduleSchema = zod_1.z.object({
1968
+ number_of_occurrences: zod_1.z.number().int().min(1).optional(),
1969
+ days_before_renewal: zod_1.z.number().int().min(1).optional(),
1970
+ end_schedule_on: zod_1.z
1971
+ .enum(['after_number_of_intervals', 'specific_date', 'subscription_end'])
1972
+ .optional(),
1973
+ end_date: zod_1.z.number().int().optional(),
1974
+ });
1975
+ const ChargeFutureRenewalsSubscriptionSpecificDatesScheduleSchema = zod_1.z.object({
1976
+ terms_to_charge: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1977
+ date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1978
+ });
1979
+ const ChargeFutureRenewalsSubscriptionBodySchema = zod_1.z.looseObject({
1980
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
1981
+ invoice_immediately: zod_1.z.boolean().optional(),
1982
+ schedule_type: zod_1.z
1983
+ .enum(['immediate', 'specific_dates', 'fixed_intervals'])
1984
+ .optional(),
1985
+ fixed_interval_schedule: ChargeFutureRenewalsSubscriptionFixedIntervalScheduleSchema.optional(),
1986
+ specific_dates_schedule: ChargeFutureRenewalsSubscriptionSpecificDatesScheduleSchema.optional(),
1987
+ });
1988
+ exports.ChargeFutureRenewalsSubscriptionBodySchema = ChargeFutureRenewalsSubscriptionBodySchema;
1989
+ //Subscription.editAdvanceInvoiceSchedule
1990
+ const EditAdvanceInvoiceScheduleSubscriptionFixedIntervalScheduleSchema = zod_1.z.object({
1991
+ number_of_occurrences: zod_1.z.number().int().min(1).optional(),
1992
+ days_before_renewal: zod_1.z.number().int().min(1).optional(),
1993
+ end_schedule_on: zod_1.z
1994
+ .enum(['after_number_of_intervals', 'specific_date', 'subscription_end'])
1995
+ .optional(),
1996
+ end_date: zod_1.z.number().int().optional(),
1997
+ });
1998
+ const EditAdvanceInvoiceScheduleSubscriptionSpecificDatesScheduleSchema = zod_1.z.object({
1999
+ id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
2000
+ terms_to_charge: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2001
+ date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2002
+ });
2003
+ const EditAdvanceInvoiceScheduleSubscriptionBodySchema = zod_1.z.looseObject({
2004
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
2005
+ schedule_type: zod_1.z.enum(['specific_dates', 'fixed_intervals']).optional(),
2006
+ fixed_interval_schedule: EditAdvanceInvoiceScheduleSubscriptionFixedIntervalScheduleSchema.optional(),
2007
+ specific_dates_schedule: EditAdvanceInvoiceScheduleSubscriptionSpecificDatesScheduleSchema.optional(),
2008
+ });
2009
+ exports.EditAdvanceInvoiceScheduleSubscriptionBodySchema = EditAdvanceInvoiceScheduleSubscriptionBodySchema;
2010
+ //Subscription.removeAdvanceInvoiceSchedule
2011
+ const RemoveAdvanceInvoiceScheduleSubscriptionSpecificDatesScheduleSchema = zod_1.z.object({
2012
+ id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
2013
+ });
2014
+ const RemoveAdvanceInvoiceScheduleSubscriptionBodySchema = zod_1.z.looseObject({
2015
+ specific_dates_schedule: RemoveAdvanceInvoiceScheduleSubscriptionSpecificDatesScheduleSchema.optional(),
2016
+ });
2017
+ exports.RemoveAdvanceInvoiceScheduleSubscriptionBodySchema = RemoveAdvanceInvoiceScheduleSubscriptionBodySchema;
2018
+ //Subscription.regenerateInvoice
2019
+ const RegenerateInvoiceSubscriptionBodySchema = zod_1.z.looseObject({
2020
+ date_from: zod_1.z.number().int().optional(),
2021
+ date_to: zod_1.z.number().int().optional(),
2022
+ prorate: zod_1.z.boolean().optional(),
2023
+ invoice_immediately: zod_1.z.boolean().optional(),
2024
+ });
2025
+ exports.RegenerateInvoiceSubscriptionBodySchema = RegenerateInvoiceSubscriptionBodySchema;
2026
+ //Subscription.importSubscription
2027
+ const ImportSubscriptionSubscriptionMetaDataSchema = zod_1.z.looseObject({});
2028
+ const ImportSubscriptionSubscriptionCustomerSchema = zod_1.z.looseObject({
2029
+ id: zod_1.z.string().max(50).optional(),
2030
+ email: zod_1.z.string().email().max(70).optional(),
2031
+ first_name: zod_1.z.string().max(150).optional(),
2032
+ last_name: zod_1.z.string().max(150).optional(),
2033
+ company: zod_1.z.string().max(250).optional(),
2034
+ phone: zod_1.z.string().max(50).optional(),
2035
+ locale: zod_1.z.string().max(50).optional(),
2036
+ taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
2037
+ entity_code: zod_1.z
2038
+ .enum([
2039
+ 'a',
2040
+ 'b',
2041
+ 'c',
2042
+ 'd',
2043
+ 'e',
2044
+ 'f',
2045
+ 'g',
2046
+ 'h',
2047
+ 'i',
2048
+ 'j',
2049
+ 'k',
2050
+ 'l',
2051
+ 'm',
2052
+ 'n',
2053
+ 'p',
2054
+ 'q',
2055
+ 'r',
2056
+ 'med1',
2057
+ 'med2',
2058
+ ])
2059
+ .optional(),
2060
+ exempt_number: zod_1.z.string().max(100).optional(),
2061
+ net_term_days: zod_1.z.number().int().optional(),
2062
+ taxjar_exemption_category: zod_1.z
2063
+ .enum(['wholesale', 'government', 'other'])
2064
+ .optional(),
2065
+ customer_type: zod_1.z
2066
+ .enum(['residential', 'business', 'senior_citizen', 'industrial'])
2067
+ .optional(),
2068
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
2069
+ allow_direct_debit: zod_1.z.boolean().default(false).optional(),
2070
+ vat_number: zod_1.z.string().max(20).optional(),
2071
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
2072
+ });
2073
+ const ImportSubscriptionSubscriptionContractTermSchema = zod_1.z.object({
2074
+ id: zod_1.z.string().max(50).optional(),
2075
+ created_at: zod_1.z.number().int().optional(),
2076
+ contract_start: zod_1.z.number().int().optional(),
2077
+ billing_cycle: zod_1.z.number().int().min(0).optional(),
2078
+ total_amount_raised: zod_1.z.number().int().min(0).optional(),
2079
+ total_amount_raised_before_tax: zod_1.z.number().int().min(0).optional(),
2080
+ action_at_term_end: zod_1.z
2081
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
2082
+ .optional(),
2083
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
2084
+ });
2085
+ const ImportSubscriptionSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
2086
+ const ImportSubscriptionSubscriptionCardSchema = zod_1.z.object({
2087
+ gateway: zod_1.z
2088
+ .enum([
2089
+ 'chargebee',
2090
+ 'chargebee_payments',
2091
+ 'adyen',
2092
+ 'stripe',
2093
+ 'wepay',
2094
+ 'braintree',
2095
+ 'authorize_net',
2096
+ 'paypal_pro',
2097
+ 'pin',
2098
+ 'eway',
2099
+ 'eway_rapid',
2100
+ 'worldpay',
2101
+ 'balanced_payments',
2102
+ 'beanstream',
2103
+ 'bluepay',
2104
+ 'elavon',
2105
+ 'first_data_global',
2106
+ 'hdfc',
2107
+ 'migs',
2108
+ 'nmi',
2109
+ 'ogone',
2110
+ 'paymill',
2111
+ 'paypal_payflow_pro',
2112
+ 'sage_pay',
2113
+ 'tco',
2114
+ 'wirecard',
2115
+ 'amazon_payments',
2116
+ 'paypal_express_checkout',
2117
+ 'orbital',
2118
+ 'moneris_us',
2119
+ 'moneris',
2120
+ 'bluesnap',
2121
+ 'cybersource',
2122
+ 'vantiv',
2123
+ 'checkout_com',
2124
+ 'paypal',
2125
+ 'ingenico_direct',
2126
+ 'exact',
2127
+ 'mollie',
2128
+ 'quickbooks',
2129
+ 'razorpay',
2130
+ 'global_payments',
2131
+ 'bank_of_america',
2132
+ 'ecentric',
2133
+ 'metrics_global',
2134
+ 'windcave',
2135
+ 'pay_com',
2136
+ 'ebanx',
2137
+ 'dlocal',
2138
+ 'nuvei',
2139
+ 'solidgate',
2140
+ 'paystack',
2141
+ 'jp_morgan',
2142
+ 'deutsche_bank',
2143
+ 'ezidebit',
2144
+ 'twikey',
2145
+ 'tempus',
2146
+ 'moyasar',
2147
+ 'payway',
2148
+ ])
2149
+ .optional(),
2150
+ gateway_account_id: zod_1.z.string().max(50).optional(),
2151
+ tmp_token: zod_1.z.string().max(300).optional(),
2152
+ first_name: zod_1.z.string().max(50).optional(),
2153
+ last_name: zod_1.z.string().max(50).optional(),
2154
+ number: zod_1.z.string().max(1500).optional(),
2155
+ expiry_month: zod_1.z.number().int().min(1).max(12).optional(),
2156
+ expiry_year: zod_1.z.number().int().optional(),
2157
+ cvv: zod_1.z.string().max(520).optional(),
2158
+ preferred_scheme: zod_1.z
2159
+ .enum(['cartes_bancaires', 'mastercard', 'visa'])
2160
+ .optional(),
2161
+ billing_addr1: zod_1.z.string().max(150).optional(),
2162
+ billing_addr2: zod_1.z.string().max(150).optional(),
2163
+ billing_city: zod_1.z.string().max(50).optional(),
2164
+ billing_state_code: zod_1.z.string().max(50).optional(),
2165
+ billing_state: zod_1.z.string().max(50).optional(),
2166
+ billing_zip: zod_1.z.string().max(20).optional(),
2167
+ billing_country: zod_1.z.string().max(50).optional(),
2168
+ additional_information: ImportSubscriptionSubscriptionAdditionalInformationSchema.optional(),
2169
+ });
2170
+ const ImportSubscriptionSubscriptionPaymentMethodSchema = zod_1.z.object({
2171
+ type: zod_1.z
2172
+ .enum([
2173
+ 'card',
2174
+ 'paypal_express_checkout',
2175
+ 'amazon_payments',
2176
+ 'direct_debit',
2177
+ 'generic',
2178
+ 'alipay',
2179
+ 'unionpay',
2180
+ 'apple_pay',
2181
+ 'wechat_pay',
2182
+ 'ideal',
2183
+ 'google_pay',
2184
+ 'sofort',
2185
+ 'bancontact',
2186
+ 'giropay',
2187
+ 'dotpay',
2188
+ 'upi',
2189
+ 'netbanking_emandates',
2190
+ 'venmo',
2191
+ 'pay_to',
2192
+ 'faster_payments',
2193
+ 'sepa_instant_transfer',
2194
+ 'automated_bank_transfer',
2195
+ 'klarna_pay_now',
2196
+ 'online_banking_poland',
2197
+ 'payconiq_by_bancontact',
2198
+ 'electronic_payment_standard',
2199
+ 'kbc_payment_button',
2200
+ 'pay_by_bank',
2201
+ 'trustly',
2202
+ 'stablecoin',
2203
+ 'kakao_pay',
2204
+ 'naver_pay',
2205
+ 'revolut_pay',
2206
+ 'cash_app_pay',
2207
+ 'pix',
2208
+ 'twint',
2209
+ 'go_pay',
2210
+ 'grab_pay',
2211
+ 'pay_co',
2212
+ 'after_pay',
2213
+ 'swish',
2214
+ 'payme',
2215
+ ])
2216
+ .optional(),
2217
+ gateway: zod_1.z
2218
+ .enum([
2219
+ 'chargebee_payments',
2220
+ 'adyen',
2221
+ 'stripe',
2222
+ 'wepay',
2223
+ 'braintree',
2224
+ 'authorize_net',
2225
+ 'paypal_pro',
2226
+ 'pin',
2227
+ 'eway',
2228
+ 'eway_rapid',
2229
+ 'worldpay',
2230
+ 'balanced_payments',
2231
+ 'beanstream',
2232
+ 'bluepay',
2233
+ 'elavon',
2234
+ 'first_data_global',
2235
+ 'hdfc',
2236
+ 'migs',
2237
+ 'nmi',
2238
+ 'ogone',
2239
+ 'paymill',
2240
+ 'paypal_payflow_pro',
2241
+ 'sage_pay',
2242
+ 'tco',
2243
+ 'wirecard',
2244
+ 'amazon_payments',
2245
+ 'paypal_express_checkout',
2246
+ 'gocardless',
2247
+ 'orbital',
2248
+ 'moneris_us',
2249
+ 'moneris',
2250
+ 'bluesnap',
2251
+ 'cybersource',
2252
+ 'vantiv',
2253
+ 'checkout_com',
2254
+ 'paypal',
2255
+ 'ingenico_direct',
2256
+ 'exact',
2257
+ 'mollie',
2258
+ 'quickbooks',
2259
+ 'razorpay',
2260
+ 'global_payments',
2261
+ 'bank_of_america',
2262
+ 'ecentric',
2263
+ 'metrics_global',
2264
+ 'windcave',
2265
+ 'pay_com',
2266
+ 'ebanx',
2267
+ 'dlocal',
2268
+ 'nuvei',
2269
+ 'solidgate',
2270
+ 'paystack',
2271
+ 'jp_morgan',
2272
+ 'deutsche_bank',
2273
+ 'ezidebit',
2274
+ 'twikey',
2275
+ 'tempus',
2276
+ 'moyasar',
2277
+ 'payway',
2278
+ ])
2279
+ .optional(),
2280
+ gateway_account_id: zod_1.z.string().max(50).optional(),
2281
+ reference_id: zod_1.z.string().max(200).optional(),
2282
+ issuing_country: zod_1.z.string().max(50).optional(),
2283
+ additional_information: ImportSubscriptionSubscriptionAdditionalInformationSchema.optional(),
2284
+ });
2285
+ const ImportSubscriptionSubscriptionBillingAddressSchema = zod_1.z.object({
2286
+ first_name: zod_1.z.string().max(150).optional(),
2287
+ last_name: zod_1.z.string().max(150).optional(),
2288
+ email: zod_1.z.string().email().max(70).optional(),
2289
+ company: zod_1.z.string().max(250).optional(),
2290
+ phone: zod_1.z.string().max(50).optional(),
2291
+ line1: zod_1.z.string().max(150).optional(),
2292
+ line2: zod_1.z.string().max(150).optional(),
2293
+ line3: zod_1.z.string().max(150).optional(),
2294
+ city: zod_1.z.string().max(50).optional(),
2295
+ state_code: zod_1.z.string().max(50).optional(),
2296
+ state: zod_1.z.string().max(50).optional(),
2297
+ zip: zod_1.z.string().max(20).optional(),
2298
+ country: zod_1.z.string().max(50).optional(),
2299
+ validation_status: zod_1.z
2300
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
2301
+ .optional(),
2302
+ });
2303
+ const ImportSubscriptionSubscriptionShippingAddressSchema = zod_1.z.object({
2304
+ first_name: zod_1.z.string().max(150).optional(),
2305
+ last_name: zod_1.z.string().max(150).optional(),
2306
+ email: zod_1.z.string().email().max(70).optional(),
2307
+ company: zod_1.z.string().max(250).optional(),
2308
+ phone: zod_1.z.string().max(50).optional(),
2309
+ line1: zod_1.z.string().max(150).optional(),
2310
+ line2: zod_1.z.string().max(150).optional(),
2311
+ line3: zod_1.z.string().max(150).optional(),
2312
+ city: zod_1.z.string().max(50).optional(),
2313
+ state_code: zod_1.z.string().max(50).optional(),
2314
+ state: zod_1.z.string().max(50).optional(),
2315
+ zip: zod_1.z.string().max(20).optional(),
2316
+ country: zod_1.z.string().max(50).optional(),
2317
+ validation_status: zod_1.z
2318
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
2319
+ .optional(),
2320
+ });
2321
+ const ImportSubscriptionSubscriptionTransactionSchema = zod_1.z.object({
2322
+ amount: zod_1.z.number().int().min(0).optional(),
2323
+ payment_method: zod_1.z
2324
+ .enum([
2325
+ 'cash',
2326
+ 'check',
2327
+ 'bank_transfer',
2328
+ 'other',
2329
+ 'app_store',
2330
+ 'play_store',
2331
+ 'custom',
2332
+ ])
2333
+ .optional(),
2334
+ reference_number: zod_1.z.string().max(100).optional(),
2335
+ date: zod_1.z.number().int().optional(),
2336
+ });
2337
+ const ImportSubscriptionSubscriptionAddonsSchema = zod_1.z.object({
2338
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2339
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2340
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2341
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2342
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2343
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2344
+ });
2345
+ const ImportSubscriptionSubscriptionEventBasedAddonsSchema = zod_1.z.object({
2346
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2347
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2348
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2349
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2350
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2351
+ service_period_in_days: zod_1.z
2352
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
2353
+ .optional(),
2354
+ on_event: zod_1.z
2355
+ .array(zod_1.z
2356
+ .enum([
2357
+ 'subscription_creation',
2358
+ 'subscription_trial_start',
2359
+ 'plan_activation',
2360
+ 'subscription_activation',
2361
+ 'contract_termination',
2362
+ ])
2363
+ .optional())
2364
+ .optional(),
2365
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
2366
+ });
2367
+ const ImportSubscriptionSubscriptionChargedEventBasedAddonsSchema = zod_1.z.object({
2368
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2369
+ last_charged_at: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2370
+ });
2371
+ const ImportSubscriptionSubscriptionCouponsSchema = zod_1.z.object({
2372
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2373
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2374
+ });
2375
+ const ImportSubscriptionSubscriptionBodySchema = zod_1.z.looseObject({
2376
+ id: zod_1.z.string().max(50).optional(),
2377
+ client_profile_id: zod_1.z.string().max(50).optional(),
2378
+ plan_id: zod_1.z.string().max(100),
2379
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
2380
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
2381
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
2382
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
2383
+ setup_fee: zod_1.z.number().int().min(0).optional(),
2384
+ trial_end: zod_1.z.number().int().optional(),
2385
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
2386
+ start_date: zod_1.z.number().int().optional(),
2387
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
2388
+ po_number: zod_1.z.string().max(100).optional(),
2389
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2390
+ contract_term_billing_cycle_on_renewal: zod_1.z
2391
+ .number()
2392
+ .int()
2393
+ .min(1)
2394
+ .max(100)
2395
+ .optional(),
2396
+ status: zod_1.z.enum([
2397
+ 'future',
2398
+ 'in_trial',
2399
+ 'active',
2400
+ 'non_renewing',
2401
+ 'paused',
2402
+ 'cancelled',
2403
+ 'transferred',
2404
+ ]),
2405
+ current_term_end: zod_1.z.number().int().optional(),
2406
+ current_term_start: zod_1.z.number().int().optional(),
2407
+ trial_start: zod_1.z.number().int().optional(),
2408
+ cancelled_at: zod_1.z.number().int().optional(),
2409
+ started_at: zod_1.z.number().int().optional(),
2410
+ activated_at: zod_1.z.number().int().optional(),
2411
+ pause_date: zod_1.z.number().int().optional(),
2412
+ resume_date: zod_1.z.number().int().optional(),
2413
+ create_current_term_invoice: zod_1.z.boolean().default(false).optional(),
2414
+ affiliate_token: zod_1.z.string().max(250).optional(),
2415
+ invoice_notes: zod_1.z.string().max(2000).optional(),
2416
+ meta_data: ImportSubscriptionSubscriptionMetaDataSchema.optional(),
2417
+ customer: ImportSubscriptionSubscriptionCustomerSchema.optional(),
2418
+ contract_term: ImportSubscriptionSubscriptionContractTermSchema.optional(),
2419
+ card: ImportSubscriptionSubscriptionCardSchema.optional(),
2420
+ payment_method: ImportSubscriptionSubscriptionPaymentMethodSchema.optional(),
2421
+ billing_address: ImportSubscriptionSubscriptionBillingAddressSchema.optional(),
2422
+ shipping_address: ImportSubscriptionSubscriptionShippingAddressSchema.optional(),
2423
+ transaction: ImportSubscriptionSubscriptionTransactionSchema.optional(),
2424
+ addons: ImportSubscriptionSubscriptionAddonsSchema.optional(),
2425
+ event_based_addons: ImportSubscriptionSubscriptionEventBasedAddonsSchema.optional(),
2426
+ charged_event_based_addons: ImportSubscriptionSubscriptionChargedEventBasedAddonsSchema.optional(),
2427
+ coupons: ImportSubscriptionSubscriptionCouponsSchema.optional(),
2428
+ });
2429
+ exports.ImportSubscriptionSubscriptionBodySchema = ImportSubscriptionSubscriptionBodySchema;
2430
+ //Subscription.importForCustomer
2431
+ const ImportForCustomerSubscriptionMetaDataSchema = zod_1.z.looseObject({});
2432
+ const ImportForCustomerSubscriptionContractTermSchema = zod_1.z.object({
2433
+ id: zod_1.z.string().max(50).optional(),
2434
+ created_at: zod_1.z.number().int().optional(),
2435
+ contract_start: zod_1.z.number().int().optional(),
2436
+ billing_cycle: zod_1.z.number().int().min(0).optional(),
2437
+ total_amount_raised: zod_1.z.number().int().min(0).optional(),
2438
+ total_amount_raised_before_tax: zod_1.z.number().int().min(0).optional(),
2439
+ action_at_term_end: zod_1.z
2440
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
2441
+ .optional(),
2442
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
2443
+ });
2444
+ const ImportForCustomerSubscriptionTransactionSchema = zod_1.z.object({
2445
+ amount: zod_1.z.number().int().min(0).optional(),
2446
+ payment_method: zod_1.z
2447
+ .enum([
2448
+ 'cash',
2449
+ 'check',
2450
+ 'bank_transfer',
2451
+ 'other',
2452
+ 'app_store',
2453
+ 'play_store',
2454
+ 'custom',
2455
+ ])
2456
+ .optional(),
2457
+ reference_number: zod_1.z.string().max(100).optional(),
2458
+ date: zod_1.z.number().int().optional(),
2459
+ });
2460
+ const ImportForCustomerSubscriptionShippingAddressSchema = zod_1.z.object({
2461
+ first_name: zod_1.z.string().max(150).optional(),
2462
+ last_name: zod_1.z.string().max(150).optional(),
2463
+ email: zod_1.z.string().email().max(70).optional(),
2464
+ company: zod_1.z.string().max(250).optional(),
2465
+ phone: zod_1.z.string().max(50).optional(),
2466
+ line1: zod_1.z.string().max(150).optional(),
2467
+ line2: zod_1.z.string().max(150).optional(),
2468
+ line3: zod_1.z.string().max(150).optional(),
2469
+ city: zod_1.z.string().max(50).optional(),
2470
+ state_code: zod_1.z.string().max(50).optional(),
2471
+ state: zod_1.z.string().max(50).optional(),
2472
+ zip: zod_1.z.string().max(20).optional(),
2473
+ country: zod_1.z.string().max(50).optional(),
2474
+ validation_status: zod_1.z
2475
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
2476
+ .optional(),
2477
+ });
2478
+ const ImportForCustomerSubscriptionAddonsSchema = zod_1.z.object({
2479
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2480
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2481
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2482
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2483
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2484
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2485
+ });
2486
+ const ImportForCustomerSubscriptionEventBasedAddonsSchema = zod_1.z.object({
2487
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2488
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2489
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2490
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2491
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2492
+ service_period_in_days: zod_1.z
2493
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
2494
+ .optional(),
2495
+ on_event: zod_1.z
2496
+ .array(zod_1.z
2497
+ .enum([
2498
+ 'subscription_creation',
2499
+ 'subscription_trial_start',
2500
+ 'plan_activation',
2501
+ 'subscription_activation',
2502
+ 'contract_termination',
2503
+ ])
2504
+ .optional())
2505
+ .optional(),
2506
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
2507
+ });
2508
+ const ImportForCustomerSubscriptionChargedEventBasedAddonsSchema = zod_1.z.object({
2509
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2510
+ last_charged_at: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2511
+ });
2512
+ const ImportForCustomerSubscriptionCouponsSchema = zod_1.z.object({
2513
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2514
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2515
+ });
2516
+ const ImportForCustomerSubscriptionBodySchema = zod_1.z.looseObject({
2517
+ id: zod_1.z.string().max(50).optional(),
2518
+ plan_id: zod_1.z.string().max(100),
2519
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
2520
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
2521
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
2522
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
2523
+ setup_fee: zod_1.z.number().int().min(0).optional(),
2524
+ trial_end: zod_1.z.number().int().optional(),
2525
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
2526
+ start_date: zod_1.z.number().int().optional(),
2527
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
2528
+ po_number: zod_1.z.string().max(100).optional(),
2529
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2530
+ payment_source_id: zod_1.z.string().max(40).optional(),
2531
+ status: zod_1.z.enum([
2532
+ 'future',
2533
+ 'in_trial',
2534
+ 'active',
2535
+ 'non_renewing',
2536
+ 'paused',
2537
+ 'cancelled',
2538
+ 'transferred',
2539
+ ]),
2540
+ current_term_end: zod_1.z.number().int().optional(),
2541
+ current_term_start: zod_1.z.number().int().optional(),
2542
+ trial_start: zod_1.z.number().int().optional(),
2543
+ cancelled_at: zod_1.z.number().int().optional(),
2544
+ started_at: zod_1.z.number().int().optional(),
2545
+ activated_at: zod_1.z.number().int().optional(),
2546
+ pause_date: zod_1.z.number().int().optional(),
2547
+ resume_date: zod_1.z.number().int().optional(),
2548
+ contract_term_billing_cycle_on_renewal: zod_1.z
2549
+ .number()
2550
+ .int()
2551
+ .min(1)
2552
+ .max(100)
2553
+ .optional(),
2554
+ create_current_term_invoice: zod_1.z.boolean().default(false).optional(),
2555
+ invoice_notes: zod_1.z.string().max(2000).optional(),
2556
+ meta_data: ImportForCustomerSubscriptionMetaDataSchema.optional(),
2557
+ contract_term: ImportForCustomerSubscriptionContractTermSchema.optional(),
2558
+ transaction: ImportForCustomerSubscriptionTransactionSchema.optional(),
2559
+ shipping_address: ImportForCustomerSubscriptionShippingAddressSchema.optional(),
2560
+ addons: ImportForCustomerSubscriptionAddonsSchema.optional(),
2561
+ event_based_addons: ImportForCustomerSubscriptionEventBasedAddonsSchema.optional(),
2562
+ charged_event_based_addons: ImportForCustomerSubscriptionChargedEventBasedAddonsSchema.optional(),
2563
+ coupons: ImportForCustomerSubscriptionCouponsSchema.optional(),
2564
+ });
2565
+ exports.ImportForCustomerSubscriptionBodySchema = ImportForCustomerSubscriptionBodySchema;
2566
+ //Subscription.importContractTerm
2567
+ const ImportContractTermSubscriptionContractTermSchema = zod_1.z.object({
2568
+ id: zod_1.z.string().max(50).optional(),
2569
+ created_at: zod_1.z.number().int().optional(),
2570
+ contract_start: zod_1.z.number().int().optional(),
2571
+ contract_end: zod_1.z.number().int().optional(),
2572
+ status: zod_1.z.enum(['active', 'completed', 'cancelled', 'terminated']).optional(),
2573
+ total_amount_raised: zod_1.z.number().int().min(0).optional(),
2574
+ total_amount_raised_before_tax: zod_1.z.number().int().min(0).optional(),
2575
+ total_contract_value: zod_1.z.number().int().min(0).optional(),
2576
+ total_contract_value_before_tax: zod_1.z.number().int().min(0).optional(),
2577
+ billing_cycle: zod_1.z.number().int().min(0).optional(),
2578
+ action_at_term_end: zod_1.z
2579
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
2580
+ .optional(),
2581
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
2582
+ });
2583
+ const ImportContractTermSubscriptionBodySchema = zod_1.z.looseObject({
2584
+ contract_term_billing_cycle_on_renewal: zod_1.z
2585
+ .number()
2586
+ .int()
2587
+ .min(1)
2588
+ .max(100)
2589
+ .optional(),
2590
+ contract_term: ImportContractTermSubscriptionContractTermSchema.optional(),
2591
+ });
2592
+ exports.ImportContractTermSubscriptionBodySchema = ImportContractTermSubscriptionBodySchema;
2593
+ //Subscription.importUnbilledCharges
2594
+ const ImportUnbilledChargesSubscriptionUnbilledChargesSchema = zod_1.z.object({
2595
+ id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
2596
+ date_from: zod_1.z.array(zod_1.z.number().int().optional()),
2597
+ date_to: zod_1.z.array(zod_1.z.number().int().optional()),
2598
+ entity_type: zod_1.z.array(zod_1.z
2599
+ .enum([
2600
+ 'adhoc',
2601
+ 'plan_item_price',
2602
+ 'addon_item_price',
2603
+ 'charge_item_price',
2604
+ 'plan_setup',
2605
+ 'plan',
2606
+ 'addon',
2607
+ ])
2608
+ .optional()),
2609
+ entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2610
+ description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
2611
+ unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2612
+ quantity: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2613
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2614
+ unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2615
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2616
+ amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2617
+ discount_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2618
+ use_for_proration: zod_1.z.array(zod_1.z.boolean().default(false).optional()).optional(),
2619
+ is_advance_charge: zod_1.z.array(zod_1.z.boolean().default(false).optional()).optional(),
2620
+ });
2621
+ const ImportUnbilledChargesSubscriptionDiscountsSchema = zod_1.z.object({
2622
+ unbilled_charge_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
2623
+ entity_type: zod_1.z
2624
+ .array(zod_1.z
2625
+ .enum([
2626
+ 'item_level_coupon',
2627
+ 'document_level_coupon',
2628
+ 'item_level_discount',
2629
+ 'document_level_discount',
2630
+ ])
2631
+ .optional())
2632
+ .optional(),
2633
+ entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2634
+ description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
2635
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
2636
+ });
2637
+ const ImportUnbilledChargesSubscriptionTiersSchema = zod_1.z.object({
2638
+ unbilled_charge_id: zod_1.z.array(zod_1.z.string().max(40).optional()),
2639
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2640
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2641
+ quantity_used: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2642
+ unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2643
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2644
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2645
+ quantity_used_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2646
+ unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
2647
+ });
2648
+ const ImportUnbilledChargesSubscriptionBodySchema = zod_1.z.looseObject({
2649
+ unbilled_charges: ImportUnbilledChargesSubscriptionUnbilledChargesSchema.optional(),
2650
+ discounts: ImportUnbilledChargesSubscriptionDiscountsSchema.optional(),
2651
+ tiers: ImportUnbilledChargesSubscriptionTiersSchema.optional(),
2652
+ });
2653
+ exports.ImportUnbilledChargesSubscriptionBodySchema = ImportUnbilledChargesSubscriptionBodySchema;
2654
+ //Subscription.importForItems
2655
+ const ImportForItemsSubscriptionMetaDataSchema = zod_1.z.looseObject({});
2656
+ const ImportForItemsSubscriptionContractTermSchema = zod_1.z.object({
2657
+ id: zod_1.z.string().max(50).optional(),
2658
+ created_at: zod_1.z.number().int().optional(),
2659
+ contract_start: zod_1.z.number().int().optional(),
2660
+ billing_cycle: zod_1.z.number().int().min(0).optional(),
2661
+ total_amount_raised: zod_1.z.number().int().min(0).optional(),
2662
+ total_amount_raised_before_tax: zod_1.z.number().int().min(0).optional(),
2663
+ action_at_term_end: zod_1.z
2664
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
2665
+ .optional(),
2666
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
2667
+ });
2668
+ const ImportForItemsSubscriptionTransactionSchema = zod_1.z.object({
2669
+ amount: zod_1.z.number().int().min(0).optional(),
2670
+ payment_method: zod_1.z
2671
+ .enum([
2672
+ 'cash',
2673
+ 'check',
2674
+ 'bank_transfer',
2675
+ 'other',
2676
+ 'app_store',
2677
+ 'play_store',
2678
+ 'custom',
2679
+ ])
2680
+ .optional(),
2681
+ reference_number: zod_1.z.string().max(100).optional(),
2682
+ date: zod_1.z.number().int().optional(),
2683
+ });
2684
+ const ImportForItemsSubscriptionShippingAddressSchema = zod_1.z.object({
2685
+ first_name: zod_1.z.string().max(150).optional(),
2686
+ last_name: zod_1.z.string().max(150).optional(),
2687
+ email: zod_1.z.string().email().max(70).optional(),
2688
+ company: zod_1.z.string().max(250).optional(),
2689
+ phone: zod_1.z.string().max(50).optional(),
2690
+ line1: zod_1.z.string().max(150).optional(),
2691
+ line2: zod_1.z.string().max(150).optional(),
2692
+ line3: zod_1.z.string().max(150).optional(),
2693
+ city: zod_1.z.string().max(50).optional(),
2694
+ state_code: zod_1.z.string().max(50).optional(),
2695
+ state: zod_1.z.string().max(50).optional(),
2696
+ zip: zod_1.z.string().max(20).optional(),
2697
+ country: zod_1.z.string().max(50).optional(),
2698
+ validation_status: zod_1.z
2699
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
2700
+ .optional(),
2701
+ });
2702
+ const ImportForItemsSubscriptionSubscriptionItemsSchema = zod_1.z.object({
2703
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
2704
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2705
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2706
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2707
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2708
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2709
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2710
+ service_period_days: zod_1.z
2711
+ .array(zod_1.z.number().int().min(1).max(730).optional())
2712
+ .optional(),
2713
+ charge_on_event: zod_1.z
2714
+ .array(zod_1.z
2715
+ .enum([
2716
+ 'subscription_creation',
2717
+ 'subscription_trial_start',
2718
+ 'plan_activation',
2719
+ 'subscription_activation',
2720
+ 'contract_termination',
2721
+ ])
2722
+ .optional())
2723
+ .optional(),
2724
+ charge_once: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
2725
+ item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
2726
+ });
2727
+ const ImportForItemsSubscriptionDiscountsSchema = zod_1.z.object({
2728
+ apply_on: zod_1.z
2729
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
2730
+ .optional(),
2731
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
2732
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
2733
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2734
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2735
+ period_unit: zod_1.z
2736
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
2737
+ .optional(),
2738
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
2739
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2740
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2741
+ });
2742
+ const ImportForItemsSubscriptionChargedItemsSchema = zod_1.z.object({
2743
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2744
+ last_charged_at: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2745
+ });
2746
+ const ImportForItemsSubscriptionItemTiersSchema = zod_1.z.object({
2747
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2748
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2749
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2750
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2751
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2752
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2753
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2754
+ pricing_type: zod_1.z
2755
+ .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional())
2756
+ .optional(),
2757
+ package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2758
+ });
2759
+ const ImportForItemsSubscriptionCouponsSchema = zod_1.z.object({
2760
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2761
+ apply_till: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
2762
+ });
2763
+ const ImportForItemsSubscriptionBodySchema = zod_1.z.looseObject({
2764
+ exhausted_coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2765
+ id: zod_1.z.string().max(50).optional(),
2766
+ trial_end: zod_1.z.number().int().optional(),
2767
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
2768
+ setup_fee: zod_1.z.number().int().min(0).optional(),
2769
+ net_term_days: zod_1.z.number().int().optional(),
2770
+ start_date: zod_1.z.number().int().optional(),
2771
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
2772
+ po_number: zod_1.z.string().max(100).optional(),
2773
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2774
+ payment_source_id: zod_1.z.string().max(40).optional(),
2775
+ status: zod_1.z.enum([
2776
+ 'future',
2777
+ 'in_trial',
2778
+ 'active',
2779
+ 'non_renewing',
2780
+ 'paused',
2781
+ 'cancelled',
2782
+ 'transferred',
2783
+ ]),
2784
+ current_term_end: zod_1.z.number().int().optional(),
2785
+ current_term_start: zod_1.z.number().int().optional(),
2786
+ trial_start: zod_1.z.number().int().optional(),
2787
+ cancelled_at: zod_1.z.number().int().optional(),
2788
+ started_at: zod_1.z.number().int().optional(),
2789
+ activated_at: zod_1.z.number().int().optional(),
2790
+ pause_date: zod_1.z.number().int().optional(),
2791
+ resume_date: zod_1.z.number().int().optional(),
2792
+ contract_term_billing_cycle_on_renewal: zod_1.z
2793
+ .number()
2794
+ .int()
2795
+ .min(1)
2796
+ .max(100)
2797
+ .optional(),
2798
+ create_current_term_invoice: zod_1.z.boolean().default(false).optional(),
2799
+ invoice_notes: zod_1.z.string().max(2000).optional(),
2800
+ meta_data: ImportForItemsSubscriptionMetaDataSchema.optional(),
2801
+ cancel_reason_code: zod_1.z.string().max(100).optional(),
2802
+ create_pending_invoices: zod_1.z.boolean().optional(),
2803
+ auto_close_invoices: zod_1.z.boolean().optional(),
2804
+ contract_term: ImportForItemsSubscriptionContractTermSchema.optional(),
2805
+ transaction: ImportForItemsSubscriptionTransactionSchema.optional(),
2806
+ shipping_address: ImportForItemsSubscriptionShippingAddressSchema.optional(),
2807
+ subscription_items: ImportForItemsSubscriptionSubscriptionItemsSchema.optional(),
2808
+ discounts: ImportForItemsSubscriptionDiscountsSchema.optional(),
2809
+ charged_items: ImportForItemsSubscriptionChargedItemsSchema.optional(),
2810
+ item_tiers: ImportForItemsSubscriptionItemTiersSchema.optional(),
2811
+ coupons: ImportForItemsSubscriptionCouponsSchema.optional(),
2812
+ });
2813
+ exports.ImportForItemsSubscriptionBodySchema = ImportForItemsSubscriptionBodySchema;
2814
+ //Subscription.overrideBillingProfile
2815
+ const OverrideBillingProfileSubscriptionBodySchema = zod_1.z.looseObject({
2816
+ payment_source_id: zod_1.z.string().max(40).optional(),
2817
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
2818
+ });
2819
+ exports.OverrideBillingProfileSubscriptionBodySchema = OverrideBillingProfileSubscriptionBodySchema;
2820
+ //Subscription.pause
2821
+ const PauseSubscriptionBodySchema = zod_1.z.looseObject({
2822
+ pause_option: zod_1.z
2823
+ .enum(['immediately', 'end_of_term', 'specific_date', 'billing_cycles'])
2824
+ .optional(),
2825
+ pause_date: zod_1.z.number().int().optional(),
2826
+ unbilled_charges_handling: zod_1.z.enum(['no_action', 'invoice']).optional(),
2827
+ invoice_dunning_handling: zod_1.z.enum(['continue', 'stop']).optional(),
2828
+ skip_billing_cycles: zod_1.z.number().int().min(1).optional(),
2829
+ resume_date: zod_1.z.number().int().optional(),
2830
+ });
2831
+ exports.PauseSubscriptionBodySchema = PauseSubscriptionBodySchema;
2832
+ //Subscription.cancel
2833
+ const CancelSubscriptionEventBasedAddonsSchema = zod_1.z.object({
2834
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2835
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2836
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2837
+ service_period_in_days: zod_1.z
2838
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
2839
+ .optional(),
2840
+ });
2841
+ const CancelSubscriptionBodySchema = zod_1.z.looseObject({
2842
+ cancel_option: zod_1.z
2843
+ .enum([
2844
+ 'immediately',
2845
+ 'end_of_term',
2846
+ 'specific_date',
2847
+ 'end_of_billing_term',
2848
+ ])
2849
+ .optional(),
2850
+ end_of_term: zod_1.z.boolean().default(false).optional(),
2851
+ cancel_at: zod_1.z.number().int().optional(),
2852
+ credit_option_for_current_term_charges: zod_1.z
2853
+ .enum(['none', 'prorate', 'full'])
2854
+ .optional(),
2855
+ unbilled_charges_option: zod_1.z.enum(['invoice', 'delete']).optional(),
2856
+ account_receivables_handling: zod_1.z
2857
+ .enum(['no_action', 'schedule_payment_collection', 'write_off'])
2858
+ .optional(),
2859
+ refundable_credits_handling: zod_1.z
2860
+ .enum(['no_action', 'schedule_refund'])
2861
+ .optional(),
2862
+ contract_term_cancel_option: zod_1.z
2863
+ .enum([
2864
+ 'terminate_immediately',
2865
+ 'end_of_contract_term',
2866
+ 'specific_date',
2867
+ 'end_of_subscription_billing_term',
2868
+ ])
2869
+ .optional(),
2870
+ invoice_date: zod_1.z.number().int().optional(),
2871
+ cancel_reason_code: zod_1.z.string().max(100).optional(),
2872
+ event_based_addons: CancelSubscriptionEventBasedAddonsSchema.optional(),
2873
+ });
2874
+ exports.CancelSubscriptionBodySchema = CancelSubscriptionBodySchema;
2875
+ //Subscription.cancelForItems
2876
+ const CancelForItemsSubscriptionSubscriptionItemsSchema = zod_1.z.object({
2877
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
2878
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
2879
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
2880
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
2881
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
2882
+ service_period_days: zod_1.z
2883
+ .array(zod_1.z.number().int().min(1).max(730).optional())
2884
+ .optional(),
2885
+ });
2886
+ const CancelForItemsSubscriptionBodySchema = zod_1.z.looseObject({
2887
+ cancel_option: zod_1.z
2888
+ .enum([
2889
+ 'immediately',
2890
+ 'end_of_term',
2891
+ 'specific_date',
2892
+ 'end_of_billing_term',
2893
+ ])
2894
+ .optional(),
2895
+ end_of_term: zod_1.z.boolean().default(false).optional(),
2896
+ cancel_at: zod_1.z.number().int().optional(),
2897
+ credit_option_for_current_term_charges: zod_1.z
2898
+ .enum(['none', 'prorate', 'full'])
2899
+ .optional(),
2900
+ unbilled_charges_option: zod_1.z.enum(['invoice', 'delete']).optional(),
2901
+ account_receivables_handling: zod_1.z
2902
+ .enum(['no_action', 'schedule_payment_collection', 'write_off'])
2903
+ .optional(),
2904
+ refundable_credits_handling: zod_1.z
2905
+ .enum(['no_action', 'schedule_refund'])
2906
+ .optional(),
2907
+ contract_term_cancel_option: zod_1.z
2908
+ .enum([
2909
+ 'terminate_immediately',
2910
+ 'end_of_contract_term',
2911
+ 'specific_date',
2912
+ 'end_of_subscription_billing_term',
2913
+ ])
2914
+ .optional(),
2915
+ invoice_date: zod_1.z.number().int().optional(),
2916
+ cancel_reason_code: zod_1.z.string().max(100).optional(),
2917
+ decommissioned: zod_1.z.boolean().default(false).optional(),
2918
+ subscription_items: CancelForItemsSubscriptionSubscriptionItemsSchema.optional(),
2919
+ });
2920
+ exports.CancelForItemsSubscriptionBodySchema = CancelForItemsSubscriptionBodySchema;
2921
+ //Subscription.resume
2922
+ const ResumeSubscriptionAdditionalInformationSchema = zod_1.z.looseObject({});
2923
+ const ResumeSubscriptionPaymentIntentSchema = zod_1.z.object({
2924
+ id: zod_1.z.string().max(150).optional(),
2925
+ gateway_account_id: zod_1.z.string().max(50).optional(),
2926
+ gw_token: zod_1.z.string().max(65000).optional(),
2927
+ payment_method_type: zod_1.z
2928
+ .enum([
2929
+ 'card',
2930
+ 'ideal',
2931
+ 'sofort',
2932
+ 'bancontact',
2933
+ 'google_pay',
2934
+ 'dotpay',
2935
+ 'giropay',
2936
+ 'apple_pay',
2937
+ 'upi',
2938
+ 'netbanking_emandates',
2939
+ 'paypal_express_checkout',
2940
+ 'direct_debit',
2941
+ 'boleto',
2942
+ 'venmo',
2943
+ 'amazon_payments',
2944
+ 'pay_to',
2945
+ 'faster_payments',
2946
+ 'sepa_instant_transfer',
2947
+ 'klarna_pay_now',
2948
+ 'online_banking_poland',
2949
+ 'payconiq_by_bancontact',
2950
+ 'electronic_payment_standard',
2951
+ 'kbc_payment_button',
2952
+ 'pay_by_bank',
2953
+ 'trustly',
2954
+ 'stablecoin',
2955
+ 'kakao_pay',
2956
+ 'naver_pay',
2957
+ 'revolut_pay',
2958
+ 'cash_app_pay',
2959
+ 'wechat_pay',
2960
+ 'alipay',
2961
+ 'pix',
2962
+ 'twint',
2963
+ 'go_pay',
2964
+ 'grab_pay',
2965
+ 'pay_co',
2966
+ 'after_pay',
2967
+ 'swish',
2968
+ 'payme',
2969
+ ])
2970
+ .optional(),
2971
+ reference_id: zod_1.z.string().max(65000).optional(),
2972
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
2973
+ additional_information: ResumeSubscriptionAdditionalInformationSchema.optional(),
2974
+ });
2975
+ const ResumeSubscriptionBodySchema = zod_1.z.looseObject({
2976
+ resume_option: zod_1.z.enum(['immediately', 'specific_date']).optional(),
2977
+ resume_date: zod_1.z.number().int().optional(),
2978
+ charges_handling: zod_1.z
2979
+ .enum(['invoice_immediately', 'add_to_unbilled_charges'])
2980
+ .optional(),
2981
+ unpaid_invoices_handling: zod_1.z
2982
+ .enum(['no_action', 'schedule_payment_collection'])
2983
+ .optional(),
2984
+ payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
2985
+ payment_intent: ResumeSubscriptionPaymentIntentSchema.optional(),
2986
+ });
2987
+ exports.ResumeSubscriptionBodySchema = ResumeSubscriptionBodySchema;
2988
+ //Subscription.move
2989
+ const MoveSubscriptionBodySchema = zod_1.z.looseObject({
2990
+ to_customer_id: zod_1.z.string().max(50),
2991
+ copy_payment_source: zod_1.z.boolean().default(false).optional(),
2992
+ });
2993
+ exports.MoveSubscriptionBodySchema = MoveSubscriptionBodySchema;