Skip to main content

Creating OUs

Organization Units, or OU's for short, can be created and updated in EVA using ImportOrganizationUnits. This service creates or updates specified OrganizationUnits, identified by your ID (that we map to our BackendID).

Creating simple OUs

{
"OrganizationUnits": [
{
"ParentID": "docs_inc",
"ID": "japan",
"Name": "Japan",
"CurrencyID": "JPY",
"CostPriceCurrencyID": "JPY",
"StatusID": 0,
"TypeID": 168
},
{
"ParentID": "japan",
"ID": "tokyo_store",
"Name": "Tokyo Store",
"CurrencyID": "JPY",
"CostPriceCurrencyID": "JPY",
"StatusID": 1,
"TypeID": 168
},
]
}

The response will tell you which OUs have been added and/or updated and also return the EVA IDs of these OUs.

In this example, we create a country container and a shop in that country. In this extremely simple example, we only specified all necessary identifiers on currencies. Additionally, we have set the correct Status and Type. For lists on statuses and types, scroll down to the bottom of this document.

Adding addresses

Addresses can be added in ImportOrganizationUnits like so:

{
"OrganizationUnits": [
{
"ParentID": "japan",
"ID": "tokyo_store",
"Name": "Tokyo Store",
"CurrencyID": "JPY",
"CostPriceCurrencyID": "JPY",
"StatusID": 1,
"TypeID": 168,
"Latitude": 52.375769767286,
"Longitude": 5.217192421803888,
"Address": {
"Address1": "2 Chome-21-13 Kosuge, Katsushika City",
"ZipCode": "124-0001",
"City": "Tokyo",
"CountryID": "JP"
}
},
]
}

Adding opening hours

Opening hours can be added in ImportOrganizationUnits like so:

{
"OrganizationUnits": [
{
"ParentID": "japan",
"ID": "tokyo_store",
"Name": "Tokyo Store",
"CurrencyID": "JPY",
"CostPriceCurrencyID": "JPY",
"StatusID": 1,
"TypeID": 168,
"OpeningHours": [
{
"TypeName": "Visiting",
"DayOfWeek": 1,
"StartTime": "08:00:00",
"EndTime": "18:00:00"
}
]
},
]
}

We've only added opening hours for one day to the example. Normally, you would add an entire array for all days of the week. For more information, see opening hours.

Note

Opening hours are easier to manage using opening hour templates, we recommend using those instead.

Update OUs

You can easily update an OU using ImportOrganizationUnits too. Omit any field you don't want altered, or send in null values of nullable fields to unset their current value.

Note

This does not apply to addresses - specifying a new or different address will create a new address with only the specified data.

Note

This does also not apply to opening hours - every value you specify will either update the existing hours or create an individual record for that day.

To disable an OU, set the IsDeleted boolean to true.

OU types

OU statuses