Paysafe.BankAccountValidation (Paysafe v1.0.0)

Copy Markdown View Source

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

  1. create/3 — creates a verification session and returns a redirect link.
  2. Redirect the customer to the link in links (rel: "redirect_bank_validation"). The customer selects their bank and authenticates via online banking.
  3. 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

Create a bank account verification session.

Look up a bank account verification by ID.

Functions

create(config, params, opts \\ [])

@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:}, optionally middle_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".

get(config, verification_id, opts \\ [])

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.