> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yorlet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Importing data

> Learn how to import data into Yorlet during onboarding.

We'll walk you through the process of importing data into Yorlet during onboarding. It follows a step-by-step approach to ensure that you can import your data correctly.

## Import steps

<Steps>
  <Step title="Owners">
    This is your landlord, leaseholder, and supplier data.
  </Step>

  <Step title="Buildings and units">
    This is your building and unit data. You can use the owner data imported in
    step one to attach the units to their owners.
  </Step>

  <Step title="Active tenancies">
    These are your active tenancies. You can use the unit data imported in step
    two to attach the tenancies to their units.
  </Step>
</Steps>

## Owners

The owner record is used to store the details of the people or businesses that own the properties.

#### Formatted fields

The following fields need to be formatted to ensure that the data is imported correctly.

| Field             | Description                                                                     |
| :---------------- | :------------------------------------------------------------------------------ |
| `business_type`   | Can be one of `individual` or `company`.                                        |
| `type`            | Can be one of `landlord`, `leaseholder`, or `supplier`.                         |
| `address.country` | This should be a two letter country code. For example, “GB” for United Kingdom. |
| `tax_residency`   | This should be a two letter country code. For example, “GB” for United Kingdom. |

<Card title="Owners import" icon="download" href="https://docs.google.com/spreadsheets/d/15k7s9IEcpENjl3KmB0HeZvZUgFejt93N_vRx3oqmyDA/edit?usp=sharing">
  Download the owners import template.
</Card>

## Buildings and units

Yorlet supports two different structures for your properties: [single property](/real-estate/buildings#single-property) and [multi-unit](/real-estate/buildings#multi-unit).

<Tabs>
  <Tab title="Single property">
    Use the single property type when you’re adding a property you wish to lease as one. For example, a property with three residents all each paying rent.

    We are going to create a building record at the same time as a unit record. Single property buildings can only have one unit.

    #### Formatted fields

    The following fields need to be formatted to ensure that the data is imported correctly.

    | Field                           | Description                                                                                                                                                                                                   |
    | :------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | `currency`                      | This should be a three letter currency code. For example, “gbp” for British Pound.                                                                                                                            |
    | `reference`                     | If you have a unique reference for the unit either from your own system or a previous system, you can add it here.                                                                                            |
    | `building_data.address.country` | This should be a two letter country code. For example, “GB” for United Kingdom.                                                                                                                               |
    | `furnished`                     | This should be either `true` or `false`.                                                                                                                                                                      |
    | `fees.management_fee`           | This should be an integer. For example, 10% should be 10.                                                                                                                                                     |
    | `fees.tax`                      | This should be an integer. For example, 20% VAT should be 20.                                                                                                                                                 |
    | `owners[0].owner`               | This should be the ID of the owner record you created in the owners import that you want to attach to this unit. This can also be the email address of the owner if you have not yet imported the owner data. |
    | `owners[0].percent_ownership`   | This should be an integer. For example, 100% ownership should be 100.                                                                                                                                         |

    <Note>
      You can add multiple owners to a unit if the property is owned by multiple people. For each owner increment the index of the `owners` array. For example, the first owner is `owners[0]`, the second owner is `owners[1]`, and so on. The sum of all the `owners[].percent_ownership` fields should be 100.
    </Note>

    <Card title="Units import (single property)" icon="download" href="https://docs.google.com/spreadsheets/d/14biiTuC2keJD0SLr9Oxk2t3yPz8R2NQO1sBitp6J9Vs/edit?usp=sharing">
      Download the unit import (single property) template.
    </Card>
  </Tab>

  <Tab title="Multi-unit">
    The multi-unit property type has a few different use cases:

    * A property that has multiple apartments, like a large building with 10 different properties you lease individually.
    * A house of multiple occupancy (HMO), where you lease individual rooms to different customers.

    We are going to create a building record first and then create a unit record for each unit in the building.

    ### Buildings

    Create a building record for each property you want to import. You can find the guide to creating a building [here](/real-estate/buildings#create-a-building).

    ### Units

    After creating the building record, you can create the unit records. You will need the building ID of the building you created in the buildings import.

    #### Formatted fields

    The following fields need to be formatted to ensure that the data is imported correctly.

    | Field                         | Description                                                                                                                                                                                                   |
    | :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | `building`                    | This should be the ID of the building record you created in the buildings import.                                                                                                                             |
    | `reference`                   | If you have a unique reference for the unit either from your own system or a previous system, you can add it here.                                                                                            |
    | `alternate_postal_code`       | This should be the postal code of the unit if it is different to the building's postal code.                                                                                                                  |
    | `currency`                    | This should be a three letter currency code. For example, “gbp” for British Pound.                                                                                                                            |
    | `furnished`                   | This should be either `true` or `false`.                                                                                                                                                                      |
    | `fees.management_fee`         | This should be an integer. For example, 10% should be 10.                                                                                                                                                     |
    | `fees.tax`                    | This should be an integer. For example, 20% VAT should be 20.                                                                                                                                                 |
    | `owners[0].owner`             | This should be the ID of the owner record you created in the owners import that you want to attach to this unit. This can also be the email address of the owner if you have not yet imported the owner data. |
    | `owners[0].percent_ownership` | This should be an integer. For example, 100% ownership should be 100.                                                                                                                                         |

    <Note>
      You can add multiple owners to a unit if the property is owned by multiple people. For each owner increment the index of the `owners` array. For example, the first owner is `owners[0]`, the second owner is `owners[1]`, and so on. The sum of all the `owners[].percent_ownership` fields should be 100.
    </Note>

    <Card title="Units import (multi-unit)" icon="download" href="https://docs.google.com/spreadsheets/d/1hdXHnRdEoQj2y0rAfSA3A4Yh0Qn2H1y-oZm1AJH9zpY/edit?usp=sharing">
      Download the unit import (multi-unit) template.
    </Card>
  </Tab>
</Tabs>

## Active tenancies

The active tenancy record is used to store the details of the tenancies that are currently active including current tenants and rent details.

#### Formatted fields

The following fields need to be formatted to ensure that the data is imported correctly.

| Field                                 | Description                                                                                                                                                                                                                                                                    |
| :------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`                                | Must be `active_tenancy`.                                                                                                                                                                                                                                                      |
| `currency`                            | This should be a three letter currency code. For example, “gbp” for British Pound.                                                                                                                                                                                             |
| `unit`                                | This should be the ID of the unit record you created in the units import.                                                                                                                                                                                                      |
| `start_date`                          | This should be a date in the format `YYYY-MM-DD`.                                                                                                                                                                                                                              |
| `end_date`                            | This should be a date in the format `YYYY-MM-DD`. If the tenancy is rolling, you can leave this blank.                                                                                                                                                                         |
| `subscription_data.collection_method` | The collection method for the subscription. `charge_automatically` requires the customer to provide a payment method; charges are made automatically each billing cycle. `send_invoice` sends an invoice to the customer each billing cycle, including a link to pay manually. |
| `subscription_data.start_date`        | This should be the next rent payment date. This should be a date in the format `YYYY-MM-DD`.                                                                                                                                                                                   |
| `subscription_data.interval`          | This should be the interval of the rent payment. This should be one of `month` or `week`.                                                                                                                                                                                      |
| `subscription_data.interval_count`    | This should be the number of intervals between rent payments. For example, if the rent is paid monthly, this should be 1. If the rent is paid every 3 months, this should be 3.                                                                                                |
| `subscription_data.amount`            | This should be the amount of the rent in the unit's currency.                                                                                                                                                                                                                  |
| `subscription_data.description`       | This should be a description of the rent. This is visible to the tenant on their invoice.                                                                                                                                                                                      |
| `applicants[0].share_of_rent`         | This should be an integer. For example, 100% share of rent should be 100.                                                                                                                                                                                                      |

<Note>
  You can add multiple applicants to a tenancy if there are multiple people
  sharing the rent. For each applicant increment the index of the `applicants`
  array. For example, the first applicant is `applicants[0]`, the second
  applicant is `applicants[1]`, and so on. The sum of all the
  `applicants[].share_of_rent` fields should be 100.
</Note>

<Card title="Active tenancies import" icon="download" href="https://docs.google.com/spreadsheets/d/1rPE2KYLoCHX7DUoKpZrG78Bu1xOm5X1yxWXs9db-41o/edit?usp=sharing">
  Download the active tenancies import template.
</Card>

## Invoices

The invoice record is used to bill customers.

#### Formatted fields

The following fields need to be formatted to ensure that the data is imported correctly.

| Field                          | Description                                                                                                                                                                                                                                                                    |
| :----------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customer`                     | Must be the ID of the customer record you created in the customers import.                                                                                                                                                                                                     |
| `currency`                     | This should be a three letter currency code. For example, “gbp” for British Pound.                                                                                                                                                                                             |
| `collection_method`            | The collection method for the subscription. `charge_automatically` requires the customer to provide a payment method; charges are made automatically each billing cycle. `send_invoice` sends an invoice to the customer each billing cycle, including a link to pay manually. |
| `unit`                         | This should be the ID of the unit record you created in the units import.                                                                                                                                                                                                      |
| `period_start`                 | This should be a date in the format `YYYY-MM-DD`.                                                                                                                                                                                                                              |
| `period_end`                   | This should be a date in the format `YYYY-MM-DD`.                                                                                                                                                                                                                              |
| `line_items[0].amount`         | This should be a the amount to charge.                                                                                                                                                                                                                                         |
| `line_items[0].description`    | This should be a description of the line item.                                                                                                                                                                                                                                 |
| `line_items[0].tax_percentage` | This should be the tax percentage for the line item. Should be a number between 0 and 100.                                                                                                                                                                                     |
| `line_items[0].type`           | This should be the type of the line item. Can be `rent`, `charge`, or `product`.                                                                                                                                                                                               |

<Note>
  You can add multiple line items to an invoice. For each line item, increment
  the index of the `line_items` array. For example, the first line item is
  `line_items[0]`, the second line item is `line_items[1]`, and so on.
</Note>

<Card title="Invoices import" icon="download" href="https://docs.google.com/spreadsheets/d/1mncaQ3zG6-HGGAnP4gEfSJc0nYj1fnvy2MFjT0-3rNs/edit?usp=sharing">
  Download the invoices import template.
</Card>

## Subscriptions

The subscription record is used to bill customers recurringly.

#### Formatted fields

The following fields need to be formatted to ensure that the data is imported correctly.

| Field                     | Description                                                                                                                                                                                                                                                                    |
| :------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customer`                | Must be the ID of the customer record you created in the customers import.                                                                                                                                                                                                     |
| `currency`                | This should be a three letter currency code. For example, “gbp” for British Pound.                                                                                                                                                                                             |
| `collection_method`       | The collection method for the subscription. `charge_automatically` requires the customer to provide a payment method; charges are made automatically each billing cycle. `send_invoice` sends an invoice to the customer each billing cycle, including a link to pay manually. |
| `start`                   | This should be the next payment date. This should be a date in the format `YYYY-MM-DD`.                                                                                                                                                                                        |
| `end`                     | This should be a date in the format `YYYY-MM-DD`. If the subscription is rolling, you can leave this blank.                                                                                                                                                                    |
| `interval`                | This should be a string of the interval. Can be `month` or `week`.                                                                                                                                                                                                             |
| `interval_count`          | The interval count of the subscription. For example, if the `interval` is `month` and the `interval_count` is `1`, the subscription will be billed every month. If the `interval` is `week` and the `interval_count` is `2`, the subscription will be billed every 2 weeks.    |
| `items[0].amount`         | This should be a the amount to charge.                                                                                                                                                                                                                                         |
| `items[0].description`    | This should be a description of the line item.                                                                                                                                                                                                                                 |
| `items[0].tax_percentage` | This should be the tax percentage for the line item. Should be a number between 0 and 100.                                                                                                                                                                                     |
| `items[0].type`           | This should be the type of the line item. Can be `rent`, `charge`, or `product`.                                                                                                                                                                                               |

<Note>
  You can add multiple line items to a subscription. For each line item,
  increment the index of the `items` array. For example, the first line item is
  `items[0]`, the second line item is `items[1]`, and so on.
</Note>

<Card title="Subscriptions import" icon="download" href="https://docs.google.com/spreadsheets/d/17SrCZpAATPL_kmW8uzFx2d5Q0oyR-e52q4qknDJ39KM/edit?usp=sharing">
  Download the subscriptions import template.
</Card>

## Account collections

The account collection record is used to deduct funds from an owner's account, for example to charge a management fee, recover an expense, or collect a service charge.

<Info>
  You can also import account collections directly in the Dashboard. See [CSV
  imports](/development/imports) for the self-serve import flow.
</Info>

#### Formatted fields

The following fields need to be formatted to ensure that the data is imported correctly.

| Field         | Description                                                                                                                                  |
| :------------ | :------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`        | The type of the account collection. Can be `expense`, `fee`, or `service_charge`.                                                            |
| `unit`        | This should be the ID of the unit record you created in the units import that this account collection relates to.                            |
| `owner`       | This should be the ID of the owner record you created in the owners import. This is the owner whose account the funds will be deducted from. |
| `description` | An arbitrary string describing the account collection. Often useful for displaying to users.                                                 |
| `amount`      | This should be the amount to charge in the smallest currency unit. For example, £400.00 should be 40000.                                     |
| `currency`    | This should be a three letter currency code. For example, “gbp” for British Pound.                                                           |
| `destination` | The ID of an owner account to allocate the collection funds to. Leave blank to allocate the funds to the platform account.                   |

<Card title="Account collections import" icon="download" href="https://docs.google.com/spreadsheets/d/1hvZAhFEVg2gF7FfadbBJHmEgfJppzL6OKQvm66xPpOU/edit?usp=sharing">
  Download the account collections import template.
</Card>
