# Class StatusItem

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.system.StatusItem](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md)

A StatusItem holds all the status information. Multi StatusItems are bundled
together into a Status.

## Property Summary

| Property                                                                                                            | Description                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [code](#code): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)                   | The status code is the unique identifier for the message and can be used by  client programs to check for a specific status and to generate a localized  message. |
| [details](#details): [Map](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Map.md) `(read-only)`      | Returns the optional details for this StatusItem.                                                                                                                 |
| [error](#error): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)` | Returns whether this Status Item represents and error.                                                                                                            |
| [message](#message): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)             | Returns the default human readable message for this Status.                                                                                                       |
| [parameters](#parameters): [List](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.List.md)            | Returns the parameters to construct a custom message.                                                                                                             |
| [status](#status): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)               | Returns the status.                                                                                                                                               |

## Constructor Summary

| Constructor                                                                                                                                                                                                                                                                                                                                                                                             | Description                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [StatusItem](#statusitem)()                                                                                                                                                                                                                                                                                                                                                                             | Constructs a new OK StatusItem.                             |
| [StatusItem](#statusitemnumber)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))                                                                                                                                                                                                                                                                                     | Constructs a new StatusItem with the given status.          |
| [StatusItem](#statusitemnumber-string)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                          | Constructs a new StatusItem with the given status and code. |
| [StatusItem](#statusitemnumber-string-string-object)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)) | Constructs a new StatusItem with the given values.          |

## Method Summary

| Method                                                                                                                                                                                                                                                                                    | Description                                                                                                                                                       |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [addDetail](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#adddetailstring-object)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)) | Add an additional detail to this StatusItem.                                                                                                                      |
| [getCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#getcode)()                                                                                                                                                                                        | The status code is the unique identifier for the message and can be used by  client programs to check for a specific status and to generate a localized  message. |
| [getDetails](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#getdetails)()                                                                                                                                                                                  | Returns the optional details for this StatusItem.                                                                                                                 |
| [getMessage](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#getmessage)()                                                                                                                                                                                  | Returns the default human readable message for this Status.                                                                                                       |
| [getParameters](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#getparameters)()                                                                                                                                                                            | Returns the parameters to construct a custom message.                                                                                                             |
| [getStatus](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#getstatus)()                                                                                                                                                                                    | Returns the status.                                                                                                                                               |
| [isError](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#iserror)()                                                                                                                                                                                        | Returns whether this Status Item represents and error.                                                                                                            |
| [setCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#setcodestring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                | Method to set the status code.                                                                                                                                    |
| [setMessage](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#setmessagestring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                          | Sets the default human readable message for this Status.                                                                                                          |
| [setParameters](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#setparametersobject)([Object\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                | Sets the parameters for a custom message.                                                                                                                         |
| [setStatus](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.StatusItem.md#setstatusnumber)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))                                                                                            | Set the status.                                                                                                                                                   |

### 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

### code

- code: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : The status code is the unique identifier for the message and can be used by
    client programs to check for a specific status and to generate a localized
    message.

***

### details

- details: [Map](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Map.md) `(read-only)`
  - : Returns the optional details for this StatusItem.

***

### error

- error: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`
  - : Returns whether this Status Item represents and error.

***

### message

- message: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the default human readable message for this Status.

    Note: Custom code and client programs must not use this message to identify
    a specific status. The getCode() must be used for that purpose. The actual
    message can change from release to release.

***

### parameters

- parameters: [List](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.List.md)
  - : Returns the parameters to construct a custom message.

***

### status

- status: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Returns the status.

***

## Constructor Details

### StatusItem()

- StatusItem()
  - : Constructs a new OK StatusItem.

***

### StatusItem(Number)

- StatusItem(status: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))
  - : Constructs a new StatusItem with the given status.

    **Parameters:**

    - status - either [Status.OK](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#ok) or  [Status.ERROR](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#error).

***

### StatusItem(Number, String)

- StatusItem(status: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), code: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))
  - : Constructs a new StatusItem with the given status and code.

    **Parameters:**

    - status - either [Status.OK](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#ok) or  [Status.ERROR](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#error).
    - code - a string representing a more detailed status code, e.g. "IMPEX-120".

***

### StatusItem(Number, String, String, Object...)

- StatusItem(status: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), code: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), message: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), parameters: [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))
  - : Constructs a new StatusItem with the given values.

    **Parameters:**

    - status - [Status.OK](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#ok) or  [Status.ERROR](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#error).
    - code - a string representing a more detailed status code, e.g. "IMPEX-120".
    - message - a default human readable message
    - parameters - a list of parameters to construct a custom message

***

## Method Details

### addDetail(String, Object)

- addDetail(key: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), value: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): void
  - : Add an additional detail to this StatusItem.

    **Parameters:**

    - key - the key for the detail.
    - value - the detail value.

***

### getCode()

- getCode(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : The status code is the unique identifier for the message and can be used by
    client programs to check for a specific status and to generate a localized
    message.

    **Returns:**

    - the status code.

***

### getDetails()

- getDetails(): [Map](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Map.md)
  - : Returns the optional details for this StatusItem.

    **Returns:**

    - the optional details for this StatusItem.

***

### getMessage()

- getMessage(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the default human readable message for this Status.

    Note: Custom code and client programs must not use this message to identify
    a specific status. The getCode() must be used for that purpose. The actual
    message can change from release to release.

    **Returns:**

    - the default human readable message for this Status.

***

### getParameters()

- getParameters(): [List](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.List.md)
  - : Returns the parameters to construct a custom message.

    **Returns:**

    - the parameters to construct a custom message.

***

### getStatus()

- getStatus(): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Returns the status.

    **Returns:**

    - either [Status.OK](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#ok) or
      [Status.ERROR](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#error).

***

### isError()

- isError(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns whether this Status Item represents and error.

    **Returns:**

    - true is this item represents an error, false otherwise.

***

### setCode(String)

- setCode(code: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Method to set the status code.
    The status code is the unique identifier for the message and can be used by
    client programs to check for a specific status and to generate a localized
    message.

    **Parameters:**

    - code - the status code.

***

### setMessage(String)

- setMessage(message: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the default human readable message for this Status.

    **Parameters:**

    - message - the default human readable message for this Status.

***

### setParameters(Object\[])

- setParameters(parameters: [Object\[\]](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): void
  - : Sets the parameters for a custom message.

    **Parameters:**

    - parameters - the parameters for a custom message.

***

### setStatus(Number)

- setStatus(status: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): void
  - : Set the status.

    **Parameters:**

    - status - either  [Status.OK](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#ok) or  [Status.ERROR](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Status.md#error).

***
