Validate a bank account
Check an ACH account before you tokenize it or pay with it.
Validating a bank account before you debit it or pay out to it catches bad account details before they turn into returns. Call POST /v1/accountValidations with an ach object and an accountValidationMethod.
accountValidationMethodisAccountNumber, orAccountNumberAndNameto also check the holder's name.achuses the same fields as a payment:bankAccountHolder,routingNumber,accountNumber, and an optionalbankAccountType.
The response includes isValid, and an errorMessage that is null when the account is valid.
Each validation is billed, so the call requires your API key and secret. A request with only accountKey is rejected with 403. Send your platform key and secret plus the merchant's accountKey.
To validate while you save an ACH account, set validateAccount to true on POST /v1/tokens instead. The account is validated before the token is stored.
Validation charges appear on the statement as their own line, separate from payment fees.
Validating check images is a different call, POST /v1/checks/validate. See Send a check.
curl -s -u "$DHANGO_KEY:$DHANGO_SECRET" \ -H "Content-Type: application/json" \ -H "accountKey: $ACCOUNT_KEY" \ -d '{"accountValidationMethod":"AccountNumberAndName","ach":{"bankAccountHolder":"Ada Lovelace","routingNumber":"021000021","accountNumber":"123456789","bankAccountType":"PersonalChecking"}}' \ https://api.dhangodemo.com/v1/accountValidationsawait fetch("https://api.dhangodemo.com/v1/accountValidations", { method: "POST", headers: { Authorization: "Basic " + Buffer.from(process.env.DHANGO_KEY + ":" + process.env.DHANGO_SECRET).toString("base64"), "Content-Type": "application/json", accountKey: process.env.ACCOUNT_KEY }, body: JSON.stringify({ accountValidationMethod: "AccountNumberAndName", ach: { bankAccountHolder: "Ada Lovelace", routingNumber: "021000021", accountNumber: "123456789", bankAccountType: "PersonalChecking" } })});import os, uuid, requestsauth = (os.environ["DHANGO_KEY"], os.environ["DHANGO_SECRET"])headers = {"accountKey": os.environ["ACCOUNT_KEY"]}response = requests.post( "https://api.dhangodemo.com/v1/accountValidations", auth=auth, headers=headers, json={ "accountValidationMethod": "AccountNumberAndName", "ach": { "bankAccountHolder": "Ada Lovelace", "routingNumber": "021000021", "accountNumber": "123456789", "bankAccountType": "PersonalChecking" } },)response.raise_for_status()result = response.json()print(result["isValid"], result["errorMessage"])