---
agentTools:
  projectIndex: https://onebrick.readme.io/llms.txt
---

# Account Verification API

This API helps verify the account of receipt to prevent fraud.

## Request parameters

| Key Parameter         | Data Type | Description                                                                                                                                                                                           |
| :-------------------- | :-------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| public\_access\_token | String    | The public access token is generated using your clientId and clientSecret, and you can retrieve it from this [endpoint](https://onebrick.readme.io/reference/generate-public-access-token-jwt-token). |
| accountNumber         | String    | Account number that the funds are intended to be sent to.                                                                                                                                             |
| bankShortCode         | String    | This should be the institution that your end-customer intends to receive funds in. Please see [this document](/reference/list-of-bank-coverage)for full list of accounts you can send to.             |

## Response parameters

| Key Parameter | Data type | Description                                                         |
| :------------ | :-------- | :------------------------------------------------------------------ |
| accountNo     | String    | Account number of the user                                          |
| bankShortCode | String    | Institution short code of the user                                  |
| accountName   | String    | Institution account name that the funds are intended to be sent to. |
| activityId    | String    | A unique reference ID for each request for bank account validation. |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Payment v2",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://sandbox.onebrick.io/v2/payments/gs"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "publicAccessToken",
        "x-default": "Bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/payments/bank-account-validation": {
      "post": {
        "summary": "Account Verification API",
        "description": "This API helps verify the account of receipt to prevent fraud.",
        "operationId": "account-verification-api",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "accountNumber",
                  "bankShortCode"
                ],
                "properties": {
                  "accountNumber": {
                    "type": "string",
                    "description": "Unique number for banks"
                  },
                  "bankShortCode": {
                    "type": "string",
                    "description": "This should be the institution that your end-customer intends to receive funds in. Please see https://docs.onebrick.io/docs/destination-banks for full list of accounts you can send to."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"status\": 200,\n    \"message\": \"OK\",\n    \"data\": {\n        \"accountName\": \"PROD ONLY\",\n        \"accountNo\": \"123123123\",\n        \"bankShortCode\": \"BCA\"\n    }\n}\n}\n"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "accountNumber missing": {
                    "value": "{\n    \"status\": 400,\n    \"message\": \"Please use the API with accountNumber in the request query\",\n    \"data\": \"The accountNumber is missing from request query\"\n}"
                  },
                  "bankShortCode missing": {
                    "value": "{\n    \"status\": 400,\n    \"message\": \"Please use the API with bankShortCode in the request query\",\n    \"data\": \"bankShortCode is missing from request query\"\n}"
                  },
                  "bankShortCode invalid": {
                    "value": "{\n    \"status\": 400,\n    \"message\": \"Please use a valid bankShortCode in the request query\",\n    \"data\": \"The bankShortCode in the request query is not valid\"\n}"
                  },
                  "Result": {
                    "value": "{\n    \"status\": 400,\n    \"message\": \"Please use a valid accountNumber in the request query\",\n    \"data\": \"The accountNumber that was inserted is either invalid or inactive\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "accountNumber missing",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "message": {
                          "type": "string",
                          "example": "Please use the API with accountNumber in the request query"
                        },
                        "data": {
                          "type": "string",
                          "example": "The accountNumber is missing from request query"
                        }
                      }
                    },
                    {
                      "title": "bankShortCode missing",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "message": {
                          "type": "string",
                          "example": "Please use the API with bankShortCode in the request query"
                        },
                        "data": {
                          "type": "string",
                          "example": "bankShortCode is missing from request query"
                        }
                      }
                    },
                    {
                      "title": "bankShortCode invalid",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "message": {
                          "type": "string",
                          "example": "Please use a valid bankShortCode in the request query"
                        },
                        "data": {
                          "type": "string",
                          "example": "The bankShortCode in the request query is not valid"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "message": {
                          "type": "string",
                          "example": "Please use a valid accountNumber in the request query"
                        },
                        "data": {
                          "type": "string",
                          "example": "The accountNumber that was inserted is either invalid or inactive"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid Token": {
                    "value": "{\n    \"status\": 401,\n    \"message\": \"Please use valid Public_access_token in headers\",\n    \"data\": \"Invalid public_access_token in headers\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "Please use valid Public_access_token in headers"
                    },
                    "data": {
                      "type": "string",
                      "example": "Invalid public_access_token in headers"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "application/json": {
                "examples": {
                  "Service is not available": {
                    "value": "{\n    \"status\": 500,\n    \"message\": \"We are facing some problem trying to validate your account, Please try after some time\",\n    \"data\": \"Service is not available\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500,
                      "default": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "We are facing some problem trying to validate your account, Please try after some time"
                    },
                    "data": {
                      "type": "string",
                      "example": "Service is not available"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "62aa98669833aa0028c5a455:699b1bdb56a60e807aba119d"
}
```