---
title: "InsertOCDArticle (deprecated)"
slug: "api/basket/operations/insertocdarticle-deprecated"
sidebar:
  order: 429
---

<a id="ref-a2acf0695f02"></a>
<a id="ref-33de1ededce5"></a>
<a id="ref-dbedc3a28ba4"></a>

## Synopsis

```text
BItemId insertOCDArticle(SessionId sessionId,
    BItemId fatherId,
    BItemId beforeId,
    InsertInfo insertInfo)
throws BasketServiceFault;
```

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

With EAIWS 4.14 this operation is removed in the SOAP service!  Please use [insertOFMLArticle](/pCon/configuratorOnline/specs/api/basket/operations/insertofmlarticle#ref-6b21dd8ff549) instead.

The `insertOCDArticle` operation inserts a new OCD article item into the basket item tree maintained by the basket service for the session identified by the `sessionId` parameter.

The `fatherId` parameter, if not the null-UUID, must identify the basket item that will become the parent of the new OCD article item. If `fatherId` is the null-UUID (§[UUID](/pCon/configuratorOnline/specs/guide/web-service-interfaces/common-type-definitions/uuid#ref-2a898bc98aaf)), the root item of the basket item tree will be used as the parent item.

The `beforeId` parameter, if not the null-UUID, must identify an existing basket item. If this item is a descendant of the basket item that has been selected as the parent of the newly inserted item, then the new item will be inserted in front of the parent’s child which is either equal to the item identified by `beforeId`, or an ancestor of this item. Otherwise (if `beforeId` is a null-UUID, or if the basket item identified by `beforeId` is not a descendant of the parent item) the new item will be inserted as the last child of the parent item.

The `insertInfo` parameter specifies the OCD article to be inserted. For more information see §[InsertInfo](/pCon/configuratorOnline/specs/api/basket/types/insertinfo#ref-71f4243a693d).

If the operation was able to find the requested article in the product data it determines the initial configuration of the article, evaluating the variant code if specified, and, if successful so far, inserts the article into the basket item tree.

The inserted basket item is of type `OCDArticle` (§[BasketItemType](/pCon/configuratorOnline/specs/api/basket/types/basketitemtype#ref-5d3667cadff0)).

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.

- Either the `fatherId` or `beforeId` parameter does not represent an UUID.

- Either the `fatherId` or `beforeId` parameter does not identify a basket item and is not the null-UUID.

- The basket item identified by the `fatherId` parameter does not permit child items.

- If an article package ID has been specified and it is either not a valid OFML package ID or it does not identify a package referenced by the configuration of the current session.

- If no article package ID has been specified and the Online Configurator was unable to find an OFML package matching the specified manufacturer and series (if specified) IDs.

- No base article number has been specified.

- The product data does not contain an article with the same manufacturer ID (if specified), series ID (if specified), and base article number.

- An invalid variant code has been specified, i.e. the variant code does not match the variant code scheme of the article.

- There was some error evaluating the relation knowledge of the article.

- There was some error accessing the product data.
