Step 3: Handle JavaScript Callback #

Your customer will then add their card information, including: Full Name, Card Number, Expiration Date, CVV, and Nickname. On submission of the form, you will need to handle the error or response which is triggered by the JavaScript callback. The callback function (err, res) allows you to determine if there is an error with the request (e.g. card expiration invalid) or if the response was successful.

If there is an error, display the error to the user to have them correct any fields and have them re-attempt to add their card by restarting the add a debit card flow.

Check our guide on simulating various Debit card error scenarios in Sandbox.

Common errors #

FastFundsIneligibleThe card is ineligible for Fast Funds.
PushToCardIneligibleThe card is ineligible for push-to-card.
InvalidAddressThe address is invalid.
Note: This error is thrown when the address entered is different from the one that the card was issued with. For example, if you originally used the format XXXXX:XXXX for the zip code, entering just the 5 digits into the card form will trigger this error.
InvalidCardNumberThe card number is invalid.
InvalidCardTypeInvalid card type. Only debit cards are supported.
InvalidCvvOrExpirationThe CVV or expiration date is invalid.
InvalidTokenThe token is invalid.
InvalidVisaActionCodeThe card could not be verified.
SuspectedFraudThe card may be lost or stolen.
DuplicateResourceCard already exists.
MaxNumberOfResourcesThe maximum number of cards have been added.

Example error callback #

  "error": {
    "code": "ValidationError",
    "message": "Validation error(s) present. See embedded errors list for more details.",
    "_embedded": {
      "errors": [
          "code": "Invalid",
          "message": "Card expiration invalid.",
          "path": "/cardExpiration"

Example duplicate card error

    "code": "DuplicateResource",
    "message": "Card already exists: id=a67d47f0-73de-4a6c-8de4-105d30aad395",
    "_links": {
        "about": {
            "href": "",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"

Example max card error

    "code": "MaxNumberOfResources",
    "message": "The maximum number of cards have been added.",

If successful, you will receive a JSON response that includes a link to the newly attached funding source.

Example success callback #

  "error": null,
  "response": {
    "_links": {
      "funding-source": {
        "href": ""

Test in the Sandbox for free today.

Use sandbox environment to test API requests.

Get API Keys
2023 All Rights Reserved
Financial institutions play an important role in our network.

All funds transfers made using the Dwolla Platform are performed by a financial institution partner, and any funds held in a Dwolla Balance are held by a financial institution partner. Learn more about our financial institution partners.