Import Organization Units
Organization Units, or OUs for short, can be created, imported, and/or updated in EVA using ImportOrganizationUnits. This service creates or updates Organization Units, which EVA then maps to a BackendID
.
Creating or importing an OU
{
"OrganizationUnits": [
{
"ParentID": "docs_inc",
"ID": "japan",
"Name": "Japan",
"CurrencyID": "JPY",
"CostPriceCurrencyID": "JPY",
"Status": 0,
"Type": 168
},
{
"ParentID": "japan",
"ID": "tokyo_store",
"Name": "Tokyo Store",
"CurrencyID": "JPY",
"CostPriceCurrencyID": "JPY",
"Status": 1,
"Type": 137
},
]
}
{
"Created": {
"japan": 16,
"tokyo_store": 17
},
"Updated": {}
}
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've created a country container and a shop in that country. In this simple example, we only specified all necessary identifiers on currencies. Additionally, we have set the correct Status
and Type
.
See OU types and OU statuses for available options.
Adding an address
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"
}
},
]
}
If a store address has changed, utilize the same service ImportOrganizationUnits
, but only update the address object. See update OUs section for more.
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.
Post a successful OU import, it is easier to manage opening hours by using a opening hours template. This can be done via the Admin Suite chapter called Opening hours template. This part is not supported via API.
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.
- Specifying a new or different address will create a new address with only the specified data.
- 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
This will determine the OrganizationUnitType
.
Frequently combined organization unit types:
Types combination | Description |
---|---|
Shop, Pickup & EVA | This combination indicates that the organization unit is a shop running on EVA where sales are performed, and one that allows for reservation orders too. |
Warehouse & Supplier | This combination indicates that the organization unit can accept delivery orders and at the same time, serve as a supplier of goods to certain stores based on the supplier relations configurations. |
When providing input for the Type
property, make sure to include the values for the desired combination. For example, the value for the Type
property of an OU with types Shop, Pickup, and EVA would be 137, representing the sum of Shop (1), Pickup (8), and EVA (128).
OU statuses
The OU statuses are solely for filtering purposes; therefore, any chosen status will have no impact on operational aspects such as transaction processing (sales, returns, etc.) within that organization unit.