Implementation guides

Creating a bank account

Qualy is capabable to automatically payout Partnerships automatically. A bank account--amongst other things such as legal information, address, and partnership's contacts--is necessary. Different countries and currencies have different requirements, this guides walks you through adding a bank account.


Before you start

If you are creating a bank account for a specific Partnershio, you will need to have the Partnership's _id to create the Bank account, check our Partnership's API Reference to create a Partnership.

Listing bank account requirements

Different countries and currencies may have different information requirements. Before creating the bank account, it's necessary to fetch the fields for the currency and country of the bank account. Use this GET endpoint to learn what datapoints are required to send a payment to your partnershop.

This this example, we are fetching the bank account requirements for the currency "AUD" and country "AU":

try {
  const response = await fetch('https://api.qualyhq.com/v1/bank-accounts/requirements/AU/AUD', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'ApiKey your-api-key-here',
      'X-TENANT-ID': 'your-tenant-id-here',
    },
  });

  if (response.ok) {
    const data = await response.json();

    console.log(data);
  } else {
    throw new Error(`Request failed with status: ${response.status}`);
  }
} catch (error) {
  console.error(error);
}

The above GET request may return a response like the below:

{
    "data": {
        "requirements": [
            {
                "type": "text",
                "name": "accountName",
                "validation": "required"
            },
            {
                "type": "text",
                "name": "bankName",
                "validation": "required",
                "requirementType": "australian"
            },
            {
                "requirementType": "australian",
                "validation": "required",
                "name": "holderType",
                "min": null,
                "max": null,
                "regexp": null,
                "type": "select",
                "options": [
                    {
                        "value": "personal"
                    },
                    {
                        "value": "business"
                    }
                ]
            },
            {
                "requirementType": "australian",
                "validation": "required",
                "name": "routingNumber",
                "min": 6,
                "max": 7,
                "regexp": "^\\d{3}\\-?\\d{3}$",
                "placeholder": "802985",
                "type": "text"
            },
            {
                "requirementType": "australian",
                "validation": "required",
                "name": "accountNumber",
                "min": 4,
                "max": 28,
                "regexp": "^\\d{4,9}$",
                "placeholder": "123456789",
                "type": "text"
            }
        ]
    },
    "hasMore": false,
    "count": 5
}

Requirement types

Qualy organizes and groups the different requirements that may be necessary by requirementTypes. When creating a bank account you will need to supply this value.

Requirement nameDescription
australianThis requirement type is used for local Australian bank accounts.
euroThis requirement type is used for local European bank accounts.
europeanThis requirement type is used for local European bank accounts.
colombiaThis requirement type is used for local Colombian bank accounts.
brazilThis requirement type is used for local Brazilian bank accounts.
united-kingdomThis requirement type is used for local United Kingdom bank accounts.
new-zealandThis requirement type is used for local New Zealand bank accounts.
united-statesThis requirement type is used for local United States bank accounts.
indiaThis requirement type is used for local Indian bank accounts.
pakistanThis requirement type is used for local Pakistani bank accounts.
swift_codeThis requirement type is used for SWIFT code bank accounts.
turkeyThis requirement type is used for local Turkish bank accounts.
thailandThis requirement type is used for local Thai bank accounts.
romaniaThis requirement type is used for local Romanian bank accounts.
argentinaThis requirement type is used for local Argentine bank accounts.
mexicoThis requirement type is used for local Mexican bank accounts.
chinaThis requirement type is used for local Chinese bank accounts.
canadaThis requirement type is used for local Canadian bank accounts.

Creating a bank account

Once you fetched the bank account requirements, and you now have the necessary information, you can create a bank account entity, calling the Bank Accounts API.

try {
  const response = await fetch('https://api.qualyhq.com/v1/bank-accounts/create', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'ApiKey your-api-key-here',
      'X-TENANT-ID': 'your-tenant-id-here',
    },
    body: JSON.stringify({
      "accountName": "Account name",
      "accountNumber": "12345678",
      "bankName": "Bank name",
      "country": "AU",
      "currency": "AUD",
      "holderType": "business",
      "requirementType": "australian",
      "routingNumber": "123456",
    }),
  });

  if (response.ok) {
    const data = await response.json();

    console.log(data);
  } else {
    throw new Error(`Request failed with status: ${response.status}`);
  }
} catch (error) {
  console.error(error);
}

Creating a bank account for a partnership

You can create a bank account and associate to a partnership by providing the parthership _id using the property partnership when calling the Bank Accounts API.

Here's an example:

try {
  const response = await fetch('https://api.qualyhq.com/v1/bank-accounts/create', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'ApiKey your-api-key-here',
      'X-TENANT-ID': 'your-tenant-id-here',
    },
    body: JSON.stringify({
      "accountName": "Account name",
      "accountNumber": "12345678",
      "bankName": "Bank name",
      "country": "AU",
      "currency": "AUD",
      "holderType": "business",
      "partnership": "6608fa09ae372f75deb3c6ad",
      "requirementType": "australian",
      "routingNumber": "123456",
    }),
  });

  if (response.ok) {
    const data = await response.json();

    console.log(data);
  } else {
    throw new Error(`Request failed with status: ${response.status}`);
  }
} catch (error) {
  console.error(error);
}

Things to know

Qualy has some rules, features and restrictons when creating a bank account, here's what you need to know:

  • Only one Bank Account per currency is allowed.
  • You may need to provide a bankName, but Qualy may overwrite it. Qualy fetches the bankName based on accountNumber and routingNumber for certain countries.
  • Qualy may automatically add address property automatically. Qualy uses the routingNumber to fetch the address of the Bank Account's branch automatically. Only available for certain countries.
Previous
Issuing refunds