# Class ShippingMethod

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.object.PersistentObject](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md)
    - [dw.object.ExtensibleObject](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.ExtensibleObject.md)
      - [dw.order.ShippingMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md)

ShippingMethod represents how the shipment will be shipped.

## Property Summary

| Property                                                                                                                                       | Description                                                                                                          |
| ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [ID](#id): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                                    | Returns the ID of the shipping method.                                                                               |
| [baseMethod](#basemethod): [ShippingMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md) `(read-only)`    | Returns the base shipping method or null if undefined.                                                               |
| [currencyCode](#currencycode): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                | Returns the currency code associated with the shipping method                                                        |
| [customerGroups](#customergroups): [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md) `(read-only)`     | Returns the customer groups assigned to the shipping method.                                                         |
| [defaultMethod](#defaultmethod): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`            | Returns 'true' if the shipping method is marked as 'default' for the current session's currency.                     |
| [dependentMethods](#dependentmethods): [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md) `(read-only)` | Returns the dependent shipping methods of this shipping method,  regardless of the online status of the methods.     |
| [description](#description): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                  | Returns the description of the shipping method as specified in the current locale or  null if it could not be found. |
| [displayName](#displayname): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                  | Returns the display name of the shipping method in the current locale or  null if it could not be found.             |
| [online](#online): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`                          | Returns true if shipping method is online, false otherwise                                                           |
| [taxClassID](#taxclassid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                    | Returns the tax class id of the shipping method.                                                                     |

## Constructor Summary

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

## Method Summary

| Method                                                                                                                        | Description                                                                                                          |
| ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [getBaseMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#getbasemethod)()             | Returns the base shipping method or null if undefined.                                                               |
| [getCurrencyCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#getcurrencycode)()         | Returns the currency code associated with the shipping method                                                        |
| [getCustomerGroups](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#getcustomergroups)()     | Returns the customer groups assigned to the shipping method.                                                         |
| [getDependentMethods](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#getdependentmethods)() | Returns the dependent shipping methods of this shipping method,  regardless of the online status of the methods.     |
| [getDescription](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#getdescription)()           | Returns the description of the shipping method as specified in the current locale or  null if it could not be found. |
| [getDisplayName](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#getdisplayname)()           | Returns the display name of the shipping method in the current locale or  null if it could not be found.             |
| [getID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#getid)()                             | Returns the ID of the shipping method.                                                                               |
| [getTaxClassID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#gettaxclassid)()             | Returns the tax class id of the shipping method.                                                                     |
| [isDefaultMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#isdefaultmethod)()         | Returns 'true' if the shipping method is marked as 'default' for the current session's currency.                     |
| [isOnline](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md#isonline)()                       | Returns true if shipping method is online, false otherwise                                                           |

### Methods inherited from class ExtensibleObject

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

### Methods inherited from class PersistentObject

[getCreationDate](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md#getcreationdate), [getLastModified](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md#getlastmodified), [getUUID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md#getuuid)

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

### ID

- ID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the ID of the shipping method.

***

### baseMethod

- baseMethod: [ShippingMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md) `(read-only)`
  - : Returns the base shipping method or null if undefined.

***

### currencyCode

- currencyCode: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the currency code associated with the shipping method

***

### customerGroups

- customerGroups: [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md) `(read-only)`
  - : Returns the customer groups assigned to the shipping method.
    Assigned ids that do not belong to an existing customer group are ignored.

***

### defaultMethod

- defaultMethod: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`
  - : Returns 'true' if the shipping method is marked as 'default' for the current session's currency.
    Otherwise 'false' is returned.

***

### dependentMethods

- dependentMethods: [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md) `(read-only)`
  - : Returns the dependent shipping methods of this shipping method,
    regardless of the online status of the methods.

    Dependent shipping methods have this method as their base method.

***

### description

- description: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the description of the shipping method as specified in the current locale or
    null if it could not be found.

***

### displayName

- displayName: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the display name of the shipping method in the current locale or
    null if it could not be found.

***

### online

- online: [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md) `(read-only)`
  - : Returns true if shipping method is online, false otherwise

***

### taxClassID

- taxClassID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the tax class id of the shipping method.

***

## Method Details

### getBaseMethod()

- getBaseMethod(): [ShippingMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.ShippingMethod.md)
  - : Returns the base shipping method or null if undefined.

    **Returns:**

    - Base shipping method

***

### getCurrencyCode()

- getCurrencyCode(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the currency code associated with the shipping method

    **Returns:**

    - currency code

***

### getCustomerGroups()

- getCustomerGroups(): [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md)
  - : Returns the customer groups assigned to the shipping method.
    Assigned ids that do not belong to an existing customer group are ignored.

    **Returns:**

    - customer groups

***

### getDependentMethods()

- getDependentMethods(): [Collection](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.Collection.md)
  - : Returns the dependent shipping methods of this shipping method,
    regardless of the online status of the methods.

    Dependent shipping methods have this method as their base method.

    **Returns:**

    - Dependent shipping methods

***

### getDescription()

- getDescription(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the description of the shipping method as specified in the current locale or
    null if it could not be found.

    **Returns:**

    - he description of the shipping method as specified in the current locale or
      null if it could not be found.

***

### getDisplayName()

- getDisplayName(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the display name of the shipping method in the current locale or
    null if it could not be found.

    **Returns:**

    - the display name of the shipping method or null if it could not be found.

***

### getID()

- getID(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the ID of the shipping method.

    **Returns:**

    - the ID of the shipping method.

***

### getTaxClassID()

- getTaxClassID(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the tax class id of the shipping method.

    **Returns:**

    - the tax class id of the shipping method.

***

### isDefaultMethod()

- isDefaultMethod(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns 'true' if the shipping method is marked as 'default' for the current session's currency.
    Otherwise 'false' is returned.

    **Returns:**

    - 'true' if it is the default shipping method of the site

***

### isOnline()

- isOnline(): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns true if shipping method is online, false otherwise

***
