---
title: "relocateItems"
slug: "api/basket/operations/relocateitems"
sidebar:
  order: 438
---

<a id="ref-0df7ba005224"></a>
<a id="ref-648ff0d4daa9"></a>
<a id="ref-ecacc33e30d4"></a>

## Synopsis

```text
RelocateItemsResult[] relocateItems(SessionId sessionId,
    BItemId fatherId,
    BItemId beforeId,
    BItemId[]           itemIds,
    RelocateItemsOptions *options)
throws BasketServiceFault;
```

See also: [`RelocateItemsResult`](/pCon/configuratorOnline/specs/api/basket/types/relocateitemsresult#ref-c77bb5f711cb), [`SessionId`](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [`BItemId`](/pCon/configuratorOnline/specs/api/basket/types/bitemid#ref-bccb6c926e5b), [`RelocateItemsOptions`](/pCon/configuratorOnline/specs/api/basket/types/relocateitemsoptions#ref-dc12213535a2), [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault#ref-d5adb74faa1b)

Move specified list of items to new position in basket item tree.

The new position of the moved items is specified by `fatherId` and `beforeId`. They become children of the item identified by the father ID, and are inserted into the list of the father's children immediately before the item identified by beforeId, unless `beforeId` is either the `NIL` ID, or identifies an item that is not a child of the father, in which case they are appended to the list of children.

The items to move, and their order once they have been moved, is specified by `itemIds`. As the order is significant, duplicate item IDs are not allowed.

In general, the specified items are moved together with all their descendants (i.e. whole sub-trees are moved). The option `flat` `(false` by default) controls the behavior if one of the items to move is a descendant of another item to move (the ancestor). If true, the sub-tree rooted at the descendant will be moved to the father. If false, the descendant will be moved as part of the sub-tree rooted at the ancestor.

If option doNotModify (false by default) is true, the final step of moving the items is suppressed. Other than that, the operation behaves exactly the same way as with this option set to false, including returning the same result and throwing the same exceptions, unless they occur during the actual move of the items (which should not happen).

`Parameters:`

**`fatherId`**

the ID of the new father

**`beforeId`**

the insert position within the list of children of the new father, or a NIL UUID (either an empty string or an UUID consisting of all zero)

**`itemIds`**

the list of IDs of the items to move

**`options`**

the options that affect the behavior of the operation; If missing, or if one of the option values is missing, the default value will be used.

The operation returns an enumeration value that indicates whether or not items have been moved, and if not, why they haven't been moved
