Skip to main content

Add a trusted international beneficiary

Add a trusted beneficiary with the API for International Credit Transfers.

Add a trusted beneficiary​

Prerequisites

Get the list of required key/value pairs for your beneficiary. They're based on the target currency and the beneficiary's country of residence.

  1. Call the addTrustedInternationalBeneficiary mutation.
  2. Add the Swan accountId (line 4). The trusted beneficiary is linked to this account.
  3. Add your trusted beneficiary's name (line 6).
  4. Add the route (line 7).
  5. Add all beneficiary key/value pairs you retrieved for the prerequisite (lines 10-18).
  6. Add the AddTrustedInternationalBeneficiarySuccessPayload success payload. Consider adding the trustedBeneficiary > id to the payload (lines 24-25).
  7. Add rejections (not shown).

Mutation​

🔎 Open the mutation in API Explorer

mutation AddBeneficiary {
addTrustedInternationalBeneficiary(
input: {
accountId: "$ACCOUNT_ID"
currency: "USD"
name: "$TRUSTED_BENEFICIARY_NAME"
route: FedwireLocal
consentRedirectUrl: "$REDIRECT_URL"
details: [
{ key: "legalType", value: "PRIVATE" }
{ key: "abartn", value: "$FEDWIRE_ROUTING_NUMBER" }
{ key: "accountNumber", value: "$ACCOUNT_NUMBER" }
{ key: "accountType", value: "CHECKING" }
{ key: "address.country", value: "US" }
{ key: "address.city", value: "Utica" }
{ key: "address.firstLine", value: "1 Canoga Blvd" }
{ key: "address.state", value: "NY" }
{ key: "address.postCode", value: "13505" }
]
}
) {
... on AddTrustedInternationalBeneficiarySuccessPayload {
__typename
trustedBeneficiary {
id
}
}
}
}

Payload​

Notice your new trusted beneficiary's ID is returned in the success payload (line 6).

{
"data": {
"addTrustedInternationalBeneficiary": {
"__typename": "AddTrustedInternationalBeneficiarySuccessPayload",
"trustedBeneficiary": {
"id": "$TRUSTED_BENEFICIARY_ID"
}
}
}
}

Save a beneficiary when initiating a transfer​

Prerequisites
  1. Optionally, get a quote.
    • This query provides a quote for the exchange rate and fees.
    • The quote isn't guaranteed.
  2. Next, get the list of required key/value pairs for your beneficiary.
    • They're based on the target currency and the beneficiary's country of residence.
  3. Then, get the list of required key/value pairs for your transaction.
    • They're based on the transfer's destination.
  1. Call the initiateInternationalCreditTransfer mutation.
  2. Add the Swan accountId (line 4). The trusted beneficiary is linked to this account.
  3. Add all beneficiary and transaction details key/value pairs you retrieved for the prerequisites (lines 5-17, 22-24).
  4. Add the route (line 19).
  5. Choose true for the boolean save (line 20).
  6. Add the InitiateInternationalCreditTransferResponseSuccessPayload success payload with the consent URL (line 41).
  7. Add rejections (not shown).

Mutation​

🔎 Open the mutation in API Explorer

mutation SaveBeneficiary {
initiateInternationalCreditTransfer(
input: {
accountId: "$ACCOUNT_ID"
internationalBeneficiary: {
name: "$TRUSTED_BENEFICIARY_NAME"
currency: "USD"
details: [
{ key: "legalType", value: "PRIVATE" }
{ key: "abartn", value: "$FEDWIRE_ROUTING_NUMBER" }
{ key: "accountNumber", value: "$ACCOUNT_NUMBER" }
{ key: "accountType", value: "CHECKING" }
{ key: "address.country", value: "US" }
{ key: "address.city", value: "Utica" }
{ key: "address.firstLine", value: "1 Canoga Blvd" }
{ key: "address.state", value: "NY" }
{ key: "address.postCode", value: "13505" }
]
route: FedwireLocal
save: true
}
internationalCreditTransferDetails: {
key: "reference"
value: "Your reference message"
}
targetAmount: { value: "500", currency: "USD" }
consentRedirectUrl: "$REDIRECT_URL"
}
) {
... on InitiateInternationalCreditTransferResponseSuccessPayload {
__typename
payment {
createdAt
id
statusInfo {
status
... on PaymentConsentPending {
__typename
status
consent {
consentUrl
}
}
}
}
}
}
}

Payload​

The payload is a typical initiation payload. There's no additional information available about the new trusted beneficiary.

{
"data": {
"initiateInternationalCreditTransfer": {
"__typename": "InitiateInternationalCreditTransferResponseSuccessPayload",
"payment": {
"id": "$PAYMENT_ID",
"statusInfo": {
"status": "ConsentPending",
"__typename": "PaymentConsentPending",
"consent": {
"consentUrl": "https://identity.swan.io/consent?consentId=$CONSENT_ID&env=Sandbox"
}
}
}
}
}
}