# Migrating existing vendors to UNIPaaS

If you have previously used a different platform, you may want to import your existing users/sub-merchants(vendors) to UNIPaaS to allow a smooth onboarding.

# Data import

To migrate the users to the UNIPaaS platform, you need to provide us with a CSV file containing the user data. We will then import this file and provide an output file containing the migration results.

### Input file format

1. Create a file in CSV (Comma Separated Values) format including the following fields:

<table>
  <thead>
    <tr>
      <th>
        alias
      </th>

      <th>
        Onboarding type
      </th>

      <th>
        Is Required
      </th>

      <th>
        Data type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `representative.firstName`  

        `individual.firstName`
      </td>

      <td>
        Company  

        Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Company representative's personal or Individual's first name.
      </td>
    </tr>

    <tr>
      <td>
        `representative.lastName`  

        `individual.lastName`
      </td>

      <td>
        Company  

        Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Company representative's personal or Individual's last name.
      </td>
    </tr>

    <tr>
      <td>
        `company.email`  

        `individual.email`
      </td>

      <td>
        Company  

        Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Company representative's or Individual's business email address.
      </td>
    </tr>

    <tr>
      <td>
        `representative.birthDate`  

        `individual.birthDate`
      </td>

      <td>
        Company  

        Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String\
        Format: YYYY-MM-DD
      </td>

      <td>
        Company representative's personal or Individual's birth date.
      </td>
    </tr>

    <tr>
      <td>
        `company.name`
      </td>

      <td>
        Company
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Legal company name
      </td>
    </tr>

    <tr>
      <td>
        `company.phone`  

        `individual.phone`
      </td>

      <td>
        Company  

        Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Company representative's or Individual's phone number.
      </td>
    </tr>

    <tr>
      <td>
        `company.address`  

        `individual.address`
      </td>

      <td>
        Company  

        Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        Address
      </td>

      <td>
        Company corporate or Individual's address  

        `country`: string, ISO 3166-1 alpha-2 code\
        `city`: string\
        `street`: string\
        `houseNumber`: string\
        `flatNumber`: string (optional)\
        `postCode`: string
      </td>
    </tr>

    <tr>
      <td>
        `company.operationalAddress`
      </td>

      <td>
        Company
      </td>

      <td>
        Yes
      </td>

      <td>
        Address
      </td>

      <td>

      </td>
    </tr>

    <tr>
      <td>
        `business.url`
      </td>

      <td>
        Company / Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        For companies - Business Website URL  

        For individuals - Profile URL (website, blog, social network profile)
      </td>
    </tr>

    <tr>
      <td>
        `business.serviceDescription`
      </td>

      <td>
        individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        A description of the services provided by the individual.
      </td>
    </tr>

    <tr>
      <td>
        `business.category`
      </td>

      <td>
        Company / Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        [MCC codes](https://docs.unipaas.com/docs/mcc-codes)  for the offered goods/services
      </td>
    </tr>

    <tr>
      <td>
        `business.bankAccount`
      </td>

      <td>
        Company / Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Number of the business bank account
      </td>
    </tr>

    <tr>
      <td>
        `business.sortCode`
      </td>

      <td>
        Company / Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Sort code of the business bank account
      </td>
    </tr>

    <tr>
      <td>
        `business.agreement`
      </td>

      <td>
        Company / Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        Agreement
      </td>

      <td>
        Digital signature on the MSA  

        `accepted`: Boolean,\
        `ipAddress`: ip
      </td>
    </tr>

    <tr>
      <td>
        `vendorReference`
      </td>

      <td>
        Company / Individual
      </td>

      <td>
        Yes
      </td>

      <td>
        String
      </td>

      <td>
        Unique user identifier in your system
      </td>
    </tr>
  </tbody>
</table>

2. Save the file in UTF-8 format.
3. Send the file to UNIPaaS.

The following is an example of an input file:

```
representative.firstName,individual.firstName,representative.lastName,individual.lastName,company.email,individual.email,representative.birthDate,individual.birthDate,company.name,company.phone,individual.phone,company.address.country,company.address.city,company.address.street,company.address.houseNumber,company.address.postCode,individual.address.country,individual.address.city,individual.address.street,individual.address.houseNumber,individual.address.postCode,company.operationalAddress,business.url,business.serviceDescription,business.category,business.bankAccount,business.sortCode,business.agreement,vendorReference
William,,Smith,,william.smith@company.com,,1980-10-21,,Design Company,442098098923,,GB,London,Moorfields,21,EC2Y 9DB,,,,,,,https://www.designcompany.com,,,30947509,300300,,M002
,Jane,,Doe,,jane.doe@janecrafts.com,,1976-11-28,,,447698092361,,,,,,GB,London,Buckingham Palace Road,123,SW1W 9SR,,https://www.janecrafts.com,Craft Shop,ARTIST_SUPPLY,34790876,40040,,J137
```

### Output file

When we have imported your CSV file, we will send you an output file with the migration results.

The output file has the following fields:

| alias           | Data Type | Description                                           |
| :-------------- | :-------- | :---------------------------------------------------- |
| vendorReference | String    | Unique user identifier in your system                 |
| vendorId        | String    | Unique user (vendor) identifier in the UNIPaaS system |
| onboardingLink  | String    | Unique user (vendor) onboarding link                  |

The following is an example of the output file:

```
vendorReference,vendorId,onboardingLink
M002,66d87dccdd0d3236ae43c4fd,https://onboarding.unipaas.com/link/abc123
V134,66d58bd06098898a5de10bde,https://onboarding.unipaas.com/link/a25h3j
B776,66d9d3bd56de78294662de5f,https://onboarding.unipaas.com/link/p2p458
J137,66e1700156de78067462dedd,https://onboarding.unipaas.com/link/fhjsm3
```

Start using `vendorId` for your users in the UNIPaaS integration.

<br />

# Access to your current integration

If data is not readily available and cannot be provided, UNIPaaS can still support the migration from your current provider. Please contact your UNIPaaS contact and provide us with:

1. Current provider name
2. Authentication details like API credentials for current provider

Once the data has been imported by UNIPaaS, we will provide you with an output file with migration results.

The output file has the following fields:

| alias           | Data Type | Description                                           |
| :-------------- | :-------- | :---------------------------------------------------- |
| vendorReference | String    | Unique user identifier in your system                 |
| vendorId        | String    | Unique user (vendor) identifier in the UNIPaaS system |
| onboardingLink  | String    | Unique user (vendor) onboarding link                  |

The following is an example of the output file:

```
vendorReference,vendorId,onboardingLink
M002,66d87dccdd0d3236ae43c4fd,https://onboarding.unipaas.com/link/abc123
V134,66d58bd06098898a5de10bde,https://onboarding.unipaas.com/link/a25h3j
B776,66d9d3bd56de78294662de5f,https://onboarding.unipaas.com/link/p2p458
J137,66e1700156de78067462dedd,https://onboarding.unipaas.com/link/fhjsm3
```

Start using `vendorId` for your users in the UNIPaaS integration.

<br />

# Webhooks

UNIPaaS sends webhook notifications to inform your system about the vendors created in the system. By subscribing to the [`onboarding/update` webhook](https://docs.unipaas.com/docs/onboardingupdate-webhook), you will get notification about your vendor's `vendorReference`and the associated `vendorId`.
