---
title: "addBasketColumns"
slug: "api/basket/operations/addbasketcolumns"
sidebar:
  order: 504
---

<a id="ref-bccfca62c6fa"></a>
<a id="ref-94389be32f3d"></a>
<a id="ref-746dd808fa92"></a>

```text
BasketColumn[] addBasketColumns(SessionId sessionId,                                                            BasketColumn[]  columns)
throws BasketServiceFault;
```

See also: [`BasketColumn`](/pCon/configuratorOnline/specs/api/basket/types/basketcolumn#ref-dc46b4c340c2), [`SessionId`](/pCon/configuratorOnline/specs/api/session/types/sessionid#ref-02e397c8fdb4), [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault#ref-d5adb74faa1b)

Add zero or more columns to the basket of the specified session.

The columns, and their initial configuration, are specified by parameter `columns`.

If the `id` attribute of a column is an empty string or the NIL UUID, then a random UUID will be generated for this column.

The `type` attribute must be specified and must not be `Undefined` or `Builtin`.

The `itemAttrId` attribute should be left unspecified. If specified, it must be `UserDefined`.

The `defaultColumn` attribute, if specified, must be either an empty string or a properly formatted UUID. If not specified or an empty string it will be replaced by the NIL UUID. The NIL UUID is used to indicate that there is no default column.

The `readOnly` attribute, if not specified, defaults to `false`.

The `name` and `title` elements must be both present and contain non-empty strings.

The `defaultValue` element, if not present, defaults to an empty string.

It is an error if the `defaultColumn` attribute contains an UUID other than the NIL UUID, and the `defaultValue` element contains a non-empty string.

Columns are added, one after another, in the order they appear in the `columns` parameter. If addition of a column fails, then all columns added so far by this operation are removed again, and the operation fails.

Possible reasons for the addition of a column to fail are:

- There is already a column with the same ID.

- A non-NIL default column ID has been specified, and there is no column with this ID.

If the operation succeeds, it returns information about all added columns. The number and order of elements in the return value is the same as in parameter `columns`. The information returned is the same as would be returned for the same columns by operation getBasketColumns (§[getBasketColumns](/pCon/configuratorOnline/specs/api/basket/operations/getbasketcolumns#ref-7369e10ccfa1)).

The operation fails with a [`BasketServiceFault`](/pCon/configuratorOnline/specs/api/basket/faults/basketservicefault) if

- The session ID is not a properly formatted UUID.

- The session ID does not reference an existing session.

- For any of the error conditions described above.
