Create an Account for a Business

Prev Next

Ask Plamen + API Guide

As we created a new business previously and we received unique merchant token, we can proceed to open an account for the business. This is done by account_create API request.

We will now proceed to open an account for the business

Utilization of the API:

For this use case, you will need to use the account_create request. Depending on what your configuration is in the Paynetics`s system, there are different options for the accounts you can create. For full API specification and example of the request check the following URL - Paynetics API documentation

Example request:

{
   "program": "account_eur", 
   "merchant": "242d993a-be0e-461d-b9e4-7c84b8bfff4f", // we fill in the merchant token so that we point out under which business we want the account to be created
   "user": "", // as we do not want the account to be opened under a specific user field should be left empty
   "main": "", // as we will not be linking this account, field main should be left empty
   "skip_iban_generation": false, // in this case we want the account to have an IBAN too, so we keep the value “false”
   "alias": "Company expenses" // With this alias the company can easily see what is this account used for
}

Now that we have sent the request to open an account, Payntics system will check the configured account program parameters and whatever else was placed in the request, to fulfil it.

It is important to take notice of the account program field. The account program holds the information on how this account will be opened and operated – currency, IBAN generation and more. You can have multiple account programs active, but only one is selected when you open an account.

Example response:

{
   "code": 0,
   "data": {
      "program": "account_eur",
      "token": "202f828a-c594-436d-b753-87c47556ef11", // This is the unique token ID for the account
      "merchant": "242d993a-be0e-461d-b9e4-7c84b8bfff4f ", // merchant ID is matching the one in the request
      "user": "", // User is empty as we have not assigned the account to a user, but have opened and assigned it for the business
      "type": "default",
      "number": "0123456789",
      "is_main": true, // as we have not added a account token id in the “main” field in the request the created account is main itself, it is not linked
      "status": "active", // status of the account
      "multicurrency": false, // this is depending of the program setup
      "balances": [
         {
            "available": 1.23,
            "blocked": 1.23,
            "currency": "EUR",
            "token": "338e7368-4800-40ad-a4db-2e3df401087b", // this is the unique token balance for this account
            "iban": "BG31PATC4002115468108680", // The IBAN which we needed to be generated
            "sort_code": "123456",
            "account_number": "12345678",
            "number": "0123456789",
            "is_main": true // This is marking that the EUR balance is the default balance for the program
         }
      ]
   }
}

In the response for account creation, we will provide back success or failure for account creation. If the creation was successful, the response will also contain account number, status of the account, which is by default active, available balance, IBAN if such was generated, currency of the account, unique account token ID, Account Sort code

The account opening event can also generate a webhook, like how one is generated, after merchant is registered.

Example webhook payload:

{
   "action": "ACCOUNT.IBAN",
   "version": 2,
   "payload": {
      "merchant": "3331b9fc-bd75-4b2b-9d11-815ed0f6ff6a",
      "user": "604cede2f73431055608ccaac916cc1db364a8ba437cfd21",
      "account": "7369d5cf-ff30-4581-949a-523ec034949c",
      "balance": "d0d58a0d-1976-4b93-a52e-c2c9186c10b3",
      "iban": "BG96PATC40022963887320",
      "sort_code": "123456",
      "account_number": "12345678"
   }
}