The beneficiaries namespace contains all the functions related to beneficiary operations. It can be accessed like this:const
beneficiaries:object
=beneficiariesNamespace.beneficiaries
addBeneficiary: (Adds a new beneficiary in the current user’s account.addBeneficiaryParams
) =>Promise
<Beneficiary
>
BeneficiaryParams
<NewBeneficiary
>
An object containing:
beneficiarySettings
: An object with the new beneficiary details. Requires at
least the name
and iban
properties to be present.operationSettings
: An object with operation-level settings such as
proxyRequestFunction
(preferred over using the access token flow),
accessToken
, stagingToken
, idempotencyKey
, and other optional
parameters. See BeneficiaryParams.Promise
<Beneficiary
>
A promise that resolves to the created beneficiary.
proxyRequestFunction
and
accessToken
are invalid or missing within operationSettings
.
getBeneficiaries: (Fetches the list of beneficiaries for the current user.getBeneficiariesParams?
) =>Promise
<GetBeneficiariesResponse
>
BeneficiaryParams
<never
>
An object containing:
operationSettings
: An object with operation-level settings such as
proxyRequestFunction
(preferred over using the access token flow),
accessToken
, stagingToken
, mfaPreference
, and other optional
parameters. This function also allows managing pagination by passing the
paginationSettings
property under operationSettings
, which accepts an
object with the page and itemsPerPage properties. See BeneficiaryParams.Promise
<GetBeneficiariesResponse
>
A promise that resolves to an array of beneficiaries and a meta
object containing pagination state.
proxyRequestFunction
and
accessToken
are invalid or missing within operationSettings
.
getBeneficiary: (Fetches a single beneficiary of the current user by ID.getBeneficiaryParams
) =>Promise
<Beneficiary
>
BeneficiaryParams
<{ beneficiaryId
: string
; }>
An object containing:
beneficiarySettings
: An object with the beneficiaryId
property (string).operationSettings
: An object with operation-level settings such as
proxyRequestFunction
(preferred over using the access token flow),
accessToken
, stagingToken
, mfaPreference
, and other optional parameters.
See BeneficiaryParams.Promise
<Beneficiary
>
A promise that resolves to a beneficiary.
beneficiaryId
parameter is not a string or is missing.
proxyRequestFunction
and accessToken
are invalid or missing within
operationSettings
.
untrustBeneficiaries: (Untrusts a list of beneficiaries in the current user’s account.untrustBeneficiariesParams
) =>Promise
<Beneficiary
[]>
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 as
proxyRequestFunction
(preferred over using the access token flow),
accessToken
, stagingToken
, and other optional parameters.
See BeneficiaryParams.Promise
<Beneficiary
[]>
A promise that resolves to an array of untrusted beneficiaries.
beneficiaryIds
parameter is not an
array of strings or is missing.
proxyRequestFunction
and
accessToken
are invalid or missing within operationSettings
.
updateBeneficiary: (Update any of the editable properites of a beneficiary in the current user’s account by ID.updateBeneficiaryParams
) =>Promise
<Beneficiary
>
BeneficiaryParams
<EditableBeneficiaryProperties
>
An object containing:
beneficiarySettings
: An object that contains a mandatory beneficiary ID
and any of the editable properties of a beneficiary, which are name
,
email
and activityTag
.operationSettings
: An object with operation-level settings such as
proxyRequestFunction
(preferred over using the access token flow),
accessToken
, stagingToken
, mfaPreference
, idempotencyKey
, and other optional
parameters. See BeneficiaryParams.Promise
<Beneficiary
>
A promise that resolves to the updated beneficiary.
name
, email
, activityTag
) are provided or are of incorrect type.
proxyRequestFunction
and
accessToken
are invalid or missing within operationSettings
.