chargebee 3.25.0-beta.1 → 3.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/CHANGELOG.md +103 -4
  2. package/README.md +0 -39
  3. package/cjs/RequestWrapper.js +1 -28
  4. package/cjs/chargebee.cjs.js +0 -3
  5. package/cjs/chargebee.cjs.worker.js +0 -2
  6. package/cjs/createChargebee.js +0 -5
  7. package/cjs/environment.js +1 -1
  8. package/cjs/resources/api_endpoints.js +121 -3
  9. package/cjs/resources/webhook/eventType.js +2 -0
  10. package/esm/RequestWrapper.js +1 -28
  11. package/esm/chargebee.esm.js +0 -2
  12. package/esm/chargebee.esm.worker.js +0 -1
  13. package/esm/createChargebee.js +0 -5
  14. package/esm/environment.js +1 -1
  15. package/esm/resources/api_endpoints.js +121 -3
  16. package/esm/resources/webhook/eventType.js +2 -0
  17. package/package.json +1 -4
  18. package/types/core.d.ts +24 -6
  19. package/types/index.d.ts +8 -17
  20. package/types/resources/Content.d.ts +4 -1
  21. package/types/resources/CreditNote.d.ts +1 -0
  22. package/types/resources/Customer.d.ts +14 -4
  23. package/types/resources/Estimate.d.ts +14 -4
  24. package/types/resources/Event.d.ts +2 -0
  25. package/types/resources/Gift.d.ts +23 -6
  26. package/types/resources/GrantBlock.d.ts +59 -0
  27. package/types/resources/HostedPage.d.ts +6 -1
  28. package/types/resources/Invoice.d.ts +14 -5
  29. package/types/resources/LedgerAccountBalance.d.ts +50 -0
  30. package/types/resources/LedgerOperation.d.ts +141 -0
  31. package/types/resources/OmnichannelSubscription.d.ts +8 -0
  32. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  33. package/types/resources/PaymentIntent.d.ts +35 -10
  34. package/types/resources/PaymentSource.d.ts +7 -2
  35. package/types/resources/PromotionalGrant.d.ts +37 -0
  36. package/types/resources/Purchase.d.ts +7 -2
  37. package/types/resources/Subscription.d.ts +49 -14
  38. package/types/resources/WebhookEvent.d.ts +22 -4
  39. package/cjs/chargebeeZodValidationError.js +0 -18
  40. package/cjs/schema/addon.schema.js +0 -153
  41. package/cjs/schema/address.schema.js +0 -35
  42. package/cjs/schema/alert.schema.js +0 -38
  43. package/cjs/schema/attached_item.schema.js +0 -58
  44. package/cjs/schema/business_entity.schema.js +0 -46
  45. package/cjs/schema/card.schema.js +0 -165
  46. package/cjs/schema/comment.schema.js +0 -69
  47. package/cjs/schema/coupon.schema.js +0 -209
  48. package/cjs/schema/coupon_code.schema.js +0 -14
  49. package/cjs/schema/coupon_set.schema.js +0 -28
  50. package/cjs/schema/credit_note.schema.js +0 -288
  51. package/cjs/schema/currency.schema.js +0 -32
  52. package/cjs/schema/customer.schema.js +0 -986
  53. package/cjs/schema/customer_entitlement.schema.js +0 -14
  54. package/cjs/schema/differential_price.schema.js +0 -68
  55. package/cjs/schema/entitlement.schema.js +0 -27
  56. package/cjs/schema/entitlement_override.schema.js +0 -33
  57. package/cjs/schema/estimate.schema.js +0 -1525
  58. package/cjs/schema/export.schema.js +0 -1545
  59. package/cjs/schema/feature.schema.js +0 -37
  60. package/cjs/schema/gift.schema.js +0 -277
  61. package/cjs/schema/hosted_page.schema.js +0 -1649
  62. package/cjs/schema/in_app_subscription.schema.js +0 -68
  63. package/cjs/schema/index.js +0 -80
  64. package/cjs/schema/invoice.schema.js +0 -1467
  65. package/cjs/schema/item.schema.js +0 -91
  66. package/cjs/schema/item_entitlement.schema.js +0 -45
  67. package/cjs/schema/item_family.schema.js +0 -21
  68. package/cjs/schema/item_price.schema.js +0 -190
  69. package/cjs/schema/non_subscription.schema.js +0 -28
  70. package/cjs/schema/offer_event.schema.js +0 -13
  71. package/cjs/schema/offer_fulfillment.schema.js +0 -20
  72. package/cjs/schema/omnichannel_one_time_order.schema.js +0 -26
  73. package/cjs/schema/omnichannel_subscription.schema.js +0 -89
  74. package/cjs/schema/omnichannel_subscription_item.schema.js +0 -13
  75. package/cjs/schema/order.schema.js +0 -273
  76. package/cjs/schema/payment_intent.schema.js +0 -117
  77. package/cjs/schema/payment_schedule_scheme.schema.js +0 -20
  78. package/cjs/schema/payment_source.schema.js +0 -358
  79. package/cjs/schema/payment_voucher.schema.js +0 -57
  80. package/cjs/schema/personalized_offer.schema.js +0 -28
  81. package/cjs/schema/plan.schema.js +0 -225
  82. package/cjs/schema/portal_session.schema.js +0 -22
  83. package/cjs/schema/price_variant.schema.js +0 -36
  84. package/cjs/schema/pricing_page_session.schema.js +0 -135
  85. package/cjs/schema/promotional_credit.schema.js +0 -78
  86. package/cjs/schema/purchase.schema.js +0 -272
  87. package/cjs/schema/quote.schema.js +0 -1557
  88. package/cjs/schema/ramp.schema.js +0 -209
  89. package/cjs/schema/recorded_purchase.schema.js +0 -32
  90. package/cjs/schema/resource_migration.schema.js +0 -14
  91. package/cjs/schema/site_migration_detail.schema.js +0 -81
  92. package/cjs/schema/subscription.schema.js +0 -2993
  93. package/cjs/schema/subscription_entitlement.schema.js +0 -25
  94. package/cjs/schema/time_machine.schema.js +0 -17
  95. package/cjs/schema/transaction.schema.js +0 -70
  96. package/cjs/schema/unbilled_charge.schema.js +0 -113
  97. package/cjs/schema/usage.schema.js +0 -93
  98. package/cjs/schema/usage_charge.schema.js +0 -17
  99. package/cjs/schema/usage_event.schema.js +0 -28
  100. package/cjs/schema/usage_file.schema.js +0 -13
  101. package/cjs/schema/usage_summary.schema.js +0 -17
  102. package/cjs/schema/virtual_bank_account.schema.js +0 -43
  103. package/cjs/schema/webhook_endpoint.schema.js +0 -504
  104. package/cjs/validationLoader.js +0 -59
  105. package/esm/chargebeeZodValidationError.js +0 -14
  106. package/esm/schema/addon.schema.js +0 -150
  107. package/esm/schema/address.schema.js +0 -32
  108. package/esm/schema/alert.schema.js +0 -35
  109. package/esm/schema/attached_item.schema.js +0 -55
  110. package/esm/schema/business_entity.schema.js +0 -43
  111. package/esm/schema/card.schema.js +0 -162
  112. package/esm/schema/comment.schema.js +0 -66
  113. package/esm/schema/coupon.schema.js +0 -206
  114. package/esm/schema/coupon_code.schema.js +0 -11
  115. package/esm/schema/coupon_set.schema.js +0 -25
  116. package/esm/schema/credit_note.schema.js +0 -285
  117. package/esm/schema/currency.schema.js +0 -29
  118. package/esm/schema/customer.schema.js +0 -983
  119. package/esm/schema/customer_entitlement.schema.js +0 -11
  120. package/esm/schema/differential_price.schema.js +0 -65
  121. package/esm/schema/entitlement.schema.js +0 -24
  122. package/esm/schema/entitlement_override.schema.js +0 -30
  123. package/esm/schema/estimate.schema.js +0 -1522
  124. package/esm/schema/export.schema.js +0 -1542
  125. package/esm/schema/feature.schema.js +0 -34
  126. package/esm/schema/gift.schema.js +0 -274
  127. package/esm/schema/hosted_page.schema.js +0 -1646
  128. package/esm/schema/in_app_subscription.schema.js +0 -65
  129. package/esm/schema/index.js +0 -64
  130. package/esm/schema/invoice.schema.js +0 -1464
  131. package/esm/schema/item.schema.js +0 -88
  132. package/esm/schema/item_entitlement.schema.js +0 -42
  133. package/esm/schema/item_family.schema.js +0 -18
  134. package/esm/schema/item_price.schema.js +0 -187
  135. package/esm/schema/non_subscription.schema.js +0 -25
  136. package/esm/schema/offer_event.schema.js +0 -10
  137. package/esm/schema/offer_fulfillment.schema.js +0 -17
  138. package/esm/schema/omnichannel_one_time_order.schema.js +0 -23
  139. package/esm/schema/omnichannel_subscription.schema.js +0 -86
  140. package/esm/schema/omnichannel_subscription_item.schema.js +0 -10
  141. package/esm/schema/order.schema.js +0 -270
  142. package/esm/schema/payment_intent.schema.js +0 -114
  143. package/esm/schema/payment_schedule_scheme.schema.js +0 -17
  144. package/esm/schema/payment_source.schema.js +0 -355
  145. package/esm/schema/payment_voucher.schema.js +0 -54
  146. package/esm/schema/personalized_offer.schema.js +0 -25
  147. package/esm/schema/plan.schema.js +0 -222
  148. package/esm/schema/portal_session.schema.js +0 -19
  149. package/esm/schema/price_variant.schema.js +0 -33
  150. package/esm/schema/pricing_page_session.schema.js +0 -132
  151. package/esm/schema/promotional_credit.schema.js +0 -75
  152. package/esm/schema/purchase.schema.js +0 -269
  153. package/esm/schema/quote.schema.js +0 -1554
  154. package/esm/schema/ramp.schema.js +0 -206
  155. package/esm/schema/recorded_purchase.schema.js +0 -29
  156. package/esm/schema/resource_migration.schema.js +0 -11
  157. package/esm/schema/site_migration_detail.schema.js +0 -78
  158. package/esm/schema/subscription.schema.js +0 -2990
  159. package/esm/schema/subscription_entitlement.schema.js +0 -22
  160. package/esm/schema/time_machine.schema.js +0 -14
  161. package/esm/schema/transaction.schema.js +0 -67
  162. package/esm/schema/unbilled_charge.schema.js +0 -110
  163. package/esm/schema/usage.schema.js +0 -90
  164. package/esm/schema/usage_charge.schema.js +0 -14
  165. package/esm/schema/usage_event.schema.js +0 -25
  166. package/esm/schema/usage_file.schema.js +0 -10
  167. package/esm/schema/usage_summary.schema.js +0 -14
  168. package/esm/schema/virtual_bank_account.schema.js +0 -40
  169. package/esm/schema/webhook_endpoint.schema.js +0 -501
  170. package/esm/validationLoader.js +0 -56
  171. package/types/resources/QuoteEntitlement.d.ts +0 -16
@@ -1,1464 +0,0 @@
1
- // Generated Zod schemas: Invoice
2
- // Actions: create, createForChargeItemsAndCharges, charge, chargeAddon, createForChargeItem, stopDunning, pauseDunning, resumeDunning, importInvoice, applyPayments, deleteLineItems, applyCredits, invoicesForCustomer, invoicesForSubscription, retrieve, pdf, addCharge, addAddonCharge, addChargeItem, close, collectPayment, recordPayment, recordTaxWithheld, removeTaxWithheld, refund, recordRefund, removePayment, removeCreditNote, voidInvoice, writeOff, delete, updateDetails, applyPaymentScheduleScheme
3
- // Do not edit manually – regenerate via sdk-generator
4
- import { z } from 'zod';
5
- //Invoice.create
6
- const CreateInvoiceShippingAddressSchema = z.object({
7
- first_name: z.string().max(150).optional(),
8
- last_name: z.string().max(150).optional(),
9
- email: z.string().email().max(70).optional(),
10
- company: z.string().max(250).optional(),
11
- phone: z.string().max(50).optional(),
12
- line1: z.string().max(150).optional(),
13
- line2: z.string().max(150).optional(),
14
- line3: z.string().max(150).optional(),
15
- city: z.string().max(50).optional(),
16
- state_code: z.string().max(50).optional(),
17
- state: z.string().max(50).optional(),
18
- zip: z.string().max(20).optional(),
19
- country: z.string().max(50).optional(),
20
- validation_status: z
21
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
22
- .optional(),
23
- });
24
- const CreateInvoiceStatementDescriptorSchema = z.object({
25
- descriptor: z.string().max(65000).optional(),
26
- });
27
- const CreateInvoiceAdditionalInformationSchema = z.looseObject({});
28
- const CreateInvoiceCardSchema = z.object({
29
- gateway: z
30
- .enum([
31
- 'chargebee',
32
- 'chargebee_payments',
33
- 'adyen',
34
- 'stripe',
35
- 'wepay',
36
- 'braintree',
37
- 'authorize_net',
38
- 'paypal_pro',
39
- 'pin',
40
- 'eway',
41
- 'eway_rapid',
42
- 'worldpay',
43
- 'balanced_payments',
44
- 'beanstream',
45
- 'bluepay',
46
- 'elavon',
47
- 'first_data_global',
48
- 'hdfc',
49
- 'migs',
50
- 'nmi',
51
- 'ogone',
52
- 'paymill',
53
- 'paypal_payflow_pro',
54
- 'sage_pay',
55
- 'tco',
56
- 'wirecard',
57
- 'amazon_payments',
58
- 'paypal_express_checkout',
59
- 'orbital',
60
- 'moneris_us',
61
- 'moneris',
62
- 'bluesnap',
63
- 'cybersource',
64
- 'vantiv',
65
- 'checkout_com',
66
- 'paypal',
67
- 'ingenico_direct',
68
- 'exact',
69
- 'mollie',
70
- 'quickbooks',
71
- 'razorpay',
72
- 'global_payments',
73
- 'bank_of_america',
74
- 'ecentric',
75
- 'metrics_global',
76
- 'windcave',
77
- 'pay_com',
78
- 'ebanx',
79
- 'dlocal',
80
- 'nuvei',
81
- 'solidgate',
82
- 'paystack',
83
- 'jp_morgan',
84
- 'deutsche_bank',
85
- 'ezidebit',
86
- 'twikey',
87
- 'tempus',
88
- 'moyasar',
89
- 'payway',
90
- ])
91
- .optional(),
92
- gateway_account_id: z.string().max(50).optional(),
93
- tmp_token: z.string().max(300).optional(),
94
- first_name: z.string().max(50).optional(),
95
- last_name: z.string().max(50).optional(),
96
- number: z.string().max(1500).optional(),
97
- expiry_month: z.number().int().min(1).max(12).optional(),
98
- expiry_year: z.number().int().optional(),
99
- cvv: z.string().max(520).optional(),
100
- preferred_scheme: z
101
- .enum(['cartes_bancaires', 'mastercard', 'visa'])
102
- .optional(),
103
- billing_addr1: z.string().max(150).optional(),
104
- billing_addr2: z.string().max(150).optional(),
105
- billing_city: z.string().max(50).optional(),
106
- billing_state_code: z.string().max(50).optional(),
107
- billing_state: z.string().max(50).optional(),
108
- billing_zip: z.string().max(20).optional(),
109
- billing_country: z.string().max(50).optional(),
110
- ip_address: z.string().max(50).optional(),
111
- additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
112
- });
113
- const CreateInvoiceBillingAddressSchema = z.looseObject({});
114
- const CreateInvoiceBankAccountSchema = z.object({
115
- gateway_account_id: z.string().max(50).optional(),
116
- iban: z.string().max(50).min(10).optional(),
117
- first_name: z.string().max(150).optional(),
118
- last_name: z.string().max(150).optional(),
119
- company: z.string().max(250).optional(),
120
- email: z.string().email().max(70).optional(),
121
- phone: z.string().max(50).optional(),
122
- bank_name: z.string().max(100).optional(),
123
- account_number: z.string().max(17).min(4).optional(),
124
- routing_number: z.string().max(9).min(3).optional(),
125
- bank_code: z.string().max(20).optional(),
126
- account_type: z
127
- .enum(['checking', 'savings', 'business_checking', 'current'])
128
- .optional(),
129
- account_holder_type: z.enum(['individual', 'company']).optional(),
130
- echeck_type: z.enum(['web', 'ppd', 'ccd']).optional(),
131
- issuing_country: z.string().max(50).optional(),
132
- swedish_identity_number: z.string().max(12).min(10).optional(),
133
- billing_address: CreateInvoiceBillingAddressSchema.optional(),
134
- });
135
- const CreateInvoicePaymentMethodSchema = z.object({
136
- type: z
137
- .enum([
138
- 'card',
139
- 'paypal_express_checkout',
140
- 'amazon_payments',
141
- 'direct_debit',
142
- 'generic',
143
- 'alipay',
144
- 'unionpay',
145
- 'apple_pay',
146
- 'wechat_pay',
147
- 'ideal',
148
- 'google_pay',
149
- 'sofort',
150
- 'bancontact',
151
- 'giropay',
152
- 'dotpay',
153
- 'upi',
154
- 'netbanking_emandates',
155
- 'venmo',
156
- 'pay_to',
157
- 'faster_payments',
158
- 'sepa_instant_transfer',
159
- 'automated_bank_transfer',
160
- 'klarna_pay_now',
161
- 'online_banking_poland',
162
- 'payconiq_by_bancontact',
163
- 'electronic_payment_standard',
164
- 'kbc_payment_button',
165
- 'pay_by_bank',
166
- 'trustly',
167
- 'stablecoin',
168
- 'kakao_pay',
169
- 'naver_pay',
170
- 'revolut_pay',
171
- 'cash_app_pay',
172
- 'pix',
173
- 'twint',
174
- 'go_pay',
175
- 'grab_pay',
176
- 'pay_co',
177
- 'after_pay',
178
- 'swish',
179
- 'payme',
180
- ])
181
- .optional(),
182
- gateway: z
183
- .enum([
184
- 'chargebee_payments',
185
- 'adyen',
186
- 'stripe',
187
- 'wepay',
188
- 'braintree',
189
- 'authorize_net',
190
- 'paypal_pro',
191
- 'pin',
192
- 'eway',
193
- 'eway_rapid',
194
- 'worldpay',
195
- 'balanced_payments',
196
- 'beanstream',
197
- 'bluepay',
198
- 'elavon',
199
- 'first_data_global',
200
- 'hdfc',
201
- 'migs',
202
- 'nmi',
203
- 'ogone',
204
- 'paymill',
205
- 'paypal_payflow_pro',
206
- 'sage_pay',
207
- 'tco',
208
- 'wirecard',
209
- 'amazon_payments',
210
- 'paypal_express_checkout',
211
- 'gocardless',
212
- 'orbital',
213
- 'moneris_us',
214
- 'moneris',
215
- 'bluesnap',
216
- 'cybersource',
217
- 'vantiv',
218
- 'checkout_com',
219
- 'paypal',
220
- 'ingenico_direct',
221
- 'exact',
222
- 'mollie',
223
- 'quickbooks',
224
- 'razorpay',
225
- 'global_payments',
226
- 'bank_of_america',
227
- 'ecentric',
228
- 'metrics_global',
229
- 'windcave',
230
- 'pay_com',
231
- 'ebanx',
232
- 'dlocal',
233
- 'nuvei',
234
- 'solidgate',
235
- 'paystack',
236
- 'jp_morgan',
237
- 'deutsche_bank',
238
- 'ezidebit',
239
- 'twikey',
240
- 'tempus',
241
- 'moyasar',
242
- 'payway',
243
- ])
244
- .optional(),
245
- gateway_account_id: z.string().max(50).optional(),
246
- reference_id: z.string().max(200).optional(),
247
- tmp_token: z.string().max(65000).optional(),
248
- issuing_country: z.string().max(50).optional(),
249
- additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
250
- });
251
- const CreateInvoicePaymentIntentSchema = z.object({
252
- id: z.string().max(150).optional(),
253
- gateway_account_id: z.string().max(50).optional(),
254
- gw_token: z.string().max(65000).optional(),
255
- payment_method_type: z
256
- .enum([
257
- 'card',
258
- 'ideal',
259
- 'sofort',
260
- 'bancontact',
261
- 'google_pay',
262
- 'dotpay',
263
- 'giropay',
264
- 'apple_pay',
265
- 'upi',
266
- 'netbanking_emandates',
267
- 'paypal_express_checkout',
268
- 'direct_debit',
269
- 'boleto',
270
- 'venmo',
271
- 'amazon_payments',
272
- 'pay_to',
273
- 'faster_payments',
274
- 'sepa_instant_transfer',
275
- 'klarna_pay_now',
276
- 'online_banking_poland',
277
- 'payconiq_by_bancontact',
278
- 'electronic_payment_standard',
279
- 'kbc_payment_button',
280
- 'pay_by_bank',
281
- 'trustly',
282
- 'stablecoin',
283
- 'kakao_pay',
284
- 'naver_pay',
285
- 'revolut_pay',
286
- 'cash_app_pay',
287
- 'wechat_pay',
288
- 'alipay',
289
- 'pix',
290
- 'twint',
291
- 'go_pay',
292
- 'grab_pay',
293
- 'pay_co',
294
- 'after_pay',
295
- 'swish',
296
- 'payme',
297
- ])
298
- .optional(),
299
- reference_id: z.string().max(65000).optional(),
300
- gw_payment_method_id: z.string().max(65000).optional(),
301
- additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
302
- });
303
- const CreateInvoiceAddonsSchema = z.object({
304
- id: z.array(z.string().max(100).optional()).optional(),
305
- quantity: z.array(z.number().int().min(1).optional()).optional(),
306
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
307
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
308
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
309
- date_from: z.array(z.number().int().optional()).optional(),
310
- date_to: z.array(z.number().int().optional()).optional(),
311
- });
312
- const CreateInvoiceChargesSchema = z.object({
313
- amount: z.array(z.number().int().min(1).optional()).optional(),
314
- amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
315
- description: z.array(z.string().max(250).optional()).optional(),
316
- taxable: z.array(z.boolean().default(true).optional()).optional(),
317
- tax_profile_id: z.array(z.string().max(50).optional()).optional(),
318
- avalara_tax_code: z.array(z.string().max(50).optional()).optional(),
319
- hsn_code: z.array(z.string().max(50).optional()).optional(),
320
- taxjar_product_code: z.array(z.string().max(50).optional()).optional(),
321
- avalara_sale_type: z
322
- .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
323
- .optional(),
324
- avalara_transaction_type: z.array(z.number().int().optional()).optional(),
325
- avalara_service_type: z.array(z.number().int().optional()).optional(),
326
- date_from: z.array(z.number().int().optional()).optional(),
327
- date_to: z.array(z.number().int().optional()).optional(),
328
- });
329
- const CreateInvoiceTaxProvidersFieldsSchema = z.object({
330
- provider_name: z.array(z.string().max(50).optional()).optional(),
331
- field_id: z.array(z.string().max(50).optional()).optional(),
332
- field_value: z.array(z.string().max(50).optional()).optional(),
333
- });
334
- const CreateInvoiceNotesToRemoveSchema = z.object({
335
- entity_type: z
336
- .array(z
337
- .enum(['plan', 'addon', 'customer', 'subscription', 'coupon'])
338
- .optional())
339
- .optional(),
340
- entity_id: z.array(z.string().max(100).optional()).optional(),
341
- });
342
- const CreateInvoiceBodySchema = z.looseObject({
343
- customer_id: z.string().max(50).optional(),
344
- subscription_id: z.string().max(50).optional(),
345
- currency_code: z.string().max(3).optional(),
346
- invoice_date: z.number().int().optional(),
347
- invoice_note: z.string().max(2000).optional(),
348
- remove_general_note: z.boolean().default(false).optional(),
349
- po_number: z.string().max(100).optional(),
350
- coupon: z.string().max(100).optional(),
351
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
352
- authorization_transaction_id: z.string().max(40).optional(),
353
- payment_source_id: z.string().max(40).optional(),
354
- auto_collection: z.enum(['on', 'off']).optional(),
355
- token_id: z.string().max(40).optional(),
356
- replace_primary_payment_source: z.boolean().default(false).optional(),
357
- retain_payment_source: z.boolean().default(true).optional(),
358
- payment_initiator: z.enum(['customer', 'merchant']).optional(),
359
- shipping_address: CreateInvoiceShippingAddressSchema.optional(),
360
- statement_descriptor: CreateInvoiceStatementDescriptorSchema.optional(),
361
- card: CreateInvoiceCardSchema.optional(),
362
- bank_account: CreateInvoiceBankAccountSchema.optional(),
363
- payment_method: CreateInvoicePaymentMethodSchema.optional(),
364
- payment_intent: CreateInvoicePaymentIntentSchema.optional(),
365
- addons: CreateInvoiceAddonsSchema.optional(),
366
- charges: CreateInvoiceChargesSchema.optional(),
367
- tax_providers_fields: CreateInvoiceTaxProvidersFieldsSchema.optional(),
368
- notes_to_remove: CreateInvoiceNotesToRemoveSchema.optional(),
369
- });
370
- export { CreateInvoiceBodySchema };
371
- //Invoice.createForChargeItemsAndCharges
372
- const CreateForChargeItemsAndChargesInvoiceShippingAddressSchema = z.object({
373
- first_name: z.string().max(150).optional(),
374
- last_name: z.string().max(150).optional(),
375
- email: z.string().email().max(70).optional(),
376
- company: z.string().max(250).optional(),
377
- phone: z.string().max(50).optional(),
378
- line1: z.string().max(150).optional(),
379
- line2: z.string().max(150).optional(),
380
- line3: z.string().max(150).optional(),
381
- city: z.string().max(50).optional(),
382
- state_code: z.string().max(50).optional(),
383
- state: z.string().max(50).optional(),
384
- zip: z.string().max(20).optional(),
385
- country: z.string().max(50).optional(),
386
- validation_status: z
387
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
388
- .optional(),
389
- });
390
- const CreateForChargeItemsAndChargesInvoiceStatementDescriptorSchema = z.object({
391
- descriptor: z.string().max(65000).optional(),
392
- });
393
- const CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema = z.looseObject({});
394
- const CreateForChargeItemsAndChargesInvoiceCardSchema = z.object({
395
- gateway: z
396
- .enum([
397
- 'chargebee',
398
- 'chargebee_payments',
399
- 'adyen',
400
- 'stripe',
401
- 'wepay',
402
- 'braintree',
403
- 'authorize_net',
404
- 'paypal_pro',
405
- 'pin',
406
- 'eway',
407
- 'eway_rapid',
408
- 'worldpay',
409
- 'balanced_payments',
410
- 'beanstream',
411
- 'bluepay',
412
- 'elavon',
413
- 'first_data_global',
414
- 'hdfc',
415
- 'migs',
416
- 'nmi',
417
- 'ogone',
418
- 'paymill',
419
- 'paypal_payflow_pro',
420
- 'sage_pay',
421
- 'tco',
422
- 'wirecard',
423
- 'amazon_payments',
424
- 'paypal_express_checkout',
425
- 'orbital',
426
- 'moneris_us',
427
- 'moneris',
428
- 'bluesnap',
429
- 'cybersource',
430
- 'vantiv',
431
- 'checkout_com',
432
- 'paypal',
433
- 'ingenico_direct',
434
- 'exact',
435
- 'mollie',
436
- 'quickbooks',
437
- 'razorpay',
438
- 'global_payments',
439
- 'bank_of_america',
440
- 'ecentric',
441
- 'metrics_global',
442
- 'windcave',
443
- 'pay_com',
444
- 'ebanx',
445
- 'dlocal',
446
- 'nuvei',
447
- 'solidgate',
448
- 'paystack',
449
- 'jp_morgan',
450
- 'deutsche_bank',
451
- 'ezidebit',
452
- 'twikey',
453
- 'tempus',
454
- 'moyasar',
455
- 'payway',
456
- ])
457
- .optional(),
458
- gateway_account_id: z.string().max(50).optional(),
459
- tmp_token: z.string().max(300).optional(),
460
- first_name: z.string().max(50).optional(),
461
- last_name: z.string().max(50).optional(),
462
- number: z.string().max(1500).optional(),
463
- expiry_month: z.number().int().min(1).max(12).optional(),
464
- expiry_year: z.number().int().optional(),
465
- cvv: z.string().max(520).optional(),
466
- preferred_scheme: z
467
- .enum(['cartes_bancaires', 'mastercard', 'visa'])
468
- .optional(),
469
- billing_addr1: z.string().max(150).optional(),
470
- billing_addr2: z.string().max(150).optional(),
471
- billing_city: z.string().max(50).optional(),
472
- billing_state_code: z.string().max(50).optional(),
473
- billing_state: z.string().max(50).optional(),
474
- billing_zip: z.string().max(20).optional(),
475
- billing_country: z.string().max(50).optional(),
476
- ip_address: z.string().max(50).optional(),
477
- additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
478
- });
479
- const CreateForChargeItemsAndChargesInvoiceBillingAddressSchema = z.looseObject({});
480
- const CreateForChargeItemsAndChargesInvoiceBankAccountSchema = z.object({
481
- gateway_account_id: z.string().max(50).optional(),
482
- iban: z.string().max(50).min(10).optional(),
483
- first_name: z.string().max(150).optional(),
484
- last_name: z.string().max(150).optional(),
485
- company: z.string().max(250).optional(),
486
- email: z.string().email().max(70).optional(),
487
- phone: z.string().max(50).optional(),
488
- bank_name: z.string().max(100).optional(),
489
- account_number: z.string().max(17).min(4).optional(),
490
- routing_number: z.string().max(9).min(3).optional(),
491
- bank_code: z.string().max(20).optional(),
492
- account_type: z
493
- .enum(['checking', 'savings', 'business_checking', 'current'])
494
- .optional(),
495
- account_holder_type: z.enum(['individual', 'company']).optional(),
496
- echeck_type: z.enum(['web', 'ppd', 'ccd']).optional(),
497
- issuing_country: z.string().max(50).optional(),
498
- swedish_identity_number: z.string().max(12).min(10).optional(),
499
- billing_address: CreateForChargeItemsAndChargesInvoiceBillingAddressSchema.optional(),
500
- });
501
- const CreateForChargeItemsAndChargesInvoicePaymentMethodSchema = z.object({
502
- type: z
503
- .enum([
504
- 'card',
505
- 'paypal_express_checkout',
506
- 'amazon_payments',
507
- 'direct_debit',
508
- 'generic',
509
- 'alipay',
510
- 'unionpay',
511
- 'apple_pay',
512
- 'wechat_pay',
513
- 'ideal',
514
- 'google_pay',
515
- 'sofort',
516
- 'bancontact',
517
- 'giropay',
518
- 'dotpay',
519
- 'upi',
520
- 'netbanking_emandates',
521
- 'venmo',
522
- 'pay_to',
523
- 'faster_payments',
524
- 'sepa_instant_transfer',
525
- 'automated_bank_transfer',
526
- 'klarna_pay_now',
527
- 'online_banking_poland',
528
- 'payconiq_by_bancontact',
529
- 'electronic_payment_standard',
530
- 'kbc_payment_button',
531
- 'pay_by_bank',
532
- 'trustly',
533
- 'stablecoin',
534
- 'kakao_pay',
535
- 'naver_pay',
536
- 'revolut_pay',
537
- 'cash_app_pay',
538
- 'pix',
539
- 'twint',
540
- 'go_pay',
541
- 'grab_pay',
542
- 'pay_co',
543
- 'after_pay',
544
- 'swish',
545
- 'payme',
546
- ])
547
- .optional(),
548
- gateway: z
549
- .enum([
550
- 'chargebee_payments',
551
- 'adyen',
552
- 'stripe',
553
- 'wepay',
554
- 'braintree',
555
- 'authorize_net',
556
- 'paypal_pro',
557
- 'pin',
558
- 'eway',
559
- 'eway_rapid',
560
- 'worldpay',
561
- 'balanced_payments',
562
- 'beanstream',
563
- 'bluepay',
564
- 'elavon',
565
- 'first_data_global',
566
- 'hdfc',
567
- 'migs',
568
- 'nmi',
569
- 'ogone',
570
- 'paymill',
571
- 'paypal_payflow_pro',
572
- 'sage_pay',
573
- 'tco',
574
- 'wirecard',
575
- 'amazon_payments',
576
- 'paypal_express_checkout',
577
- 'gocardless',
578
- 'orbital',
579
- 'moneris_us',
580
- 'moneris',
581
- 'bluesnap',
582
- 'cybersource',
583
- 'vantiv',
584
- 'checkout_com',
585
- 'paypal',
586
- 'ingenico_direct',
587
- 'exact',
588
- 'mollie',
589
- 'quickbooks',
590
- 'razorpay',
591
- 'global_payments',
592
- 'bank_of_america',
593
- 'ecentric',
594
- 'metrics_global',
595
- 'windcave',
596
- 'pay_com',
597
- 'ebanx',
598
- 'dlocal',
599
- 'nuvei',
600
- 'solidgate',
601
- 'paystack',
602
- 'jp_morgan',
603
- 'deutsche_bank',
604
- 'ezidebit',
605
- 'twikey',
606
- 'tempus',
607
- 'moyasar',
608
- 'payway',
609
- ])
610
- .optional(),
611
- gateway_account_id: z.string().max(50).optional(),
612
- reference_id: z.string().max(200).optional(),
613
- tmp_token: z.string().max(65000).optional(),
614
- issuing_country: z.string().max(50).optional(),
615
- additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
616
- });
617
- const CreateForChargeItemsAndChargesInvoicePaymentIntentSchema = z.object({
618
- id: z.string().max(150).optional(),
619
- gateway_account_id: z.string().max(50).optional(),
620
- gw_token: z.string().max(65000).optional(),
621
- payment_method_type: z
622
- .enum([
623
- 'card',
624
- 'ideal',
625
- 'sofort',
626
- 'bancontact',
627
- 'google_pay',
628
- 'dotpay',
629
- 'giropay',
630
- 'apple_pay',
631
- 'upi',
632
- 'netbanking_emandates',
633
- 'paypal_express_checkout',
634
- 'direct_debit',
635
- 'boleto',
636
- 'venmo',
637
- 'amazon_payments',
638
- 'pay_to',
639
- 'faster_payments',
640
- 'sepa_instant_transfer',
641
- 'klarna_pay_now',
642
- 'online_banking_poland',
643
- 'payconiq_by_bancontact',
644
- 'electronic_payment_standard',
645
- 'kbc_payment_button',
646
- 'pay_by_bank',
647
- 'trustly',
648
- 'stablecoin',
649
- 'kakao_pay',
650
- 'naver_pay',
651
- 'revolut_pay',
652
- 'cash_app_pay',
653
- 'wechat_pay',
654
- 'alipay',
655
- 'pix',
656
- 'twint',
657
- 'go_pay',
658
- 'grab_pay',
659
- 'pay_co',
660
- 'after_pay',
661
- 'swish',
662
- 'payme',
663
- ])
664
- .optional(),
665
- reference_id: z.string().max(65000).optional(),
666
- gw_payment_method_id: z.string().max(65000).optional(),
667
- additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
668
- });
669
- const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = z.object({
670
- item_price_id: z.array(z.string().max(100).optional()).optional(),
671
- quantity: z.array(z.number().int().min(1).optional()).optional(),
672
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
673
- unit_price: z.array(z.number().int().min(0).optional()).optional(),
674
- unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
675
- date_from: z.array(z.number().int().optional()).optional(),
676
- date_to: z.array(z.number().int().optional()).optional(),
677
- });
678
- const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({
679
- item_price_id: z.array(z.string().max(100).optional()).optional(),
680
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
681
- ending_unit: z.array(z.number().int().optional()).optional(),
682
- price: z.array(z.number().int().min(0).optional()).optional(),
683
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
684
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
685
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
686
- pricing_type: z
687
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
688
- .optional(),
689
- package_size: z.array(z.number().int().min(1).optional()).optional(),
690
- });
691
- const CreateForChargeItemsAndChargesInvoiceChargesSchema = z.object({
692
- amount: z.array(z.number().int().min(1).optional()).optional(),
693
- amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
694
- description: z.array(z.string().max(250).optional()).optional(),
695
- taxable: z.array(z.boolean().default(true).optional()).optional(),
696
- tax_profile_id: z.array(z.string().max(50).optional()).optional(),
697
- avalara_tax_code: z.array(z.string().max(50).optional()).optional(),
698
- hsn_code: z.array(z.string().max(50).optional()).optional(),
699
- taxjar_product_code: z.array(z.string().max(50).optional()).optional(),
700
- avalara_sale_type: z
701
- .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
702
- .optional(),
703
- avalara_transaction_type: z.array(z.number().int().optional()).optional(),
704
- avalara_service_type: z.array(z.number().int().optional()).optional(),
705
- date_from: z.array(z.number().int().optional()).optional(),
706
- date_to: z.array(z.number().int().optional()).optional(),
707
- });
708
- const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = z.object({
709
- entity_type: z
710
- .array(z
711
- .enum([
712
- 'customer',
713
- 'subscription',
714
- 'coupon',
715
- 'plan_item_price',
716
- 'addon_item_price',
717
- 'charge_item_price',
718
- ])
719
- .optional())
720
- .optional(),
721
- entity_id: z.array(z.string().max(100).optional()).optional(),
722
- });
723
- const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema = z.object({
724
- provider_name: z.array(z.string().max(50).optional()).optional(),
725
- field_id: z.array(z.string().max(50).optional()).optional(),
726
- field_value: z.array(z.string().max(50).optional()).optional(),
727
- });
728
- const CreateForChargeItemsAndChargesInvoiceDiscountsSchema = z.object({
729
- percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
730
- amount: z.array(z.number().int().min(0).optional()).optional(),
731
- quantity: z.array(z.number().int().min(1).optional()).optional(),
732
- apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
733
- item_price_id: z.array(z.string().max(100).optional()).optional(),
734
- });
735
- const CreateForChargeItemsAndChargesInvoiceBodySchema = z.looseObject({
736
- customer_id: z.string().max(50).optional(),
737
- subscription_id: z.string().max(50).optional(),
738
- currency_code: z.string().max(3).optional(),
739
- invoice_note: z.string().max(2000).optional(),
740
- remove_general_note: z.boolean().default(false).optional(),
741
- po_number: z.string().max(100).optional(),
742
- coupon: z.string().max(100).optional(),
743
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
744
- authorization_transaction_id: z.string().max(40).optional(),
745
- payment_source_id: z.string().max(40).optional(),
746
- auto_collection: z.enum(['on', 'off']).optional(),
747
- net_term_days: z.number().int().optional(),
748
- invoice_date: z.number().int().optional(),
749
- token_id: z.string().max(40).optional(),
750
- replace_primary_payment_source: z.boolean().default(false).optional(),
751
- retain_payment_source: z.boolean().default(true).optional(),
752
- payment_initiator: z.enum(['customer', 'merchant']).optional(),
753
- shipping_address: CreateForChargeItemsAndChargesInvoiceShippingAddressSchema.optional(),
754
- statement_descriptor: CreateForChargeItemsAndChargesInvoiceStatementDescriptorSchema.optional(),
755
- card: CreateForChargeItemsAndChargesInvoiceCardSchema.optional(),
756
- bank_account: CreateForChargeItemsAndChargesInvoiceBankAccountSchema.optional(),
757
- payment_method: CreateForChargeItemsAndChargesInvoicePaymentMethodSchema.optional(),
758
- payment_intent: CreateForChargeItemsAndChargesInvoicePaymentIntentSchema.optional(),
759
- item_prices: CreateForChargeItemsAndChargesInvoiceItemPricesSchema.optional(),
760
- item_tiers: CreateForChargeItemsAndChargesInvoiceItemTiersSchema.optional(),
761
- charges: CreateForChargeItemsAndChargesInvoiceChargesSchema.optional(),
762
- notes_to_remove: CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema.optional(),
763
- tax_providers_fields: CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema.optional(),
764
- discounts: CreateForChargeItemsAndChargesInvoiceDiscountsSchema.optional(),
765
- });
766
- export { CreateForChargeItemsAndChargesInvoiceBodySchema };
767
- //Invoice.charge
768
- const ChargeInvoiceTaxProvidersFieldsSchema = z.object({
769
- provider_name: z.array(z.string().max(50).optional()).optional(),
770
- field_id: z.array(z.string().max(50).optional()).optional(),
771
- field_value: z.array(z.string().max(50).optional()).optional(),
772
- });
773
- const ChargeInvoiceBodySchema = z.looseObject({
774
- customer_id: z.string().max(50).optional(),
775
- subscription_id: z.string().max(50).optional(),
776
- currency_code: z.string().max(3).optional(),
777
- amount: z.number().int().min(1).optional(),
778
- amount_in_decimal: z.string().max(39).optional(),
779
- description: z.string().max(250),
780
- date_from: z.number().int().optional(),
781
- date_to: z.number().int().optional(),
782
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
783
- coupon: z.string().max(100).optional(),
784
- avalara_sale_type: z
785
- .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
786
- .optional(),
787
- avalara_transaction_type: z.number().int().optional(),
788
- avalara_service_type: z.number().int().optional(),
789
- po_number: z.string().max(100).optional(),
790
- invoice_date: z.number().int().optional(),
791
- payment_source_id: z.string().max(40).optional(),
792
- payment_initiator: z.enum(['customer', 'merchant']).optional(),
793
- tax_providers_fields: ChargeInvoiceTaxProvidersFieldsSchema.optional(),
794
- });
795
- export { ChargeInvoiceBodySchema };
796
- //Invoice.chargeAddon
797
- const ChargeAddonInvoiceBodySchema = z.looseObject({
798
- customer_id: z.string().max(50).optional(),
799
- subscription_id: z.string().max(50).optional(),
800
- addon_id: z.string().max(100),
801
- addon_quantity: z.number().int().min(1).optional(),
802
- addon_unit_price: z.number().int().min(0).optional(),
803
- addon_quantity_in_decimal: z.string().max(33).optional(),
804
- addon_unit_price_in_decimal: z.string().max(39).optional(),
805
- date_from: z.number().int().optional(),
806
- date_to: z.number().int().optional(),
807
- coupon_ids: z.array(z.string().max(100).optional()).optional(),
808
- coupon: z.string().max(100).optional(),
809
- po_number: z.string().max(100).optional(),
810
- invoice_date: z.number().int().optional(),
811
- payment_source_id: z.string().max(40).optional(),
812
- payment_initiator: z.enum(['customer', 'merchant']).optional(),
813
- });
814
- export { ChargeAddonInvoiceBodySchema };
815
- //Invoice.createForChargeItem
816
- const CreateForChargeItemInvoiceItemPriceSchema = z.object({
817
- item_price_id: z.string().max(100),
818
- quantity: z.number().int().min(1).optional(),
819
- quantity_in_decimal: z.string().max(33).optional(),
820
- unit_price: z.number().int().min(0).optional(),
821
- unit_price_in_decimal: z.string().max(39).optional(),
822
- date_from: z.number().int().optional(),
823
- date_to: z.number().int().optional(),
824
- });
825
- const CreateForChargeItemInvoiceItemTiersSchema = z.object({
826
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
827
- ending_unit: z.array(z.number().int().optional()).optional(),
828
- price: z.array(z.number().int().min(0).optional()).optional(),
829
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
830
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
831
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
832
- pricing_type: z
833
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
834
- .optional(),
835
- package_size: z.array(z.number().int().min(1).optional()).optional(),
836
- });
837
- const CreateForChargeItemInvoiceBodySchema = z.looseObject({
838
- customer_id: z.string().max(50).optional(),
839
- subscription_id: z.string().max(50).optional(),
840
- po_number: z.string().max(100).optional(),
841
- coupon: z.string().max(100).optional(),
842
- payment_source_id: z.string().max(40).optional(),
843
- payment_initiator: z.enum(['customer', 'merchant']).optional(),
844
- invoice_date: z.number().int().optional(),
845
- item_price: CreateForChargeItemInvoiceItemPriceSchema.optional(),
846
- item_tiers: CreateForChargeItemInvoiceItemTiersSchema.optional(),
847
- });
848
- export { CreateForChargeItemInvoiceBodySchema };
849
- //Invoice.stopDunning
850
- const StopDunningInvoiceBodySchema = z.looseObject({
851
- comment: z.string().max(300).optional(),
852
- });
853
- export { StopDunningInvoiceBodySchema };
854
- //Invoice.pauseDunning
855
- const PauseDunningInvoiceBodySchema = z.looseObject({
856
- expected_payment_date: z.number().int(),
857
- comment: z.string().max(300).optional(),
858
- });
859
- export { PauseDunningInvoiceBodySchema };
860
- //Invoice.resumeDunning
861
- const ResumeDunningInvoiceBodySchema = z.looseObject({
862
- comment: z.string().max(300).optional(),
863
- });
864
- export { ResumeDunningInvoiceBodySchema };
865
- //Invoice.importInvoice
866
- const ImportInvoiceInvoiceCreditNoteSchema = z.object({
867
- id: z.string().max(50).optional(),
868
- });
869
- const ImportInvoiceInvoiceBillingAddressSchema = z.object({
870
- first_name: z.string().max(150).optional(),
871
- last_name: z.string().max(150).optional(),
872
- email: z.string().email().max(70).optional(),
873
- company: z.string().max(250).optional(),
874
- phone: z.string().max(50).optional(),
875
- line1: z.string().max(150).optional(),
876
- line2: z.string().max(150).optional(),
877
- line3: z.string().max(150).optional(),
878
- city: z.string().max(50).optional(),
879
- state_code: z.string().max(50).optional(),
880
- state: z.string().max(50).optional(),
881
- zip: z.string().max(20).optional(),
882
- country: z.string().max(50).optional(),
883
- validation_status: z
884
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
885
- .optional(),
886
- });
887
- const ImportInvoiceInvoiceShippingAddressSchema = z.object({
888
- first_name: z.string().max(150).optional(),
889
- last_name: z.string().max(150).optional(),
890
- email: z.string().email().max(70).optional(),
891
- company: z.string().max(250).optional(),
892
- phone: z.string().max(50).optional(),
893
- line1: z.string().max(150).optional(),
894
- line2: z.string().max(150).optional(),
895
- line3: z.string().max(150).optional(),
896
- city: z.string().max(50).optional(),
897
- state_code: z.string().max(50).optional(),
898
- state: z.string().max(50).optional(),
899
- zip: z.string().max(20).optional(),
900
- country: z.string().max(50).optional(),
901
- validation_status: z
902
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
903
- .optional(),
904
- });
905
- const ImportInvoiceInvoiceLineItemsSchema = z.object({
906
- id: z.array(z.string().max(40).optional()).optional(),
907
- date_from: z.array(z.number().int().optional()).optional(),
908
- date_to: z.array(z.number().int().optional()).optional(),
909
- subscription_id: z.array(z.string().max(50).optional()).optional(),
910
- description: z.array(z.string().max(250).optional()),
911
- unit_amount: z.array(z.number().int().optional()).optional(),
912
- quantity: z.array(z.number().int().optional()).optional(),
913
- amount: z.array(z.number().int().optional()).optional(),
914
- unit_amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
915
- quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
916
- amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
917
- entity_type: z
918
- .array(z
919
- .enum([
920
- 'adhoc',
921
- 'plan_item_price',
922
- 'addon_item_price',
923
- 'charge_item_price',
924
- 'plan_setup',
925
- 'plan',
926
- 'addon',
927
- ])
928
- .optional())
929
- .optional(),
930
- entity_id: z.array(z.string().max(100).optional()).optional(),
931
- item_level_discount1_entity_id: z
932
- .array(z.string().max(100).optional())
933
- .optional(),
934
- item_level_discount1_amount: z
935
- .array(z.number().int().min(0).optional())
936
- .optional(),
937
- item_level_discount2_entity_id: z
938
- .array(z.string().max(100).optional())
939
- .optional(),
940
- item_level_discount2_amount: z
941
- .array(z.number().int().min(0).optional())
942
- .optional(),
943
- tax1_name: z.array(z.string().max(50).optional()).optional(),
944
- tax1_amount: z.array(z.number().int().min(0).optional()).optional(),
945
- tax2_name: z.array(z.string().max(50).optional()).optional(),
946
- tax2_amount: z.array(z.number().int().min(0).optional()).optional(),
947
- tax3_name: z.array(z.string().max(50).optional()).optional(),
948
- tax3_amount: z.array(z.number().int().min(0).optional()).optional(),
949
- tax4_name: z.array(z.string().max(50).optional()).optional(),
950
- tax4_amount: z.array(z.number().int().min(0).optional()).optional(),
951
- tax5_name: z.array(z.string().max(50).optional()).optional(),
952
- tax5_amount: z.array(z.number().int().min(0).optional()).optional(),
953
- tax6_name: z.array(z.string().max(50).optional()).optional(),
954
- tax6_amount: z.array(z.number().int().min(0).optional()).optional(),
955
- tax7_name: z.array(z.string().max(50).optional()).optional(),
956
- tax7_amount: z.array(z.number().int().min(0).optional()).optional(),
957
- tax8_name: z.array(z.string().max(50).optional()).optional(),
958
- tax8_amount: z.array(z.number().int().min(0).optional()).optional(),
959
- tax9_name: z.array(z.string().max(50).optional()).optional(),
960
- tax9_amount: z.array(z.number().int().min(0).optional()).optional(),
961
- tax10_name: z.array(z.string().max(50).optional()).optional(),
962
- tax10_amount: z.array(z.number().int().min(0).optional()).optional(),
963
- created_at: z.array(z.number().int().optional()).optional(),
964
- });
965
- const ImportInvoiceInvoicePaymentReferenceNumbersSchema = z.object({
966
- id: z.array(z.string().max(40).optional()).optional(),
967
- type: z.array(z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']).optional()),
968
- number: z.array(z.string().max(100).optional()),
969
- });
970
- const ImportInvoiceInvoiceLineItemTiersSchema = z.object({
971
- line_item_id: z.array(z.string().max(40).optional()),
972
- starting_unit: z.array(z.number().int().min(0).optional()).optional(),
973
- ending_unit: z.array(z.number().int().optional()).optional(),
974
- quantity_used: z.array(z.number().int().min(0).optional()).optional(),
975
- unit_amount: z.array(z.number().int().min(0).optional()).optional(),
976
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
977
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
978
- quantity_used_in_decimal: z.array(z.string().max(33).optional()).optional(),
979
- unit_amount_in_decimal: z.array(z.string().max(40).optional()).optional(),
980
- });
981
- const ImportInvoiceInvoiceDiscountsSchema = z.object({
982
- line_item_id: z.array(z.string().max(40).optional()).optional(),
983
- entity_type: z.array(z
984
- .enum([
985
- 'item_level_coupon',
986
- 'document_level_coupon',
987
- 'promotional_credits',
988
- 'item_level_discount',
989
- 'document_level_discount',
990
- ])
991
- .optional()),
992
- entity_id: z.array(z.string().max(100).optional()).optional(),
993
- description: z.array(z.string().max(250).optional()).optional(),
994
- amount: z.array(z.number().int().min(0).optional()),
995
- });
996
- const ImportInvoiceInvoiceTaxesSchema = z.object({
997
- name: z.array(z.string().max(100).optional()),
998
- rate: z.array(z.number().min(0).max(100).optional()),
999
- amount: z.array(z.number().int().min(0).optional()).optional(),
1000
- description: z.array(z.string().max(50).optional()).optional(),
1001
- juris_type: z
1002
- .array(z
1003
- .enum([
1004
- 'country',
1005
- 'federal',
1006
- 'state',
1007
- 'county',
1008
- 'city',
1009
- 'special',
1010
- 'unincorporated',
1011
- 'other',
1012
- ])
1013
- .optional())
1014
- .optional(),
1015
- juris_name: z.array(z.string().max(250).optional()).optional(),
1016
- juris_code: z.array(z.string().max(250).optional()).optional(),
1017
- });
1018
- const ImportInvoiceInvoicePaymentsSchema = z.object({
1019
- id: z.array(z.string().max(40).optional()).optional(),
1020
- amount: z.array(z.number().int().min(1).optional()),
1021
- payment_method: z.array(z
1022
- .enum([
1023
- 'cash',
1024
- 'check',
1025
- 'bank_transfer',
1026
- 'other',
1027
- 'app_store',
1028
- 'play_store',
1029
- 'custom',
1030
- ])
1031
- .optional()),
1032
- date: z.array(z.number().int().optional()).optional(),
1033
- reference_number: z.array(z.string().max(100).min(1).optional()).optional(),
1034
- });
1035
- const ImportInvoiceInvoiceNotesSchema = z.object({
1036
- entity_type: z
1037
- .array(z
1038
- .enum([
1039
- 'coupon',
1040
- 'plan_item_price',
1041
- 'addon_item_price',
1042
- 'charge_item_price',
1043
- 'plan',
1044
- 'addon',
1045
- ])
1046
- .optional())
1047
- .optional(),
1048
- entity_id: z.array(z.string().max(50).optional()).optional(),
1049
- note: z.array(z.string().max(65000).optional()).optional(),
1050
- });
1051
- const ImportInvoiceInvoiceLineItemAddressesSchema = z.object({
1052
- line_item_id: z.array(z.string().max(40).optional()).optional(),
1053
- first_name: z.array(z.string().max(150).optional()).optional(),
1054
- last_name: z.array(z.string().max(150).optional()).optional(),
1055
- email: z.array(z.string().email().max(70).optional()).optional(),
1056
- company: z.array(z.string().max(250).optional()).optional(),
1057
- phone: z.array(z.string().max(50).optional()).optional(),
1058
- line1: z.array(z.string().max(150).optional()).optional(),
1059
- line2: z.array(z.string().max(150).optional()).optional(),
1060
- line3: z.array(z.string().max(150).optional()).optional(),
1061
- city: z.array(z.string().max(50).optional()).optional(),
1062
- state_code: z.array(z.string().max(50).optional()).optional(),
1063
- state: z.array(z.string().max(50).optional()).optional(),
1064
- zip: z.array(z.string().max(20).optional()).optional(),
1065
- country: z.array(z.string().max(50).optional()).optional(),
1066
- validation_status: z
1067
- .array(z
1068
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1069
- .optional())
1070
- .optional(),
1071
- });
1072
- const ImportInvoiceInvoiceBodySchema = z.looseObject({
1073
- id: z.string().max(50),
1074
- currency_code: z.string().max(3).optional(),
1075
- customer_id: z.string().max(50).optional(),
1076
- subscription_id: z.string().max(50).optional(),
1077
- po_number: z.string().max(100).optional(),
1078
- price_type: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1079
- tax_override_reason: z
1080
- .enum(['id_exempt', 'customer_exempt', 'export'])
1081
- .optional(),
1082
- vat_number: z.string().max(20).optional(),
1083
- vat_number_prefix: z.string().max(10).optional(),
1084
- date: z.number().int(),
1085
- total: z.number().int().min(0),
1086
- round_off: z.number().int().min(-99).max(99).optional(),
1087
- status: z
1088
- .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1089
- .optional(),
1090
- voided_at: z.number().int().optional(),
1091
- void_reason_code: z.string().max(100).optional(),
1092
- is_written_off: z.boolean().default(false).optional(),
1093
- write_off_amount: z.number().int().min(0).optional(),
1094
- write_off_date: z.number().int().optional(),
1095
- due_date: z.number().int().optional(),
1096
- net_term_days: z.number().int().optional(),
1097
- has_advance_charges: z.boolean().default(false).optional(),
1098
- use_for_proration: z.boolean().default(false).optional(),
1099
- credit_note: ImportInvoiceInvoiceCreditNoteSchema.optional(),
1100
- billing_address: ImportInvoiceInvoiceBillingAddressSchema.optional(),
1101
- shipping_address: ImportInvoiceInvoiceShippingAddressSchema.optional(),
1102
- line_items: ImportInvoiceInvoiceLineItemsSchema.optional(),
1103
- payment_reference_numbers: ImportInvoiceInvoicePaymentReferenceNumbersSchema.optional(),
1104
- line_item_tiers: ImportInvoiceInvoiceLineItemTiersSchema.optional(),
1105
- discounts: ImportInvoiceInvoiceDiscountsSchema.optional(),
1106
- taxes: ImportInvoiceInvoiceTaxesSchema.optional(),
1107
- payments: ImportInvoiceInvoicePaymentsSchema.optional(),
1108
- notes: ImportInvoiceInvoiceNotesSchema.optional(),
1109
- line_item_addresses: ImportInvoiceInvoiceLineItemAddressesSchema.optional(),
1110
- });
1111
- export { ImportInvoiceInvoiceBodySchema };
1112
- //Invoice.applyPayments
1113
- const ApplyPaymentsInvoiceTransactionsSchema = z.object({
1114
- id: z.array(z.string().max(40).optional()).optional(),
1115
- amount: z.array(z.number().int().min(0).optional()).optional(),
1116
- });
1117
- const ApplyPaymentsInvoiceBodySchema = z.looseObject({
1118
- comment: z.string().max(300).optional(),
1119
- transactions: ApplyPaymentsInvoiceTransactionsSchema.optional(),
1120
- });
1121
- export { ApplyPaymentsInvoiceBodySchema };
1122
- //Invoice.deleteLineItems
1123
- const DeleteLineItemsInvoiceLineItemsSchema = z.object({
1124
- id: z.array(z.string().max(40).optional()).optional(),
1125
- });
1126
- const DeleteLineItemsInvoiceBodySchema = z.looseObject({
1127
- line_items: DeleteLineItemsInvoiceLineItemsSchema.optional(),
1128
- });
1129
- export { DeleteLineItemsInvoiceBodySchema };
1130
- //Invoice.applyCredits
1131
- const ApplyCreditsInvoiceCreditNotesSchema = z.object({
1132
- id: z.array(z.string().max(50).optional()).optional(),
1133
- });
1134
- const ApplyCreditsInvoiceBodySchema = z.looseObject({
1135
- comment: z.string().max(300).optional(),
1136
- credit_notes: ApplyCreditsInvoiceCreditNotesSchema.optional(),
1137
- });
1138
- export { ApplyCreditsInvoiceBodySchema };
1139
- //Invoice.invoicesForCustomer
1140
- const InvoicesForCustomerInvoiceBodySchema = z.looseObject({
1141
- limit: z.number().int().min(1).max(100).optional(),
1142
- offset: z.string().max(1000).optional(),
1143
- });
1144
- export { InvoicesForCustomerInvoiceBodySchema };
1145
- //Invoice.invoicesForSubscription
1146
- const InvoicesForSubscriptionInvoiceBodySchema = z.looseObject({
1147
- limit: z.number().int().min(1).max(100).optional(),
1148
- offset: z.string().max(1000).optional(),
1149
- });
1150
- export { InvoicesForSubscriptionInvoiceBodySchema };
1151
- //Invoice.retrieve
1152
- const RetrieveInvoiceSubscriptionIdSchema = z.object({
1153
- is: z.string().min(1).optional(),
1154
- });
1155
- const RetrieveInvoiceCustomerIdSchema = z.object({
1156
- is: z.string().min(1).optional(),
1157
- });
1158
- const RetrieveInvoiceLineItemSchema = z.object({
1159
- subscription_id: RetrieveInvoiceSubscriptionIdSchema.optional(),
1160
- customer_id: RetrieveInvoiceCustomerIdSchema.optional(),
1161
- });
1162
- const RetrieveInvoiceBodySchema = z.looseObject({
1163
- line_items_limit: z.number().int().min(1).max(300).optional(),
1164
- line_items_offset: z.string().max(1000).optional(),
1165
- line_item: RetrieveInvoiceLineItemSchema.optional(),
1166
- });
1167
- export { RetrieveInvoiceBodySchema };
1168
- //Invoice.pdf
1169
- const PdfInvoiceBodySchema = z.looseObject({
1170
- disposition_type: z.enum(['attachment', 'inline']).optional(),
1171
- });
1172
- export { PdfInvoiceBodySchema };
1173
- //Invoice.addCharge
1174
- const AddChargeInvoiceLineItemSchema = z.object({
1175
- date_from: z.number().int().optional(),
1176
- date_to: z.number().int().optional(),
1177
- });
1178
- const AddChargeInvoiceBodySchema = z.looseObject({
1179
- amount: z.number().int().min(1),
1180
- description: z.string().max(250),
1181
- avalara_sale_type: z
1182
- .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
1183
- .optional(),
1184
- avalara_transaction_type: z.number().int().optional(),
1185
- avalara_service_type: z.number().int().optional(),
1186
- avalara_tax_code: z.string().max(50).optional(),
1187
- hsn_code: z.string().max(50).optional(),
1188
- taxjar_product_code: z.string().max(50).optional(),
1189
- comment: z.string().max(300).optional(),
1190
- subscription_id: z.string().max(50).optional(),
1191
- line_item: AddChargeInvoiceLineItemSchema.optional(),
1192
- });
1193
- export { AddChargeInvoiceBodySchema };
1194
- //Invoice.addAddonCharge
1195
- const AddAddonChargeInvoiceLineItemSchema = z.object({
1196
- date_from: z.number().int().optional(),
1197
- date_to: z.number().int().optional(),
1198
- });
1199
- const AddAddonChargeInvoiceBodySchema = z.looseObject({
1200
- addon_id: z.string().max(100),
1201
- addon_quantity: z.number().int().min(1).optional(),
1202
- addon_unit_price: z.number().int().min(0).optional(),
1203
- addon_quantity_in_decimal: z.string().max(33).optional(),
1204
- addon_unit_price_in_decimal: z.string().max(39).optional(),
1205
- comment: z.string().max(300).optional(),
1206
- subscription_id: z.string().max(50).optional(),
1207
- line_item: AddAddonChargeInvoiceLineItemSchema.optional(),
1208
- });
1209
- export { AddAddonChargeInvoiceBodySchema };
1210
- //Invoice.addChargeItem
1211
- const AddChargeItemInvoiceItemPriceSchema = z.object({
1212
- item_price_id: z.string().max(100),
1213
- quantity: z.number().int().min(1).optional(),
1214
- quantity_in_decimal: z.string().max(33).optional(),
1215
- unit_price: z.number().int().min(0).optional(),
1216
- unit_price_in_decimal: z.string().max(39).optional(),
1217
- date_from: z.number().int().optional(),
1218
- date_to: z.number().int().optional(),
1219
- });
1220
- const AddChargeItemInvoiceItemTiersSchema = z.object({
1221
- starting_unit: z.array(z.number().int().min(1).optional()).optional(),
1222
- ending_unit: z.array(z.number().int().optional()).optional(),
1223
- price: z.array(z.number().int().min(0).optional()).optional(),
1224
- starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1225
- ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1226
- price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1227
- pricing_type: z
1228
- .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
1229
- .optional(),
1230
- package_size: z.array(z.number().int().min(1).optional()).optional(),
1231
- });
1232
- const AddChargeItemInvoiceBodySchema = z.looseObject({
1233
- comment: z.string().max(300).optional(),
1234
- subscription_id: z.string().max(50).optional(),
1235
- item_price: AddChargeItemInvoiceItemPriceSchema.optional(),
1236
- item_tiers: AddChargeItemInvoiceItemTiersSchema.optional(),
1237
- });
1238
- export { AddChargeItemInvoiceBodySchema };
1239
- //Invoice.close
1240
- const CloseInvoiceNotesToRemoveSchema = z.object({
1241
- entity_type: z
1242
- .array(z
1243
- .enum([
1244
- 'customer',
1245
- 'subscription',
1246
- 'coupon',
1247
- 'plan_item_price',
1248
- 'addon_item_price',
1249
- 'charge_item_price',
1250
- 'plan',
1251
- 'addon',
1252
- ])
1253
- .optional())
1254
- .optional(),
1255
- entity_id: z.array(z.string().max(100).optional()).optional(),
1256
- });
1257
- const CloseInvoiceBodySchema = z.looseObject({
1258
- comment: z.string().max(300).optional(),
1259
- invoice_note: z.string().max(2000).optional(),
1260
- remove_general_note: z.boolean().default(false).optional(),
1261
- invoice_date: z.number().int().optional(),
1262
- notes_to_remove: CloseInvoiceNotesToRemoveSchema.optional(),
1263
- });
1264
- export { CloseInvoiceBodySchema };
1265
- //Invoice.collectPayment
1266
- const CollectPaymentInvoiceBodySchema = z.looseObject({
1267
- amount: z.number().int().min(1).optional(),
1268
- authorization_transaction_id: z.string().max(40).optional(),
1269
- payment_source_id: z.string().max(40).optional(),
1270
- comment: z.string().max(300).optional(),
1271
- payment_initiator: z.enum(['customer', 'merchant']).optional(),
1272
- });
1273
- export { CollectPaymentInvoiceBodySchema };
1274
- //Invoice.recordPayment
1275
- const RecordPaymentInvoiceTransactionSchema = z.object({
1276
- amount: z.number().int().min(0).optional(),
1277
- payment_method: z.enum([
1278
- 'cash',
1279
- 'check',
1280
- 'bank_transfer',
1281
- 'other',
1282
- 'app_store',
1283
- 'play_store',
1284
- 'custom',
1285
- ]),
1286
- reference_number: z.string().max(100).optional(),
1287
- custom_payment_method_id: z.string().max(50).optional(),
1288
- id_at_gateway: z.string().max(100).optional(),
1289
- status: z.enum(['success', 'failure', 'late_failure']).optional(),
1290
- date: z.number().int().optional(),
1291
- error_code: z.string().max(100).optional(),
1292
- error_text: z.string().max(65000).optional(),
1293
- });
1294
- const RecordPaymentInvoiceBodySchema = z.looseObject({
1295
- comment: z.string().max(300).optional(),
1296
- transaction: RecordPaymentInvoiceTransactionSchema.optional(),
1297
- });
1298
- export { RecordPaymentInvoiceBodySchema };
1299
- //Invoice.recordTaxWithheld
1300
- const RecordTaxWithheldInvoiceTaxWithheldSchema = z.object({
1301
- amount: z.number().int().min(1),
1302
- reference_number: z.string().max(100).optional(),
1303
- date: z.number().int().optional(),
1304
- description: z.string().max(65000).optional(),
1305
- });
1306
- const RecordTaxWithheldInvoiceBodySchema = z.looseObject({
1307
- tax_withheld: RecordTaxWithheldInvoiceTaxWithheldSchema.optional(),
1308
- });
1309
- export { RecordTaxWithheldInvoiceBodySchema };
1310
- //Invoice.removeTaxWithheld
1311
- const RemoveTaxWithheldInvoiceTaxWithheldSchema = z.object({
1312
- id: z.string().max(40),
1313
- });
1314
- const RemoveTaxWithheldInvoiceBodySchema = z.looseObject({
1315
- tax_withheld: RemoveTaxWithheldInvoiceTaxWithheldSchema.optional(),
1316
- });
1317
- export { RemoveTaxWithheldInvoiceBodySchema };
1318
- //Invoice.refund
1319
- const RefundInvoiceCreditNoteSchema = z.object({
1320
- reason_code: z
1321
- .enum([
1322
- 'product_unsatisfactory',
1323
- 'service_unsatisfactory',
1324
- 'order_change',
1325
- 'order_cancellation',
1326
- 'waiver',
1327
- 'other',
1328
- ])
1329
- .optional(),
1330
- create_reason_code: z.string().max(100).optional(),
1331
- });
1332
- const RefundInvoiceBodySchema = z.looseObject({
1333
- refund_amount: z.number().int().min(1).optional(),
1334
- comment: z.string().max(300).optional(),
1335
- customer_notes: z.string().max(2000).optional(),
1336
- credit_note: RefundInvoiceCreditNoteSchema.optional(),
1337
- });
1338
- export { RefundInvoiceBodySchema };
1339
- //Invoice.recordRefund
1340
- const RecordRefundInvoiceTransactionSchema = z.object({
1341
- amount: z.number().int().min(0).optional(),
1342
- payment_method: z.enum([
1343
- 'cash',
1344
- 'check',
1345
- 'chargeback',
1346
- 'bank_transfer',
1347
- 'other',
1348
- 'app_store',
1349
- 'play_store',
1350
- 'custom',
1351
- ]),
1352
- reference_number: z.string().max(100).optional(),
1353
- custom_payment_method_id: z.string().max(50).optional(),
1354
- date: z.number().int(),
1355
- });
1356
- const RecordRefundInvoiceCreditNoteSchema = z.object({
1357
- reason_code: z
1358
- .enum([
1359
- 'chargeback',
1360
- 'product_unsatisfactory',
1361
- 'service_unsatisfactory',
1362
- 'order_change',
1363
- 'order_cancellation',
1364
- 'waiver',
1365
- 'other',
1366
- ])
1367
- .optional(),
1368
- create_reason_code: z.string().max(100).optional(),
1369
- });
1370
- const RecordRefundInvoiceBodySchema = z.looseObject({
1371
- comment: z.string().max(65000).optional(),
1372
- customer_notes: z.string().max(2000).optional(),
1373
- transaction: RecordRefundInvoiceTransactionSchema.optional(),
1374
- credit_note: RecordRefundInvoiceCreditNoteSchema.optional(),
1375
- });
1376
- export { RecordRefundInvoiceBodySchema };
1377
- //Invoice.removePayment
1378
- const RemovePaymentInvoiceTransactionSchema = z.object({
1379
- id: z.string().max(40),
1380
- });
1381
- const RemovePaymentInvoiceBodySchema = z.looseObject({
1382
- transaction: RemovePaymentInvoiceTransactionSchema.optional(),
1383
- });
1384
- export { RemovePaymentInvoiceBodySchema };
1385
- //Invoice.removeCreditNote
1386
- const RemoveCreditNoteInvoiceCreditNoteSchema = z.object({
1387
- id: z.string().max(50),
1388
- });
1389
- const RemoveCreditNoteInvoiceBodySchema = z.looseObject({
1390
- credit_note: RemoveCreditNoteInvoiceCreditNoteSchema.optional(),
1391
- });
1392
- export { RemoveCreditNoteInvoiceBodySchema };
1393
- //Invoice.voidInvoice
1394
- const VoidInvoiceInvoiceBodySchema = z.looseObject({
1395
- comment: z.string().max(300).optional(),
1396
- void_reason_code: z.string().max(100).optional(),
1397
- });
1398
- export { VoidInvoiceInvoiceBodySchema };
1399
- //Invoice.writeOff
1400
- const WriteOffInvoiceBodySchema = z.looseObject({
1401
- comment: z.string().max(300).optional(),
1402
- });
1403
- export { WriteOffInvoiceBodySchema };
1404
- //Invoice.delete
1405
- const DeleteInvoiceBodySchema = z.looseObject({
1406
- comment: z.string().max(300).optional(),
1407
- });
1408
- export { DeleteInvoiceBodySchema };
1409
- //Invoice.updateDetails
1410
- const UpdateDetailsInvoiceBillingAddressSchema = z.object({
1411
- first_name: z.string().max(150).optional(),
1412
- last_name: z.string().max(150).optional(),
1413
- email: z.string().email().max(70).optional(),
1414
- company: z.string().max(250).optional(),
1415
- phone: z.string().max(50).optional(),
1416
- line1: z.string().max(150).optional(),
1417
- line2: z.string().max(150).optional(),
1418
- line3: z.string().max(150).optional(),
1419
- city: z.string().max(50).optional(),
1420
- state_code: z.string().max(50).optional(),
1421
- state: z.string().max(50).optional(),
1422
- zip: z.string().max(20).optional(),
1423
- country: z.string().max(50).optional(),
1424
- validation_status: z
1425
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1426
- .optional(),
1427
- });
1428
- const UpdateDetailsInvoiceShippingAddressSchema = z.object({
1429
- first_name: z.string().max(150).optional(),
1430
- last_name: z.string().max(150).optional(),
1431
- email: z.string().email().max(70).optional(),
1432
- company: z.string().max(250).optional(),
1433
- phone: z.string().max(50).optional(),
1434
- line1: z.string().max(150).optional(),
1435
- line2: z.string().max(150).optional(),
1436
- line3: z.string().max(150).optional(),
1437
- city: z.string().max(50).optional(),
1438
- state_code: z.string().max(50).optional(),
1439
- state: z.string().max(50).optional(),
1440
- zip: z.string().max(20).optional(),
1441
- country: z.string().max(50).optional(),
1442
- validation_status: z
1443
- .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1444
- .optional(),
1445
- });
1446
- const UpdateDetailsInvoiceStatementDescriptorSchema = z.object({
1447
- descriptor: z.string().max(65000).optional(),
1448
- });
1449
- const UpdateDetailsInvoiceBodySchema = z.looseObject({
1450
- vat_number: z.string().max(20).optional(),
1451
- vat_number_prefix: z.string().max(10).optional(),
1452
- po_number: z.string().max(100).optional(),
1453
- comment: z.string().max(300).optional(),
1454
- billing_address: UpdateDetailsInvoiceBillingAddressSchema.optional(),
1455
- shipping_address: UpdateDetailsInvoiceShippingAddressSchema.optional(),
1456
- statement_descriptor: UpdateDetailsInvoiceStatementDescriptorSchema.optional(),
1457
- });
1458
- export { UpdateDetailsInvoiceBodySchema };
1459
- //Invoice.applyPaymentScheduleScheme
1460
- const ApplyPaymentScheduleSchemeInvoiceBodySchema = z.looseObject({
1461
- scheme_id: z.string(),
1462
- amount: z.number().int().min(0).optional(),
1463
- });
1464
- export { ApplyPaymentScheduleSchemeInvoiceBodySchema };