import {z} from 'zod' export type IntentStatus = 'succeeded' | 'failed' | 'cancelled' | 'cancelled_post_capture' | 'processing' | 'requires_customer_action' | 'requires_merchant_action' | 'requires_payment_method' | 'requires_confirmation' | 'requires_capture' | 'partially_captured' | 'partially_captured_and_capturable' | 'partially_authorized_and_requires_capture' | 'partially_captured_and_processing' | 'conflicted' | 'expired' | 'review'; export type PayoutStatus = 'success' | 'failed' | 'cancelled' | 'initiated' | 'expired' | 'reversed' | 'pending' | 'ineligible' | 'requires_creation' | 'requires_confirmation' | 'requires_payout_method_data' | 'requires_fulfillment' | 'requires_vendor_account_creation'; export type WebhookDetails = {webhook_version?: (string | null) | undefined, webhook_username?: (string | null) | undefined, webhook_password?: (string | null) | undefined, webhook_url?: (string | null) | undefined, payment_created_enabled?: (boolean | null) | undefined, payment_succeeded_enabled?: (boolean | null) | undefined, payment_failed_enabled?: (boolean | null) | undefined, payment_statuses_enabled: Array, refund_statuses_enabled: Array, payout_statuses_enabled?: (Array | null) | undefined}; export type RoutableConnectors = 'absa_sanlam' | 'authipay' | 'adyenplatform' | 'stripe_billing_test' | 'phonypay' | 'fauxpay' | 'pretendpay' | 'stripe_test' | 'adyen_test' | 'checkout_test' | 'paypal_test' | 'aci' | 'adyen' | 'affirm' | 'airwallex' | 'amazonpay' | 'archipel' | 'authorizedotnet' | 'bankofamerica' | 'barclaycard' | 'billwerk' | 'bitpay' | 'bambora' | 'blackhawknetwork' | 'bamboraapac' | 'bluesnap' | 'calida' | 'boku' | 'braintree' | 'breadpay' | 'cashtocode' | 'celero' | 'chargebee' | 'custombilling' | 'checkbook' | 'checkout' | 'coinbase' | 'coingate' | 'cryptopay' | 'cybersource' | 'cybersourcedecisionmanager' | 'datatrans' | 'deutschebank' | 'digitalvirgo' | 'dlocal' | 'dwolla' | 'ebanx' | 'elavon' | 'envoy' | 'facilitapay' | 'finix' | 'fiserv' | 'fiservemea' | 'fiservcommercehub' | 'fiuu' | 'flexiti' | 'forte' | 'getnet' | 'gigadat' | 'givepayments' | 'globalpay' | 'globepay' | 'gocardless' | 'hipay' | 'helcim' | 'hyperpg' | 'iatapay' | 'imerchantsolutions' | 'inespay' | 'interpayments' | 'itaubank' | 'jpmorgan' | 'klarna' | 'loonio' | 'mifinity' | 'mollie' | 'moneris' | 'multisafepay' | 'nexinets' | 'nexixpay' | 'nmi' | 'nomupay' | 'noon' | 'nordea' | 'novalnet' | 'nuvei' | 'opennode' | 'paybox' | 'payme' | 'payload' | 'payone' | 'paypal' | 'paysafe' | 'paystack' | 'paytm' | 'payconex' | 'payu' | 'peachpayments' | 'payjustnow' | 'payjustnowinstore' | 'phonepe' | 'placetopay' | 'powertranz' | 'prophetpay' | 'rapyd' | 'razorpay' | 'recurly' | 'redsys' | 'revolv3' | 'riskified' | 'santander' | 'shift4' | 'signifyd' | 'silverflow' | 'square' | 'stax' | 'stripe' | 'stripebilling' | 'tesouro' | 'truelayer' | 'trustly' | 'trustpay' | 'trustpayments' | 'tokenio' | 'tsys' | 'tsys_transit' | 'volt' | 'wellsfargo' | 'wise' | 'worldline' | 'worldpay' | 'worldpaymodular' | 'worldpayvantiv' | 'worldpayxml' | 'xendit' | 'zen' | 'zift' | 'plaid' | 'zsl' | 'juspaythreedsserver' | 'ctp_mastercard' | 'ctp_visa' | 'netcetera' | 'cardinal' | 'threedsecureio'; export type RoutableConnectorChoice = {connector: RoutableConnectors, merchant_connector_id?: (string | null) | undefined}; export type ConnectorVolumeSplit = {connector: RoutableConnectorChoice, split: number}; export type ConnectorSelection = {type: 'priority', data: Array} | {type: 'volume_split', data: Array}; export type RuleConnectorSelection = Record; export type ProgramConnectorSelection = {defaultSelection: ConnectorSelection, rules: RuleConnectorSelection, metadata: {[key: string]: unknown}}; export type ThreeDSDecisionRule = unknown; export type RuleThreeDsDecisionRule = unknown; export type ProgramThreeDsDecisionRule = {defaultSelection: ThreeDSDecisionRule, rules: RuleThreeDsDecisionRule, metadata: {[key: string]: unknown}}; export type StaticRoutingAlgorithm = {type: 'single', data: RoutableConnectorChoice} | {type: 'priority', data: Array} | {type: 'volume_split', data: Array} | {type: 'advanced', data: ProgramConnectorSelection} | {type: 'three_ds_decision_rule', data: ProgramThreeDsDecisionRule}; export type TransactionDetailsUiConfiguration = {position?: (number | null) | undefined, is_key_bold?: (boolean | null) | undefined, is_value_bold?: (boolean | null) | undefined}; export type PaymentLinkTransactionDetails = {key: string, value: string, ui_configuration?: (TransactionDetailsUiConfiguration | null) | undefined}; export type ElementPosition = 'left' | 'top left' | 'top' | 'top right' | 'right' | 'bottom right' | 'bottom' | 'bottom left' | 'center'; export type SizeVariants = 'cover' | 'contain'; export type ElementSize = {Variants: SizeVariants} | {Percentage: number} | {Pixels: number}; export type PaymentLinkBackgroundImageConfig = {url: string, position?: (ElementPosition | null) | undefined, size?: (ElementSize | null) | undefined}; export type PaymentLinkDetailsLayout = 'layout1' | 'layout2'; export type PaymentMethod = 'card' | 'card_redirect' | 'pay_later' | 'wallet' | 'bank_redirect' | 'bank_transfer' | 'crypto' | 'bank_debit' | 'reward' | 'real_time_payment' | 'upi' | 'voucher' | 'gift_card' | 'open_banking' | 'mobile_payment' | 'network_token'; export type PaymentMethodType = 'ach' | 'affirm' | 'afterpay_clearpay' | 'alfamart' | 'ali_pay' | 'ali_pay_hk' | 'alma' | 'amazon_pay' | 'paysera' | 'apple_pay' | 'atome' | 'bacs' | 'bancontact_card' | 'becs' | 'benefit' | 'bizum' | 'blik' | 'bluecode' | 'boleto' | 'bca_bank_transfer' | 'bni_va' | 'breadpay' | 'bri_va' | 'bhn_card_network' | 'card_redirect' | 'cimb_va' | 'classic' | 'credit' | 'crypto_currency' | 'cashapp' | 'dana' | 'danamon_va' | 'debit' | 'duit_now' | 'efecty' | 'eft' | 'eft_debit_order' | 'eps' | 'flexiti' | 'fps' | 'evoucher' | 'giropay' | 'givex' | 'google_pay' | 'go_pay' | 'gcash' | 'ideal' | 'interac' | 'indomaret' | 'klarna' | 'kakao_pay' | 'local_bank_redirect' | 'mandiri_va' | 'knet' | 'mb_way' | 'mobile_pay' | 'momo' | 'momo_atm' | 'multibanco' | 'online_banking_thailand' | 'online_banking_czech_republic' | 'online_banking_finland' | 'online_banking_fpx' | 'online_banking_poland' | 'online_banking_slovakia' | 'oxxo' | 'pago_efectivo' | 'permata_bank_transfer' | 'open_banking_uk' | 'pay_bright' | 'payjustnow' | 'paypal' | 'paze' | 'pix' | 'pix_key' | 'pix_emv' | 'pix_qr' | 'pix_automatico_qr' | 'pix_automatico_push' | 'pay_safe_card' | 'przelewy24' | 'prompt_pay' | 'pse' | 'qris' | 'red_compra' | 'red_pagos' | 'samsung_pay' | 'sepa' | 'sepa_bank_transfer' | 'sepa_guarenteed_debit' | 'skrill' | 'sofort' | 'swish' | 'touch_n_go' | 'trustly' | 'twint' | 'upi_collect' | 'upi_intent' | 'upi_qr' | 'vipps' | 'viet_qr' | 'venmo' | 'walley' | 'we_chat_pay' | 'seven_eleven' | 'lawson' | 'mini_stop' | 'family_mart' | 'seicomart' | 'pay_easy' | 'local_bank_transfer' | 'mifinity' | 'open_banking_pis' | 'direct_carrier_billing' | 'instant_bank_transfer' | 'instant_bank_transfer_finland' | 'instant_bank_transfer_poland' | 'revolut_pay' | 'indonesian_bank_transfer' | 'open_banking' | 'network_token'; export type SdkDisplayMode = 'default_sdk_message' | 'custom_message' | 'hidden'; export type CustomMessage = {value: string, display_mode?: SdkDisplayMode | undefined}; export type CustomTerms = {payment_method_type: PaymentMethodType, message: CustomMessage}; export type PaymentMethodConfig = {payment_method: PaymentMethod, payment_method_types: Array}; export type PaymentMethodsConfig = Array; export type PaymentLinkSdkLabelType = 'above' | 'floating' | 'never'; export type PaymentLinkShowSdkTerms = 'always' | 'auto' | 'never'; export type PaymentLinkConfigRequest = {theme?: (string | null) | undefined, logo?: (string | null) | undefined, seller_name?: (string | null) | undefined, sdk_layout?: (string | null) | undefined, display_sdk_only?: (boolean | null) | undefined, enabled_saved_payment_method?: (boolean | null) | undefined, hide_card_nickname_field?: (boolean | null) | undefined, show_card_form_by_default?: (boolean | null) | undefined, transaction_details?: (Array | null) | undefined, background_image?: (PaymentLinkBackgroundImageConfig | null) | undefined, details_layout?: (PaymentLinkDetailsLayout | null) | undefined, payment_button_text?: (string | null) | undefined, custom_message_for_card_terms?: (string | null) | undefined, custom_message_for_payment_method_types?: (PaymentMethodsConfig | null) | undefined, payment_button_colour?: (string | null) | undefined, skip_status_screen?: (boolean | null) | undefined, payment_button_text_colour?: (string | null) | undefined, background_colour?: (string | null) | undefined, sdk_ui_rules?: ({[key: string]: {[key: string]: string}} | null) | undefined, payment_link_ui_rules?: ({[key: string]: {[key: string]: string}} | null) | undefined, enable_button_only_on_form_ready?: (boolean | null) | undefined, payment_form_header_text?: (string | null) | undefined, payment_form_label_type?: (PaymentLinkSdkLabelType | null) | undefined, show_card_terms?: (PaymentLinkShowSdkTerms | null) | undefined, is_setup_mandate_flow?: (boolean | null) | undefined, color_icon_card_cvc_error?: (string | null) | undefined, show_merchant_name?: (boolean | null) | undefined}; export type BusinessPaymentLinkConfig = {theme?: (string | null) | undefined, logo?: (string | null) | undefined, seller_name?: (string | null) | undefined, sdk_layout?: (string | null) | undefined, display_sdk_only?: (boolean | null) | undefined, enabled_saved_payment_method?: (boolean | null) | undefined, hide_card_nickname_field?: (boolean | null) | undefined, show_card_form_by_default?: (boolean | null) | undefined, transaction_details?: (Array | null) | undefined, background_image?: (PaymentLinkBackgroundImageConfig | null) | undefined, details_layout?: (PaymentLinkDetailsLayout | null) | undefined, payment_button_text?: (string | null) | undefined, custom_message_for_card_terms?: (string | null) | undefined, custom_message_for_payment_method_types?: (PaymentMethodsConfig | null) | undefined, payment_button_colour?: (string | null) | undefined, skip_status_screen?: (boolean | null) | undefined, payment_button_text_colour?: (string | null) | undefined, background_colour?: (string | null) | undefined, sdk_ui_rules?: ({[key: string]: {[key: string]: string}} | null) | undefined, payment_link_ui_rules?: ({[key: string]: {[key: string]: string}} | null) | undefined, enable_button_only_on_form_ready?: (boolean | null) | undefined, payment_form_header_text?: (string | null) | undefined, payment_form_label_type?: (PaymentLinkSdkLabelType | null) | undefined, show_card_terms?: (PaymentLinkShowSdkTerms | null) | undefined, is_setup_mandate_flow?: (boolean | null) | undefined, color_icon_card_cvc_error?: (string | null) | undefined, show_merchant_name?: (boolean | null) | undefined, domain_name?: (string | null) | undefined, business_specific_configs?: ({[key: string]: PaymentLinkConfigRequest} | null) | undefined, allowed_domains?: (Array | null) | undefined, branding_visibility?: (boolean | null) | undefined}; export type AuthenticationConnectors = 'threedsecureio' | 'netcetera' | 'gpayments' | 'ctp_mastercard' | 'unified_authentication_service' | 'juspaythreedsserver' | 'ctp_visa' | 'cardinal'; export type AuthenticationConnectorDetails = {authentication_connectors: Array, three_ds_requestor_url: string, three_ds_requestor_app_url?: (string | null) | undefined}; export type UIWidgetFormLayout = 'tabs' | 'journey'; export type BusinessPayoutLinkConfig = {logo?: (string | null) | undefined, merchant_name?: (string | null) | undefined, theme?: (string | null) | undefined, domain_name?: (string | null) | undefined, allowed_domains: Array, form_layout?: (UIWidgetFormLayout | null) | undefined, payout_test_mode?: (boolean | null) | undefined}; export type CardTestingGuardStatus = 'enabled' | 'disabled'; export type CardTestingGuardConfig = {card_ip_blocking_status: CardTestingGuardStatus, card_ip_blocking_threshold: number, guest_user_card_blocking_status: CardTestingGuardStatus, guest_user_card_blocking_threshold: number, customer_id_blocking_status: CardTestingGuardStatus, customer_id_blocking_threshold: number, card_testing_guard_expiry: number, guest_ip_blocking_status?: (CardTestingGuardStatus | null) | undefined, guest_ip_blocking_threshold?: (number | null) | undefined}; export type CountryAlpha2 = 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CW' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GG' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IM' | 'IL' | 'IT' | 'JM' | 'JP' | 'JE' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KP' | 'KR' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MK' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'ME' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'MP' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'BL' | 'SH' | 'KN' | 'LC' | 'MF' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'RS' | 'SC' | 'SL' | 'SG' | 'SX' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'SS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SZ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'UM' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | 'US'; export type MerchantCategoryCode = string; export type MerchantCountryCode = string; export type ExternalVaultEnabled = 'enable' | 'skip'; export type VaultSdk = 'vgs_sdk' | 'hyperswitch_sdk'; export type VaultTokenType = unknown; export type VaultTokenField = {token_type?: (VaultTokenType | null) | undefined}; export type ExternalVaultConnectorDetails = {vault_connector_id?: (string | null) | undefined, vault_sdk?: (VaultSdk | null) | undefined, vault_token_selector?: (Array | null) | undefined}; export type SurchargeConnectorDetails = {surcharge_connector_id?: (string | null) | undefined}; export type InternalNetworkTokenizationCredentials = {token_service_api_key: string, public_key: string, private_key: string, key_id: string}; export type NetworkTokeizationProviderCredentials = {internal_network_token_service: InternalNetworkTokenizationCredentials}; export type CardType = 'credit' | 'debit'; export type CardBlockingConfig = {issuing_country?: (Array | null) | undefined, card_types?: (Array | null) | undefined, card_subtypes?: (Array | null) | undefined, issuers?: (Array | null) | undefined, block_if_bin_info_unavailable?: (boolean | null) | undefined}; export type WalletBlockingConfig = {card_types?: (Array | null) | undefined}; export type PaymentMethodBlockingConfig = {card?: (CardBlockingConfig | null) | undefined, wallet?: (WalletBlockingConfig | null) | undefined}; export type ProfileCreate = {profile_name?: (string | null) | undefined, return_url?: (string | null) | undefined, enable_payment_response_hash?: (boolean | null) | undefined, payment_response_hash_key?: (string | null) | undefined, redirect_to_merchant_with_http_post?: (boolean | null) | undefined, webhook_details?: (WebhookDetails | null) | undefined, metadata?: (Record | null) | undefined, routing_algorithm?: (Record | null) | undefined, intent_fulfillment_time?: (number | null) | undefined, frm_routing_algorithm?: (Record | null) | undefined, payout_routing_algorithm?: (StaticRoutingAlgorithm | null) | undefined, applepay_verified_domains?: (Array | null) | undefined, session_expiry?: (number | null) | undefined, payment_link_config?: (BusinessPaymentLinkConfig | null) | undefined, authentication_connector_details?: (AuthenticationConnectorDetails | null) | undefined, use_billing_as_payment_method_billing?: (boolean | null) | undefined, collect_shipping_details_from_wallet_connector?: (boolean | null) | undefined, collect_billing_details_from_wallet_connector?: (boolean | null) | undefined, always_collect_shipping_details_from_wallet_connector?: (boolean | null) | undefined, always_collect_billing_details_from_wallet_connector?: (boolean | null) | undefined, is_connector_agnostic_mit_enabled?: (boolean | null) | undefined, payout_link_config?: (BusinessPayoutLinkConfig | null) | undefined, outgoing_webhook_custom_http_headers?: (Record | null) | undefined, tax_connector_id?: (string | null) | undefined, is_tax_connector_enabled?: boolean | undefined, is_network_tokenization_enabled?: boolean | undefined, is_auto_retries_enabled?: (boolean | null) | undefined, max_auto_retries_enabled?: (number | null) | undefined, always_request_extended_authorization?: (boolean | null) | undefined, is_click_to_pay_enabled?: boolean | undefined, authentication_product_ids?: (Record | null) | undefined, card_testing_guard_config?: (CardTestingGuardConfig | null) | undefined, is_clear_pan_retries_enabled?: (boolean | null) | undefined, force_3ds_challenge?: (boolean | null) | undefined, is_debit_routing_enabled?: (boolean | null) | undefined, merchant_business_country?: (CountryAlpha2 | null) | undefined, is_iframe_redirection_enabled?: (boolean | null) | undefined, is_pre_network_tokenization_enabled?: (boolean | null) | undefined, merchant_category_code?: (MerchantCategoryCode | null) | undefined, merchant_country_code?: (MerchantCountryCode | null) | undefined, dispute_polling_interval?: (number | null) | undefined, is_manual_retry_enabled?: (boolean | null) | undefined, always_enable_overcapture?: (boolean | null) | undefined, is_external_vault_enabled?: (ExternalVaultEnabled | null) | undefined, external_vault_connector_details?: (ExternalVaultConnectorDetails | null) | undefined, billing_processor_id?: (string | null) | undefined, surcharge_connector_details?: (SurchargeConnectorDetails | null) | undefined, is_l2_l3_enabled?: (boolean | null) | undefined, network_tokenization_credentials?: (NetworkTokeizationProviderCredentials | null) | undefined, payment_method_blocking?: (PaymentMethodBlockingConfig | null) | undefined}; export type CreateApiAccountAccountIdBusinessProfileArgs = {account_id: string, body: ProfileCreate}; export type CreateApiAccountAccountIdBusinessProfileOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; export const intentStatus = z.enum(["succeeded", "failed", "cancelled", "cancelled_post_capture", "processing", "requires_customer_action", "requires_merchant_action", "requires_payment_method", "requires_confirmation", "requires_capture", "partially_captured", "partially_captured_and_capturable", "partially_authorized_and_requires_capture", "partially_captured_and_processing", "conflicted", "expired", "review"]); export const payoutStatus = z.enum(["success", "failed", "cancelled", "initiated", "expired", "reversed", "pending", "ineligible", "requires_creation", "requires_confirmation", "requires_payout_method_data", "requires_fulfillment", "requires_vendor_account_creation"]); export const webhookDetails = z.object({webhook_version: z.string().max(255).nullable().optional(), webhook_username: z.string().max(255).nullable().optional(), webhook_password: z.string().max(255).nullable().optional(), webhook_url: z.string().nullable().optional(), payment_created_enabled: z.boolean().nullable().optional(), payment_succeeded_enabled: z.boolean().nullable().optional(), payment_failed_enabled: z.boolean().nullable().optional(), payment_statuses_enabled: z.array(intentStatus), refund_statuses_enabled: z.array(intentStatus), payout_statuses_enabled: z.array(payoutStatus).nullable().optional()}); export const routableConnectors = z.enum(["absa_sanlam", "authipay", "adyenplatform", "stripe_billing_test", "phonypay", "fauxpay", "pretendpay", "stripe_test", "adyen_test", "checkout_test", "paypal_test", "aci", "adyen", "affirm", "airwallex", "amazonpay", "archipel", "authorizedotnet", "bankofamerica", "barclaycard", "billwerk", "bitpay", "bambora", "blackhawknetwork", "bamboraapac", "bluesnap", "calida", "boku", "braintree", "breadpay", "cashtocode", "celero", "chargebee", "custombilling", "checkbook", "checkout", "coinbase", "coingate", "cryptopay", "cybersource", "cybersourcedecisionmanager", "datatrans", "deutschebank", "digitalvirgo", "dlocal", "dwolla", "ebanx", "elavon", "envoy", "facilitapay", "finix", "fiserv", "fiservemea", "fiservcommercehub", "fiuu", "flexiti", "forte", "getnet", "gigadat", "givepayments", "globalpay", "globepay", "gocardless", "hipay", "helcim", "hyperpg", "iatapay", "imerchantsolutions", "inespay", "interpayments", "itaubank", "jpmorgan", "klarna", "loonio", "mifinity", "mollie", "moneris", "multisafepay", "nexinets", "nexixpay", "nmi", "nomupay", "noon", "nordea", "novalnet", "nuvei", "opennode", "paybox", "payme", "payload", "payone", "paypal", "paysafe", "paystack", "paytm", "payconex", "payu", "peachpayments", "payjustnow", "payjustnowinstore", "phonepe", "placetopay", "powertranz", "prophetpay", "rapyd", "razorpay", "recurly", "redsys", "revolv3", "riskified", "santander", "shift4", "signifyd", "silverflow", "square", "stax", "stripe", "stripebilling", "tesouro", "truelayer", "trustly", "trustpay", "trustpayments", "tokenio", "tsys", "tsys_transit", "volt", "wellsfargo", "wise", "worldline", "worldpay", "worldpaymodular", "worldpayvantiv", "worldpayxml", "xendit", "zen", "zift", "plaid", "zsl", "juspaythreedsserver", "ctp_mastercard", "ctp_visa", "netcetera", "cardinal", "threedsecureio"]); export const routableConnectorChoice = z.object({connector: routableConnectors, merchant_connector_id: z.string().nullable().optional()}); export const connectorVolumeSplit = z.object({connector: routableConnectorChoice, split: z.number().int().gte(0)}); export const connectorSelection = z.discriminatedUnion("type", [z.object({type: z.literal("priority"), data: z.array(routableConnectorChoice)}), z.object({type: z.literal("volume_split"), data: z.array(connectorVolumeSplit)})]); export const ruleConnectorSelection = z.object({}); export const programConnectorSelection = z.object({defaultSelection: connectorSelection, rules: ruleConnectorSelection, metadata: z.record(z.string(), z.unknown())}); export const threeDSDecisionRule = z.unknown(); export const ruleThreeDsDecisionRule = z.unknown(); export const programThreeDsDecisionRule = z.object({defaultSelection: threeDSDecisionRule, rules: ruleThreeDsDecisionRule, metadata: z.record(z.string(), z.unknown())}); export const staticRoutingAlgorithm = z.discriminatedUnion("type", [z.object({type: z.literal("single"), data: routableConnectorChoice}), z.object({type: z.literal("priority"), data: z.array(routableConnectorChoice)}), z.object({type: z.literal("volume_split"), data: z.array(connectorVolumeSplit)}), z.object({type: z.literal("advanced"), data: programConnectorSelection}), z.object({type: z.literal("three_ds_decision_rule"), data: programThreeDsDecisionRule})]); export const transactionDetailsUiConfiguration = z.object({position: z.number().int().nullable().optional(), is_key_bold: z.boolean().nullable().optional(), is_value_bold: z.boolean().nullable().optional()}); export const paymentLinkTransactionDetails = z.object({key: z.string().max(255), value: z.string().max(255), ui_configuration: transactionDetailsUiConfiguration.nullable().optional()}); export const elementPosition = z.enum(["left", "top left", "top", "top right", "right", "bottom right", "bottom", "bottom left", "center"]); export const sizeVariants = z.enum(["cover", "contain"]); export const elementSize = z.union([z.object({Variants: sizeVariants}), z.object({Percentage: z.number().int().gte(0)}), z.object({Pixels: z.number().int().gte(0)})]); export const paymentLinkBackgroundImageConfig = z.object({url: z.string(), position: elementPosition.nullable().optional(), size: elementSize.nullable().optional()}); export const paymentLinkDetailsLayout = z.enum(["layout1", "layout2"]); export const paymentMethod = z.enum(["card", "card_redirect", "pay_later", "wallet", "bank_redirect", "bank_transfer", "crypto", "bank_debit", "reward", "real_time_payment", "upi", "voucher", "gift_card", "open_banking", "mobile_payment", "network_token"]); export const paymentMethodType = z.enum(["ach", "affirm", "afterpay_clearpay", "alfamart", "ali_pay", "ali_pay_hk", "alma", "amazon_pay", "paysera", "apple_pay", "atome", "bacs", "bancontact_card", "becs", "benefit", "bizum", "blik", "bluecode", "boleto", "bca_bank_transfer", "bni_va", "breadpay", "bri_va", "bhn_card_network", "card_redirect", "cimb_va", "classic", "credit", "crypto_currency", "cashapp", "dana", "danamon_va", "debit", "duit_now", "efecty", "eft", "eft_debit_order", "eps", "flexiti", "fps", "evoucher", "giropay", "givex", "google_pay", "go_pay", "gcash", "ideal", "interac", "indomaret", "klarna", "kakao_pay", "local_bank_redirect", "mandiri_va", "knet", "mb_way", "mobile_pay", "momo", "momo_atm", "multibanco", "online_banking_thailand", "online_banking_czech_republic", "online_banking_finland", "online_banking_fpx", "online_banking_poland", "online_banking_slovakia", "oxxo", "pago_efectivo", "permata_bank_transfer", "open_banking_uk", "pay_bright", "payjustnow", "paypal", "paze", "pix", "pix_key", "pix_emv", "pix_qr", "pix_automatico_qr", "pix_automatico_push", "pay_safe_card", "przelewy24", "prompt_pay", "pse", "qris", "red_compra", "red_pagos", "samsung_pay", "sepa", "sepa_bank_transfer", "sepa_guarenteed_debit", "skrill", "sofort", "swish", "touch_n_go", "trustly", "twint", "upi_collect", "upi_intent", "upi_qr", "vipps", "viet_qr", "venmo", "walley", "we_chat_pay", "seven_eleven", "lawson", "mini_stop", "family_mart", "seicomart", "pay_easy", "local_bank_transfer", "mifinity", "open_banking_pis", "direct_carrier_billing", "instant_bank_transfer", "instant_bank_transfer_finland", "instant_bank_transfer_poland", "revolut_pay", "indonesian_bank_transfer", "open_banking", "network_token"]); export const sdkDisplayMode = z.enum(["default_sdk_message", "custom_message", "hidden"]); export const customMessage = z.object({value: z.string(), display_mode: sdkDisplayMode.optional()}); export const customTerms = z.object({payment_method_type: paymentMethodType, message: customMessage}); export const paymentMethodConfig = z.object({payment_method: paymentMethod, payment_method_types: z.array(customTerms)}); export const paymentMethodsConfig = z.array(paymentMethodConfig); export const paymentLinkSdkLabelType = z.enum(["above", "floating", "never"]); export const paymentLinkShowSdkTerms = z.enum(["always", "auto", "never"]); export const paymentLinkConfigRequest = z.object({theme: z.string().max(255).nullable().optional(), logo: z.string().max(255).nullable().optional(), seller_name: z.string().max(255).nullable().optional(), sdk_layout: z.string().max(255).nullable().optional(), display_sdk_only: z.boolean().nullable().optional(), enabled_saved_payment_method: z.boolean().nullable().optional(), hide_card_nickname_field: z.boolean().nullable().optional(), show_card_form_by_default: z.boolean().nullable().optional(), transaction_details: z.array(paymentLinkTransactionDetails).nullable().optional(), background_image: paymentLinkBackgroundImageConfig.nullable().optional(), details_layout: paymentLinkDetailsLayout.nullable().optional(), payment_button_text: z.string().nullable().optional(), custom_message_for_card_terms: z.string().nullable().optional(), custom_message_for_payment_method_types: paymentMethodsConfig.nullable().optional(), payment_button_colour: z.string().nullable().optional(), skip_status_screen: z.boolean().nullable().optional(), payment_button_text_colour: z.string().nullable().optional(), background_colour: z.string().nullable().optional(), sdk_ui_rules: z.record(z.string(), z.record(z.string(), z.string())).nullable().optional(), payment_link_ui_rules: z.record(z.string(), z.record(z.string(), z.string())).nullable().optional(), enable_button_only_on_form_ready: z.boolean().nullable().optional(), payment_form_header_text: z.string().nullable().optional(), payment_form_label_type: paymentLinkSdkLabelType.nullable().optional(), show_card_terms: paymentLinkShowSdkTerms.nullable().optional(), is_setup_mandate_flow: z.boolean().nullable().optional(), color_icon_card_cvc_error: z.string().nullable().optional(), show_merchant_name: z.boolean().nullable().optional()}); export const businessPaymentLinkConfig = z.object({theme: z.string().max(255).nullable().optional(), logo: z.string().max(255).nullable().optional(), seller_name: z.string().max(255).nullable().optional(), sdk_layout: z.string().max(255).nullable().optional(), display_sdk_only: z.boolean().nullable().optional(), enabled_saved_payment_method: z.boolean().nullable().optional(), hide_card_nickname_field: z.boolean().nullable().optional(), show_card_form_by_default: z.boolean().nullable().optional(), transaction_details: z.array(paymentLinkTransactionDetails).nullable().optional(), background_image: paymentLinkBackgroundImageConfig.nullable().optional(), details_layout: paymentLinkDetailsLayout.nullable().optional(), payment_button_text: z.string().nullable().optional(), custom_message_for_card_terms: z.string().nullable().optional(), custom_message_for_payment_method_types: paymentMethodsConfig.nullable().optional(), payment_button_colour: z.string().nullable().optional(), skip_status_screen: z.boolean().nullable().optional(), payment_button_text_colour: z.string().nullable().optional(), background_colour: z.string().nullable().optional(), sdk_ui_rules: z.record(z.string(), z.record(z.string(), z.string())).nullable().optional(), payment_link_ui_rules: z.record(z.string(), z.record(z.string(), z.string())).nullable().optional(), enable_button_only_on_form_ready: z.boolean().nullable().optional(), payment_form_header_text: z.string().nullable().optional(), payment_form_label_type: paymentLinkSdkLabelType.nullable().optional(), show_card_terms: paymentLinkShowSdkTerms.nullable().optional(), is_setup_mandate_flow: z.boolean().nullable().optional(), color_icon_card_cvc_error: z.string().nullable().optional(), show_merchant_name: z.boolean().nullable().optional(), domain_name: z.string().nullable().optional(), business_specific_configs: z.record(z.string(), paymentLinkConfigRequest).nullable().optional(), allowed_domains: z.array(z.string()).nullable().optional(), branding_visibility: z.boolean().nullable().optional()}); export const authenticationConnectors = z.enum(["threedsecureio", "netcetera", "gpayments", "ctp_mastercard", "unified_authentication_service", "juspaythreedsserver", "ctp_visa", "cardinal"]); export const authenticationConnectorDetails = z.object({authentication_connectors: z.array(authenticationConnectors), three_ds_requestor_url: z.string(), three_ds_requestor_app_url: z.string().nullable().optional()}); export const extendedCardInfoConfig = z.object({public_key: z.string(), ttl_in_secs: z.number().int().gte(0).lte(7200).optional()}); export const uIWidgetFormLayout = z.enum(["tabs", "journey"]); export const businessPayoutLinkConfig = z.object({logo: z.string().max(255).nullable().optional(), merchant_name: z.string().max(255).nullable().optional(), theme: z.string().max(255).nullable().optional(), domain_name: z.string().nullable().optional(), allowed_domains: z.array(z.string()), form_layout: uIWidgetFormLayout.nullable().optional(), payout_test_mode: z.boolean().nullable().optional()}); export const cardTestingGuardStatus = z.enum(["enabled", "disabled"]); export const cardTestingGuardConfig = z.object({card_ip_blocking_status: cardTestingGuardStatus, card_ip_blocking_threshold: z.number().int(), guest_user_card_blocking_status: cardTestingGuardStatus, guest_user_card_blocking_threshold: z.number().int(), customer_id_blocking_status: cardTestingGuardStatus, customer_id_blocking_threshold: z.number().int(), card_testing_guard_expiry: z.number().int(), guest_ip_blocking_status: cardTestingGuardStatus.nullable().optional(), guest_ip_blocking_threshold: z.number().int().nullable().optional()}); export const countryAlpha2 = z.enum(["AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "CI", "HR", "CU", "CW", "CY", "CZ", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RE", "RO", "RU", "RW", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW", "US"]); export const profileAcquirerResponse = z.object({profile_acquirer_id: z.string(), acquirer_assigned_merchant_id: z.string().nullable().optional(), merchant_name: z.string().nullable().optional(), network: z.string().nullable().optional(), acquirer_bin: z.string().nullable().optional(), acquirer_ica: z.string().nullable().optional(), acquirer_fraud_rate: z.number().nullable().optional(), acquirer_country_code: z.string().nullable().optional(), profile_id: z.string(), is_default: z.boolean()}); export const acquirerBucketConfigResponse = z.object({acquirer_assigned_merchant_id: z.string().nullable().optional(), merchant_name: z.string().nullable().optional(), network: z.string(), acquirer_bin: z.string().nullable().optional(), acquirer_ica: z.string().nullable().optional(), acquirer_fraud_rate: z.number().nullable().optional(), acquirer_country_code: z.string().nullable().optional()}); export const profileAcquirerConfigsResponse = z.object({default_acquirer_config: z.string().nullable().optional(), configs: z.record(z.string(), z.array(acquirerBucketConfigResponse))}); export const merchantCategoryCode = z.string(); export const merchantCountryCode = z.string(); export const externalVaultEnabled = z.enum(["enable", "skip"]); export const vaultSdk = z.enum(["vgs_sdk", "hyperswitch_sdk"]); export const vaultTokenType = z.unknown(); export const vaultTokenField = z.object({token_type: vaultTokenType.nullable().optional()}); export const externalVaultConnectorDetails = z.object({vault_connector_id: z.string().nullable().optional(), vault_sdk: vaultSdk.nullable().optional(), vault_token_selector: z.array(vaultTokenField).nullable().optional()}); export const surchargeConnectorDetails = z.object({surcharge_connector_id: z.string().nullable().optional()}); export const internalNetworkTokenizationCredentials = z.object({token_service_api_key: z.string().max(255), public_key: z.string().max(255), private_key: z.string().max(255), key_id: z.string().max(255)}); export const networkTokeizationProviderCredentials = z.object({internal_network_token_service: internalNetworkTokenizationCredentials}); export const cardType = z.enum(["credit", "debit"]); export const cardBlockingConfig = z.object({issuing_country: z.array(countryAlpha2).nullable().optional(), card_types: z.array(cardType).nullable().optional(), card_subtypes: z.array(z.string()).nullable().optional(), issuers: z.array(z.string()).nullable().optional(), block_if_bin_info_unavailable: z.boolean().nullable().optional()}); export const walletBlockingConfig = z.object({card_types: z.array(cardType).nullable().optional()}); export const paymentMethodBlockingConfig = z.object({card: cardBlockingConfig.nullable().optional(), wallet: walletBlockingConfig.nullable().optional()}); export const profileResponse = z.object({merchant_id: z.string().max(64), profile_id: z.string().max(64), profile_name: z.string().max(64), return_url: z.string().max(255).nullable().optional(), enable_payment_response_hash: z.boolean(), payment_response_hash_key: z.string().nullable().optional(), redirect_to_merchant_with_http_post: z.boolean(), webhook_details: webhookDetails.nullable().optional(), metadata: z.object({}).nullable().optional(), routing_algorithm: z.object({}).nullable().optional(), intent_fulfillment_time: z.number().int().nullable().optional(), frm_routing_algorithm: z.object({}).nullable().optional(), payout_routing_algorithm: staticRoutingAlgorithm.nullable().optional(), applepay_verified_domains: z.array(z.string()).nullable().optional(), session_expiry: z.number().int().nullable().optional(), payment_link_config: businessPaymentLinkConfig.nullable().optional(), authentication_connector_details: authenticationConnectorDetails.nullable().optional(), use_billing_as_payment_method_billing: z.boolean().nullable().optional(), extended_card_info_config: extendedCardInfoConfig.nullable().optional(), collect_shipping_details_from_wallet_connector: z.boolean().nullable().optional(), collect_billing_details_from_wallet_connector: z.boolean().nullable().optional(), always_collect_shipping_details_from_wallet_connector: z.boolean().nullable().optional(), always_collect_billing_details_from_wallet_connector: z.boolean().nullable().optional(), is_connector_agnostic_mit_enabled: z.boolean().nullable().optional(), payout_link_config: businessPayoutLinkConfig.nullable().optional(), outgoing_webhook_custom_http_headers: z.object({}).nullable().optional(), tax_connector_id: z.string().nullable().optional(), is_tax_connector_enabled: z.boolean(), is_network_tokenization_enabled: z.boolean(), is_auto_retries_enabled: z.boolean(), max_auto_retries_enabled: z.number().int().nullable().optional(), always_request_extended_authorization: z.boolean().nullable().optional(), is_click_to_pay_enabled: z.boolean(), authentication_product_ids: z.object({}).nullable().optional(), card_testing_guard_config: cardTestingGuardConfig.nullable().optional(), is_clear_pan_retries_enabled: z.boolean(), force_3ds_challenge: z.boolean(), is_debit_routing_enabled: z.boolean().nullable().optional(), merchant_business_country: countryAlpha2.nullable().optional(), is_pre_network_tokenization_enabled: z.boolean(), acquirer_configs: z.array(profileAcquirerResponse).nullable().optional(), acquirer_config_bucket: profileAcquirerConfigsResponse.nullable().optional(), is_iframe_redirection_enabled: z.boolean().nullable().optional(), merchant_category_code: merchantCategoryCode.nullable().optional(), merchant_country_code: merchantCountryCode.nullable().optional(), dispute_polling_interval: z.number().int().gte(0).nullable().optional(), is_manual_retry_enabled: z.boolean().nullable().optional(), always_enable_overcapture: z.boolean().nullable().optional(), is_external_vault_enabled: externalVaultEnabled.nullable().optional(), external_vault_connector_details: externalVaultConnectorDetails.nullable().optional(), billing_processor_id: z.string().nullable().optional(), surcharge_connector_details: surchargeConnectorDetails.nullable().optional(), is_l2_l3_enabled: z.boolean().nullable().optional(), network_tokenization_credentials: networkTokeizationProviderCredentials.nullable().optional(), payment_method_blocking: paymentMethodBlockingConfig.nullable().optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Profile - Create * * POST /account/{account_id}/business_profile */ export const createApiAccountAccountIdBusinessProfile = async (args: CreateApiAccountAccountIdBusinessProfileArgs, options: CreateApiAccountAccountIdBusinessProfileOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/account/${encodeURIComponent(String(args.account_id))}/business_profile${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(profileResponse, await res.json()) };