Variable: beneficiaries
The beneficiaries namespace contains all the functions related to beneficiary operations. It can be accessed like this:constbeneficiaries:object=beneficiariesNamespace.beneficiaries
Type declaration
addBeneficiary()
addBeneficiary: (Adds a new beneficiary in the current user’s account.addBeneficiaryParams) =>Promise<Beneficiary>
Parameters
addBeneficiaryParams
BeneficiaryParams<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 asproxyRequestFunction(preferred over using the access token flow),accessToken,stagingToken,idempotencyKey, and other optional parameters. See BeneficiaryParams.
Returns
Promise<Beneficiary>
A promise that resolves to the created beneficiary.
Throws
InvalidParametersError If any required property is missing or invalid.
Throws
AuthenticationError If both the proxyRequestFunction and
accessToken are invalid or missing within operationSettings.
Throws
EmbedApiError If the API request fails or returns an error.
getBeneficiaries()
getBeneficiaries: (Fetches the list of beneficiaries for the current user.getBeneficiariesParams?) =>Promise<GetBeneficiariesResponse>
Parameters
getBeneficiariesParams?
BeneficiaryParams<never>
An object containing:
operationSettings: An object with operation-level settings such asproxyRequestFunction(preferred over using the access token flow),accessToken,stagingToken,mfaPreference, and other optional parameters. This function also allows managing pagination by passing thepaginationSettingsproperty underoperationSettings, which accepts an object with the page and itemsPerPage properties. See BeneficiaryParams.
Returns
Promise<GetBeneficiariesResponse>
A promise that resolves to an array of beneficiaries and a meta
object containing pagination state.
Throws
InvalidParametersError If any of the values provided under
operationSettings is invalid.
Throws
AuthenticationError If both the proxyRequestFunction and
accessToken are invalid or missing within operationSettings.
Throws
EmbedApiError If the API request fails or returns an error.
getBeneficiary()
getBeneficiary: (Fetches a single beneficiary of the current user by ID.getBeneficiaryParams) =>Promise<Beneficiary>
Parameters
getBeneficiaryParams
BeneficiaryParams<{ beneficiaryId: string; }>
An object containing:
beneficiarySettings: An object with thebeneficiaryIdproperty (string).operationSettings: An object with operation-level settings such asproxyRequestFunction(preferred over using the access token flow),accessToken,stagingToken,mfaPreference, and other optional parameters. See BeneficiaryParams.
Returns
Promise<Beneficiary>
A promise that resolves to a beneficiary.
Throws
InvalidParametersError If the beneficiaryId parameter is not a string or is missing.
Throws
AuthenticationError If both the proxyRequestFunction and accessToken are invalid or missing within
operationSettings.
Throws
EmbedApiError If the API request fails or returns an error.
untrustBeneficiaries()
untrustBeneficiaries: (Untrusts a list of beneficiaries in the current user’s account.untrustBeneficiariesParams) =>Promise<Beneficiary[]>
Parameters
untrustBeneficiariesParams
BeneficiaryParams<{ 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 asproxyRequestFunction(preferred over using the access token flow),accessToken,stagingToken, and other optional parameters. See BeneficiaryParams.
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.
Throws
AuthenticationError If both the proxyRequestFunction and
accessToken are invalid or missing within operationSettings.
Throws
EmbedApiError If the API request fails or returns an error.
updateBeneficiary()
updateBeneficiary: (Update any of the editable properites of a beneficiary in the current user’s account by ID.updateBeneficiaryParams) =>Promise<Beneficiary>
Parameters
updateBeneficiaryParams
BeneficiaryParams<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 asproxyRequestFunction(preferred over using the access token flow),accessToken,stagingToken,mfaPreference,idempotencyKey, and other optional parameters. See BeneficiaryParams.
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.
Throws
AuthenticationError If both the proxyRequestFunction and
accessToken are invalid or missing within operationSettings.
Throws
EmbedApiError If the API request fails or returns an error.