# Accounts and account opening

> A user first has an entity record, then a currency account, then a virtual account. The three steps happen in order and cannot be reordered; each result arrives either as an event or as a synchronous response — never infer it from a submission succeeding.

*Scenarios · This page is independent of integration method. API parameters live in the API Reference; event semantics in Events and status; the diagram is at the end of this page.*

## Concepts and choices

**Three objects, three jobs.** KYC is the entity record and decides whether the user qualifies. The currency account decides which currencies the user can hold. The virtual account is the bank-side collection account and decides where money can be sent. They are not interchangeable.

**The order is fixed.** The integration flow submits business KYC first, then opens a currency account, then applies for a virtual account. Each virtual account call covers one country and one currency.

**KYC is asynchronous.** Submitting only returns a `userId`; the decision arrives as `EMFIN.KYC_STATUS`. Omit `userId` in the request to create a user; pass an existing ID to update that user's business KYC, in which case every required field must be sent again.

**Open currencies one by one.** One currency account per currency; the call only takes `userId` and `currencyCode`. Which currencies are available depends on your merchant setup.

**A virtual account needs a country and a currency.** `bankCountry` is an ISO 3166-1 alpha-2 code and `currencyCode` is ISO 4217. A successful request returns `vaApplicationId`, the key used to match the opening result.

## Lifecycle and notifications

1. **Upload materials.** Keep the returned `fileId`; KYC and additional-material requests both reference it.
2. **Submit business KYC.** `userId` in the request may be empty; the response returns `userId`, the key for every later call. Store it next to your own user ID.
3. **Wait for EMFIN.KYC_STATUS.** Read `data.action`: materials requested, decision given, or the request revoked.
4. **Open a currency account.** Send `userId` and `currencyCode`; the response `data` is empty. This version of the documentation records no callback for the endpoint, so treat the response as the result.
5. **Apply for a virtual account.** Send `userId`, `bankCountry` and `currencyCode`; keep `vaApplicationId`. The response means accepted, not opened.
6. **Wait for EMFIN.VA_RESULT.** Match it by `data.vaApplicationId`; only `status=S` is a success.
7. **Query the virtual account.** Before collecting, confirm `status` is `ACTIVE`; only show an available account to the payer.
8. **Close it when needed.** Wait for `EMFIN.CLOSE_VA_RESULT`.

## Edge cases

| Situation | What to do |
| --- | --- |
| KYC rejected | Do not open accounts. Fix the reason and resubmit. |
| Resubmitting KYC | It does not speed up a running review; wait for `EMFIN.KYC_STATUS`. |
| Updating a submitted KYC | Include `userId`; every required field must still be sent. |
| Virtual account without a currency account | The server rejects it; open the currency account first. |
| Several currencies for one user | One currency account per currency; each virtual account call covers one country and one currency, all linked by the same `userId`. |
| Collecting right after opening a currency account | You cannot. Collection needs an active virtual account; an opening response is not a collection signal. |
| Collecting on an unavailable account | Do not. The documentation only promises that an `ACTIVE` account can be paid into; show only accounts in that state. |
| Collecting while closing | Do not display the account during closure; wait for `EMFIN.CLOSE_VA_RESULT` before deciding. |
| Mixing availability with business status | Two different scales; see Events and status. |
| Wrong currency | Opening the wrong currency does not break the flow, but that account cannot collect; open another one with the right `currencyCode`. |

## Developer view

> The diagram expands the account opening chain by participant and marks the endpoint and key fields at each step.

![Account opening sequence](/images/embedded-finance/en/scenarios/01-general-open.png)

*Accounts · sequence diagram*

| Step | Endpoint / event | Key fields |
| --- | --- | --- |
| Upload a file | `POST /api/v2/upload/file` | `fileName`, `file`; returns `fileId` |
| Submit business KYC | `POST /api/v2/kyc/business` | `userId` (optional), `kycType`, registration data, related parties |
| KYC outcome | `EMFIN.KYC_STATUS` | `data.action`, `data.kycStatus`, `data.requestedInfomation` |
| Open a currency account | `POST /api/v2/currency-accounts/open` | `userId`, `currencyCode` |
| Apply for a virtual account | `POST /api/v2/virtual-account/open` | `userId`, `bankCountry`, `currencyCode`; returns `vaApplicationId` |
| Opening result | `EMFIN.VA_RESULT` | `data.vaApplicationId`, `data.status` (S/F) |
| Query virtual accounts | `POST /api/v2/virtual-account/query` | `userId`; returns the account list and `status` |
| Close an account | `POST /api/v2/virtual-account/close` / `EMFIN.CLOSE_VA_RESULT` | `userId`, `vaApplicationId`, `vaCloseReason` (≤512 chars) |

## Related

- [Scenario overview](/embedded-finance/get-started/scenarios)
- [Inbound and crediting](/embedded-finance/get-started/scenarios/inbound)
- [Additional materials](/embedded-finance/get-started/scenarios/additional-materials)
- [Events and status](/embedded-finance/get-started/scenarios/events-and-status)
