Bank Account Validation API.
Prompts customers to verify bank account ownership via a redirect-based open-banking flow before you send payouts to those accounts.
Available for Canada and United States.
Base path: /bankaccountvalidator/v1/accounts/{account_id}/verifications.
Flow
create/3— creates a verification session and returns a redirect link.- Redirect the customer to the link in
links(rel: "redirect_bank_validation"). The customer selects their bank and authenticates via online banking. get/3— once the customer completes the flow, look up the verification by ID to retrieve the validated bank account details and a single-use payment token you can use for payouts.
There is no synchronous response for step 2 — the customer must complete the redirect flow before a lookup will return validated details.
Example
{:ok, verification} = Paysafe.BankAccountValidation.create(config, %{
merchant_ref_num: "1323563",
profile: %{first_name: "John", last_name: "Smith", locale: "en_CA"},
account_types: ["SAVING", "CHEQUING"],
currency_codes: ["CAD", "USD"],
return_links: [%{rel: "default", href: "https://mysite.com/return"}]
})
Paysafe.Types.BankVerification.redirect_url(verification)
#=> "https://api.test.paysafe.com/bankaccountvalidator/v1/redirect?sessionId=..."
Summary
Functions
@spec create(Paysafe.Config.t(), map(), keyword()) :: {:ok, Paysafe.Types.BankVerification.t()} | {:error, Paysafe.Error.t()}
Create a bank account verification session.
Parameters
:merchant_ref_num(required) — Unique reference.:profile(required) —%{first_name:, last_name:, locale:}, optionallymiddle_name:.:account_types— List of"SAVING"and/or"CHEQUING".:currency_codes— List of ISO 4217 currency codes to accept.:return_links— Where to redirect the customer after completion.:bankscheme— e.g."ACH","EFT".
@spec get(Paysafe.Config.t(), String.t(), keyword()) :: {:ok, Paysafe.Types.BankVerification.t()} | {:error, Paysafe.Error.t()}
Look up a bank account verification by ID.
Returns the validated bank account details and a single-use payment token once the customer has completed the redirect flow.