Transfer Element
createElement('payoutForm', options?)
Parameters
type
required'payoutForm'options
optionalPayoutFormOptionspayoutForm Element.apiVersion
optionalstringcustomizations
optionalPayoutFormCustomizationscustomerSupportLink
optionalstringfields
optionalPayoutFormCustomizationsFieldsControls the display logic of specific fields, such as hidden or disabled. By default, all fields are visible and enabled.
beneficiary.bank_details.bank_country_code
optionalPayoutFormCustomizationsFieldsConfigblacklist
optionalstring[]disabled
optionalbooleanwhitelist
optionalstring[]beneficiary.bank_details.local_clearing_system
optionalPayoutFormCustomizationsFieldsConfigblacklist
optionalstring[]disabled
optionalbooleanwhitelist
optionalstring[]beneficiary.entity_type
optionalPayoutFormCustomizationsFieldsConfigblacklist
optionalstring[]disabled
optionalbooleanwhitelist
optionalstring[]source_amount
optionalPayoutFormCustomizationsFieldsConfigDisabledOnlydisabled
optionalbooleansource_currency
optionalPayoutFormCustomizationsFieldsConfigDisabledOnlydisabled
optionalbooleanswift_charge_option
optionalPayoutFormCustomizationsFieldsConfigDisabledOnlydisabled
optionalbooleantransfer_amount
optionalPayoutFormCustomizationsFieldsConfigDisabledOnlydisabled
optionalbooleantransfer_currency
optionalPayoutFormCustomizationsFieldsConfigDisabledOnlydisabled
optionalbooleantransfer_date
optionalPayoutFormCustomizationsFieldsConfigblacklist
optionalstring[]disabled
optionalbooleanwhitelist
optionalstring[]transfer_method
optionalPayoutFormCustomizationsFieldsConfigblacklist
optionalstring[]disabled
optionalbooleanwhitelist
optionalstring[]payment_amount
optionalPayoutFormCustomizationsFieldsConfigDisabledOnlyDeprecateddisabled
optionalbooleanpayment_currency
optionalPayoutFormCustomizationsFieldsConfigDisabledOnlyDeprecateddisabled
optionalbooleanpayment_date
optionalPayoutFormCustomizationsFieldsConfigDeprecatedblacklist
optionalstring[]disabled
optionalbooleanwhitelist
optionalstring[]payment_method
optionalPayoutFormCustomizationsFieldsConfigDeprecatedblacklist
optionalstring[]disabled
optionalbooleanwhitelist
optionalstring[]minHeight
optionalnumberui
optionalPayoutFormCustomizationsUihideConnector
optionalbooleanhideFeeConfig
optionalbooleanhideFlightTime
optionalbooleanhidePaymentAmountWhenEquals
optionalbooleanhideTransferFee
optionalbooleanhideTransferFeeWhenFree
optionalbooleandefaultValues
optionalPayoutFormDefaultValuesPre-filled values for the form fields. Note: Pre-filled values only take effect for fields that can be rendered on initial load. Fields that are dynamically generated through user interactions will not be affected by default values.
beneficiary
optionalPayoutFormBeneficiarybank_details
optionalPayoutFormBeneficiaryBankDetailsbank_country_code
optionalstringlocal_clearing_system
optionalstringentity_type
optional'COMPANY' | 'PERSONAL'beneficiary_id
optionalstringfee_paid_by
optional'PAYER' | 'BENEFICIARY'source_amount
optionalnumbersource_currency
optionalstringswift_charge_option
optional'SHARED' | 'PAYER'transfer_amount
optionalnumbertransfer_currency
optionalstringtransfer_date
optionalstringtransfer_method
optional'SWIFT' | 'LOCAL'payment_amount
optionalnumberDeprecatedpayment_currency
optionalstringDeprecatedpayment_date
optionalstringDeprecatedpayment_method
optional'SWIFT' | 'LOCAL'Deprecatedlocale
optional'en' | 'zh' | 'zh-HK' | 'de' | 'es' | 'fr' | 'it' | 'ja' | 'ko' | 'en-US' | 'es-MX' | 'tr'init() is used.langKey
optional'en' | 'zh' | 'zh-HK' | 'de' | 'es' | 'fr' | 'it' | 'ja' | 'ko' | 'en-US' | 'es-MX' | 'tr'Deprecatedlocale instead.Returns
PayoutFormElement | null
1import { createElement } from '@airwallex/components-sdk';2const element = await createElement('payoutForm', {3 defaultValues: {4 beneficiary_id: 'replace-with-your-beneficiary-id',5 },6});
destroy()
1element.destroy();
mount(domElement)
Parameters
domElement
requiredstring | HTMLElement1// There are two ways to mount the element:2// 1. Call with the container DOM id3element.mount('container-dom-id');45// 2. Find the created DOM in the existing HTML and call with the container DOM element6const containerElement = document.getElementById('container-dom-id');7element.mount(containerElement);
on('ready', handler)
Parameters
type
required'ready'handler
required() => void1element.on('ready', () => {2 console.log('Payout form is ready');3 });
on('error', handler)
Parameters
type
required'error'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
code
required'UNKNOWN_ERROR' | 'INVALID_BENEFICIARY_ID'message
optionalstring1element.on('error', (data: { code: string }) => {2 console.error(data.code);3 });
on('formState', handler)
Parameters
type
required'formState'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
errors
requiredPayoutFormErrorscode
requiredenumAFTER_FEE_IS_TOO_SMALL
AMOUNT_ABOVE_LIMIT
AMOUNT_ABOVE_PAYMENT_METHOD_LIMIT
AMOUNT_BELOW_LIMIT
BOTH_BUY_SELL_AMOUNTS_SPECIFIED
INVALID_AMOUNT_MAX_THREE_DECIMALS
INVALID_AMOUNT_MAX_TWO_DECIMALS
INVALID_AMOUNT_MUST_POSITIVE
INVALID_AMOUNT_NO_DECIMALS
INVALID_CURRENCY_PAIR
INVALID_PARAMS
INVALID_SETTLEMENT_DATE
MISSING_AMOUNT
MISSING_CURRENCY_PAIR
MISSING_FEE_CONFIG
UNKNOWN_ERROR
UNSUPPORTED_CURRENCY
SCHEMA_NOT_FOUND
AMOUNT_ABOVE_BALANCE_LIMIT
VALIDATION_FAILED
CNY_INBOUND_TRANSFER_ERROR
message
optionalstringloading
requiredbooleanvalidation
requiredboolean1element.on('formState', (data: { loading: boolean; validation: boolean; errors: string }) => {2 // validation is true if the form is valid3 // loading is true if the form is loading4 // errors is the error message if the form is invalid5 });
on('change', handler)
Parameters
type
required'change'handler
requiredfunctionThe callback function that will be called when the event occurs.
The handler receives an object with the following properties:
values
requiredPayoutFormValuesfee_paid_by
required'PAYER' | 'BENEFICIARY'source_currency
requiredstringbeneficiary
optionalPayoutFormBeneficiarybank_details
optionalPayoutFormBeneficiaryBankDetailsbank_country_code
optionalstringlocal_clearing_system
optionalstringentity_type
optional'COMPANY' | 'PERSONAL'beneficiary_id
optionalstringpayment_amount
optionalnumberpayment_currency
optionalstringpayment_date
optionalstringpayment_method
optional'SWIFT' | 'LOCAL'source_amount
optionalnumberswift_charge_option
optional'SHARED' | 'PAYER'transfer_amount
optionalnumbertransfer_currency
optionalstringtransfer_date
optionalstringtransfer_method
optional'SWIFT' | 'LOCAL'1element.on('change', (data: {values: PayoutFormValues}) => {2 // data.values is the form value3 });
submit()
Returns
Promise<PayoutFormSubmitResponse>
PayoutFormSubmitResponse
requiredobjectadditionalInfo
requiredPayoutFormAdditionalInforeason
requiredPayoutFormReason[]label
requiredstringvalue
requiredstringquote
optionalPayoutFormQuoteid
requiredstringvalidity
requiredobjectvalidFrom
requiredstringvalidTo
requiredstringvalues
requiredPayoutFormValuesfee_paid_by
required'PAYER' | 'BENEFICIARY'source_currency
requiredstringbeneficiary
optionalPayoutFormBeneficiarybank_details
optionalPayoutFormBeneficiaryBankDetailsbank_country_code
optionalstringlocal_clearing_system
optionalstringentity_type
optional'COMPANY' | 'PERSONAL'beneficiary_id
optionalstringpayment_amount
optionalnumberpayment_currency
optionalstringpayment_date
optionalstringpayment_method
optional'SWIFT' | 'LOCAL'source_amount
optionalnumberswift_charge_option
optional'SHARED' | 'PAYER'transfer_amount
optionalnumbertransfer_currency
optionalstringtransfer_date
optionalstringtransfer_method
optional'SWIFT' | 'LOCAL'errors
optionalPayoutFormErrorscode
requiredenumAFTER_FEE_IS_TOO_SMALL
AMOUNT_ABOVE_LIMIT
AMOUNT_ABOVE_PAYMENT_METHOD_LIMIT
AMOUNT_BELOW_LIMIT
BOTH_BUY_SELL_AMOUNTS_SPECIFIED
INVALID_AMOUNT_MAX_THREE_DECIMALS
INVALID_AMOUNT_MAX_TWO_DECIMALS
INVALID_AMOUNT_MUST_POSITIVE
INVALID_AMOUNT_NO_DECIMALS
INVALID_CURRENCY_PAIR
INVALID_PARAMS
INVALID_SETTLEMENT_DATE
MISSING_AMOUNT
MISSING_CURRENCY_PAIR
MISSING_FEE_CONFIG
UNKNOWN_ERROR
UNSUPPORTED_CURRENCY
SCHEMA_NOT_FOUND
AMOUNT_ABOVE_BALANCE_LIMIT
VALIDATION_FAILED
CNY_INBOUND_TRANSFER_ERROR
message
optionalstring1const { values: transfer, errors } = await element.submit();2if (!errors) {3 // Submit the transfer information to the backend for processing4} else {5 // Handle errors using the error code6}
unmount()
1element.unmount();