---
# System prepended metadata

title: Apply Financials

---

# Apply Financials

Official docs : https://applyfinancial.wordpress.com/validate-api/

## Generate 

```typescript=
let data = querystring.stringify({
  username: process.env.APPLY_FINANCIALS_USERNAME,
  password: process.env.APPLY_FINANCIALS_PASSWORD
})

const result: any = await axios.post(`${HOST}/authenticate`, data, {
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
  }
})

this.token = result.data.token
```

## Get Bank Details from NationalId

```typescript=
let data = {
  countryCode: string,
  nationalId: string,
  token: this.token
}

const result: any = await axios.get(`${HOST}/convert`, {
  params: data
})
```

## Validate bank account

```typescript=
let data = {
  countryCode: string,
  nationalId: string,
  accountNumber: string,
  token: this.token
}

const result: any = await axios.get(`${HOST}/convert`, {
  params: data
})

if (result.status != 'PASS') {
  throw new Error(validation.comment)
}
```