Validation while Creating Customer

My web app will create Customers with Dwolla. Is it my responsibility to validate:

  • email
  • ssn
  • address1
  • city
  • postalCode
  • country
  • ein

… or will Dwolla check if these numbers are valid?

In addition, how do I gracefully catch errors while creating a Customer so that I can report the error to the front-end? Does this apply to every API call to Dwolla?

Ho @ngwattcos,

Yes, Dwolla does check on those fields for any validation errors. If there exists an error, Dwolla responds with a 400 ValidationError.

Here’s an example error response for an invalid email address -

{
    "code": "ValidationError",
    "message": "Validation error(s) present. See embedded errors list for more details.",
    "_embedded": {
        "errors": [
            {
                "code": "InvalidFormat",
                "message": "Email invalid.",
                "path": "/email",
                "_links": {}
            }
        ]
    }
}

You can also find a list of common errors in our API docs.

1 Like