chargebee
Version:
A library for integrating with Chargebee.
1,202 lines (1,201 loc) • 44.6 kB
JavaScript
"use strict";
// Generated Zod schemas: Customer
// Actions: create, list, update, updatePaymentMethod, updateBillingInfo, contactsForCustomer, assignPaymentRole, addContact, updateContact, deleteContact, addPromotionalCredits, deductPromotionalCredits, setPromotionalCredits, recordExcessPayment, collectPayment, delete, move, changeBillingDate, merge, relationships, hierarchy, listHierarchyDetail, updateHierarchySettings
// Do not edit manually – regenerate via sdk-generator
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateHierarchySettingsCustomerBodySchema = exports.ListHierarchyDetailCustomerBodySchema = exports.HierarchyCustomerBodySchema = exports.RelationshipsCustomerBodySchema = exports.MergeCustomerBodySchema = exports.ChangeBillingDateCustomerBodySchema = exports.MoveCustomerBodySchema = exports.DeleteCustomerBodySchema = exports.CollectPaymentCustomerBodySchema = exports.RecordExcessPaymentCustomerBodySchema = exports.SetPromotionalCreditsCustomerBodySchema = exports.DeductPromotionalCreditsCustomerBodySchema = exports.AddPromotionalCreditsCustomerBodySchema = exports.DeleteContactCustomerBodySchema = exports.UpdateContactCustomerBodySchema = exports.AddContactCustomerBodySchema = exports.AssignPaymentRoleCustomerBodySchema = exports.ContactsForCustomerCustomerBodySchema = exports.UpdateBillingInfoCustomerBodySchema = exports.UpdatePaymentMethodCustomerBodySchema = exports.UpdateCustomerBodySchema = exports.ListCustomerBodySchema = exports.CreateCustomerBodySchema = void 0;
const zod_1 = require("zod");
//Customer.create
const CreateCustomerMetaDataSchema = zod_1.z.looseObject({});
const CreateCustomerAdditionalInformationSchema = zod_1.z.looseObject({});
const CreateCustomerCardSchema = zod_1.z.object({
gateway: zod_1.z
.enum([
'chargebee',
'chargebee_payments',
'adyen',
'stripe',
'wepay',
'braintree',
'authorize_net',
'paypal_pro',
'pin',
'eway',
'eway_rapid',
'worldpay',
'balanced_payments',
'beanstream',
'bluepay',
'elavon',
'first_data_global',
'hdfc',
'migs',
'nmi',
'ogone',
'paymill',
'paypal_payflow_pro',
'sage_pay',
'tco',
'wirecard',
'amazon_payments',
'paypal_express_checkout',
'orbital',
'moneris_us',
'moneris',
'bluesnap',
'cybersource',
'vantiv',
'checkout_com',
'paypal',
'ingenico_direct',
'exact',
'mollie',
'quickbooks',
'razorpay',
'global_payments',
'bank_of_america',
'ecentric',
'metrics_global',
'windcave',
'pay_com',
'ebanx',
'dlocal',
'nuvei',
'solidgate',
'paystack',
'jp_morgan',
'deutsche_bank',
'ezidebit',
'twikey',
'tempus',
'moyasar',
'payway',
])
.optional(),
gateway_account_id: zod_1.z.string().max(50).optional(),
tmp_token: zod_1.z.string().max(300).optional(),
first_name: zod_1.z.string().max(50).optional(),
last_name: zod_1.z.string().max(50).optional(),
number: zod_1.z.string().max(1500).optional(),
expiry_month: zod_1.z.number().int().min(1).max(12).optional(),
expiry_year: zod_1.z.number().int().optional(),
cvv: zod_1.z.string().max(520).optional(),
preferred_scheme: zod_1.z
.enum(['cartes_bancaires', 'mastercard', 'visa'])
.optional(),
billing_addr1: zod_1.z.string().max(150).optional(),
billing_addr2: zod_1.z.string().max(150).optional(),
billing_city: zod_1.z.string().max(50).optional(),
billing_state_code: zod_1.z.string().max(50).optional(),
billing_state: zod_1.z.string().max(50).optional(),
billing_zip: zod_1.z.string().max(20).optional(),
billing_country: zod_1.z.string().max(50).optional(),
ip_address: zod_1.z.string().max(50).optional(),
additional_information: CreateCustomerAdditionalInformationSchema.optional(),
});
const CreateCustomerBillingAddressSchema = zod_1.z.looseObject({});
const CreateCustomerBankAccountSchema = zod_1.z.object({
gateway_account_id: zod_1.z.string().max(50).optional(),
iban: zod_1.z.string().max(50).min(10).optional(),
first_name: zod_1.z.string().max(150).optional(),
last_name: zod_1.z.string().max(150).optional(),
company: zod_1.z.string().max(250).optional(),
email: zod_1.z.string().email().max(70).optional(),
phone: zod_1.z.string().max(50).optional(),
bank_name: zod_1.z.string().max(100).optional(),
account_number: zod_1.z.string().max(17).min(4).optional(),
routing_number: zod_1.z.string().max(9).min(3).optional(),
bank_code: zod_1.z.string().max(20).optional(),
account_type: zod_1.z
.enum(['checking', 'savings', 'business_checking', 'current'])
.optional(),
account_holder_type: zod_1.z.enum(['individual', 'company']).optional(),
echeck_type: zod_1.z.enum(['web', 'ppd', 'ccd']).optional(),
issuing_country: zod_1.z.string().max(50).optional(),
swedish_identity_number: zod_1.z.string().max(12).min(10).optional(),
billing_address: CreateCustomerBillingAddressSchema.optional(),
});
const CreateCustomerPaymentMethodSchema = zod_1.z.object({
type: zod_1.z
.enum([
'card',
'paypal_express_checkout',
'amazon_payments',
'direct_debit',
'generic',
'alipay',
'unionpay',
'apple_pay',
'wechat_pay',
'ideal',
'google_pay',
'sofort',
'bancontact',
'giropay',
'dotpay',
'upi',
'netbanking_emandates',
'venmo',
'pay_to',
'faster_payments',
'sepa_instant_transfer',
'automated_bank_transfer',
'klarna_pay_now',
'online_banking_poland',
'payconiq_by_bancontact',
'electronic_payment_standard',
'kbc_payment_button',
'pay_by_bank',
'trustly',
'stablecoin',
'kakao_pay',
'naver_pay',
'revolut_pay',
'cash_app_pay',
'twint',
'go_pay',
'grab_pay',
'pay_co',
'after_pay',
'swish',
'payme',
'pix',
'klarna',
'alipay_hk',
'paypay',
'gcash',
'south_korean_cards',
])
.optional(),
gateway: zod_1.z
.enum([
'chargebee_payments',
'adyen',
'stripe',
'wepay',
'braintree',
'authorize_net',
'paypal_pro',
'pin',
'eway',
'eway_rapid',
'worldpay',
'balanced_payments',
'beanstream',
'bluepay',
'elavon',
'first_data_global',
'hdfc',
'migs',
'nmi',
'ogone',
'paymill',
'paypal_payflow_pro',
'sage_pay',
'tco',
'wirecard',
'amazon_payments',
'paypal_express_checkout',
'gocardless',
'orbital',
'moneris_us',
'moneris',
'bluesnap',
'cybersource',
'vantiv',
'checkout_com',
'paypal',
'ingenico_direct',
'exact',
'mollie',
'quickbooks',
'razorpay',
'global_payments',
'bank_of_america',
'ecentric',
'metrics_global',
'windcave',
'pay_com',
'ebanx',
'dlocal',
'nuvei',
'solidgate',
'paystack',
'jp_morgan',
'deutsche_bank',
'ezidebit',
'twikey',
'tempus',
'moyasar',
'payway',
])
.optional(),
gateway_account_id: zod_1.z.string().max(50).optional(),
reference_id: zod_1.z.string().max(200).optional(),
tmp_token: zod_1.z.string().max(65000).optional(),
issuing_country: zod_1.z.string().max(50).optional(),
additional_information: CreateCustomerAdditionalInformationSchema.optional(),
});
const CreateCustomerPaymentIntentSchema = zod_1.z.object({
id: zod_1.z.string().max(150).optional(),
gateway_account_id: zod_1.z.string().max(50).optional(),
gw_token: zod_1.z.string().max(65000).optional(),
payment_method_type: zod_1.z
.enum([
'card',
'ideal',
'sofort',
'bancontact',
'google_pay',
'dotpay',
'giropay',
'apple_pay',
'upi',
'netbanking_emandates',
'paypal_express_checkout',
'direct_debit',
'boleto',
'venmo',
'amazon_payments',
'pay_to',
'faster_payments',
'sepa_instant_transfer',
'klarna_pay_now',
'online_banking_poland',
'payconiq_by_bancontact',
'electronic_payment_standard',
'kbc_payment_button',
'pay_by_bank',
'trustly',
'stablecoin',
'kakao_pay',
'naver_pay',
'revolut_pay',
'cash_app_pay',
'wechat_pay',
'alipay',
'twint',
'go_pay',
'grab_pay',
'pay_co',
'after_pay',
'swish',
'payme',
'pix',
'klarna',
'alipay_hk',
'paypay',
'gcash',
'south_korean_cards',
])
.optional(),
reference_id: zod_1.z.string().max(65000).optional(),
gw_payment_method_id: zod_1.z.string().max(65000).optional(),
additional_information: CreateCustomerAdditionalInformationSchema.optional(),
});
const CreateCustomerEntityIdentifiersSchema = zod_1.z.object({
id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
scheme: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
standard: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
});
const CreateCustomerTaxProvidersFieldsSchema = zod_1.z.object({
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
});
const CreateCustomerBodySchema = zod_1.z.looseObject({
id: zod_1.z.string().max(50).optional(),
first_name: zod_1.z.string().max(150).optional(),
last_name: zod_1.z.string().max(150).optional(),
email: zod_1.z.string().email().max(70).optional(),
preferred_currency_code: zod_1.z.string().max(3).optional(),
phone: zod_1.z.string().max(50).optional(),
company: zod_1.z.string().max(250).optional(),
auto_collection: zod_1.z.enum(['on', 'off']).optional(),
net_term_days: zod_1.z.number().int().optional(),
allow_direct_debit: zod_1.z.boolean().default(false).optional(),
vat_number: zod_1.z.string().max(20).optional(),
vat_number_prefix: zod_1.z.string().max(10).optional(),
entity_identifier_scheme: zod_1.z.string().max(50).optional(),
entity_identifier_standard: zod_1.z.string().max(50).optional(),
registered_for_gst: zod_1.z.boolean().optional(),
is_einvoice_enabled: zod_1.z.boolean().optional(),
einvoicing_method: zod_1.z.enum(['automatic', 'manual', 'site_default']).optional(),
taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
exemption_details: zod_1.z.array(zod_1.z.string().optional()).optional(),
customer_type: zod_1.z
.enum(['residential', 'business', 'senior_citizen', 'industrial'])
.optional(),
client_profile_id: zod_1.z.string().max(50).optional(),
taxjar_exemption_category: zod_1.z
.enum(['wholesale', 'government', 'other'])
.optional(),
business_customer_without_vat_number: zod_1.z.boolean().optional(),
locale: zod_1.z.string().max(50).optional(),
entity_code: zod_1.z
.enum([
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'p',
'q',
'r',
'med1',
'med2',
])
.optional(),
exempt_number: zod_1.z.string().max(100).optional(),
meta_data: CreateCustomerMetaDataSchema.optional(),
offline_payment_method: zod_1.z
.enum([
'no_preference',
'cash',
'check',
'bank_transfer',
'ach_credit',
'sepa_credit',
'boleto',
'us_automated_bank_transfer',
'eu_automated_bank_transfer',
'uk_automated_bank_transfer',
'jp_automated_bank_transfer',
'mx_automated_bank_transfer',
'custom',
])
.optional(),
auto_close_invoices: zod_1.z.boolean().optional(),
consolidated_invoicing: zod_1.z.boolean().optional(),
token_id: zod_1.z.string().max(40).optional(),
business_entity_id: zod_1.z.string().max(50).optional(),
created_from_ip: zod_1.z.string().max(50).optional(),
invoice_notes: zod_1.z.string().max(2000).optional(),
card: CreateCustomerCardSchema.optional(),
bank_account: CreateCustomerBankAccountSchema.optional(),
payment_method: CreateCustomerPaymentMethodSchema.optional(),
payment_intent: CreateCustomerPaymentIntentSchema.optional(),
billing_address: CreateCustomerBillingAddressSchema.optional(),
entity_identifiers: CreateCustomerEntityIdentifiersSchema.optional(),
tax_providers_fields: CreateCustomerTaxProvidersFieldsSchema.optional(),
});
exports.CreateCustomerBodySchema = CreateCustomerBodySchema;
//Customer.list
const ListCustomerIdSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
});
const ListCustomerFirstNameSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
is_present: zod_1.z.enum(['true', 'false']).optional(),
});
const ListCustomerLastNameSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
is_present: zod_1.z.enum(['true', 'false']).optional(),
});
const ListCustomerEmailSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
is_present: zod_1.z.enum(['true', 'false']).optional(),
});
const ListCustomerCompanySchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
is_present: zod_1.z.enum(['true', 'false']).optional(),
});
const ListCustomerPhoneSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
is_present: zod_1.z.enum(['true', 'false']).optional(),
});
const ListCustomerAutoCollectionSchema = zod_1.z.object({
is: zod_1.z.enum(['on', 'off']).optional(),
is_not: zod_1.z.enum(['on', 'off']).optional(),
in: zod_1.z.enum(['on', 'off']).optional(),
not_in: zod_1.z.enum(['on', 'off']).optional(),
});
const ListCustomerTaxabilitySchema = zod_1.z.object({
is: zod_1.z.enum(['taxable', 'exempt']).optional(),
is_not: zod_1.z.enum(['taxable', 'exempt']).optional(),
in: zod_1.z.enum(['taxable', 'exempt']).optional(),
not_in: zod_1.z.enum(['taxable', 'exempt']).optional(),
});
const ListCustomerCreatedAtSchema = zod_1.z.object({
after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
});
const ListCustomerUpdatedAtSchema = zod_1.z.object({
after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
});
const ListCustomerOfflinePaymentMethodSchema = zod_1.z.object({
is: zod_1.z
.enum([
'no_preference',
'cash',
'check',
'bank_transfer',
'ach_credit',
'sepa_credit',
'boleto',
'us_automated_bank_transfer',
'eu_automated_bank_transfer',
'uk_automated_bank_transfer',
'jp_automated_bank_transfer',
'mx_automated_bank_transfer',
'custom',
])
.optional(),
is_not: zod_1.z
.enum([
'no_preference',
'cash',
'check',
'bank_transfer',
'ach_credit',
'sepa_credit',
'boleto',
'us_automated_bank_transfer',
'eu_automated_bank_transfer',
'uk_automated_bank_transfer',
'jp_automated_bank_transfer',
'mx_automated_bank_transfer',
'custom',
])
.optional(),
in: zod_1.z
.enum([
'no_preference',
'cash',
'check',
'bank_transfer',
'ach_credit',
'sepa_credit',
'boleto',
'us_automated_bank_transfer',
'eu_automated_bank_transfer',
'uk_automated_bank_transfer',
'jp_automated_bank_transfer',
'mx_automated_bank_transfer',
'custom',
])
.optional(),
not_in: zod_1.z
.enum([
'no_preference',
'cash',
'check',
'bank_transfer',
'ach_credit',
'sepa_credit',
'boleto',
'us_automated_bank_transfer',
'eu_automated_bank_transfer',
'uk_automated_bank_transfer',
'jp_automated_bank_transfer',
'mx_automated_bank_transfer',
'custom',
])
.optional(),
});
const ListCustomerAutoCloseInvoicesSchema = zod_1.z.object({
is: zod_1.z.enum(['true', 'false']).optional(),
});
const ListCustomerChannelSchema = zod_1.z.object({
is: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
is_not: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
not_in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
});
const ListCustomerBusinessEntityIdSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
});
const ListCustomerSortBySchema = zod_1.z.looseObject({
asc: zod_1.z.enum(['created_at', 'updated_at']).optional(),
desc: zod_1.z.enum(['created_at', 'updated_at']).optional(),
});
const ListCustomerParentIdSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
});
const ListCustomerPaymentOwnerIdSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
});
const ListCustomerInvoiceOwnerIdSchema = zod_1.z.object({
is: zod_1.z.string().min(1).optional(),
is_not: zod_1.z.string().min(1).optional(),
starts_with: zod_1.z.string().min(1).optional(),
});
const ListCustomerRelationshipSchema = zod_1.z.object({
parent_id: ListCustomerParentIdSchema.optional(),
payment_owner_id: ListCustomerPaymentOwnerIdSchema.optional(),
invoice_owner_id: ListCustomerInvoiceOwnerIdSchema.optional(),
});
const ListCustomerBodySchema = zod_1.z.looseObject({
limit: zod_1.z.number().int().min(1).max(100).optional(),
offset: zod_1.z.string().max(1000).optional(),
include_deleted: zod_1.z.boolean().default(false).optional(),
id: ListCustomerIdSchema.optional(),
first_name: ListCustomerFirstNameSchema.optional(),
last_name: ListCustomerLastNameSchema.optional(),
email: ListCustomerEmailSchema.optional(),
company: ListCustomerCompanySchema.optional(),
phone: ListCustomerPhoneSchema.optional(),
auto_collection: ListCustomerAutoCollectionSchema.optional(),
taxability: ListCustomerTaxabilitySchema.optional(),
created_at: ListCustomerCreatedAtSchema.optional(),
updated_at: ListCustomerUpdatedAtSchema.optional(),
offline_payment_method: ListCustomerOfflinePaymentMethodSchema.optional(),
auto_close_invoices: ListCustomerAutoCloseInvoicesSchema.optional(),
channel: ListCustomerChannelSchema.optional(),
business_entity_id: ListCustomerBusinessEntityIdSchema.optional(),
sort_by: ListCustomerSortBySchema.optional(),
relationship: ListCustomerRelationshipSchema.optional(),
});
exports.ListCustomerBodySchema = ListCustomerBodySchema;
//Customer.update
const UpdateCustomerMetaDataSchema = zod_1.z.looseObject({});
const UpdateCustomerTaxProvidersFieldsSchema = zod_1.z.object({
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
});
const UpdateCustomerBodySchema = zod_1.z.looseObject({
first_name: zod_1.z.string().max(150).optional(),
last_name: zod_1.z.string().max(150).optional(),
email: zod_1.z.string().email().max(70).optional(),
preferred_currency_code: zod_1.z.string().max(3).optional(),
phone: zod_1.z.string().max(50).optional(),
company: zod_1.z.string().max(250).optional(),
auto_collection: zod_1.z.enum(['on', 'off']).optional(),
allow_direct_debit: zod_1.z.boolean().default(false).optional(),
net_term_days: zod_1.z.number().int().optional(),
taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
exemption_details: zod_1.z.array(zod_1.z.string().optional()).optional(),
customer_type: zod_1.z
.enum(['residential', 'business', 'senior_citizen', 'industrial'])
.optional(),
client_profile_id: zod_1.z.string().max(50).optional(),
taxjar_exemption_category: zod_1.z
.enum(['wholesale', 'government', 'other'])
.optional(),
locale: zod_1.z.string().max(50).optional(),
entity_code: zod_1.z
.enum([
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'p',
'q',
'r',
'med1',
'med2',
])
.optional(),
exempt_number: zod_1.z.string().max(100).optional(),
offline_payment_method: zod_1.z
.enum([
'no_preference',
'cash',
'check',
'bank_transfer',
'ach_credit',
'sepa_credit',
'boleto',
'us_automated_bank_transfer',
'eu_automated_bank_transfer',
'uk_automated_bank_transfer',
'jp_automated_bank_transfer',
'mx_automated_bank_transfer',
'custom',
])
.optional(),
invoice_notes: zod_1.z.string().max(2000).optional(),
auto_close_invoices: zod_1.z.boolean().optional(),
meta_data: UpdateCustomerMetaDataSchema.optional(),
fraud_flag: zod_1.z.enum(['safe', 'fraudulent']).optional(),
consolidated_invoicing: zod_1.z.boolean().optional(),
tax_providers_fields: UpdateCustomerTaxProvidersFieldsSchema.optional(),
});
exports.UpdateCustomerBodySchema = UpdateCustomerBodySchema;
//Customer.updatePaymentMethod
const UpdatePaymentMethodCustomerAdditionalInformationSchema = zod_1.z.looseObject({});
const UpdatePaymentMethodCustomerPaymentMethodSchema = zod_1.z.object({
type: zod_1.z.enum([
'card',
'paypal_express_checkout',
'amazon_payments',
'direct_debit',
'generic',
'alipay',
'unionpay',
'wechat_pay',
'ideal',
'google_pay',
'sofort',
'bancontact',
'giropay',
'dotpay',
'upi',
'netbanking_emandates',
'venmo',
'pay_to',
'faster_payments',
'sepa_instant_transfer',
'automated_bank_transfer',
'klarna_pay_now',
'online_banking_poland',
'payconiq_by_bancontact',
'electronic_payment_standard',
'kbc_payment_button',
'pay_by_bank',
'trustly',
'stablecoin',
'kakao_pay',
'naver_pay',
'revolut_pay',
'cash_app_pay',
'twint',
'go_pay',
'grab_pay',
'pay_co',
'after_pay',
'swish',
'payme',
'pix',
'klarna',
'alipay_hk',
'paypay',
'gcash',
'south_korean_cards',
]),
gateway: zod_1.z
.enum([
'chargebee_payments',
'adyen',
'stripe',
'wepay',
'braintree',
'authorize_net',
'paypal_pro',
'pin',
'eway',
'eway_rapid',
'worldpay',
'balanced_payments',
'beanstream',
'bluepay',
'elavon',
'first_data_global',
'hdfc',
'migs',
'nmi',
'ogone',
'paymill',
'paypal_payflow_pro',
'sage_pay',
'tco',
'wirecard',
'amazon_payments',
'paypal_express_checkout',
'gocardless',
'orbital',
'moneris_us',
'moneris',
'bluesnap',
'cybersource',
'vantiv',
'checkout_com',
'paypal',
'ingenico_direct',
'exact',
'mollie',
'quickbooks',
'razorpay',
'global_payments',
'bank_of_america',
'ecentric',
'metrics_global',
'windcave',
'pay_com',
'ebanx',
'dlocal',
'nuvei',
'solidgate',
'paystack',
'jp_morgan',
'deutsche_bank',
'ezidebit',
'twikey',
'tempus',
'moyasar',
'payway',
])
.optional(),
gateway_account_id: zod_1.z.string().max(50).optional(),
reference_id: zod_1.z.string().max(200).optional(),
tmp_token: zod_1.z.string().max(65000).optional(),
issuing_country: zod_1.z.string().max(50).optional(),
additional_information: UpdatePaymentMethodCustomerAdditionalInformationSchema.optional(),
});
const UpdatePaymentMethodCustomerBodySchema = zod_1.z.looseObject({
payment_method: UpdatePaymentMethodCustomerPaymentMethodSchema.optional(),
});
exports.UpdatePaymentMethodCustomerBodySchema = UpdatePaymentMethodCustomerBodySchema;
//Customer.updateBillingInfo
const UpdateBillingInfoCustomerBillingAddressSchema = zod_1.z.object({
first_name: zod_1.z.string().max(150).optional(),
last_name: zod_1.z.string().max(150).optional(),
email: zod_1.z.string().email().max(70).optional(),
company: zod_1.z.string().max(250).optional(),
phone: zod_1.z.string().max(50).optional(),
line1: zod_1.z.string().max(150).optional(),
line2: zod_1.z.string().max(150).optional(),
line3: zod_1.z.string().max(150).optional(),
city: zod_1.z.string().max(50).optional(),
state_code: zod_1.z.string().max(50).optional(),
state: zod_1.z.string().max(50).optional(),
zip: zod_1.z.string().max(20).optional(),
country: zod_1.z.string().max(50).optional(),
validation_status: zod_1.z
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
.optional(),
});
const UpdateBillingInfoCustomerEntityIdentifiersSchema = zod_1.z.object({
id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
scheme: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
operation: zod_1.z
.array(zod_1.z.enum(['create', 'update', 'delete']).optional())
.optional(),
standard: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
});
const UpdateBillingInfoCustomerTaxProvidersFieldsSchema = zod_1.z.object({
provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
});
const UpdateBillingInfoCustomerBodySchema = zod_1.z.looseObject({
vat_number: zod_1.z.string().max(20).optional(),
vat_number_prefix: zod_1.z.string().max(10).optional(),
entity_identifier_scheme: zod_1.z.string().max(50).optional(),
entity_identifier_standard: zod_1.z.string().max(50).optional(),
registered_for_gst: zod_1.z.boolean().optional(),
business_customer_without_vat_number: zod_1.z.boolean().optional(),
is_einvoice_enabled: zod_1.z.boolean().optional(),
einvoicing_method: zod_1.z.enum(['automatic', 'manual', 'site_default']).optional(),
billing_address: UpdateBillingInfoCustomerBillingAddressSchema.optional(),
entity_identifiers: UpdateBillingInfoCustomerEntityIdentifiersSchema.optional(),
tax_providers_fields: UpdateBillingInfoCustomerTaxProvidersFieldsSchema.optional(),
});
exports.UpdateBillingInfoCustomerBodySchema = UpdateBillingInfoCustomerBodySchema;
//Customer.contactsForCustomer
const ContactsForCustomerCustomerBodySchema = zod_1.z.looseObject({
limit: zod_1.z.number().int().min(1).max(100).optional(),
offset: zod_1.z.string().max(1000).optional(),
});
exports.ContactsForCustomerCustomerBodySchema = ContactsForCustomerCustomerBodySchema;
//Customer.assignPaymentRole
const AssignPaymentRoleCustomerBodySchema = zod_1.z.looseObject({
payment_source_id: zod_1.z.string().max(40),
role: zod_1.z.enum(['primary', 'backup', 'none']),
});
exports.AssignPaymentRoleCustomerBodySchema = AssignPaymentRoleCustomerBodySchema;
//Customer.addContact
const AddContactCustomerContactSchema = zod_1.z.object({
id: zod_1.z.string().max(150).optional(),
first_name: zod_1.z.string().max(150).optional(),
last_name: zod_1.z.string().max(150).optional(),
email: zod_1.z.string().email().max(70),
phone: zod_1.z.string().max(50).optional(),
label: zod_1.z.string().max(50).optional(),
enabled: zod_1.z.boolean().default(false).optional(),
send_billing_email: zod_1.z.boolean().default(false).optional(),
send_account_email: zod_1.z.boolean().default(false).optional(),
});
const AddContactCustomerBodySchema = zod_1.z.looseObject({
contact: AddContactCustomerContactSchema.optional(),
});
exports.AddContactCustomerBodySchema = AddContactCustomerBodySchema;
//Customer.updateContact
const UpdateContactCustomerContactSchema = zod_1.z.object({
id: zod_1.z.string().max(150),
first_name: zod_1.z.string().max(150).optional(),
last_name: zod_1.z.string().max(150).optional(),
email: zod_1.z.string().email().max(70).optional(),
phone: zod_1.z.string().max(50).optional(),
label: zod_1.z.string().max(50).optional(),
enabled: zod_1.z.boolean().default(false).optional(),
send_billing_email: zod_1.z.boolean().default(false).optional(),
send_account_email: zod_1.z.boolean().default(false).optional(),
});
const UpdateContactCustomerBodySchema = zod_1.z.looseObject({
contact: UpdateContactCustomerContactSchema.optional(),
});
exports.UpdateContactCustomerBodySchema = UpdateContactCustomerBodySchema;
//Customer.deleteContact
const DeleteContactCustomerContactSchema = zod_1.z.object({
id: zod_1.z.string().max(150),
});
const DeleteContactCustomerBodySchema = zod_1.z.looseObject({
contact: DeleteContactCustomerContactSchema.optional(),
});
exports.DeleteContactCustomerBodySchema = DeleteContactCustomerBodySchema;
//Customer.addPromotionalCredits
const AddPromotionalCreditsCustomerBodySchema = zod_1.z.looseObject({
amount: zod_1.z.number().int().min(1),
currency_code: zod_1.z.string().max(3).optional(),
description: zod_1.z.string().max(250),
credit_type: zod_1.z
.enum(['loyalty_credits', 'referral_rewards', 'general'])
.optional(),
reference: zod_1.z.string().max(500).optional(),
});
exports.AddPromotionalCreditsCustomerBodySchema = AddPromotionalCreditsCustomerBodySchema;
//Customer.deductPromotionalCredits
const DeductPromotionalCreditsCustomerBodySchema = zod_1.z.looseObject({
amount: zod_1.z.number().int().min(1),
currency_code: zod_1.z.string().max(3).optional(),
description: zod_1.z.string().max(250),
credit_type: zod_1.z
.enum(['loyalty_credits', 'referral_rewards', 'general'])
.optional(),
reference: zod_1.z.string().max(500).optional(),
});
exports.DeductPromotionalCreditsCustomerBodySchema = DeductPromotionalCreditsCustomerBodySchema;
//Customer.setPromotionalCredits
const SetPromotionalCreditsCustomerBodySchema = zod_1.z.looseObject({
amount: zod_1.z.number().int().min(0),
currency_code: zod_1.z.string().max(3).optional(),
description: zod_1.z.string().max(250),
credit_type: zod_1.z
.enum(['loyalty_credits', 'referral_rewards', 'general'])
.optional(),
reference: zod_1.z.string().max(500).optional(),
});
exports.SetPromotionalCreditsCustomerBodySchema = SetPromotionalCreditsCustomerBodySchema;
//Customer.recordExcessPayment
const RecordExcessPaymentCustomerTransactionSchema = zod_1.z.object({
id: zod_1.z.string().max(40).optional(),
amount: zod_1.z.number().int().min(0),
currency_code: zod_1.z.string().max(3).optional(),
date: zod_1.z.number().int(),
payment_method: zod_1.z.enum([
'cash',
'check',
'bank_transfer',
'other',
'app_store',
'play_store',
'custom',
]),
reference_number: zod_1.z.string().max(100).optional(),
custom_payment_method_id: zod_1.z.string().max(50).optional(),
});
const RecordExcessPaymentCustomerBodySchema = zod_1.z.looseObject({
comment: zod_1.z.string().max(300).optional(),
transaction: RecordExcessPaymentCustomerTransactionSchema.optional(),
});
exports.RecordExcessPaymentCustomerBodySchema = RecordExcessPaymentCustomerBodySchema;
//Customer.collectPayment
const CollectPaymentCustomerAdditionalInformationSchema = zod_1.z.looseObject({});
const CollectPaymentCustomerPaymentMethodSchema = zod_1.z.object({
type: zod_1.z
.enum([
'card',
'paypal_express_checkout',
'amazon_payments',
'direct_debit',
'generic',
'alipay',
'unionpay',
'apple_pay',
'wechat_pay',
'ideal',
'google_pay',
'sofort',
'bancontact',
'giropay',
'dotpay',
'upi',
'netbanking_emandates',
'venmo',
'pay_to',
'faster_payments',
'sepa_instant_transfer',
'automated_bank_transfer',
'klarna_pay_now',
'online_banking_poland',
'payconiq_by_bancontact',
'electronic_payment_standard',
'kbc_payment_button',
'pay_by_bank',
'trustly',
'stablecoin',
'kakao_pay',
'naver_pay',
'revolut_pay',
'cash_app_pay',
'twint',
'go_pay',
'grab_pay',
'pay_co',
'after_pay',
'swish',
'payme',
'pix',
'klarna',
'alipay_hk',
'paypay',
'gcash',
'south_korean_cards',
])
.optional(),
gateway_account_id: zod_1.z.string().max(50).optional(),
reference_id: zod_1.z.string().max(200).optional(),
tmp_token: zod_1.z.string().max(65000).optional(),
additional_information: CollectPaymentCustomerAdditionalInformationSchema.optional(),
});
const CollectPaymentCustomerCardSchema = zod_1.z.object({
gateway_account_id: zod_1.z.string().max(50).optional(),
first_name: zod_1.z.string().max(50).optional(),
last_name: zod_1.z.string().max(50).optional(),
number: zod_1.z.string().max(1500).optional(),
expiry_month: zod_1.z.number().int().min(1).max(12).optional(),
expiry_year: zod_1.z.number().int().optional(),
cvv: zod_1.z.string().max(520).optional(),
preferred_scheme: zod_1.z
.enum(['cartes_bancaires', 'mastercard', 'visa'])
.optional(),
billing_addr1: zod_1.z.string().max(150).optional(),
billing_addr2: zod_1.z.string().max(150).optional(),
billing_city: zod_1.z.string().max(50).optional(),
billing_state_code: zod_1.z.string().max(50).optional(),
billing_state: zod_1.z.string().max(50).optional(),
billing_zip: zod_1.z.string().max(20).optional(),
billing_country: zod_1.z.string().max(50).optional(),
additional_information: CollectPaymentCustomerAdditionalInformationSchema.optional(),
});
const CollectPaymentCustomerPaymentIntentSchema = zod_1.z.object({
id: zod_1.z.string().max(150).optional(),
gateway_account_id: zod_1.z.string().max(50).optional(),
gw_token: zod_1.z.string().max(65000).optional(),
payment_method_type: zod_1.z
.enum([
'card',
'ideal',
'sofort',
'bancontact',
'google_pay',
'dotpay',
'giropay',
'apple_pay',
'upi',
'netbanking_emandates',
'paypal_express_checkout',
'direct_debit',
'boleto',
'venmo',
'amazon_payments',
'pay_to',
'faster_payments',
'sepa_instant_transfer',
'klarna_pay_now',
'online_banking_poland',
'payconiq_by_bancontact',
'electronic_payment_standard',
'kbc_payment_button',
'pay_by_bank',
'trustly',
'stablecoin',
'kakao_pay',
'naver_pay',
'revolut_pay',
'cash_app_pay',
'wechat_pay',
'alipay',
'twint',
'go_pay',
'grab_pay',
'pay_co',
'after_pay',
'swish',
'payme',
'pix',
'klarna',
'alipay_hk',
'paypay',
'gcash',
'south_korean_cards',
])
.optional(),
gw_payment_method_id: zod_1.z.string().max(65000).optional(),
reference_id: zod_1.z.string().max(65000).optional(),
additional_information: CollectPaymentCustomerAdditionalInformationSchema.optional(),
});
const CollectPaymentCustomerInvoiceAllocationsSchema = zod_1.z.object({
invoice_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
allocation_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
});
const CollectPaymentCustomerBodySchema = zod_1.z.looseObject({
amount: zod_1.z.number().int().min(0).optional(),
payment_source_id: zod_1.z.string().max(40).optional(),
token_id: zod_1.z.string().max(40).optional(),
replace_primary_payment_source: zod_1.z.boolean().default(false).optional(),
retain_payment_source: zod_1.z.boolean().default(false).optional(),
payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
payment_method: CollectPaymentCustomerPaymentMethodSchema.optional(),
card: CollectPaymentCustomerCardSchema.optional(),
payment_intent: CollectPaymentCustomerPaymentIntentSchema.optional(),
invoice_allocations: CollectPaymentCustomerInvoiceAllocationsSchema.optional(),
});
exports.CollectPaymentCustomerBodySchema = CollectPaymentCustomerBodySchema;
//Customer.delete
const DeleteCustomerBodySchema = zod_1.z.looseObject({
delete_payment_method: zod_1.z.boolean().default(true).optional(),
});
exports.DeleteCustomerBodySchema = DeleteCustomerBodySchema;
//Customer.move
const MoveCustomerBodySchema = zod_1.z.looseObject({
id_at_from_site: zod_1.z.string().max(100),
from_site: zod_1.z.string().max(50),
});
exports.MoveCustomerBodySchema = MoveCustomerBodySchema;
//Customer.changeBillingDate
const ChangeBillingDateCustomerBodySchema = zod_1.z.looseObject({
billing_date: zod_1.z.number().int().min(1).max(31).optional(),
billing_month: zod_1.z.number().int().min(1).max(12).optional(),
billing_date_mode: zod_1.z.enum(['using_defaults', 'manually_set']).optional(),
billing_day_of_week: zod_1.z
.enum([
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday',
])
.optional(),
billing_day_of_week_mode: zod_1.z
.enum(['using_defaults', 'manually_set'])
.optional(),
});
exports.ChangeBillingDateCustomerBodySchema = ChangeBillingDateCustomerBodySchema;
//Customer.merge
const MergeCustomerBodySchema = zod_1.z.looseObject({
from_customer_id: zod_1.z.string().max(50),
to_customer_id: zod_1.z.string().max(50),
});
exports.MergeCustomerBodySchema = MergeCustomerBodySchema;
//Customer.relationships
const RelationshipsCustomerParentAccountAccessSchema = zod_1.z.object({
portal_edit_child_subscriptions: zod_1.z
.enum(['yes', 'view_only', 'no'])
.optional(),
portal_download_child_invoices: zod_1.z.enum(['yes', 'view_only', 'no']).optional(),
send_subscription_emails: zod_1.z.boolean().optional(),
send_payment_emails: zod_1.z.boolean().optional(),
send_invoice_emails: zod_1.z.boolean().optional(),
});
const RelationshipsCustomerChildAccountAccessSchema = zod_1.z.object({
portal_edit_subscriptions: zod_1.z.enum(['yes', 'view_only']).optional(),
portal_download_invoices: zod_1.z.enum(['yes', 'view_only', 'no']).optional(),
send_subscription_emails: zod_1.z.boolean().optional(),
send_payment_emails: zod_1.z.boolean().optional(),
send_invoice_emails: zod_1.z.boolean().optional(),
});
const RelationshipsCustomerBodySchema = zod_1.z.looseObject({
parent_id: zod_1.z.string().max(50).optional(),
payment_owner_id: zod_1.z.string().max(50).optional(),
invoice_owner_id: zod_1.z.string().max(50).optional(),
use_default_hierarchy_settings: zod_1.z.boolean().default(true).optional(),
parent_account_access: RelationshipsCustomerParentAccountAccessSchema.optional(),
child_account_access: RelationshipsCustomerChildAccountAccessSchema.optional(),
});
exports.RelationshipsCustomerBodySchema = RelationshipsCustomerBodySchema;
//Customer.hierarchy
const HierarchyCustomerBodySchema = zod_1.z.looseObject({
hierarchy_operation_type: zod_1.z.enum([
'complete_hierarchy',
'subordinates',
'path_to_root',
'subordinates_with_unbilled_charges_payable_by_parent',
'immediate_children',
]),
});
exports.HierarchyCustomerBodySchema = HierarchyCustomerBodySchema;
//Customer.listHierarchyDetail
const ListHierarchyDetailCustomerBodySchema = zod_1.z.looseObject({
limit: zod_1.z.number().int().min(1).max(100).optional(),
offset: zod_1.z.string().max(1000).optional(),
hierarchy_operation_type: zod_1.z.enum([
'complete_hierarchy',
'subordinates',
'path_to_root',
'subordinates_with_unbilled_charges_payable_by_parent',
'immediate_children',
]),
});
exports.ListHierarchyDetailCustomerBodySchema = ListHierarchyDetailCustomerBodySchema;
//Customer.updateHierarchySettings
const UpdateHierarchySettingsCustomerParentAccountAccessSchema = zod_1.z.object({
portal_edit_child_subscriptions: zod_1.z
.enum(['yes', 'view_only', 'no'])
.optional(),
portal_download_child_invoices: zod_1.z.enum(['yes', 'view_only', 'no']).optional(),
send_subscription_emails: zod_1.z.boolean().optional(),
send_payment_emails: zod_1.z.boolean().optional(),
send_invoice_emails: zod_1.z.boolean().optional(),
});
const UpdateHierarchySettingsCustomerChildAccountAccessSchema = zod_1.z.object({
portal_edit_subscriptions: zod_1.z.enum(['yes', 'view_only']).optional(),
portal_download_invoices: zod_1.z.enum(['yes', 'view_only', 'no']).optional(),
send_subscription_emails: zod_1.z.boolean().optional(),
send_payment_emails: zod_1.z.boolean().optional(),
send_invoice_emails: zod_1.z.boolean().optional(),
});
const UpdateHierarchySettingsCustomerBodySchema = zod_1.z.looseObject({
use_default_hierarchy_settings: zod_1.z.boolean().default(true).optional(),
parent_account_access: UpdateHierarchySettingsCustomerParentAccountAccessSchema.optional(),
child_account_access: UpdateHierarchySettingsCustomerChildAccountAccessSchema.optional(),
});
exports.UpdateHierarchySettingsCustomerBodySchema = UpdateHierarchySettingsCustomerBodySchema;