---
title: "getTopFolderId"
slug: "api/basket/operations/gettopfolderid"
sidebar:
  order: 423
---

<a id="ref-2b71f739a923"></a>
<a id="ref-5ab088a72078"></a>
<a id="ref-fa5c6a685934"></a>

## Synopsis

```text
BItemId getTopFolderId( SessionId sessionId,
    ViewId viewId)
throws BasketServiceFault;
```

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

The `getTopFolderId` operation returns the basket item ID of the root node of the tree of basket items maintained by the basket service for the session identified by the `sessionId` parameter.

If the argument `viewId` is present and neither an empty string nor the NIL-UUID then it must be the ID of a current basket view, the `itemId` argument must be the ID of an item of this view, and the returned item IDs will be IDs of items of this view.

A [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault) is returned if any of the following conditions occurs:

- The `sessionId` parameter is not a valid string representation of an UUID or does not represent an open session.
