Variable: beneficiaries
The beneficiaries namespace contains all the client-side functions related to beneficiary operations. This version uses proxy-based authentication (proxyEndpointDescriptor) and is designed for browser environments. For server-side operations using access tokens, import fromconstbeneficiaries:object
'@qonto/embed-sdk/server/beneficiaries'.
It can be accessed like this:
trustBeneficiaries function requires UI elements and is only
available in the client-side version.
Type declaration
addBeneficiary()
addBeneficiary: (Adds a new beneficiary in the current user’s account. Client-side only - Uses proxy-based authentication. For server-side operations, import fromaddBeneficiaryParams) =>Promise<Beneficiary>
'@qonto/embed-sdk/server/beneficiaries'.
Parameters
addBeneficiaryParams
BeneficiaryClientParams<NewBeneficiary>
An object containing:
beneficiarySettings: An object with the new beneficiary details. Requires at least thenameandibanproperties to be present.operationSettings: An object with operation-level settings such asproxyEndpointDescriptor(required),idempotencyKey, and other optional parameters.
Returns
Promise<Beneficiary>
A promise that resolves to the created beneficiary.
Throws
InvalidParametersError If any required property is missing or invalid,
or if proxyEndpointDescriptor is not provided.
Throws
EmbedApiError If the API request fails or returns an error.
getBeneficiaries()
getBeneficiaries: (Fetches the list of beneficiaries for the current user. Client-side only - Uses proxy-based authentication. For server-side operations, import fromgetBeneficiariesParams?) =>Promise<GetBeneficiariesResponse>
'@qonto/embed-sdk/server/beneficiaries'.
Parameters
getBeneficiariesParams?
BeneficiaryClientParams<never>
An object containing:
operationSettings: An object with operation-level settings such asproxyEndpointDescriptor(required),paginationSettings, and other optional parameters.
Returns
Promise<GetBeneficiariesResponse>
A promise that resolves to an array of beneficiaries and a meta
object containing pagination state.
Throws
InvalidParametersError If proxyEndpointDescriptor is not provided.
Throws
EmbedApiError If the API request fails or returns an error.
getBeneficiary()
getBeneficiary: (Fetches a single beneficiary of the current user by ID. Client-side only - Uses proxy-based authentication. For server-side operations, import fromgetBeneficiaryParams) =>Promise<Beneficiary>
'@qonto/embed-sdk/server/beneficiaries'.
Parameters
getBeneficiaryParams
BeneficiaryClientParams<{ beneficiaryId: string; }>
An object containing:
beneficiarySettings: An object with thebeneficiaryIdproperty (string).operationSettings: An object with operation-level settings such asproxyEndpointDescriptor(required).
Returns
Promise<Beneficiary>
A promise that resolves to a beneficiary.
Throws
InvalidParametersError If the beneficiaryId parameter is not a string or is missing,
or if proxyEndpointDescriptor is not provided.
Throws
EmbedApiError If the API request fails or returns an error.
trustBeneficiaries()
trustBeneficiaries: (Trusts a list of beneficiaries in the current user’s account. Client-side only - This function requires UI elements (iframe/SCA) and is only available in the client-side version. It is not available in the server-side API.trustBeneficiariesParams) =>Promise<Beneficiary[]>
Parameters
trustBeneficiariesParams
BeneficiaryClientParamsWithUI<{ beneficiaryIds: string[]; }>
An object containing:
beneficiarySettings: An object with the list of beneficiary IDs to trust (e.g.,{ beneficiaryIds: string[] }).operationSettings: An object with operation-level settings such asaccessToken,stagingToken,uiParentElementId, and other optional parameters.
Returns
Promise<Beneficiary[]>
A promise that resolves to an array of trusted beneficiaries.
Throws
AuthenticationError If the access token is invalid or missing.
Ensure initialize has been called before using this function if you are not
passing the access token.
Throws
InvalidParametersError If the beneficiaryIds parameter is not an
array of strings or is missing.
Throws
EmbedApiError If the API request fails or returns an error.
untrustBeneficiaries()
untrustBeneficiaries: (Untrusts a list of beneficiaries in the current user’s account. Client-side only - Uses proxy-based authentication. For server-side operations, import fromuntrustBeneficiariesParams) =>Promise<Beneficiary[]>
'@qonto/embed-sdk/server/beneficiaries'.
Parameters
untrustBeneficiariesParams
BeneficiaryClientParams<{ beneficiaryIds: string[]; }>
An object containing:
beneficiarySettings: An object with the list of beneficiary IDs to untrust (e.g.,{ beneficiaryIds: string[] }).operationSettings: An object with operation-level settings such asproxyEndpointDescriptor(required).
Returns
Promise<Beneficiary[]>
A promise that resolves to an array of untrusted beneficiaries.
Throws
InvalidParametersError If the beneficiaryIds parameter is not an
array of strings or is missing, or if proxyEndpointDescriptor is not provided.
Throws
EmbedApiError If the API request fails or returns an error.
updateBeneficiary()
updateBeneficiary: (Update any of the editable properties of a beneficiary in the current user’s account by ID. Client-side only - Uses proxy-based authentication. For server-side operations, import fromupdateBeneficiaryParams) =>Promise<Beneficiary>
'@qonto/embed-sdk/server/beneficiaries'.
Parameters
updateBeneficiaryParams
BeneficiaryClientParams<EditableBeneficiaryProperties>
An object containing:
beneficiarySettings: An object that contains a mandatory beneficiary ID and any of the editable properties of a beneficiary, which arename,emailandactivityTag.operationSettings: An object with operation-level settings such asproxyEndpointDescriptor(required),mfaPreference,idempotencyKey, and other optional parameters.
Returns
Promise<Beneficiary>
A promise that resolves to the updated beneficiary.
Throws
InvalidParametersError If the beneficiary ID is missing or if none of the
editable properties (name, email, activityTag) are provided or are of incorrect type,
or if proxyEndpointDescriptor is not provided.
Throws
EmbedApiError If the API request fails or returns an error.