---
updatedAt: 2026-08-12T23:59:56.000Z
agentTools:
  projectIndex: https://developers.masspay.io/llms.txt
---

# Validate a bank account

This **POST** endpoint is used to validate a bank account against MassPay's account verification providers, independently of a payout. <br> The bank account is validated for the user identified by `user_token` in the path, and the account holder name on record for that user is used for name matching. <br> If a finalized result is available within ~5 seconds (including cached results), it is returned synchronously with HTTP `200`. Otherwise HTTP `202` is returned with a status of `PROCESSING` and the finalized result is delivered asynchronously through the `avs.completed` webhook event. <br> Validations are charged per validation based on your client pricing configuration; validations that cannot be verified by any provider (`UNSUPPORTED`) are not charged.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "description": "MassPay API",
    "version": "1.0.0",
    "title": "MassPay API",
    "termsOfService": "https://www.masspay.io/terms/",
    "contact": {
      "name": "MassPay",
      "email": "info@masspay.io",
      "url": "https://www.masspay.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "tags": [
    {
      "name": "Account",
      "description": "The account resource describes your account."
    }
  ],
  "paths": {
    "/payout/account/validate/{user_token}": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Validate a bank account",
        "description": "This **POST** endpoint is used to validate a bank account against MassPay's account verification providers, independently of a payout. <br>\nThe bank account is validated for the user identified by `user_token` in the path, and the account holder name on record for that user is used for name matching. <br>\nIf a finalized result is available within ~5 seconds (including cached results), it is returned synchronously with HTTP `200`. Otherwise HTTP `202` is returned with a status of `PROCESSING` and the finalized result is delivered asynchronously through the `avs.completed` webhook event. <br>\nValidations are charged per validation based on your client pricing configuration; validations that cannot be verified by any provider (`UNSUPPORTED`) are not charged.",
        "operationId": "validateBankAccount",
        "parameters": [
          {
            "name": "user_token",
            "in": "path",
            "description": "Token representing the user the bank account belongs to. The name on record for this user is used for account holder name matching.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "usr_9a542efe-6060-11f1-b042-02a06bb795f5"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateBankAccountRequest"
              },
              "examples": {
                "US bank account": {
                  "value": {
                    "country_code": "US",
                    "attrs": [
                      {
                        "type": "BankAccountNumber",
                        "value": "31742287"
                      },
                      {
                        "type": "BankRoutingNumber",
                        "value": "021000021"
                      },
                      {
                        "type": "BankAccountType",
                        "value": "CHECKING"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finalized validation result.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationResult"
                },
                "examples": {
                  "Match": {
                    "value": {
                      "status": "MATCH",
                      "ownership_verified": true,
                      "first_name_match": "MATCH",
                      "last_name_match": "MATCH",
                      "match_score": 100
                    }
                  },
                  "Unsupported": {
                    "value": {
                      "status": "UNSUPPORTED",
                      "ownership_verified": false,
                      "first_name_match": null,
                      "last_name_match": null,
                      "match_score": null
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Validation is still processing. The finalized result will be delivered via the `avs.completed` webhook event.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProcessing"
                },
                "examples": {
                  "Processing": {
                    "value": {
                      "status": "PROCESSING",
                      "user_token": "usr_9a542efe-6060-11f1-b042-02a06bb795f5"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request. Returned when `attrs` is missing, the `BankAccountNumber` attribute is not supplied, or `user_token` does not reference an existing user.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error400"
                },
                "examples": {
                  "Missing bank account number": {
                    "value": {
                      "title": "Bad request.",
                      "message": "The request was invalid or malformed. Please ensure that the request body conforms to the required format and that all required parameters are included.",
                      "code": 400,
                      "error": {
                        "reason": "Error validating bank account",
                        "details": [
                          "BankAccountNumber attribute is required"
                        ]
                      }
                    }
                  },
                  "Unknown user": {
                    "value": {
                      "title": "Bad request.",
                      "message": "The request was invalid or malformed. Please ensure that the request body conforms to the required format and that all required parameters are included.",
                      "code": 400,
                      "error": {
                        "reason": "Error validating bank account",
                        "details": [
                          "user_token does not reference an existing user"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error401"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error403"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error404"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error405"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error500"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Time-out.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error504"
                }
              }
            }
          }
        },
        "security": [
          {
            "AUTHORIZER_NAME": []
          },
          {
            "api_key": []
          }
        ]
      },
      "parameters": [
        {
          "name": "user_token",
          "in": "path",
          "description": "Token representing the user the bank account belongs to. The name on record for this user is used for account holder name matching.",
          "required": true,
          "schema": {
            "type": "string",
            "example": "usr_9a542efe-6060-11f1-b042-02a06bb795f5"
          }
        }
      ]
    }
  },
  "servers": [
    {
      "url": "https://{environment}.masspay.io/{VERSION}",
      "description": "MassPay's API server",
      "variables": {
        "VERSION": {
          "default": "v1.0.0",
          "enum": [
            "v1.0.0"
          ]
        },
        "environment": {
          "default": "api",
          "enum": [
            "api",
            "staging-api"
          ]
        }
      }
    }
  ],
  "components": {
    "schemas": {
      "Error400": {
        "description": "Bad request.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Bad request."
            ],
            "example": "Bad request."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The request was invalid or malformed. Please ensure that the request body conforms to the required format and that all required parameters are included."
            ],
            "example": "The request was invalid or malformed. Please ensure that the request body conforms to the required format and that all required parameters are included."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              400
            ],
            "example": 400
          },
          "error": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "example": "Error initiating payout",
                "description": "Reason for error"
              },
              "details": {
                "type": "array",
                "description": "Specific details of the cause of the error",
                "items": {
                  "type": "string",
                  "example": "Source amount cannot be $0"
                }
              }
            }
          }
        },
        "required": [
          "message",
          "code"
        ]
      },
      "Error401": {
        "description": "Unauthorized.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Unauthorized."
            ],
            "example": "Unauthorized."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "Authentication failed or credentials were not provided. Please ensure that you have provided valid API credentials and that they are authorized to access the MassPay API."
            ],
            "example": "Authentication failed or credentials were not provided. Please ensure that you have provided valid API credentials and that they are authorized to access the MassPay API."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              401
            ],
            "example": 401
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error403": {
        "description": "Forbidden.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Forbidden."
            ],
            "example": "Forbidden."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The requested action is not allowed or the API credentials do not have sufficient permissions. Please ensure that the API credentials used for the request have the necessary permissions to perform the requested action."
            ],
            "example": "The requested action is not allowed or the API credentials do not have sufficient permissions. Please ensure that the API credentials used for the request have the necessary permissions to perform the requested action."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              403
            ],
            "example": 403
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error404": {
        "description": "Not found.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Not found."
            ],
            "example": "Not found."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The requested resource was not found. Please ensure that the URL for the request is correct and that the requested resource exists."
            ],
            "example": "The requested resource was not found. Please ensure that the URL for the request is correct and that the requested resource exists."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              404
            ],
            "example": 404
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error405": {
        "description": "Method not allowed.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Method not allowed."
            ],
            "example": "Method not allowed."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The HTTP method used for the request is not supported by the MassPay API. Please ensure that you are using the correct HTTP method (e.g., POST) for the specific MassPay API endpoint."
            ],
            "example": "The HTTP method used for the request is not supported by the MassPay API. Please ensure that you are using the correct HTTP method (e.g., POST) for the specific MassPay API endpoint."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              405
            ],
            "example": 405
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error500": {
        "description": "Internal server error",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Internal server error."
            ],
            "example": "Internal server error."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "An unexpected error occurred on the server-side while processing the request. Please try again later or contact support if the issue persists."
            ],
            "example": "An unexpected error occurred on the server-side while processing the request. Please try again later or contact support if the issue persists."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              500
            ],
            "example": 500
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error504": {
        "description": "Gateway Time-out.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Gateway Time-out."
            ],
            "example": "Gateway Time-out."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The request timed out while waiting for a response from the server. Please try again later or contact support if the issue persists."
            ],
            "example": "The request timed out while waiting for a response from the server. Please try again later or contact support if the issue persists."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              500
            ],
            "example": 500
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "ValidateBankAccountRequest": {
        "type": "object",
        "title": "ValidateBankAccountRequest",
        "description": "Bank account details to validate. The user is identified by the `user_token` path parameter.",
        "x-tags": [
          "Account"
        ],
        "required": [
          "attrs"
        ],
        "properties": {
          "country_code": {
            "type": "string",
            "description": "ISO alpha-2 country code of the bank account.",
            "minLength": 2,
            "maxLength": 2,
            "example": "US"
          },
          "attrs": {
            "type": "array",
            "description": "Bank account attributes to validate. `BankAccountNumber` is required.",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/AccountValidationAttribute"
            }
          }
        }
      },
      "AccountValidationAttribute": {
        "type": "object",
        "title": "AccountValidationAttribute",
        "description": "A single bank account attribute supplied for validation.",
        "x-tags": [
          "Account"
        ],
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Attribute type.",
            "enum": [
              "BankAccountNumber",
              "BankRoutingNumber",
              "SWIFT",
              "BankAccountType",
              "IdentificationNumber",
              "IdentificationType"
            ],
            "example": "BankAccountNumber"
          },
          "value": {
            "type": "string",
            "description": "Value of the attribute.",
            "example": "31742287"
          }
        }
      },
      "ValidationResult": {
        "type": "object",
        "title": "ValidationResult",
        "description": "Finalized account validation result.",
        "x-tags": [
          "Account"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "Finalized validation status.\n- `MATCH`: the account exists and the account holder name matches the user on record.\n- `CLOSE_MATCH`: the account exists and the account holder name is a partial match.\n- `NO_MATCH`: the account holder name does not match the user on record.\n- `UNSUPPORTED`: no provider was able to verify this account. Not charged.",
            "enum": [
              "MATCH",
              "CLOSE_MATCH",
              "NO_MATCH",
              "UNSUPPORTED"
            ],
            "example": "MATCH"
          },
          "ownership_verified": {
            "type": "boolean",
            "description": "Whether account ownership was verified by the provider.",
            "example": true
          },
          "first_name_match": {
            "type": "string",
            "nullable": true,
            "description": "First name match outcome, when returned by the validating provider.",
            "example": "MATCH"
          },
          "last_name_match": {
            "type": "string",
            "nullable": true,
            "description": "Last name match outcome, when returned by the validating provider.",
            "example": "MATCH"
          },
          "match_score": {
            "type": "integer",
            "nullable": true,
            "description": "Name match score (0-100) when provided by the validating provider.",
            "minimum": 0,
            "maximum": 100,
            "example": 100
          },
          "score_value": {
            "type": "integer",
            "nullable": true,
            "description": "Provider-specific risk score, when returned."
          },
          "score_rag": {
            "type": "string",
            "nullable": true,
            "description": "Provider-specific red/amber/green rating for the score, when returned."
          },
          "score_description": {
            "type": "string",
            "nullable": true,
            "description": "Human readable explanation of the provider score, when returned."
          }
        }
      },
      "ValidationProcessing": {
        "type": "object",
        "title": "ValidationProcessing",
        "description": "Returned when a finalized result is not available within the synchronous window. The finalized result is delivered via the `avs.completed` webhook event.",
        "x-tags": [
          "Account"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "PROCESSING"
            ],
            "example": "PROCESSING"
          },
          "user_token": {
            "type": "string",
            "description": "Token of the user the validation was requested for.",
            "example": "usr_9a542efe-6060-11f1-b042-02a06bb795f5"
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      },
      "AUTHORIZER_NAME": {
        "name": "Authorization",
        "in": "header",
        "type": "apiKey"
      }
    }
  }
}
```