Skip to main content

Verify a beneficiary

Verify a beneficiary with the API. Verifying beneficiaries reduces the risk of errors and potential fraud.

Guide​

  1. Call the beneficiaryVerification query.
  2. Add your beneficiary's name and iban, as well as the debtorAccountId (lines 4-6).
  3. Add all the information you'd like to review in the payload.

Query​

🔎 Open the query in API Explorer

query VerifyBeneficiary {
beneficiaryVerification(
input: {
iban: "$BENEFICIARY_IBAN"
name: "Beneficiary name"
debtorAccountId: "$SWAN_DEBTOR_ACCOUNT_ID"
}
) {
... on BeneficiaryMatch {
__typename
accountHolderType
accountStatus
}
... on BeneficiaryTypo {
__typename
nameSuggestion
accountStatus
accountHolderType
}
... on InvalidBeneficiaryVerification {
__typename
message
}
... on BeneficiaryMismatch {
__typename
nameSuggestion
accountHolderResidencyCity
accountHolderType
accountStatus
}
}
}

Payload​

The payload shows a beneficiary verification that didn't pass because the account wasn't found.

{
"errors": [
{
"message": "Account was not found.",
"path": [
"beneficiaryVerification"
],
"extensions": {
"code": "Account_NotFound",
"meta": {
"id": "$BENEFICIARY_VERIFICATION_ID"
},
"stacktrace": "Error: Account was not found.\n at /home/node/app/src/domain/iban/use-cases/beneficiary-verification/beneficiary-verification.use-case.js:107:266\n at /home/node/app/node_modules/fp-ts/lib/FromEither.js:36:97\n at pipe (/home/node/app/node_modules/fp-ts/lib/function.js:301:23)\n at /home/node/app/src/domain/iban/use-cases/beneficiary-verification/beneficiary-verification.use-case.js:107:214\n at /home/node/app/node_modules/fp-ts/lib/EitherT.js:83:97\n at /home/node/app/node_modules/fp-ts/lib/Task.js:133:41\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async toPromise (/home/node/app/node_modules/@swan-io/utils/lib/fp/index.js:26:12)\n at async descriptor.value (/home/node/app/node_modules/@swan-io/metrics/metrics/decorators/default.js:12:28)"
}
}
],
"data": {
"beneficiaryVerification": null
}
}