# Class ReturnItem

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.object.Extensible](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.Extensible.md)
    - [dw.order.AbstractItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md)
      - [dw.order.ReturnItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md)

An item of a [Return](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md), created using [Return.createItem(String)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md#createitemstring).
Represents a physically returned order line item. Please refer to the documentation of [ReturnHooks](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.hooks.ReturnHooks.md)
for further information.

When the related Return were set to status COMPLETED, only the the custom attributes of the return item can be changed.

Order post-processing APIs (gillian) are now inactive by default and will throw
an exception if accessed. Activation needs preliminary approval by Product Management.
Please contact support in this case. Existing customers using these APIs are not
affected by this change and can use the APIs until further notice.

## Property Summary

| Property                                                                                                                                            | Description                                                                                                                                      |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| [basePrice](#baseprice): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`                             | Price of a single unit before discount application.                                                                                              |
| [note](#note): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)                                                   | Return the note for this return item.                                                                                                            |
| [parentItem](#parentitem): [ReturnItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md)                               | Returns null or the parent item.                                                                                                                 |
| [reasonCode](#reasoncode): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)                                 | Returns the reason code for return item.                                                                                                         |
| [returnCaseItem](#returncaseitem): [ReturnCaseItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnCaseItem.md) `(read-only)` | Returns the return case item related to this item.                                                                                               |
| [returnNumber](#returnnumber): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                     | The mandatory returnNumber of the [Return](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md) to which this item belongs. |
| [returnedQuantity](#returnedquantity): [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md)                       | The [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md) returned.                                             |

## Constructor Summary

This class does not have a constructor, so you cannot create it directly.

## Method Summary

| Method                                                                                                                                                                                                                                                                                                                                                                                               | Description                                                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [addTaxItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#addtaxitemdecimal-taxgroup)([Decimal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Decimal.md), [TaxGroup](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxGroup.md))                                                                                                   | Create a new [tax-item](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxItem.md) and add to this item.                              |
| [applyPriceRate](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#applypriceratedecimal-decimal-boolean)([Decimal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Decimal.md), [Decimal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Decimal.md), [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)) | Apply a rate of (factor / divisor) to the prices in this item, with the option to half round up or half round down to the  nearest cent if necessary. |
| [getBasePrice](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#getbaseprice)()                                                                                                                                                                                                                                                                                          | Price of a single unit before discount application.                                                                                                   |
| [getNote](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#getnote)()                                                                                                                                                                                                                                                                                                    | Return the note for this return item.                                                                                                                 |
| [getParentItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#getparentitem)()                                                                                                                                                                                                                                                                                        | Returns null or the parent item.                                                                                                                      |
| [getReasonCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#getreasoncode)()                                                                                                                                                                                                                                                                                        | Returns the reason code for return item.                                                                                                              |
| [getReturnCaseItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#getreturncaseitem)()                                                                                                                                                                                                                                                                                | Returns the return case item related to this item.                                                                                                    |
| [getReturnNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#getreturnnumber)()                                                                                                                                                                                                                                                                                    | The mandatory returnNumber of the [Return](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md) to which this item belongs.      |
| [getReturnedQuantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#getreturnedquantity)()                                                                                                                                                                                                                                                                            | The [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md) returned.                                                  |
| [setNote](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#setnotestring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                                            | Sets a note for this return item.                                                                                                                     |
| [setParentItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#setparentitemreturnitem)([ReturnItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md))                                                                                                                                                                                    | Set a parent item.                                                                                                                                    |
| [setReasonCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#setreasoncodestring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                                | Set the reason code.                                                                                                                                  |
| [setReturnedQuantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#setreturnedquantityquantity)([Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md))                                                                                                                                                                              | Set the [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md) returned.                                              |
| [setTaxBasis](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#settaxbasismoney)([Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md))                                                                                                                                                                                                       | Set the tax-basis price for this item.                                                                                                                |
| [setTaxItems](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#settaxitemscollection)([Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md))                                                                                                                                                                                         | Set the tax-items for this item.                                                                                                                      |

### Methods inherited from class AbstractItem

[getGrossPrice](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getgrossprice), [getItemID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getitemid), [getLineItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getlineitem), [getNetPrice](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getnetprice), [getOrderItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getorderitem), [getOrderItemID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getorderitemid), [getTax](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#gettax), [getTaxBasis](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#gettaxbasis), [getTaxItems](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#gettaxitems)

### Methods inherited from class Extensible

[describe](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.Extensible.md#describe), [getCustom](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.Extensible.md#getcustom)

### Methods inherited from class Object

[assign](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#assignobject-object), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject-object), [defineProperties](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertiesobject-object), [defineProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertyobject-object-object), [entries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#entriesobject), [freeze](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#freezeobject), [fromEntries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#hasownpropertystring), [is](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isobject-object), [isExtensible](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isextensibleobject), [isFrozen](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isfrozenobject), [isPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isprototypeofobject), [isSealed](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#issealedobject), [keys](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#keysobject), [preventExtensions](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#propertyisenumerablestring), [seal](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#sealobject), [setPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tolocalestring), [toString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tostring), [valueOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valueof), [values](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valuesobject)

## Property Details

### basePrice

- basePrice: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`
  - : Price of a single unit before discount application.

***

### note

- note: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Return the note for this return item.

***

### parentItem

- parentItem: [ReturnItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md)
  - : Returns null or the parent item.

***

### reasonCode

- reasonCode: [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)
  - : Returns the reason code for return item. The list of reason codes can be updated
    by updating meta-data for ReturnItem.

***

### returnCaseItem

- returnCaseItem: [ReturnCaseItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnCaseItem.md) `(read-only)`
  - : Returns the return case item related to this item. Should never return null.

***

### returnNumber

- returnNumber: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : The mandatory returnNumber of the [Return](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md) to which this item belongs.

***

### returnedQuantity

- returnedQuantity: [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md)
  - : The [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md) returned. This may return an N/A quantity.

***

## Method Details

### addTaxItem(Decimal, TaxGroup)

- addTaxItem(amount: [Decimal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Decimal.md), taxGroup: [TaxGroup](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxGroup.md)): [TaxItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxItem.md)
  - : Create a new [tax-item](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxItem.md) and add to this item.

    **Parameters:**

    - amount - amount to assign to the tax-item
    - taxGroup - the [TaxGroup](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxGroup.md) to which the item belongs

    **Returns:**

    - the new tax-item

***

### applyPriceRate(Decimal, Decimal, Boolean)

- applyPriceRate(factor: [Decimal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Decimal.md), divisor: [Decimal](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Decimal.md), roundUp: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)): void
  - : Apply a rate of (factor / divisor) to the prices in this item, with the option to half round up or half round down to the
    nearest cent if necessary.

    *Examples*:

    | TaxBasis before | factor | divisor | roundup | Calculation     | TaxBasis after |
    | --------------- | ------ | ------- | ------- | --------------- | -------------- |
    | $10.00          | 1      | 2       | true    | 10*1/2=         | $5.00          |
    | $10.00          | 9      | 10      | true    | 10*9/10=        | $9.00          |
    | $10.00          | 1      | 3       | true    | 10*1/3=3.3333=  | $3.33          |
    | $2.47           | 1      | 2       | true    | 2.47*1/2=1.235= | $1.24          |
    | $2.47           | 1      | 2       | false   | 2.47*1/2=1.235= | $1.23          |

    *Which prices are updated?*:

    The rate described above is applied to tax-basis and tax then the net-price and gross-price are recalculated by adding / subtracting
    depending on whether the order is based on net price.

    *Example (order based on net price)*

    New TaxBasis:$10.00, Tax:$1.00, NetPrice=TaxBasis=$10.00, GrossPrice=TaxBasis+Tax=$11.00

    *Example (order based on gross price)*

    New TaxBasis:$10.00, Tax:$1.00, NetPrice=TaxBasis-tax=$9.00, GrossPrice=TaxBasis=$10.00

    **Parameters:**

    - factor - factor used to calculate rate
    - divisor - divisor used to calculate rate
    - roundUp - whether to round up or down on 0.5

    **See Also:**

    - [AbstractItem.getTaxBasis()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#gettaxbasis)
    - [AbstractItem.getTax()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#gettax)
    - [AbstractItem.getNetPrice()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getnetprice)
    - [AbstractItem.getGrossPrice()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.AbstractItem.md#getgrossprice)
    - [TaxMgr.getTaxationPolicy()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxMgr.md#gettaxationpolicy)

***

### getBasePrice()

- getBasePrice(): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)
  - : Price of a single unit before discount application.

    **Returns:**

    - Price of a single unit before discount application.

***

### getNote()

- getNote(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Return the note for this return item.

    **Returns:**

    - the note or `null`

***

### getParentItem()

- getParentItem(): [ReturnItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md)
  - : Returns null or the parent item.

    **Returns:**

    - null or the parent item.

***

### getReasonCode()

- getReasonCode(): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)
  - : Returns the reason code for return item. The list of reason codes can be updated
    by updating meta-data for ReturnItem.

    **Returns:**

    - the return reason code

***

### getReturnCaseItem()

- getReturnCaseItem(): [ReturnCaseItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnCaseItem.md)
  - : Returns the return case item related to this item. Should never return null.

    **Returns:**

    - the return case item related to this item

***

### getReturnNumber()

- getReturnNumber(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : The mandatory returnNumber of the [Return](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md) to which this item belongs.

    **Returns:**

    - the returnNumber of the Return to which this item belongs

***

### getReturnedQuantity()

- getReturnedQuantity(): [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md)
  - : The [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md) returned. This may return an N/A quantity.

    **Returns:**

    - the quantity returned, may be N/A

***

### setNote(String)

- setNote(note: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets a note for this return item.

    **Parameters:**

    - note - the note for this return item to set

***

### setParentItem(ReturnItem)

- setParentItem(parentItem: [ReturnItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md)): void
  - : Set a parent item. The parent item must belong to the same
    [Return](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.Return.md). An infinite parent-child loop is disallowed
    as is a parent-child depth greater than 10. Setting a parent item
    indicates a dependency of the child item on the parent item, and can be
    used to form a parallel structure to that accessed using
    [ProductLineItem.getParent()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ProductLineItem.md#getparent).

    **Parameters:**

    - parentItem - The parent item, null is allowed

***

### setReasonCode(String)

- setReasonCode(reasonCode: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Set the reason code. The list of reason codes can be updated by updating meta-data for ReturnItem.

    **Parameters:**

    - reasonCode - the reason code to set

***

### setReturnedQuantity(Quantity)

- setReturnedQuantity(quantity: [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md)): void
  - : Set the [Quantity](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Quantity.md) returned. Passing null results in an exception being thrown.
    The quantity must be higher than zero and not be higher than the remaining quantity to return.

    The item prices are recalculated in this method as described in [applyPriceRate(Decimal, Decimal, Boolean)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#applypriceratedecimal-decimal-boolean)
    with the `quantity` argument as the factor, and ordered quantity as divisor
    and `true` as the roundup parameter.

    **Parameters:**

    - quantity - the quantity returned, null not allowed

    **See Also:**

    - [OrderItem.getReturnedQuantity()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderItem.md#getreturnedquantity)
    - [ProductLineItem.getQuantity()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ProductLineItem.md#getquantity)

***

### setTaxBasis(Money)

- setTaxBasis(taxBasis: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)): void
  - : Set the tax-basis price for this item.

    **Parameters:**

    - taxBasis - the tax basis value.

***

### setTaxItems(Collection)

- setTaxItems(taxItems: [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md)): void
  - : Set the tax-items for this item.

    **Parameters:**

    - taxItems - items

    **See Also:**

    - [addTaxItem(Decimal, TaxGroup)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ReturnItem.md#addtaxitemdecimal-taxgroup)
    - [TaxGroup.create(String, String, String, Decimal)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.TaxGroup.md#createstring-string-string-decimal)

***
