Class ShippingLineItem

Represents a specific line item in a shipment. The ShippingLineItem defines the general shipping costs of a shipment.

Constant Summary 

ConstantDescription
STANDARD_SHIPPING_ID: String = “STANDARD_SHIPPING”Constant used to get the standard shipping line item.

Property Summary 

PropertyDescription
ID: String (read-only)Returns the ID of this ShippingLineItem.
adjustedGrossPrice: Money (read-only)Returns the price of this shipping line item including tax after shipping adjustments have been applied.
adjustedNetPrice: Money (read-only)Returns the price of this shipping line item, excluding tax after shipping adjustments have been applied.
adjustedPrice: Money (read-only)Returns the adjusted price of this shipping line item.
adjustedTax: Money (read-only)Returns the tax of this shipping line item after shipping adjustments have been applied.
orderItem: OrderItem (read-only)Returns the order-item extension for this item, or null.
shippingPriceAdjustments: Collection (read-only)Returns the collection of shipping price adjustments that have been applied to this shipping line item.

Constructor Summary 

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

Method Summary 

MethodDescription
createShippingPriceAdjustment(String)Creates a shipping price adjustment to be applied to the shipping line item.
The promotion ID is mandatory and must not be the ID of any actual promotion defined in B2C Commerce.
If there already exists a shipping price adjustment on this shipping line item referring to the specified promotion ID, an exception is thrown.
createShippingPriceAdjustment(String, Discount)Creates a shipping price adjustment to be applied to the shipping line item.
The promotion ID is mandatory and must not be the ID of any actual promotion defined in B2C Commerce.
getAdjustedGrossPrice()Returns the price of this shipping line item including tax after shipping adjustments have been applied.
getAdjustedNetPrice()Returns the price of this shipping line item, excluding tax after shipping adjustments have been applied.
getAdjustedPrice()Returns the adjusted price of this shipping line item.
getAdjustedTax()Returns the tax of this shipping line item after shipping adjustments have been applied.
getID()Returns the ID of this ShippingLineItem.
getOrderItem()Returns the order-item extension for this item, or null.
getShippingPriceAdjustments()Returns the collection of shipping price adjustments that have been applied to this shipping line item.
removeShippingPriceAdjustment(PriceAdjustment)Removes the specified shipping price adjustment from this shipping line item.

Methods inherited from class LineItem 

getBasePrice, getGrossPrice, getLineItemCtnr, getLineItemText, getNetPrice, getPrice, getPriceValue, getTax, getTaxBasis, getTaxClassID, getTaxRate, setBasePrice, setGrossPrice, setLineItemText, setNetPrice, setPriceValue, setTax, setTaxClassID, setTaxRate, updatePrice, updateTax, updateTax, updateTaxAmount

Methods inherited from class ExtensibleObject 

describe, getCustom

Methods inherited from class PersistentObject 

getCreationDate, getLastModified, getUUID

Methods inherited from class Object 

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

Constant Details 

STANDARD_SHIPPING_ID 

STANDARD_SHIPPING_ID: String = "STANDARD_SHIPPING"

Constant used to get the standard shipping line item.


Property Details 

ID 

ID: String (read-only)

Returns the ID of this ShippingLineItem.


adjustedGrossPrice 

adjustedGrossPrice: Money (read-only)

Returns the price of this shipping line item including tax after shipping adjustments have been applied.


adjustedNetPrice 

adjustedNetPrice: Money (read-only)

Returns the price of this shipping line item, excluding tax after shipping adjustments have been applied.


adjustedPrice 

adjustedPrice: Money (read-only)

Returns the adjusted price of this shipping line item. If the line item container is based on net pricing, the adjusted net price is returned. If the line item container is based on gross pricing, the adjusted gross price is returned.


adjustedTax 

adjustedTax: Money (read-only)

Returns the tax of this shipping line item after shipping adjustments have been applied.


orderItem 

orderItem: OrderItem (read-only)

Returns the order-item extension for this item, or null. An order-item extension will only exist for a ShippingLineItem which belongs to an Order.

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.


shippingPriceAdjustments 

shippingPriceAdjustments: Collection (read-only)

Returns the collection of shipping price adjustments that have been applied to this shipping line item.


Method Details 

createShippingPriceAdjustment(String) 

createShippingPriceAdjustment(promotionID: String): PriceAdjustment

Creates a shipping price adjustment to be applied to the shipping line item.

The promotion ID is mandatory and must not be the ID of any actual promotion defined in B2C Commerce.

If there already exists a shipping price adjustment on this shipping line item referring to the specified promotion ID, an exception is thrown.

Parameters:

  • promotionID - Promotion ID

Returns:

  • The new price adjustment line item.

createShippingPriceAdjustment(String, Discount) 

createShippingPriceAdjustment(promotionID: String, discount: Discount): PriceAdjustment

Creates a shipping price adjustment to be applied to the shipping line item.

The promotion ID is mandatory and must not be the ID of any actual promotion defined in B2C Commerce. If a shipping price adjustment on this shipping line item referring to the specified promotion ID already exists, an exception is thrown.

The possible values for discount are PercentageDiscount, AmountDiscount, FixedPriceShippingDiscount.

Examples:

` var myShippingItem : dw.order.ShippingLineItem; // assume known

var paFixedShippingPrice12 : dw.order.PriceAdjustment = myShippingItem.createPriceAdjustment("myPromotionID1", new FixedPriceShippingDiscount(12));

var paTenPercent : dw.order.PriceAdjustment = myShippingItem.createPriceAdjustment("myPromotionID2", new PercentageDiscount(10));

var paReduceBy2 : dw.order.PriceAdjustment = myShippingItem.createPriceAdjustment("myPromotionID3", new AmountDiscount(2));

`

Parameters:

  • promotionID - Promotion ID
  • discount - The desired discount, not null

Returns:

  • The new price adjustment line item.

getAdjustedGrossPrice() 

getAdjustedGrossPrice(): Money

Returns the price of this shipping line item including tax after shipping adjustments have been applied.

Returns:

  • the price of this shipping line item, including tax after shipping adjustments have been applied.

getAdjustedNetPrice() 

getAdjustedNetPrice(): Money

Returns the price of this shipping line item, excluding tax after shipping adjustments have been applied.

Returns:

  • the price of this shipping line item, excluding tax after shipping adjustments have been applied.

getAdjustedPrice() 

getAdjustedPrice(): Money

Returns the adjusted price of this shipping line item. If the line item container is based on net pricing, the adjusted net price is returned. If the line item container is based on gross pricing, the adjusted gross price is returned.

Returns:

  • either the adjusted net or gross price of this shipping line item.

getAdjustedTax() 

getAdjustedTax(): Money

Returns the tax of this shipping line item after shipping adjustments have been applied.

Returns:

  • the tax of this shipping line item after shipping adjustments have been applied.

getID() 

getID(): String

Returns the ID of this ShippingLineItem.

Returns:

  • ID of this ShippingLineItem

getOrderItem() 

getOrderItem(): OrderItem

Returns the order-item extension for this item, or null. An order-item extension will only exist for a ShippingLineItem which belongs to an Order.

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.

Returns:

  • null or the order-item

getShippingPriceAdjustments() 

getShippingPriceAdjustments(): Collection

Returns the collection of shipping price adjustments that have been applied to this shipping line item.

Returns:

  • the collection of shipping price adjustments that have been applied to this shipping line item.

removeShippingPriceAdjustment(PriceAdjustment) 

removeShippingPriceAdjustment(priceAdjustment: PriceAdjustment): void

Removes the specified shipping price adjustment from this shipping line item.

Parameters:

  • priceAdjustment - The price adjustment line item to remove