chargebee 3.26.0 → 3.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- package/README.md +131 -0
- package/cjs/RequestWrapper.js +130 -12
- package/cjs/chargebee.cjs.js +5 -0
- package/cjs/chargebee.cjs.worker.js +2 -0
- package/cjs/chargebeeZodValidationError.js +18 -0
- package/cjs/createChargebee.js +23 -2
- package/cjs/environment.js +1 -1
- package/cjs/schema/addon.schema.js +269 -0
- package/cjs/schema/address.schema.js +35 -0
- package/cjs/schema/alert.schema.js +74 -0
- package/cjs/schema/alert_status.schema.js +31 -0
- package/cjs/schema/attached_item.schema.js +144 -0
- package/cjs/schema/business_entity.schema.js +46 -0
- package/cjs/schema/card.schema.js +165 -0
- package/cjs/schema/comment.schema.js +69 -0
- package/cjs/schema/coupon.schema.js +323 -0
- package/cjs/schema/coupon_code.schema.js +49 -0
- package/cjs/schema/coupon_set.schema.js +88 -0
- package/cjs/schema/credit_note.schema.js +502 -0
- package/cjs/schema/currency.schema.js +32 -0
- package/cjs/schema/customer.schema.js +1201 -0
- package/cjs/schema/customer_entitlement.schema.js +14 -0
- package/cjs/schema/differential_price.schema.js +106 -0
- package/cjs/schema/entitlement.schema.js +54 -0
- package/cjs/schema/entitlement_override.schema.js +35 -0
- package/cjs/schema/estimate.schema.js +1535 -0
- package/cjs/schema/event.schema.js +1060 -0
- package/cjs/schema/export.schema.js +3385 -0
- package/cjs/schema/feature.schema.js +78 -0
- package/cjs/schema/gift.schema.js +293 -0
- package/cjs/schema/grant_block.schema.js +47 -0
- package/cjs/schema/hosted_page.schema.js +1777 -0
- package/cjs/schema/in_app_subscription.schema.js +68 -0
- package/cjs/schema/index.js +88 -0
- package/cjs/schema/invoice.schema.js +1685 -0
- package/cjs/schema/item.schema.js +195 -0
- package/cjs/schema/item_entitlement.schema.js +45 -0
- package/cjs/schema/item_family.schema.js +57 -0
- package/cjs/schema/item_price.schema.js +335 -0
- package/cjs/schema/ledger_account_balance.schema.js +21 -0
- package/cjs/schema/ledger_operation.schema.js +104 -0
- package/cjs/schema/meter.schema.js +13 -0
- package/cjs/schema/metered_feature.schema.js +20 -0
- package/cjs/schema/non_subscription.schema.js +28 -0
- package/cjs/schema/offer_event.schema.js +13 -0
- package/cjs/schema/offer_fulfillment.schema.js +20 -0
- package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
- package/cjs/schema/omnichannel_subscription.schema.js +122 -0
- package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
- package/cjs/schema/order.schema.js +441 -0
- package/cjs/schema/payment_intent.schema.js +127 -0
- package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
- package/cjs/schema/payment_source.schema.js +630 -0
- package/cjs/schema/payment_voucher.schema.js +57 -0
- package/cjs/schema/personalized_offer.schema.js +28 -0
- package/cjs/schema/plan.schema.js +363 -0
- package/cjs/schema/portal_session.schema.js +22 -0
- package/cjs/schema/price_variant.schema.js +93 -0
- package/cjs/schema/pricing_page_session.schema.js +135 -0
- package/cjs/schema/promotional_credit.schema.js +78 -0
- package/cjs/schema/promotional_grant.schema.js +17 -0
- package/cjs/schema/purchase.schema.js +277 -0
- package/cjs/schema/quote.schema.js +1667 -0
- package/cjs/schema/ramp.schema.js +245 -0
- package/cjs/schema/recorded_purchase.schema.js +32 -0
- package/cjs/schema/resource_migration.schema.js +14 -0
- package/cjs/schema/site_migration_detail.schema.js +81 -0
- package/cjs/schema/subscription.schema.js +3344 -0
- package/cjs/schema/subscription_entitlement.schema.js +25 -0
- package/cjs/schema/time_machine.schema.js +17 -0
- package/cjs/schema/transaction.schema.js +744 -0
- package/cjs/schema/unbilled_charge.schema.js +139 -0
- package/cjs/schema/usage.schema.js +93 -0
- package/cjs/schema/usage_charge.schema.js +17 -0
- package/cjs/schema/usage_event.schema.js +28 -0
- package/cjs/schema/usage_file.schema.js +13 -0
- package/cjs/schema/usage_summary.schema.js +17 -0
- package/cjs/schema/virtual_bank_account.schema.js +71 -0
- package/cjs/schema/webhook_endpoint.schema.js +508 -0
- package/cjs/telemetry/TelemetryAdapter.js +145 -0
- package/cjs/telemetry/index.js +28 -0
- package/cjs/telemetry/otel.js +66 -0
- package/cjs/telemetry/types.js +47 -0
- package/cjs/validationLoader.js +59 -0
- package/esm/RequestWrapper.js +130 -12
- package/esm/chargebee.esm.js +3 -0
- package/esm/chargebee.esm.worker.js +1 -0
- package/esm/chargebeeZodValidationError.js +14 -0
- package/esm/createChargebee.js +23 -2
- package/esm/environment.js +1 -1
- package/esm/schema/addon.schema.js +266 -0
- package/esm/schema/address.schema.js +32 -0
- package/esm/schema/alert.schema.js +71 -0
- package/esm/schema/alert_status.schema.js +28 -0
- package/esm/schema/attached_item.schema.js +141 -0
- package/esm/schema/business_entity.schema.js +43 -0
- package/esm/schema/card.schema.js +162 -0
- package/esm/schema/comment.schema.js +66 -0
- package/esm/schema/coupon.schema.js +320 -0
- package/esm/schema/coupon_code.schema.js +46 -0
- package/esm/schema/coupon_set.schema.js +85 -0
- package/esm/schema/credit_note.schema.js +499 -0
- package/esm/schema/currency.schema.js +29 -0
- package/esm/schema/customer.schema.js +1198 -0
- package/esm/schema/customer_entitlement.schema.js +11 -0
- package/esm/schema/differential_price.schema.js +103 -0
- package/esm/schema/entitlement.schema.js +51 -0
- package/esm/schema/entitlement_override.schema.js +32 -0
- package/esm/schema/estimate.schema.js +1532 -0
- package/esm/schema/event.schema.js +1057 -0
- package/esm/schema/export.schema.js +3382 -0
- package/esm/schema/feature.schema.js +75 -0
- package/esm/schema/gift.schema.js +290 -0
- package/esm/schema/grant_block.schema.js +44 -0
- package/esm/schema/hosted_page.schema.js +1774 -0
- package/esm/schema/in_app_subscription.schema.js +65 -0
- package/esm/schema/index.js +72 -0
- package/esm/schema/invoice.schema.js +1682 -0
- package/esm/schema/item.schema.js +192 -0
- package/esm/schema/item_entitlement.schema.js +42 -0
- package/esm/schema/item_family.schema.js +54 -0
- package/esm/schema/item_price.schema.js +332 -0
- package/esm/schema/ledger_account_balance.schema.js +18 -0
- package/esm/schema/ledger_operation.schema.js +101 -0
- package/esm/schema/meter.schema.js +10 -0
- package/esm/schema/metered_feature.schema.js +17 -0
- package/esm/schema/non_subscription.schema.js +25 -0
- package/esm/schema/offer_event.schema.js +10 -0
- package/esm/schema/offer_fulfillment.schema.js +17 -0
- package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
- package/esm/schema/omnichannel_subscription.schema.js +119 -0
- package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
- package/esm/schema/order.schema.js +438 -0
- package/esm/schema/payment_intent.schema.js +124 -0
- package/esm/schema/payment_schedule_scheme.schema.js +17 -0
- package/esm/schema/payment_source.schema.js +627 -0
- package/esm/schema/payment_voucher.schema.js +54 -0
- package/esm/schema/personalized_offer.schema.js +25 -0
- package/esm/schema/plan.schema.js +360 -0
- package/esm/schema/portal_session.schema.js +19 -0
- package/esm/schema/price_variant.schema.js +90 -0
- package/esm/schema/pricing_page_session.schema.js +132 -0
- package/esm/schema/promotional_credit.schema.js +75 -0
- package/esm/schema/promotional_grant.schema.js +14 -0
- package/esm/schema/purchase.schema.js +274 -0
- package/esm/schema/quote.schema.js +1664 -0
- package/esm/schema/ramp.schema.js +242 -0
- package/esm/schema/recorded_purchase.schema.js +29 -0
- package/esm/schema/resource_migration.schema.js +11 -0
- package/esm/schema/site_migration_detail.schema.js +78 -0
- package/esm/schema/subscription.schema.js +3341 -0
- package/esm/schema/subscription_entitlement.schema.js +22 -0
- package/esm/schema/time_machine.schema.js +14 -0
- package/esm/schema/transaction.schema.js +741 -0
- package/esm/schema/unbilled_charge.schema.js +136 -0
- package/esm/schema/usage.schema.js +90 -0
- package/esm/schema/usage_charge.schema.js +14 -0
- package/esm/schema/usage_event.schema.js +25 -0
- package/esm/schema/usage_file.schema.js +10 -0
- package/esm/schema/usage_summary.schema.js +14 -0
- package/esm/schema/virtual_bank_account.schema.js +68 -0
- package/esm/schema/webhook_endpoint.schema.js +505 -0
- package/esm/telemetry/TelemetryAdapter.js +132 -0
- package/esm/telemetry/index.js +8 -0
- package/esm/telemetry/otel.js +62 -0
- package/esm/telemetry/types.js +44 -0
- package/esm/validationLoader.js +56 -0
- package/package.json +43 -24
- package/types/core.d.ts +2 -0
- package/types/index.d.ts +85 -0
- package/types/telemetry/otel.d.ts +22 -0
|
@@ -0,0 +1,1198 @@
|
|
|
1
|
+
// Generated Zod schemas: Customer
|
|
2
|
+
// Actions: create, list, update, updatePaymentMethod, updateBillingInfo, contactsForCustomer, assignPaymentRole, addContact, updateContact, deleteContact, addPromotionalCredits, deductPromotionalCredits, setPromotionalCredits, recordExcessPayment, collectPayment, delete, move, changeBillingDate, merge, relationships, hierarchy, listHierarchyDetail, updateHierarchySettings
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//Customer.create
|
|
6
|
+
const CreateCustomerMetaDataSchema = z.looseObject({});
|
|
7
|
+
const CreateCustomerAdditionalInformationSchema = z.looseObject({});
|
|
8
|
+
const CreateCustomerCardSchema = z.object({
|
|
9
|
+
gateway: z
|
|
10
|
+
.enum([
|
|
11
|
+
'chargebee',
|
|
12
|
+
'chargebee_payments',
|
|
13
|
+
'adyen',
|
|
14
|
+
'stripe',
|
|
15
|
+
'wepay',
|
|
16
|
+
'braintree',
|
|
17
|
+
'authorize_net',
|
|
18
|
+
'paypal_pro',
|
|
19
|
+
'pin',
|
|
20
|
+
'eway',
|
|
21
|
+
'eway_rapid',
|
|
22
|
+
'worldpay',
|
|
23
|
+
'balanced_payments',
|
|
24
|
+
'beanstream',
|
|
25
|
+
'bluepay',
|
|
26
|
+
'elavon',
|
|
27
|
+
'first_data_global',
|
|
28
|
+
'hdfc',
|
|
29
|
+
'migs',
|
|
30
|
+
'nmi',
|
|
31
|
+
'ogone',
|
|
32
|
+
'paymill',
|
|
33
|
+
'paypal_payflow_pro',
|
|
34
|
+
'sage_pay',
|
|
35
|
+
'tco',
|
|
36
|
+
'wirecard',
|
|
37
|
+
'amazon_payments',
|
|
38
|
+
'paypal_express_checkout',
|
|
39
|
+
'orbital',
|
|
40
|
+
'moneris_us',
|
|
41
|
+
'moneris',
|
|
42
|
+
'bluesnap',
|
|
43
|
+
'cybersource',
|
|
44
|
+
'vantiv',
|
|
45
|
+
'checkout_com',
|
|
46
|
+
'paypal',
|
|
47
|
+
'ingenico_direct',
|
|
48
|
+
'exact',
|
|
49
|
+
'mollie',
|
|
50
|
+
'quickbooks',
|
|
51
|
+
'razorpay',
|
|
52
|
+
'global_payments',
|
|
53
|
+
'bank_of_america',
|
|
54
|
+
'ecentric',
|
|
55
|
+
'metrics_global',
|
|
56
|
+
'windcave',
|
|
57
|
+
'pay_com',
|
|
58
|
+
'ebanx',
|
|
59
|
+
'dlocal',
|
|
60
|
+
'nuvei',
|
|
61
|
+
'solidgate',
|
|
62
|
+
'paystack',
|
|
63
|
+
'jp_morgan',
|
|
64
|
+
'deutsche_bank',
|
|
65
|
+
'ezidebit',
|
|
66
|
+
'twikey',
|
|
67
|
+
'tempus',
|
|
68
|
+
'moyasar',
|
|
69
|
+
'payway',
|
|
70
|
+
])
|
|
71
|
+
.optional(),
|
|
72
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
73
|
+
tmp_token: z.string().max(300).optional(),
|
|
74
|
+
first_name: z.string().max(50).optional(),
|
|
75
|
+
last_name: z.string().max(50).optional(),
|
|
76
|
+
number: z.string().max(1500).optional(),
|
|
77
|
+
expiry_month: z.number().int().min(1).max(12).optional(),
|
|
78
|
+
expiry_year: z.number().int().optional(),
|
|
79
|
+
cvv: z.string().max(520).optional(),
|
|
80
|
+
preferred_scheme: z
|
|
81
|
+
.enum(['cartes_bancaires', 'mastercard', 'visa'])
|
|
82
|
+
.optional(),
|
|
83
|
+
billing_addr1: z.string().max(150).optional(),
|
|
84
|
+
billing_addr2: z.string().max(150).optional(),
|
|
85
|
+
billing_city: z.string().max(50).optional(),
|
|
86
|
+
billing_state_code: z.string().max(50).optional(),
|
|
87
|
+
billing_state: z.string().max(50).optional(),
|
|
88
|
+
billing_zip: z.string().max(20).optional(),
|
|
89
|
+
billing_country: z.string().max(50).optional(),
|
|
90
|
+
ip_address: z.string().max(50).optional(),
|
|
91
|
+
additional_information: CreateCustomerAdditionalInformationSchema.optional(),
|
|
92
|
+
});
|
|
93
|
+
const CreateCustomerBillingAddressSchema = z.looseObject({});
|
|
94
|
+
const CreateCustomerBankAccountSchema = z.object({
|
|
95
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
96
|
+
iban: z.string().max(50).min(10).optional(),
|
|
97
|
+
first_name: z.string().max(150).optional(),
|
|
98
|
+
last_name: z.string().max(150).optional(),
|
|
99
|
+
company: z.string().max(250).optional(),
|
|
100
|
+
email: z.string().email().max(70).optional(),
|
|
101
|
+
phone: z.string().max(50).optional(),
|
|
102
|
+
bank_name: z.string().max(100).optional(),
|
|
103
|
+
account_number: z.string().max(17).min(4).optional(),
|
|
104
|
+
routing_number: z.string().max(9).min(3).optional(),
|
|
105
|
+
bank_code: z.string().max(20).optional(),
|
|
106
|
+
account_type: z
|
|
107
|
+
.enum(['checking', 'savings', 'business_checking', 'current'])
|
|
108
|
+
.optional(),
|
|
109
|
+
account_holder_type: z.enum(['individual', 'company']).optional(),
|
|
110
|
+
echeck_type: z.enum(['web', 'ppd', 'ccd']).optional(),
|
|
111
|
+
issuing_country: z.string().max(50).optional(),
|
|
112
|
+
swedish_identity_number: z.string().max(12).min(10).optional(),
|
|
113
|
+
billing_address: CreateCustomerBillingAddressSchema.optional(),
|
|
114
|
+
});
|
|
115
|
+
const CreateCustomerPaymentMethodSchema = z.object({
|
|
116
|
+
type: z
|
|
117
|
+
.enum([
|
|
118
|
+
'card',
|
|
119
|
+
'paypal_express_checkout',
|
|
120
|
+
'amazon_payments',
|
|
121
|
+
'direct_debit',
|
|
122
|
+
'generic',
|
|
123
|
+
'alipay',
|
|
124
|
+
'unionpay',
|
|
125
|
+
'apple_pay',
|
|
126
|
+
'wechat_pay',
|
|
127
|
+
'ideal',
|
|
128
|
+
'google_pay',
|
|
129
|
+
'sofort',
|
|
130
|
+
'bancontact',
|
|
131
|
+
'giropay',
|
|
132
|
+
'dotpay',
|
|
133
|
+
'upi',
|
|
134
|
+
'netbanking_emandates',
|
|
135
|
+
'venmo',
|
|
136
|
+
'pay_to',
|
|
137
|
+
'faster_payments',
|
|
138
|
+
'sepa_instant_transfer',
|
|
139
|
+
'automated_bank_transfer',
|
|
140
|
+
'klarna_pay_now',
|
|
141
|
+
'online_banking_poland',
|
|
142
|
+
'payconiq_by_bancontact',
|
|
143
|
+
'electronic_payment_standard',
|
|
144
|
+
'kbc_payment_button',
|
|
145
|
+
'pay_by_bank',
|
|
146
|
+
'trustly',
|
|
147
|
+
'stablecoin',
|
|
148
|
+
'kakao_pay',
|
|
149
|
+
'naver_pay',
|
|
150
|
+
'revolut_pay',
|
|
151
|
+
'cash_app_pay',
|
|
152
|
+
'twint',
|
|
153
|
+
'go_pay',
|
|
154
|
+
'grab_pay',
|
|
155
|
+
'pay_co',
|
|
156
|
+
'after_pay',
|
|
157
|
+
'swish',
|
|
158
|
+
'payme',
|
|
159
|
+
'pix',
|
|
160
|
+
'klarna',
|
|
161
|
+
'alipay_hk',
|
|
162
|
+
'paypay',
|
|
163
|
+
'gcash',
|
|
164
|
+
'south_korean_cards',
|
|
165
|
+
])
|
|
166
|
+
.optional(),
|
|
167
|
+
gateway: z
|
|
168
|
+
.enum([
|
|
169
|
+
'chargebee_payments',
|
|
170
|
+
'adyen',
|
|
171
|
+
'stripe',
|
|
172
|
+
'wepay',
|
|
173
|
+
'braintree',
|
|
174
|
+
'authorize_net',
|
|
175
|
+
'paypal_pro',
|
|
176
|
+
'pin',
|
|
177
|
+
'eway',
|
|
178
|
+
'eway_rapid',
|
|
179
|
+
'worldpay',
|
|
180
|
+
'balanced_payments',
|
|
181
|
+
'beanstream',
|
|
182
|
+
'bluepay',
|
|
183
|
+
'elavon',
|
|
184
|
+
'first_data_global',
|
|
185
|
+
'hdfc',
|
|
186
|
+
'migs',
|
|
187
|
+
'nmi',
|
|
188
|
+
'ogone',
|
|
189
|
+
'paymill',
|
|
190
|
+
'paypal_payflow_pro',
|
|
191
|
+
'sage_pay',
|
|
192
|
+
'tco',
|
|
193
|
+
'wirecard',
|
|
194
|
+
'amazon_payments',
|
|
195
|
+
'paypal_express_checkout',
|
|
196
|
+
'gocardless',
|
|
197
|
+
'orbital',
|
|
198
|
+
'moneris_us',
|
|
199
|
+
'moneris',
|
|
200
|
+
'bluesnap',
|
|
201
|
+
'cybersource',
|
|
202
|
+
'vantiv',
|
|
203
|
+
'checkout_com',
|
|
204
|
+
'paypal',
|
|
205
|
+
'ingenico_direct',
|
|
206
|
+
'exact',
|
|
207
|
+
'mollie',
|
|
208
|
+
'quickbooks',
|
|
209
|
+
'razorpay',
|
|
210
|
+
'global_payments',
|
|
211
|
+
'bank_of_america',
|
|
212
|
+
'ecentric',
|
|
213
|
+
'metrics_global',
|
|
214
|
+
'windcave',
|
|
215
|
+
'pay_com',
|
|
216
|
+
'ebanx',
|
|
217
|
+
'dlocal',
|
|
218
|
+
'nuvei',
|
|
219
|
+
'solidgate',
|
|
220
|
+
'paystack',
|
|
221
|
+
'jp_morgan',
|
|
222
|
+
'deutsche_bank',
|
|
223
|
+
'ezidebit',
|
|
224
|
+
'twikey',
|
|
225
|
+
'tempus',
|
|
226
|
+
'moyasar',
|
|
227
|
+
'payway',
|
|
228
|
+
])
|
|
229
|
+
.optional(),
|
|
230
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
231
|
+
reference_id: z.string().max(200).optional(),
|
|
232
|
+
tmp_token: z.string().max(65000).optional(),
|
|
233
|
+
issuing_country: z.string().max(50).optional(),
|
|
234
|
+
additional_information: CreateCustomerAdditionalInformationSchema.optional(),
|
|
235
|
+
});
|
|
236
|
+
const CreateCustomerPaymentIntentSchema = z.object({
|
|
237
|
+
id: z.string().max(150).optional(),
|
|
238
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
239
|
+
gw_token: z.string().max(65000).optional(),
|
|
240
|
+
payment_method_type: z
|
|
241
|
+
.enum([
|
|
242
|
+
'card',
|
|
243
|
+
'ideal',
|
|
244
|
+
'sofort',
|
|
245
|
+
'bancontact',
|
|
246
|
+
'google_pay',
|
|
247
|
+
'dotpay',
|
|
248
|
+
'giropay',
|
|
249
|
+
'apple_pay',
|
|
250
|
+
'upi',
|
|
251
|
+
'netbanking_emandates',
|
|
252
|
+
'paypal_express_checkout',
|
|
253
|
+
'direct_debit',
|
|
254
|
+
'boleto',
|
|
255
|
+
'venmo',
|
|
256
|
+
'amazon_payments',
|
|
257
|
+
'pay_to',
|
|
258
|
+
'faster_payments',
|
|
259
|
+
'sepa_instant_transfer',
|
|
260
|
+
'klarna_pay_now',
|
|
261
|
+
'online_banking_poland',
|
|
262
|
+
'payconiq_by_bancontact',
|
|
263
|
+
'electronic_payment_standard',
|
|
264
|
+
'kbc_payment_button',
|
|
265
|
+
'pay_by_bank',
|
|
266
|
+
'trustly',
|
|
267
|
+
'stablecoin',
|
|
268
|
+
'kakao_pay',
|
|
269
|
+
'naver_pay',
|
|
270
|
+
'revolut_pay',
|
|
271
|
+
'cash_app_pay',
|
|
272
|
+
'wechat_pay',
|
|
273
|
+
'alipay',
|
|
274
|
+
'twint',
|
|
275
|
+
'go_pay',
|
|
276
|
+
'grab_pay',
|
|
277
|
+
'pay_co',
|
|
278
|
+
'after_pay',
|
|
279
|
+
'swish',
|
|
280
|
+
'payme',
|
|
281
|
+
'pix',
|
|
282
|
+
'klarna',
|
|
283
|
+
'alipay_hk',
|
|
284
|
+
'paypay',
|
|
285
|
+
'gcash',
|
|
286
|
+
'south_korean_cards',
|
|
287
|
+
])
|
|
288
|
+
.optional(),
|
|
289
|
+
reference_id: z.string().max(65000).optional(),
|
|
290
|
+
gw_payment_method_id: z.string().max(65000).optional(),
|
|
291
|
+
additional_information: CreateCustomerAdditionalInformationSchema.optional(),
|
|
292
|
+
});
|
|
293
|
+
const CreateCustomerEntityIdentifiersSchema = z.object({
|
|
294
|
+
id: z.array(z.string().max(40).optional()).optional(),
|
|
295
|
+
scheme: z.array(z.string().max(50).optional()).optional(),
|
|
296
|
+
value: z.array(z.string().max(50).optional()).optional(),
|
|
297
|
+
standard: z.array(z.string().max(50).optional()).optional(),
|
|
298
|
+
});
|
|
299
|
+
const CreateCustomerTaxProvidersFieldsSchema = z.object({
|
|
300
|
+
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
301
|
+
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
302
|
+
field_value: z.array(z.string().max(50).optional()).optional(),
|
|
303
|
+
});
|
|
304
|
+
const CreateCustomerBodySchema = z.looseObject({
|
|
305
|
+
id: z.string().max(50).optional(),
|
|
306
|
+
first_name: z.string().max(150).optional(),
|
|
307
|
+
last_name: z.string().max(150).optional(),
|
|
308
|
+
email: z.string().email().max(70).optional(),
|
|
309
|
+
preferred_currency_code: z.string().max(3).optional(),
|
|
310
|
+
phone: z.string().max(50).optional(),
|
|
311
|
+
company: z.string().max(250).optional(),
|
|
312
|
+
auto_collection: z.enum(['on', 'off']).optional(),
|
|
313
|
+
net_term_days: z.number().int().optional(),
|
|
314
|
+
allow_direct_debit: z.boolean().default(false).optional(),
|
|
315
|
+
vat_number: z.string().max(20).optional(),
|
|
316
|
+
vat_number_prefix: z.string().max(10).optional(),
|
|
317
|
+
entity_identifier_scheme: z.string().max(50).optional(),
|
|
318
|
+
entity_identifier_standard: z.string().max(50).optional(),
|
|
319
|
+
registered_for_gst: z.boolean().optional(),
|
|
320
|
+
is_einvoice_enabled: z.boolean().optional(),
|
|
321
|
+
einvoicing_method: z.enum(['automatic', 'manual', 'site_default']).optional(),
|
|
322
|
+
taxability: z.enum(['taxable', 'exempt']).optional(),
|
|
323
|
+
exemption_details: z.array(z.string().optional()).optional(),
|
|
324
|
+
customer_type: z
|
|
325
|
+
.enum(['residential', 'business', 'senior_citizen', 'industrial'])
|
|
326
|
+
.optional(),
|
|
327
|
+
client_profile_id: z.string().max(50).optional(),
|
|
328
|
+
taxjar_exemption_category: z
|
|
329
|
+
.enum(['wholesale', 'government', 'other'])
|
|
330
|
+
.optional(),
|
|
331
|
+
business_customer_without_vat_number: z.boolean().optional(),
|
|
332
|
+
locale: z.string().max(50).optional(),
|
|
333
|
+
entity_code: z
|
|
334
|
+
.enum([
|
|
335
|
+
'a',
|
|
336
|
+
'b',
|
|
337
|
+
'c',
|
|
338
|
+
'd',
|
|
339
|
+
'e',
|
|
340
|
+
'f',
|
|
341
|
+
'g',
|
|
342
|
+
'h',
|
|
343
|
+
'i',
|
|
344
|
+
'j',
|
|
345
|
+
'k',
|
|
346
|
+
'l',
|
|
347
|
+
'm',
|
|
348
|
+
'n',
|
|
349
|
+
'p',
|
|
350
|
+
'q',
|
|
351
|
+
'r',
|
|
352
|
+
'med1',
|
|
353
|
+
'med2',
|
|
354
|
+
])
|
|
355
|
+
.optional(),
|
|
356
|
+
exempt_number: z.string().max(100).optional(),
|
|
357
|
+
meta_data: CreateCustomerMetaDataSchema.optional(),
|
|
358
|
+
offline_payment_method: z
|
|
359
|
+
.enum([
|
|
360
|
+
'no_preference',
|
|
361
|
+
'cash',
|
|
362
|
+
'check',
|
|
363
|
+
'bank_transfer',
|
|
364
|
+
'ach_credit',
|
|
365
|
+
'sepa_credit',
|
|
366
|
+
'boleto',
|
|
367
|
+
'us_automated_bank_transfer',
|
|
368
|
+
'eu_automated_bank_transfer',
|
|
369
|
+
'uk_automated_bank_transfer',
|
|
370
|
+
'jp_automated_bank_transfer',
|
|
371
|
+
'mx_automated_bank_transfer',
|
|
372
|
+
'custom',
|
|
373
|
+
])
|
|
374
|
+
.optional(),
|
|
375
|
+
auto_close_invoices: z.boolean().optional(),
|
|
376
|
+
consolidated_invoicing: z.boolean().optional(),
|
|
377
|
+
token_id: z.string().max(40).optional(),
|
|
378
|
+
business_entity_id: z.string().max(50).optional(),
|
|
379
|
+
created_from_ip: z.string().max(50).optional(),
|
|
380
|
+
invoice_notes: z.string().max(2000).optional(),
|
|
381
|
+
card: CreateCustomerCardSchema.optional(),
|
|
382
|
+
bank_account: CreateCustomerBankAccountSchema.optional(),
|
|
383
|
+
payment_method: CreateCustomerPaymentMethodSchema.optional(),
|
|
384
|
+
payment_intent: CreateCustomerPaymentIntentSchema.optional(),
|
|
385
|
+
billing_address: CreateCustomerBillingAddressSchema.optional(),
|
|
386
|
+
entity_identifiers: CreateCustomerEntityIdentifiersSchema.optional(),
|
|
387
|
+
tax_providers_fields: CreateCustomerTaxProvidersFieldsSchema.optional(),
|
|
388
|
+
});
|
|
389
|
+
export { CreateCustomerBodySchema };
|
|
390
|
+
//Customer.list
|
|
391
|
+
const ListCustomerIdSchema = z.object({
|
|
392
|
+
is: z.string().min(1).optional(),
|
|
393
|
+
is_not: z.string().min(1).optional(),
|
|
394
|
+
starts_with: z.string().min(1).optional(),
|
|
395
|
+
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
396
|
+
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
397
|
+
});
|
|
398
|
+
const ListCustomerFirstNameSchema = z.object({
|
|
399
|
+
is: z.string().min(1).optional(),
|
|
400
|
+
is_not: z.string().min(1).optional(),
|
|
401
|
+
starts_with: z.string().min(1).optional(),
|
|
402
|
+
is_present: z.enum(['true', 'false']).optional(),
|
|
403
|
+
});
|
|
404
|
+
const ListCustomerLastNameSchema = z.object({
|
|
405
|
+
is: z.string().min(1).optional(),
|
|
406
|
+
is_not: z.string().min(1).optional(),
|
|
407
|
+
starts_with: z.string().min(1).optional(),
|
|
408
|
+
is_present: z.enum(['true', 'false']).optional(),
|
|
409
|
+
});
|
|
410
|
+
const ListCustomerEmailSchema = z.object({
|
|
411
|
+
is: z.string().min(1).optional(),
|
|
412
|
+
is_not: z.string().min(1).optional(),
|
|
413
|
+
starts_with: z.string().min(1).optional(),
|
|
414
|
+
is_present: z.enum(['true', 'false']).optional(),
|
|
415
|
+
});
|
|
416
|
+
const ListCustomerCompanySchema = z.object({
|
|
417
|
+
is: z.string().min(1).optional(),
|
|
418
|
+
is_not: z.string().min(1).optional(),
|
|
419
|
+
starts_with: z.string().min(1).optional(),
|
|
420
|
+
is_present: z.enum(['true', 'false']).optional(),
|
|
421
|
+
});
|
|
422
|
+
const ListCustomerPhoneSchema = z.object({
|
|
423
|
+
is: z.string().min(1).optional(),
|
|
424
|
+
is_not: z.string().min(1).optional(),
|
|
425
|
+
starts_with: z.string().min(1).optional(),
|
|
426
|
+
is_present: z.enum(['true', 'false']).optional(),
|
|
427
|
+
});
|
|
428
|
+
const ListCustomerAutoCollectionSchema = z.object({
|
|
429
|
+
is: z.enum(['on', 'off']).optional(),
|
|
430
|
+
is_not: z.enum(['on', 'off']).optional(),
|
|
431
|
+
in: z.enum(['on', 'off']).optional(),
|
|
432
|
+
not_in: z.enum(['on', 'off']).optional(),
|
|
433
|
+
});
|
|
434
|
+
const ListCustomerTaxabilitySchema = z.object({
|
|
435
|
+
is: z.enum(['taxable', 'exempt']).optional(),
|
|
436
|
+
is_not: z.enum(['taxable', 'exempt']).optional(),
|
|
437
|
+
in: z.enum(['taxable', 'exempt']).optional(),
|
|
438
|
+
not_in: z.enum(['taxable', 'exempt']).optional(),
|
|
439
|
+
});
|
|
440
|
+
const ListCustomerCreatedAtSchema = z.object({
|
|
441
|
+
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
442
|
+
before: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
443
|
+
on: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
444
|
+
between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
445
|
+
});
|
|
446
|
+
const ListCustomerUpdatedAtSchema = z.object({
|
|
447
|
+
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
448
|
+
before: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
449
|
+
on: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
450
|
+
between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
451
|
+
});
|
|
452
|
+
const ListCustomerOfflinePaymentMethodSchema = z.object({
|
|
453
|
+
is: z
|
|
454
|
+
.enum([
|
|
455
|
+
'no_preference',
|
|
456
|
+
'cash',
|
|
457
|
+
'check',
|
|
458
|
+
'bank_transfer',
|
|
459
|
+
'ach_credit',
|
|
460
|
+
'sepa_credit',
|
|
461
|
+
'boleto',
|
|
462
|
+
'us_automated_bank_transfer',
|
|
463
|
+
'eu_automated_bank_transfer',
|
|
464
|
+
'uk_automated_bank_transfer',
|
|
465
|
+
'jp_automated_bank_transfer',
|
|
466
|
+
'mx_automated_bank_transfer',
|
|
467
|
+
'custom',
|
|
468
|
+
])
|
|
469
|
+
.optional(),
|
|
470
|
+
is_not: z
|
|
471
|
+
.enum([
|
|
472
|
+
'no_preference',
|
|
473
|
+
'cash',
|
|
474
|
+
'check',
|
|
475
|
+
'bank_transfer',
|
|
476
|
+
'ach_credit',
|
|
477
|
+
'sepa_credit',
|
|
478
|
+
'boleto',
|
|
479
|
+
'us_automated_bank_transfer',
|
|
480
|
+
'eu_automated_bank_transfer',
|
|
481
|
+
'uk_automated_bank_transfer',
|
|
482
|
+
'jp_automated_bank_transfer',
|
|
483
|
+
'mx_automated_bank_transfer',
|
|
484
|
+
'custom',
|
|
485
|
+
])
|
|
486
|
+
.optional(),
|
|
487
|
+
in: z
|
|
488
|
+
.enum([
|
|
489
|
+
'no_preference',
|
|
490
|
+
'cash',
|
|
491
|
+
'check',
|
|
492
|
+
'bank_transfer',
|
|
493
|
+
'ach_credit',
|
|
494
|
+
'sepa_credit',
|
|
495
|
+
'boleto',
|
|
496
|
+
'us_automated_bank_transfer',
|
|
497
|
+
'eu_automated_bank_transfer',
|
|
498
|
+
'uk_automated_bank_transfer',
|
|
499
|
+
'jp_automated_bank_transfer',
|
|
500
|
+
'mx_automated_bank_transfer',
|
|
501
|
+
'custom',
|
|
502
|
+
])
|
|
503
|
+
.optional(),
|
|
504
|
+
not_in: z
|
|
505
|
+
.enum([
|
|
506
|
+
'no_preference',
|
|
507
|
+
'cash',
|
|
508
|
+
'check',
|
|
509
|
+
'bank_transfer',
|
|
510
|
+
'ach_credit',
|
|
511
|
+
'sepa_credit',
|
|
512
|
+
'boleto',
|
|
513
|
+
'us_automated_bank_transfer',
|
|
514
|
+
'eu_automated_bank_transfer',
|
|
515
|
+
'uk_automated_bank_transfer',
|
|
516
|
+
'jp_automated_bank_transfer',
|
|
517
|
+
'mx_automated_bank_transfer',
|
|
518
|
+
'custom',
|
|
519
|
+
])
|
|
520
|
+
.optional(),
|
|
521
|
+
});
|
|
522
|
+
const ListCustomerAutoCloseInvoicesSchema = z.object({
|
|
523
|
+
is: z.enum(['true', 'false']).optional(),
|
|
524
|
+
});
|
|
525
|
+
const ListCustomerChannelSchema = z.object({
|
|
526
|
+
is: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
527
|
+
is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
528
|
+
in: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
529
|
+
not_in: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
530
|
+
});
|
|
531
|
+
const ListCustomerBusinessEntityIdSchema = z.object({
|
|
532
|
+
is: z.string().min(1).optional(),
|
|
533
|
+
});
|
|
534
|
+
const ListCustomerSortBySchema = z.looseObject({
|
|
535
|
+
asc: z.enum(['created_at', 'updated_at']).optional(),
|
|
536
|
+
desc: z.enum(['created_at', 'updated_at']).optional(),
|
|
537
|
+
});
|
|
538
|
+
const ListCustomerParentIdSchema = z.object({
|
|
539
|
+
is: z.string().min(1).optional(),
|
|
540
|
+
is_not: z.string().min(1).optional(),
|
|
541
|
+
starts_with: z.string().min(1).optional(),
|
|
542
|
+
});
|
|
543
|
+
const ListCustomerPaymentOwnerIdSchema = z.object({
|
|
544
|
+
is: z.string().min(1).optional(),
|
|
545
|
+
is_not: z.string().min(1).optional(),
|
|
546
|
+
starts_with: z.string().min(1).optional(),
|
|
547
|
+
});
|
|
548
|
+
const ListCustomerInvoiceOwnerIdSchema = z.object({
|
|
549
|
+
is: z.string().min(1).optional(),
|
|
550
|
+
is_not: z.string().min(1).optional(),
|
|
551
|
+
starts_with: z.string().min(1).optional(),
|
|
552
|
+
});
|
|
553
|
+
const ListCustomerRelationshipSchema = z.object({
|
|
554
|
+
parent_id: ListCustomerParentIdSchema.optional(),
|
|
555
|
+
payment_owner_id: ListCustomerPaymentOwnerIdSchema.optional(),
|
|
556
|
+
invoice_owner_id: ListCustomerInvoiceOwnerIdSchema.optional(),
|
|
557
|
+
});
|
|
558
|
+
const ListCustomerBodySchema = z.looseObject({
|
|
559
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
560
|
+
offset: z.string().max(1000).optional(),
|
|
561
|
+
include_deleted: z.boolean().default(false).optional(),
|
|
562
|
+
id: ListCustomerIdSchema.optional(),
|
|
563
|
+
first_name: ListCustomerFirstNameSchema.optional(),
|
|
564
|
+
last_name: ListCustomerLastNameSchema.optional(),
|
|
565
|
+
email: ListCustomerEmailSchema.optional(),
|
|
566
|
+
company: ListCustomerCompanySchema.optional(),
|
|
567
|
+
phone: ListCustomerPhoneSchema.optional(),
|
|
568
|
+
auto_collection: ListCustomerAutoCollectionSchema.optional(),
|
|
569
|
+
taxability: ListCustomerTaxabilitySchema.optional(),
|
|
570
|
+
created_at: ListCustomerCreatedAtSchema.optional(),
|
|
571
|
+
updated_at: ListCustomerUpdatedAtSchema.optional(),
|
|
572
|
+
offline_payment_method: ListCustomerOfflinePaymentMethodSchema.optional(),
|
|
573
|
+
auto_close_invoices: ListCustomerAutoCloseInvoicesSchema.optional(),
|
|
574
|
+
channel: ListCustomerChannelSchema.optional(),
|
|
575
|
+
business_entity_id: ListCustomerBusinessEntityIdSchema.optional(),
|
|
576
|
+
sort_by: ListCustomerSortBySchema.optional(),
|
|
577
|
+
relationship: ListCustomerRelationshipSchema.optional(),
|
|
578
|
+
});
|
|
579
|
+
export { ListCustomerBodySchema };
|
|
580
|
+
//Customer.update
|
|
581
|
+
const UpdateCustomerMetaDataSchema = z.looseObject({});
|
|
582
|
+
const UpdateCustomerTaxProvidersFieldsSchema = z.object({
|
|
583
|
+
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
584
|
+
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
585
|
+
field_value: z.array(z.string().max(50).optional()).optional(),
|
|
586
|
+
});
|
|
587
|
+
const UpdateCustomerBodySchema = z.looseObject({
|
|
588
|
+
first_name: z.string().max(150).optional(),
|
|
589
|
+
last_name: z.string().max(150).optional(),
|
|
590
|
+
email: z.string().email().max(70).optional(),
|
|
591
|
+
preferred_currency_code: z.string().max(3).optional(),
|
|
592
|
+
phone: z.string().max(50).optional(),
|
|
593
|
+
company: z.string().max(250).optional(),
|
|
594
|
+
auto_collection: z.enum(['on', 'off']).optional(),
|
|
595
|
+
allow_direct_debit: z.boolean().default(false).optional(),
|
|
596
|
+
net_term_days: z.number().int().optional(),
|
|
597
|
+
taxability: z.enum(['taxable', 'exempt']).optional(),
|
|
598
|
+
exemption_details: z.array(z.string().optional()).optional(),
|
|
599
|
+
customer_type: z
|
|
600
|
+
.enum(['residential', 'business', 'senior_citizen', 'industrial'])
|
|
601
|
+
.optional(),
|
|
602
|
+
client_profile_id: z.string().max(50).optional(),
|
|
603
|
+
taxjar_exemption_category: z
|
|
604
|
+
.enum(['wholesale', 'government', 'other'])
|
|
605
|
+
.optional(),
|
|
606
|
+
locale: z.string().max(50).optional(),
|
|
607
|
+
entity_code: z
|
|
608
|
+
.enum([
|
|
609
|
+
'a',
|
|
610
|
+
'b',
|
|
611
|
+
'c',
|
|
612
|
+
'd',
|
|
613
|
+
'e',
|
|
614
|
+
'f',
|
|
615
|
+
'g',
|
|
616
|
+
'h',
|
|
617
|
+
'i',
|
|
618
|
+
'j',
|
|
619
|
+
'k',
|
|
620
|
+
'l',
|
|
621
|
+
'm',
|
|
622
|
+
'n',
|
|
623
|
+
'p',
|
|
624
|
+
'q',
|
|
625
|
+
'r',
|
|
626
|
+
'med1',
|
|
627
|
+
'med2',
|
|
628
|
+
])
|
|
629
|
+
.optional(),
|
|
630
|
+
exempt_number: z.string().max(100).optional(),
|
|
631
|
+
offline_payment_method: z
|
|
632
|
+
.enum([
|
|
633
|
+
'no_preference',
|
|
634
|
+
'cash',
|
|
635
|
+
'check',
|
|
636
|
+
'bank_transfer',
|
|
637
|
+
'ach_credit',
|
|
638
|
+
'sepa_credit',
|
|
639
|
+
'boleto',
|
|
640
|
+
'us_automated_bank_transfer',
|
|
641
|
+
'eu_automated_bank_transfer',
|
|
642
|
+
'uk_automated_bank_transfer',
|
|
643
|
+
'jp_automated_bank_transfer',
|
|
644
|
+
'mx_automated_bank_transfer',
|
|
645
|
+
'custom',
|
|
646
|
+
])
|
|
647
|
+
.optional(),
|
|
648
|
+
invoice_notes: z.string().max(2000).optional(),
|
|
649
|
+
auto_close_invoices: z.boolean().optional(),
|
|
650
|
+
meta_data: UpdateCustomerMetaDataSchema.optional(),
|
|
651
|
+
fraud_flag: z.enum(['safe', 'fraudulent']).optional(),
|
|
652
|
+
consolidated_invoicing: z.boolean().optional(),
|
|
653
|
+
tax_providers_fields: UpdateCustomerTaxProvidersFieldsSchema.optional(),
|
|
654
|
+
});
|
|
655
|
+
export { UpdateCustomerBodySchema };
|
|
656
|
+
//Customer.updatePaymentMethod
|
|
657
|
+
const UpdatePaymentMethodCustomerAdditionalInformationSchema = z.looseObject({});
|
|
658
|
+
const UpdatePaymentMethodCustomerPaymentMethodSchema = z.object({
|
|
659
|
+
type: z.enum([
|
|
660
|
+
'card',
|
|
661
|
+
'paypal_express_checkout',
|
|
662
|
+
'amazon_payments',
|
|
663
|
+
'direct_debit',
|
|
664
|
+
'generic',
|
|
665
|
+
'alipay',
|
|
666
|
+
'unionpay',
|
|
667
|
+
'wechat_pay',
|
|
668
|
+
'ideal',
|
|
669
|
+
'google_pay',
|
|
670
|
+
'sofort',
|
|
671
|
+
'bancontact',
|
|
672
|
+
'giropay',
|
|
673
|
+
'dotpay',
|
|
674
|
+
'upi',
|
|
675
|
+
'netbanking_emandates',
|
|
676
|
+
'venmo',
|
|
677
|
+
'pay_to',
|
|
678
|
+
'faster_payments',
|
|
679
|
+
'sepa_instant_transfer',
|
|
680
|
+
'automated_bank_transfer',
|
|
681
|
+
'klarna_pay_now',
|
|
682
|
+
'online_banking_poland',
|
|
683
|
+
'payconiq_by_bancontact',
|
|
684
|
+
'electronic_payment_standard',
|
|
685
|
+
'kbc_payment_button',
|
|
686
|
+
'pay_by_bank',
|
|
687
|
+
'trustly',
|
|
688
|
+
'stablecoin',
|
|
689
|
+
'kakao_pay',
|
|
690
|
+
'naver_pay',
|
|
691
|
+
'revolut_pay',
|
|
692
|
+
'cash_app_pay',
|
|
693
|
+
'twint',
|
|
694
|
+
'go_pay',
|
|
695
|
+
'grab_pay',
|
|
696
|
+
'pay_co',
|
|
697
|
+
'after_pay',
|
|
698
|
+
'swish',
|
|
699
|
+
'payme',
|
|
700
|
+
'pix',
|
|
701
|
+
'klarna',
|
|
702
|
+
'alipay_hk',
|
|
703
|
+
'paypay',
|
|
704
|
+
'gcash',
|
|
705
|
+
'south_korean_cards',
|
|
706
|
+
]),
|
|
707
|
+
gateway: z
|
|
708
|
+
.enum([
|
|
709
|
+
'chargebee_payments',
|
|
710
|
+
'adyen',
|
|
711
|
+
'stripe',
|
|
712
|
+
'wepay',
|
|
713
|
+
'braintree',
|
|
714
|
+
'authorize_net',
|
|
715
|
+
'paypal_pro',
|
|
716
|
+
'pin',
|
|
717
|
+
'eway',
|
|
718
|
+
'eway_rapid',
|
|
719
|
+
'worldpay',
|
|
720
|
+
'balanced_payments',
|
|
721
|
+
'beanstream',
|
|
722
|
+
'bluepay',
|
|
723
|
+
'elavon',
|
|
724
|
+
'first_data_global',
|
|
725
|
+
'hdfc',
|
|
726
|
+
'migs',
|
|
727
|
+
'nmi',
|
|
728
|
+
'ogone',
|
|
729
|
+
'paymill',
|
|
730
|
+
'paypal_payflow_pro',
|
|
731
|
+
'sage_pay',
|
|
732
|
+
'tco',
|
|
733
|
+
'wirecard',
|
|
734
|
+
'amazon_payments',
|
|
735
|
+
'paypal_express_checkout',
|
|
736
|
+
'gocardless',
|
|
737
|
+
'orbital',
|
|
738
|
+
'moneris_us',
|
|
739
|
+
'moneris',
|
|
740
|
+
'bluesnap',
|
|
741
|
+
'cybersource',
|
|
742
|
+
'vantiv',
|
|
743
|
+
'checkout_com',
|
|
744
|
+
'paypal',
|
|
745
|
+
'ingenico_direct',
|
|
746
|
+
'exact',
|
|
747
|
+
'mollie',
|
|
748
|
+
'quickbooks',
|
|
749
|
+
'razorpay',
|
|
750
|
+
'global_payments',
|
|
751
|
+
'bank_of_america',
|
|
752
|
+
'ecentric',
|
|
753
|
+
'metrics_global',
|
|
754
|
+
'windcave',
|
|
755
|
+
'pay_com',
|
|
756
|
+
'ebanx',
|
|
757
|
+
'dlocal',
|
|
758
|
+
'nuvei',
|
|
759
|
+
'solidgate',
|
|
760
|
+
'paystack',
|
|
761
|
+
'jp_morgan',
|
|
762
|
+
'deutsche_bank',
|
|
763
|
+
'ezidebit',
|
|
764
|
+
'twikey',
|
|
765
|
+
'tempus',
|
|
766
|
+
'moyasar',
|
|
767
|
+
'payway',
|
|
768
|
+
])
|
|
769
|
+
.optional(),
|
|
770
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
771
|
+
reference_id: z.string().max(200).optional(),
|
|
772
|
+
tmp_token: z.string().max(65000).optional(),
|
|
773
|
+
issuing_country: z.string().max(50).optional(),
|
|
774
|
+
additional_information: UpdatePaymentMethodCustomerAdditionalInformationSchema.optional(),
|
|
775
|
+
});
|
|
776
|
+
const UpdatePaymentMethodCustomerBodySchema = z.looseObject({
|
|
777
|
+
payment_method: UpdatePaymentMethodCustomerPaymentMethodSchema.optional(),
|
|
778
|
+
});
|
|
779
|
+
export { UpdatePaymentMethodCustomerBodySchema };
|
|
780
|
+
//Customer.updateBillingInfo
|
|
781
|
+
const UpdateBillingInfoCustomerBillingAddressSchema = z.object({
|
|
782
|
+
first_name: z.string().max(150).optional(),
|
|
783
|
+
last_name: z.string().max(150).optional(),
|
|
784
|
+
email: z.string().email().max(70).optional(),
|
|
785
|
+
company: z.string().max(250).optional(),
|
|
786
|
+
phone: z.string().max(50).optional(),
|
|
787
|
+
line1: z.string().max(150).optional(),
|
|
788
|
+
line2: z.string().max(150).optional(),
|
|
789
|
+
line3: z.string().max(150).optional(),
|
|
790
|
+
city: z.string().max(50).optional(),
|
|
791
|
+
state_code: z.string().max(50).optional(),
|
|
792
|
+
state: z.string().max(50).optional(),
|
|
793
|
+
zip: z.string().max(20).optional(),
|
|
794
|
+
country: z.string().max(50).optional(),
|
|
795
|
+
validation_status: z
|
|
796
|
+
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
797
|
+
.optional(),
|
|
798
|
+
});
|
|
799
|
+
const UpdateBillingInfoCustomerEntityIdentifiersSchema = z.object({
|
|
800
|
+
id: z.array(z.string().max(40).optional()).optional(),
|
|
801
|
+
scheme: z.array(z.string().max(50).optional()).optional(),
|
|
802
|
+
value: z.array(z.string().max(50).optional()).optional(),
|
|
803
|
+
operation: z
|
|
804
|
+
.array(z.enum(['create', 'update', 'delete']).optional())
|
|
805
|
+
.optional(),
|
|
806
|
+
standard: z.array(z.string().max(50).optional()).optional(),
|
|
807
|
+
});
|
|
808
|
+
const UpdateBillingInfoCustomerTaxProvidersFieldsSchema = z.object({
|
|
809
|
+
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
810
|
+
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
811
|
+
field_value: z.array(z.string().max(50).optional()).optional(),
|
|
812
|
+
});
|
|
813
|
+
const UpdateBillingInfoCustomerBodySchema = z.looseObject({
|
|
814
|
+
vat_number: z.string().max(20).optional(),
|
|
815
|
+
vat_number_prefix: z.string().max(10).optional(),
|
|
816
|
+
entity_identifier_scheme: z.string().max(50).optional(),
|
|
817
|
+
entity_identifier_standard: z.string().max(50).optional(),
|
|
818
|
+
registered_for_gst: z.boolean().optional(),
|
|
819
|
+
business_customer_without_vat_number: z.boolean().optional(),
|
|
820
|
+
is_einvoice_enabled: z.boolean().optional(),
|
|
821
|
+
einvoicing_method: z.enum(['automatic', 'manual', 'site_default']).optional(),
|
|
822
|
+
billing_address: UpdateBillingInfoCustomerBillingAddressSchema.optional(),
|
|
823
|
+
entity_identifiers: UpdateBillingInfoCustomerEntityIdentifiersSchema.optional(),
|
|
824
|
+
tax_providers_fields: UpdateBillingInfoCustomerTaxProvidersFieldsSchema.optional(),
|
|
825
|
+
});
|
|
826
|
+
export { UpdateBillingInfoCustomerBodySchema };
|
|
827
|
+
//Customer.contactsForCustomer
|
|
828
|
+
const ContactsForCustomerCustomerBodySchema = z.looseObject({
|
|
829
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
830
|
+
offset: z.string().max(1000).optional(),
|
|
831
|
+
});
|
|
832
|
+
export { ContactsForCustomerCustomerBodySchema };
|
|
833
|
+
//Customer.assignPaymentRole
|
|
834
|
+
const AssignPaymentRoleCustomerBodySchema = z.looseObject({
|
|
835
|
+
payment_source_id: z.string().max(40),
|
|
836
|
+
role: z.enum(['primary', 'backup', 'none']),
|
|
837
|
+
});
|
|
838
|
+
export { AssignPaymentRoleCustomerBodySchema };
|
|
839
|
+
//Customer.addContact
|
|
840
|
+
const AddContactCustomerContactSchema = z.object({
|
|
841
|
+
id: z.string().max(150).optional(),
|
|
842
|
+
first_name: z.string().max(150).optional(),
|
|
843
|
+
last_name: z.string().max(150).optional(),
|
|
844
|
+
email: z.string().email().max(70),
|
|
845
|
+
phone: z.string().max(50).optional(),
|
|
846
|
+
label: z.string().max(50).optional(),
|
|
847
|
+
enabled: z.boolean().default(false).optional(),
|
|
848
|
+
send_billing_email: z.boolean().default(false).optional(),
|
|
849
|
+
send_account_email: z.boolean().default(false).optional(),
|
|
850
|
+
});
|
|
851
|
+
const AddContactCustomerBodySchema = z.looseObject({
|
|
852
|
+
contact: AddContactCustomerContactSchema.optional(),
|
|
853
|
+
});
|
|
854
|
+
export { AddContactCustomerBodySchema };
|
|
855
|
+
//Customer.updateContact
|
|
856
|
+
const UpdateContactCustomerContactSchema = z.object({
|
|
857
|
+
id: z.string().max(150),
|
|
858
|
+
first_name: z.string().max(150).optional(),
|
|
859
|
+
last_name: z.string().max(150).optional(),
|
|
860
|
+
email: z.string().email().max(70).optional(),
|
|
861
|
+
phone: z.string().max(50).optional(),
|
|
862
|
+
label: z.string().max(50).optional(),
|
|
863
|
+
enabled: z.boolean().default(false).optional(),
|
|
864
|
+
send_billing_email: z.boolean().default(false).optional(),
|
|
865
|
+
send_account_email: z.boolean().default(false).optional(),
|
|
866
|
+
});
|
|
867
|
+
const UpdateContactCustomerBodySchema = z.looseObject({
|
|
868
|
+
contact: UpdateContactCustomerContactSchema.optional(),
|
|
869
|
+
});
|
|
870
|
+
export { UpdateContactCustomerBodySchema };
|
|
871
|
+
//Customer.deleteContact
|
|
872
|
+
const DeleteContactCustomerContactSchema = z.object({
|
|
873
|
+
id: z.string().max(150),
|
|
874
|
+
});
|
|
875
|
+
const DeleteContactCustomerBodySchema = z.looseObject({
|
|
876
|
+
contact: DeleteContactCustomerContactSchema.optional(),
|
|
877
|
+
});
|
|
878
|
+
export { DeleteContactCustomerBodySchema };
|
|
879
|
+
//Customer.addPromotionalCredits
|
|
880
|
+
const AddPromotionalCreditsCustomerBodySchema = z.looseObject({
|
|
881
|
+
amount: z.number().int().min(1),
|
|
882
|
+
currency_code: z.string().max(3).optional(),
|
|
883
|
+
description: z.string().max(250),
|
|
884
|
+
credit_type: z
|
|
885
|
+
.enum(['loyalty_credits', 'referral_rewards', 'general'])
|
|
886
|
+
.optional(),
|
|
887
|
+
reference: z.string().max(500).optional(),
|
|
888
|
+
});
|
|
889
|
+
export { AddPromotionalCreditsCustomerBodySchema };
|
|
890
|
+
//Customer.deductPromotionalCredits
|
|
891
|
+
const DeductPromotionalCreditsCustomerBodySchema = z.looseObject({
|
|
892
|
+
amount: z.number().int().min(1),
|
|
893
|
+
currency_code: z.string().max(3).optional(),
|
|
894
|
+
description: z.string().max(250),
|
|
895
|
+
credit_type: z
|
|
896
|
+
.enum(['loyalty_credits', 'referral_rewards', 'general'])
|
|
897
|
+
.optional(),
|
|
898
|
+
reference: z.string().max(500).optional(),
|
|
899
|
+
});
|
|
900
|
+
export { DeductPromotionalCreditsCustomerBodySchema };
|
|
901
|
+
//Customer.setPromotionalCredits
|
|
902
|
+
const SetPromotionalCreditsCustomerBodySchema = z.looseObject({
|
|
903
|
+
amount: z.number().int().min(0),
|
|
904
|
+
currency_code: z.string().max(3).optional(),
|
|
905
|
+
description: z.string().max(250),
|
|
906
|
+
credit_type: z
|
|
907
|
+
.enum(['loyalty_credits', 'referral_rewards', 'general'])
|
|
908
|
+
.optional(),
|
|
909
|
+
reference: z.string().max(500).optional(),
|
|
910
|
+
});
|
|
911
|
+
export { SetPromotionalCreditsCustomerBodySchema };
|
|
912
|
+
//Customer.recordExcessPayment
|
|
913
|
+
const RecordExcessPaymentCustomerTransactionSchema = z.object({
|
|
914
|
+
id: z.string().max(40).optional(),
|
|
915
|
+
amount: z.number().int().min(0),
|
|
916
|
+
currency_code: z.string().max(3).optional(),
|
|
917
|
+
date: z.number().int(),
|
|
918
|
+
payment_method: z.enum([
|
|
919
|
+
'cash',
|
|
920
|
+
'check',
|
|
921
|
+
'bank_transfer',
|
|
922
|
+
'other',
|
|
923
|
+
'app_store',
|
|
924
|
+
'play_store',
|
|
925
|
+
'custom',
|
|
926
|
+
]),
|
|
927
|
+
reference_number: z.string().max(100).optional(),
|
|
928
|
+
custom_payment_method_id: z.string().max(50).optional(),
|
|
929
|
+
});
|
|
930
|
+
const RecordExcessPaymentCustomerBodySchema = z.looseObject({
|
|
931
|
+
comment: z.string().max(300).optional(),
|
|
932
|
+
transaction: RecordExcessPaymentCustomerTransactionSchema.optional(),
|
|
933
|
+
});
|
|
934
|
+
export { RecordExcessPaymentCustomerBodySchema };
|
|
935
|
+
//Customer.collectPayment
|
|
936
|
+
const CollectPaymentCustomerAdditionalInformationSchema = z.looseObject({});
|
|
937
|
+
const CollectPaymentCustomerPaymentMethodSchema = z.object({
|
|
938
|
+
type: z
|
|
939
|
+
.enum([
|
|
940
|
+
'card',
|
|
941
|
+
'paypal_express_checkout',
|
|
942
|
+
'amazon_payments',
|
|
943
|
+
'direct_debit',
|
|
944
|
+
'generic',
|
|
945
|
+
'alipay',
|
|
946
|
+
'unionpay',
|
|
947
|
+
'apple_pay',
|
|
948
|
+
'wechat_pay',
|
|
949
|
+
'ideal',
|
|
950
|
+
'google_pay',
|
|
951
|
+
'sofort',
|
|
952
|
+
'bancontact',
|
|
953
|
+
'giropay',
|
|
954
|
+
'dotpay',
|
|
955
|
+
'upi',
|
|
956
|
+
'netbanking_emandates',
|
|
957
|
+
'venmo',
|
|
958
|
+
'pay_to',
|
|
959
|
+
'faster_payments',
|
|
960
|
+
'sepa_instant_transfer',
|
|
961
|
+
'automated_bank_transfer',
|
|
962
|
+
'klarna_pay_now',
|
|
963
|
+
'online_banking_poland',
|
|
964
|
+
'payconiq_by_bancontact',
|
|
965
|
+
'electronic_payment_standard',
|
|
966
|
+
'kbc_payment_button',
|
|
967
|
+
'pay_by_bank',
|
|
968
|
+
'trustly',
|
|
969
|
+
'stablecoin',
|
|
970
|
+
'kakao_pay',
|
|
971
|
+
'naver_pay',
|
|
972
|
+
'revolut_pay',
|
|
973
|
+
'cash_app_pay',
|
|
974
|
+
'twint',
|
|
975
|
+
'go_pay',
|
|
976
|
+
'grab_pay',
|
|
977
|
+
'pay_co',
|
|
978
|
+
'after_pay',
|
|
979
|
+
'swish',
|
|
980
|
+
'payme',
|
|
981
|
+
'pix',
|
|
982
|
+
'klarna',
|
|
983
|
+
'alipay_hk',
|
|
984
|
+
'paypay',
|
|
985
|
+
'gcash',
|
|
986
|
+
'south_korean_cards',
|
|
987
|
+
])
|
|
988
|
+
.optional(),
|
|
989
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
990
|
+
reference_id: z.string().max(200).optional(),
|
|
991
|
+
tmp_token: z.string().max(65000).optional(),
|
|
992
|
+
additional_information: CollectPaymentCustomerAdditionalInformationSchema.optional(),
|
|
993
|
+
});
|
|
994
|
+
const CollectPaymentCustomerCardSchema = z.object({
|
|
995
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
996
|
+
first_name: z.string().max(50).optional(),
|
|
997
|
+
last_name: z.string().max(50).optional(),
|
|
998
|
+
number: z.string().max(1500).optional(),
|
|
999
|
+
expiry_month: z.number().int().min(1).max(12).optional(),
|
|
1000
|
+
expiry_year: z.number().int().optional(),
|
|
1001
|
+
cvv: z.string().max(520).optional(),
|
|
1002
|
+
preferred_scheme: z
|
|
1003
|
+
.enum(['cartes_bancaires', 'mastercard', 'visa'])
|
|
1004
|
+
.optional(),
|
|
1005
|
+
billing_addr1: z.string().max(150).optional(),
|
|
1006
|
+
billing_addr2: z.string().max(150).optional(),
|
|
1007
|
+
billing_city: z.string().max(50).optional(),
|
|
1008
|
+
billing_state_code: z.string().max(50).optional(),
|
|
1009
|
+
billing_state: z.string().max(50).optional(),
|
|
1010
|
+
billing_zip: z.string().max(20).optional(),
|
|
1011
|
+
billing_country: z.string().max(50).optional(),
|
|
1012
|
+
additional_information: CollectPaymentCustomerAdditionalInformationSchema.optional(),
|
|
1013
|
+
});
|
|
1014
|
+
const CollectPaymentCustomerPaymentIntentSchema = z.object({
|
|
1015
|
+
id: z.string().max(150).optional(),
|
|
1016
|
+
gateway_account_id: z.string().max(50).optional(),
|
|
1017
|
+
gw_token: z.string().max(65000).optional(),
|
|
1018
|
+
payment_method_type: z
|
|
1019
|
+
.enum([
|
|
1020
|
+
'card',
|
|
1021
|
+
'ideal',
|
|
1022
|
+
'sofort',
|
|
1023
|
+
'bancontact',
|
|
1024
|
+
'google_pay',
|
|
1025
|
+
'dotpay',
|
|
1026
|
+
'giropay',
|
|
1027
|
+
'apple_pay',
|
|
1028
|
+
'upi',
|
|
1029
|
+
'netbanking_emandates',
|
|
1030
|
+
'paypal_express_checkout',
|
|
1031
|
+
'direct_debit',
|
|
1032
|
+
'boleto',
|
|
1033
|
+
'venmo',
|
|
1034
|
+
'amazon_payments',
|
|
1035
|
+
'pay_to',
|
|
1036
|
+
'faster_payments',
|
|
1037
|
+
'sepa_instant_transfer',
|
|
1038
|
+
'klarna_pay_now',
|
|
1039
|
+
'online_banking_poland',
|
|
1040
|
+
'payconiq_by_bancontact',
|
|
1041
|
+
'electronic_payment_standard',
|
|
1042
|
+
'kbc_payment_button',
|
|
1043
|
+
'pay_by_bank',
|
|
1044
|
+
'trustly',
|
|
1045
|
+
'stablecoin',
|
|
1046
|
+
'kakao_pay',
|
|
1047
|
+
'naver_pay',
|
|
1048
|
+
'revolut_pay',
|
|
1049
|
+
'cash_app_pay',
|
|
1050
|
+
'wechat_pay',
|
|
1051
|
+
'alipay',
|
|
1052
|
+
'twint',
|
|
1053
|
+
'go_pay',
|
|
1054
|
+
'grab_pay',
|
|
1055
|
+
'pay_co',
|
|
1056
|
+
'after_pay',
|
|
1057
|
+
'swish',
|
|
1058
|
+
'payme',
|
|
1059
|
+
'pix',
|
|
1060
|
+
'klarna',
|
|
1061
|
+
'alipay_hk',
|
|
1062
|
+
'paypay',
|
|
1063
|
+
'gcash',
|
|
1064
|
+
'south_korean_cards',
|
|
1065
|
+
])
|
|
1066
|
+
.optional(),
|
|
1067
|
+
gw_payment_method_id: z.string().max(65000).optional(),
|
|
1068
|
+
reference_id: z.string().max(65000).optional(),
|
|
1069
|
+
additional_information: CollectPaymentCustomerAdditionalInformationSchema.optional(),
|
|
1070
|
+
});
|
|
1071
|
+
const CollectPaymentCustomerInvoiceAllocationsSchema = z.object({
|
|
1072
|
+
invoice_id: z.array(z.string().max(50).optional()),
|
|
1073
|
+
allocation_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
1074
|
+
});
|
|
1075
|
+
const CollectPaymentCustomerBodySchema = z.looseObject({
|
|
1076
|
+
amount: z.number().int().min(0).optional(),
|
|
1077
|
+
payment_source_id: z.string().max(40).optional(),
|
|
1078
|
+
token_id: z.string().max(40).optional(),
|
|
1079
|
+
replace_primary_payment_source: z.boolean().default(false).optional(),
|
|
1080
|
+
retain_payment_source: z.boolean().default(false).optional(),
|
|
1081
|
+
payment_initiator: z.enum(['customer', 'merchant']).optional(),
|
|
1082
|
+
payment_method: CollectPaymentCustomerPaymentMethodSchema.optional(),
|
|
1083
|
+
card: CollectPaymentCustomerCardSchema.optional(),
|
|
1084
|
+
payment_intent: CollectPaymentCustomerPaymentIntentSchema.optional(),
|
|
1085
|
+
invoice_allocations: CollectPaymentCustomerInvoiceAllocationsSchema.optional(),
|
|
1086
|
+
});
|
|
1087
|
+
export { CollectPaymentCustomerBodySchema };
|
|
1088
|
+
//Customer.delete
|
|
1089
|
+
const DeleteCustomerBodySchema = z.looseObject({
|
|
1090
|
+
delete_payment_method: z.boolean().default(true).optional(),
|
|
1091
|
+
});
|
|
1092
|
+
export { DeleteCustomerBodySchema };
|
|
1093
|
+
//Customer.move
|
|
1094
|
+
const MoveCustomerBodySchema = z.looseObject({
|
|
1095
|
+
id_at_from_site: z.string().max(100),
|
|
1096
|
+
from_site: z.string().max(50),
|
|
1097
|
+
});
|
|
1098
|
+
export { MoveCustomerBodySchema };
|
|
1099
|
+
//Customer.changeBillingDate
|
|
1100
|
+
const ChangeBillingDateCustomerBodySchema = z.looseObject({
|
|
1101
|
+
billing_date: z.number().int().min(1).max(31).optional(),
|
|
1102
|
+
billing_month: z.number().int().min(1).max(12).optional(),
|
|
1103
|
+
billing_date_mode: z.enum(['using_defaults', 'manually_set']).optional(),
|
|
1104
|
+
billing_day_of_week: z
|
|
1105
|
+
.enum([
|
|
1106
|
+
'sunday',
|
|
1107
|
+
'monday',
|
|
1108
|
+
'tuesday',
|
|
1109
|
+
'wednesday',
|
|
1110
|
+
'thursday',
|
|
1111
|
+
'friday',
|
|
1112
|
+
'saturday',
|
|
1113
|
+
])
|
|
1114
|
+
.optional(),
|
|
1115
|
+
billing_day_of_week_mode: z
|
|
1116
|
+
.enum(['using_defaults', 'manually_set'])
|
|
1117
|
+
.optional(),
|
|
1118
|
+
});
|
|
1119
|
+
export { ChangeBillingDateCustomerBodySchema };
|
|
1120
|
+
//Customer.merge
|
|
1121
|
+
const MergeCustomerBodySchema = z.looseObject({
|
|
1122
|
+
from_customer_id: z.string().max(50),
|
|
1123
|
+
to_customer_id: z.string().max(50),
|
|
1124
|
+
});
|
|
1125
|
+
export { MergeCustomerBodySchema };
|
|
1126
|
+
//Customer.relationships
|
|
1127
|
+
const RelationshipsCustomerParentAccountAccessSchema = z.object({
|
|
1128
|
+
portal_edit_child_subscriptions: z
|
|
1129
|
+
.enum(['yes', 'view_only', 'no'])
|
|
1130
|
+
.optional(),
|
|
1131
|
+
portal_download_child_invoices: z.enum(['yes', 'view_only', 'no']).optional(),
|
|
1132
|
+
send_subscription_emails: z.boolean().optional(),
|
|
1133
|
+
send_payment_emails: z.boolean().optional(),
|
|
1134
|
+
send_invoice_emails: z.boolean().optional(),
|
|
1135
|
+
});
|
|
1136
|
+
const RelationshipsCustomerChildAccountAccessSchema = z.object({
|
|
1137
|
+
portal_edit_subscriptions: z.enum(['yes', 'view_only']).optional(),
|
|
1138
|
+
portal_download_invoices: z.enum(['yes', 'view_only', 'no']).optional(),
|
|
1139
|
+
send_subscription_emails: z.boolean().optional(),
|
|
1140
|
+
send_payment_emails: z.boolean().optional(),
|
|
1141
|
+
send_invoice_emails: z.boolean().optional(),
|
|
1142
|
+
});
|
|
1143
|
+
const RelationshipsCustomerBodySchema = z.looseObject({
|
|
1144
|
+
parent_id: z.string().max(50).optional(),
|
|
1145
|
+
payment_owner_id: z.string().max(50).optional(),
|
|
1146
|
+
invoice_owner_id: z.string().max(50).optional(),
|
|
1147
|
+
use_default_hierarchy_settings: z.boolean().default(true).optional(),
|
|
1148
|
+
parent_account_access: RelationshipsCustomerParentAccountAccessSchema.optional(),
|
|
1149
|
+
child_account_access: RelationshipsCustomerChildAccountAccessSchema.optional(),
|
|
1150
|
+
});
|
|
1151
|
+
export { RelationshipsCustomerBodySchema };
|
|
1152
|
+
//Customer.hierarchy
|
|
1153
|
+
const HierarchyCustomerBodySchema = z.looseObject({
|
|
1154
|
+
hierarchy_operation_type: z.enum([
|
|
1155
|
+
'complete_hierarchy',
|
|
1156
|
+
'subordinates',
|
|
1157
|
+
'path_to_root',
|
|
1158
|
+
'subordinates_with_unbilled_charges_payable_by_parent',
|
|
1159
|
+
'immediate_children',
|
|
1160
|
+
]),
|
|
1161
|
+
});
|
|
1162
|
+
export { HierarchyCustomerBodySchema };
|
|
1163
|
+
//Customer.listHierarchyDetail
|
|
1164
|
+
const ListHierarchyDetailCustomerBodySchema = z.looseObject({
|
|
1165
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
1166
|
+
offset: z.string().max(1000).optional(),
|
|
1167
|
+
hierarchy_operation_type: z.enum([
|
|
1168
|
+
'complete_hierarchy',
|
|
1169
|
+
'subordinates',
|
|
1170
|
+
'path_to_root',
|
|
1171
|
+
'subordinates_with_unbilled_charges_payable_by_parent',
|
|
1172
|
+
'immediate_children',
|
|
1173
|
+
]),
|
|
1174
|
+
});
|
|
1175
|
+
export { ListHierarchyDetailCustomerBodySchema };
|
|
1176
|
+
//Customer.updateHierarchySettings
|
|
1177
|
+
const UpdateHierarchySettingsCustomerParentAccountAccessSchema = z.object({
|
|
1178
|
+
portal_edit_child_subscriptions: z
|
|
1179
|
+
.enum(['yes', 'view_only', 'no'])
|
|
1180
|
+
.optional(),
|
|
1181
|
+
portal_download_child_invoices: z.enum(['yes', 'view_only', 'no']).optional(),
|
|
1182
|
+
send_subscription_emails: z.boolean().optional(),
|
|
1183
|
+
send_payment_emails: z.boolean().optional(),
|
|
1184
|
+
send_invoice_emails: z.boolean().optional(),
|
|
1185
|
+
});
|
|
1186
|
+
const UpdateHierarchySettingsCustomerChildAccountAccessSchema = z.object({
|
|
1187
|
+
portal_edit_subscriptions: z.enum(['yes', 'view_only']).optional(),
|
|
1188
|
+
portal_download_invoices: z.enum(['yes', 'view_only', 'no']).optional(),
|
|
1189
|
+
send_subscription_emails: z.boolean().optional(),
|
|
1190
|
+
send_payment_emails: z.boolean().optional(),
|
|
1191
|
+
send_invoice_emails: z.boolean().optional(),
|
|
1192
|
+
});
|
|
1193
|
+
const UpdateHierarchySettingsCustomerBodySchema = z.looseObject({
|
|
1194
|
+
use_default_hierarchy_settings: z.boolean().default(true).optional(),
|
|
1195
|
+
parent_account_access: UpdateHierarchySettingsCustomerParentAccountAccessSchema.optional(),
|
|
1196
|
+
child_account_access: UpdateHierarchySettingsCustomerChildAccountAccessSchema.optional(),
|
|
1197
|
+
});
|
|
1198
|
+
export { UpdateHierarchySettingsCustomerBodySchema };
|