Class LineItemCtnr

A container for line items, such as ProductLineItems, CouponLineItems, GiftCertificateLineItems. This container also provides access to shipments, shipping adjustments (promotions), and payment instruments (credit cards).

LineItemCtnr also contains a set of methods for creating line items and adjustments, and for accessing various price values. There are three types of price-related methods:

  • _Net-based_methods represent the amount of a category before tax has been calculated. For example, the getMerchandizeTotalNetPrice() returns the price of all merchandise in the container whereas getShippingTotalNetPrice() returns the price of all shipments in the container.
  • _Tax-based_methods return the amount of tax on a category. For example, the getMerchandizeTotalTax() returns the total tax for all merchandise and the getShippingTotalTax() returns the tax applied to all shipments.
  • _Gross-based_methods represent the amount of a category after tax has been calculated. For example, the getMerchandizeTotalGrossPrice() returns the price of all merchandise in the container, including tax on the merchandise, whereas getShippingTotalGrossPrice() returns the price of all shipments in the container, including tax on the shipments in the container.

There are also a set of methods that provide access to 'adjusted' values. The adjusted-based methods return values where promotions have been applied. For example, the getAdjustedMerchandizeTotalNetPrice() method returns the net price of all merchandise after product-level and order-level promotions have been applied. Whereas the getAdjustedMerchandizeTotalGrossPrice() method returns the price of all merchandise after product-level and order-level promotions have been applied and includes the amount of merchandise-related tax.

Finally, there are a set of methods that return the aggregate values representing the line items in the container. These are the total-based methods getTotalNetPrice(), getTotalTax() and getTotalGrossPrice(). These methods return the totals of all items in the container and include any order-level promotions.

Note that all merchandise-related methods do not include 'gift certificates' values in the values they return. Gift certificates are not considered merchandise as they do not represent a product.

Basket, Order

ConstantDescription
BUSINESS_TYPE_B2B: Number = 2constant for Business Type B2B
BUSINESS_TYPE_B2C: Number = 1constant for Business Type B2C
CHANNEL_TYPE_CALLCENTER: Number = 2constant for Channel Type CallCenter
CHANNEL_TYPE_CUSTOMERSERVICECENTER: Number = 11constant for Channel Type Customer Service Center
CHANNEL_TYPE_DSS: Number = 4constant for Channel Type DSS
CHANNEL_TYPE_FACEBOOKADS: Number = 8constant for Channel Type Facebook Ads
CHANNEL_TYPE_GOOGLE: Number = 13constant for Channel Type Google
CHANNEL_TYPE_INSTAGRAMCOMMERCE: Number = 12constant for Channel Type Instagram Commerce
CHANNEL_TYPE_MARKETPLACE: Number = 3constant for Channel Type Marketplace
CHANNEL_TYPE_ONLINERESERVATION: Number = 10constant for Channel Type Online Reservation
CHANNEL_TYPE_PINTEREST: Number = 6constant for Channel Type Pinterest
CHANNEL_TYPE_SNAPCHAT: Number = 15constant for Channel Type Snapchat
CHANNEL_TYPE_STORE: Number = 5constant for Channel Type Store
CHANNEL_TYPE_STOREFRONT: Number = 1constant for Channel Type Storefront
CHANNEL_TYPE_SUBSCRIPTIONS: Number = 9constant for Channel Type Subscriptions
CHANNEL_TYPE_TIKTOK: Number = 14constant for Channel Type TikTok
CHANNEL_TYPE_TWITTER: Number = 7constant for Channel Type Twitter
CHANNEL_TYPE_WHATSAPP: Number = 16constant for Channel Type WhatsApp
CHANNEL_TYPE_YOUTUBE: Number = 17constant for Channel Type YouTube
PropertyDescription
adjustedMerchandizeTotalGrossPrice: Money (read-only)Returns the adjusted total gross price (including tax) in purchase currency.
adjustedMerchandizeTotalNetPrice: Money (read-only)Returns the total net price (excluding tax) in purchase currency.
adjustedMerchandizeTotalPrice: Money (read-only)Returns the adjusted merchandize total price including product-level and order-level adjustments.
adjustedMerchandizeTotalTax: Money (read-only)Returns the subtotal tax in purchase currency.
adjustedShippingTotalGrossPrice: Money (read-only)Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping adjustments have been applied.
adjustedShippingTotalNetPrice: Money (read-only)Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments have been applied.
adjustedShippingTotalPrice: Money (read-only)Returns the adjusted shipping total price.
adjustedShippingTotalTax: Money (read-only)Returns the tax of all shipping line items of the line item container after shipping adjustments have been applied.
allGiftCertificateLineItems: Collection (read-only)Returns all gift certificate line items of the container.
allLineItems: Collection (read-only)Returns all product, shipping, price adjustment, and gift certificate line items of the line item container.
allProductLineItems: Collection (read-only)Returns all product line items of the container, no matter if they are dependent or independent.
allProductQuantities: HashMap (read-only)Returns a hash mapping all products in the line item container to their total quantities.
allShippingPriceAdjustments: Collection (read-only)Returns the collection of all shipping price adjustments applied somewhere in the container.
billingAddress: OrderAddress (read-only)Returns the billing address defined for the container.
bonusDiscountLineItems: Collection (read-only)Returns an unsorted collection of the the bonus discount line items associated with this container.
bonusLineItems: Collection (read-only)Returns the collection of product line items that are bonus items (where ProductLineItem.isBonusProductLineItem() is true).
businessType: EnumValue (read-only)Returns the type of the business this order has been placed in.
Possible values are BUSINESS_TYPE_B2C or BUSINESS_TYPE_B2B.
channelType: EnumValue (read-only)The channel type defines in which sales channel this order has been created.
couponLineItems: Collection (read-only)Returns a sorted collection of the coupon line items in the container.
currencyCode: String (read-only)Returns the currency code for this line item container.
customer: Customer (read-only)Returns the customer associated with this container.
customerEmail: StringReturns the email of the customer associated with this container.
customerName: StringReturns the name of the customer associated with this container.
customerNo: String (read-only)Returns the customer number of the customer associated with this container.
defaultShipment: Shipment (read-only)Returns the default shipment of the line item container.
etag: String (read-only)Returns the Etag of the line item container.
externallyTaxed: Boolean (read-only)Use this method to check whether the LineItemCtnr is calculated based on external tax tables.
giftCertificateLineItems: Collection (read-only)Returns all gift certificate line items of the container.
giftCertificatePaymentInstruments: Collection (read-only)Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this container.
giftCertificateTotalGrossPrice: Money (read-only)Returns the total gross price of all gift certificates in the cart.
giftCertificateTotalNetPrice: Money (read-only)Returns the total net price (excluding tax) of all gift certificates in the cart.
giftCertificateTotalPrice: Money (read-only)Returns the gift certificate total price.
giftCertificateTotalTax: Money (read-only)Returns the total tax of all gift certificates in the cart.
merchandizeTotalGrossPrice: Money (read-only)Returns the total gross price (including tax) in purchase currency.
merchandizeTotalNetPrice: Money (read-only)Returns the total net price (excluding tax) in purchase currency.
merchandizeTotalPrice: Money (read-only)Returns the merchandize total price.
merchandizeTotalTax: Money (read-only)Returns the total tax in purchase currency.
notes: List (read-only)Returns the list of notes for this object, ordered by creation time from oldest to newest.
paymentInstrument: OrderPaymentInstrument (read-only)Returns the payment instrument of the line item container or null.
paymentInstruments: Collection (read-only)Returns an unsorted collection of the payment instruments in this container.
priceAdjustments: Collection (read-only)Returns the collection of price adjustments that have been applied to the totals such as promotion on the purchase value (i.e.
productLineItems: Collection (read-only)Returns the product line items of the container that are not dependent on other product line items.
productQuantities: HashMap (read-only)Returns a hash map of all products in the line item container and their total quantities.
productQuantityTotal: Number (read-only)Returns the total quantity of all product line items.
shipments: Collection (read-only)Returns all shipments of the line item container.
The first shipment in the returned collection is the default shipment (shipment ID always set to "me").
shippingPriceAdjustments: Collection (read-only)Returns the of shipping price adjustments applied to the shipping total of the container.
shippingTotalGrossPrice: Money (read-only)Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments have been applied.
shippingTotalNetPrice: Money (read-only)Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments have been applied.
shippingTotalPrice: Money (read-only)Returns the shipping total price.
shippingTotalTax: Money (read-only)Returns the tax of all shipping line items of the line item container before shipping adjustments have been applied.
taxRoundedAtGroup: Boolean (read-only)Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation.
taxTotalsPerTaxRate: SortedMap (read-only)This method returns a SortedMap in which the keys are Decimal tax rates and the values are Money total tax for the tax rate.
totalGrossPrice: Money (read-only)Returns the grand total price gross of tax for LineItemCtnr, in purchase currency.
totalNetPrice: Money (read-only)Returns the grand total price for LineItemCtnr net of tax, in purchase currency.
totalTax: Money (read-only)Returns the grand total tax for LineItemCtnr, in purchase currency.

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

MethodDescription
addNote(String, String)Adds a note to the object.
createBillingAddress()Create a billing address for the LineItemCtnr.
createBonusProductLineItem(BonusDiscountLineItem, Product, ProductOptionModel, Shipment)Creates a product line item in the container based on the passed Product and BonusDiscountLineItem.
createCouponLineItem(String)Creates a coupon line item that is not based on the B2C Commerce campaign system and associates it with the specified coupon code.
createCouponLineItem(String, Boolean)Creates a new CouponLineItem for this container based on the supplied coupon code.
createGiftCertificateLineItem(Number, String)Creates a gift certificate line item.
createGiftCertificatePaymentInstrument(String, Money)Creates an OrderPaymentInstrument representing a Gift Certificate.
createPaymentInstrument(String, Money)Creates a payment instrument using the specified payment method id and amount.
createPaymentInstrumentFromWallet(CustomerPaymentInstrument, Money)Creates a payment instrument using the specified wallet payment instrument and amount.
createPriceAdjustment(String)Creates an order price adjustment.
The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise an exception is thrown.
createPriceAdjustment(String, Discount)Creates an order level price adjustment for a specific discount.
The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise an exception is thrown.
createProductLineItem(Product, ProductOptionModel, Shipment)Creates a new product line item in the container and assigns it to the specified shipment.
createProductLineItem(ProductListItem, Shipment)Creates a new product line item in the basket and assigns it to the specified shipment.
createProductLineItem(String, Shipment)Creates a new product line item in the container and assigns it to the specified shipment.
createProductLineItem(String, Quantity, Shipment)Creates a new product line item in the container and assigns it to the specified shipment.
createShipment(String)Creates a standard shipment for the line item container.
createShippingPriceAdjustment(String)Creates a shipping price adjustment to be applied to the container.
getAdjustedMerchandizeTotalGrossPrice()Returns the adjusted total gross price (including tax) in purchase currency.
getAdjustedMerchandizeTotalNetPrice()Returns the total net price (excluding tax) in purchase currency.
getAdjustedMerchandizeTotalPrice()Returns the adjusted merchandize total price including product-level and order-level adjustments.
getAdjustedMerchandizeTotalPrice(Boolean)Returns the adjusted merchandize total price including order-level adjustments if requested.
getAdjustedMerchandizeTotalTax()Returns the subtotal tax in purchase currency.
getAdjustedShippingTotalGrossPrice()Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping adjustments have been applied.
getAdjustedShippingTotalNetPrice()Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments have been applied.
getAdjustedShippingTotalPrice()Returns the adjusted shipping total price.
getAdjustedShippingTotalTax()Returns the tax of all shipping line items of the line item container after shipping adjustments have been applied.
getAllGiftCertificateLineItems()Returns all gift certificate line items of the container.
getAllLineItems()Returns all product, shipping, price adjustment, and gift certificate line items of the line item container.
getAllProductLineItems()Returns all product line items of the container, no matter if they are dependent or independent.
getAllProductLineItems(String)Returns all product line items of the container that have a product ID equal to the specified product ID, no matter if they are dependent or independent.
getAllProductQuantities()Returns a hash mapping all products in the line item container to their total quantities.
getAllShippingPriceAdjustments()Returns the collection of all shipping price adjustments applied somewhere in the container.
getBillingAddress()Returns the billing address defined for the container.
getBonusDiscountLineItems()Returns an unsorted collection of the the bonus discount line items associated with this container.
getBonusLineItems()Returns the collection of product line items that are bonus items (where ProductLineItem.isBonusProductLineItem() is true).
getBusinessType()Returns the type of the business this order has been placed in.
Possible values are BUSINESS_TYPE_B2C or BUSINESS_TYPE_B2B.
getChannelType()The channel type defines in which sales channel this order has been created.
getCouponLineItem(String)Returns the coupon line item representing the specified coupon code.
getCouponLineItems()Returns a sorted collection of the coupon line items in the container.
getCurrencyCode()Returns the currency code for this line item container.
getCustomer()Returns the customer associated with this container.
getCustomerEmail()Returns the email of the customer associated with this container.
getCustomerName()Returns the name of the customer associated with this container.
getCustomerNo()Returns the customer number of the customer associated with this container.
getDefaultShipment()Returns the default shipment of the line item container.
getEtag()Returns the Etag of the line item container.
getGiftCertificateLineItems()Returns all gift certificate line items of the container.
getGiftCertificateLineItems(String)Returns all gift certificate line items of the container, no matter if they are dependent or independent.
getGiftCertificatePaymentInstruments()Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this container.
getGiftCertificatePaymentInstruments(String)Returns an unsorted collection containing all PaymentInstruments of type PaymentInstrument.METHOD_GIFT_CERTIFICATE where the specified code is the same code on the payment instrument.
getGiftCertificateTotalGrossPrice()Returns the total gross price of all gift certificates in the cart.
getGiftCertificateTotalNetPrice()Returns the total net price (excluding tax) of all gift certificates in the cart.
getGiftCertificateTotalPrice()Returns the gift certificate total price.
getGiftCertificateTotalTax()Returns the total tax of all gift certificates in the cart.
getMerchandizeTotalGrossPrice()Returns the total gross price (including tax) in purchase currency.
getMerchandizeTotalNetPrice()Returns the total net price (excluding tax) in purchase currency.
getMerchandizeTotalPrice()Returns the merchandize total price.
getMerchandizeTotalTax()Returns the total tax in purchase currency.
getNotes()Returns the list of notes for this object, ordered by creation time from oldest to newest.
getPaymentInstrument()Returns the payment instrument of the line item container or null.
getPaymentInstruments()Returns an unsorted collection of the payment instruments in this container.
getPaymentInstruments(String)Returns an unsorted collection of PaymentInstrument instances based on the specified payment method ID.
getPriceAdjustmentByPromotionID(String)Returns the price adjustment associated to the specified promotion ID.
getPriceAdjustments()Returns the collection of price adjustments that have been applied to the totals such as promotion on the purchase value (i.e.
getProductLineItems()Returns the product line items of the container that are not dependent on other product line items.
getProductLineItems(String)Returns the product line items of the container that have a product ID equal to the specified product ID and that are not dependent on other product line items.
getProductQuantities()Returns a hash map of all products in the line item container and their total quantities.
getProductQuantities(Boolean)Returns a hash map of all products in the line item container and their total quantities.
getProductQuantityTotal()Returns the total quantity of all product line items.
getShipment(String)Returns the shipment for the specified ID or null if no shipment with this ID exists in the line item container.
getShipments()Returns all shipments of the line item container.
The first shipment in the returned collection is the default shipment (shipment ID always set to "me").
getShippingPriceAdjustmentByPromotionID(String)Returns the shipping price adjustment associated with the specified promotion ID.
getShippingPriceAdjustments()Returns the of shipping price adjustments applied to the shipping total of the container.
getShippingTotalGrossPrice()Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments have been applied.
getShippingTotalNetPrice()Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments have been applied.
getShippingTotalPrice()Returns the shipping total price.
getShippingTotalTax()Returns the tax of all shipping line items of the line item container before shipping adjustments have been applied.
getTaxTotalsPerTaxRate()This method returns a SortedMap in which the keys are Decimal tax rates and the values are Money total tax for the tax rate.
getTotalGrossPrice()Returns the grand total price gross of tax for LineItemCtnr, in purchase currency.
getTotalNetPrice()Returns the grand total price for LineItemCtnr net of tax, in purchase currency.
getTotalTax()Returns the grand total tax for LineItemCtnr, in purchase currency.
isExternallyTaxed()Use this method to check whether the LineItemCtnr is calculated based on external tax tables.
isTaxRoundedAtGroup()Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation.
removeAllPaymentInstruments()Removes the all Payment Instruments from this container and deletes the Payment Instruments.
removeBonusDiscountLineItem(BonusDiscountLineItem)Removes the specified bonus discount line item from the line item container.
removeCouponLineItem(CouponLineItem)Removes the specified coupon line item from the line item container.
removeGiftCertificateLineItem(GiftCertificateLineItem)Removes the specified gift certificate line item from the line item container.
removeNote(Note)Removes a note from this line item container and deletes it.
removePaymentInstrument(PaymentInstrument)Removes the specified Payment Instrument from this container and deletes the Payment Instrument.
removePriceAdjustment(PriceAdjustment)Removes the specified price adjustment line item from the line item container.
removeProductLineItem(ProductLineItem)Removes the specified product line item from the line item container.
removeShipment(Shipment)Removes the specified shipment and all associated product, gift certificate, shipping and price adjustment line items from the line item container.
removeShippingPriceAdjustment(PriceAdjustment)Removes the specified shipping price adjustment line item from the line item container.
setCustomerEmail(String)Sets the email address of the customer associated with this container.
setCustomerName(String)Sets the name of the customer associated with this container.
updateOrderLevelPriceAdjustmentTax()Calculates the tax for all shipping and order-level merchandise price adjustments in this LineItemCtnr.
updateTotals()Recalculates the totals of the line item container.
verifyPriceAdjustmentLimits()Verifies whether the manual price adjustments made for the line item container exceed the corresponding limits for the current user and the current site.

describe, getCustom

getCreationDate, getLastModified, getUUID

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

BUSINESS_TYPE_B2B: Number = 2

constant for Business Type B2B


BUSINESS_TYPE_B2C: Number = 1

constant for Business Type B2C


CHANNEL_TYPE_CALLCENTER: Number = 2

constant for Channel Type CallCenter


CHANNEL_TYPE_CUSTOMERSERVICECENTER: Number = 11

constant for Channel Type Customer Service Center


CHANNEL_TYPE_DSS: Number = 4

constant for Channel Type DSS


CHANNEL_TYPE_FACEBOOKADS: Number = 8

constant for Channel Type Facebook Ads


CHANNEL_TYPE_GOOGLE: Number = 13

constant for Channel Type Google


CHANNEL_TYPE_INSTAGRAMCOMMERCE: Number = 12

constant for Channel Type Instagram Commerce


CHANNEL_TYPE_MARKETPLACE: Number = 3

constant for Channel Type Marketplace


CHANNEL_TYPE_ONLINERESERVATION: Number = 10

constant for Channel Type Online Reservation


CHANNEL_TYPE_PINTEREST: Number = 6

constant for Channel Type Pinterest


CHANNEL_TYPE_SNAPCHAT: Number = 15

constant for Channel Type Snapchat


CHANNEL_TYPE_STORE: Number = 5

constant for Channel Type Store


CHANNEL_TYPE_STOREFRONT: Number = 1

constant for Channel Type Storefront


CHANNEL_TYPE_SUBSCRIPTIONS: Number = 9

constant for Channel Type Subscriptions


CHANNEL_TYPE_TIKTOK: Number = 14

constant for Channel Type TikTok


CHANNEL_TYPE_TWITTER: Number = 7

constant for Channel Type Twitter


CHANNEL_TYPE_WHATSAPP: Number = 16

constant for Channel Type WhatsApp


CHANNEL_TYPE_YOUTUBE: Number = 17

constant for Channel Type YouTube


adjustedMerchandizeTotalGrossPrice: Money (read-only)

Returns the adjusted total gross price (including tax) in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping, but after product-level and order-level adjustments.


adjustedMerchandizeTotalNetPrice: Money (read-only)

Returns the total net price (excluding tax) in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping, but after product-level and order-level adjustments.


adjustedMerchandizeTotalPrice: Money (read-only)

Returns the adjusted merchandize total price including product-level and order-level adjustments. If the line item container is based on net pricing the adjusted merchandize total net price is returned. If the line item container is based on gross pricing the adjusted merchandize total gross price is returned.


adjustedMerchandizeTotalTax: Money (read-only)

Returns the subtotal tax in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping have been added, but after adjustment from promotions have been added.


adjustedShippingTotalGrossPrice: Money (read-only)

Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping adjustments have been applied.


adjustedShippingTotalNetPrice: Money (read-only)

Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments have been applied.


adjustedShippingTotalPrice: Money (read-only)

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


adjustedShippingTotalTax: Money (read-only)

Returns the tax of all shipping line items of the line item container after shipping adjustments have been applied.


allGiftCertificateLineItems: Collection (read-only)

Returns all gift certificate line items of the container.

Deprecated:

Use getGiftCertificateLineItems() to get the collection instead.


allLineItems: Collection (read-only)

Returns all product, shipping, price adjustment, and gift certificate line items of the line item container.


allProductLineItems: Collection (read-only)

Returns all product line items of the container, no matter if they are dependent or independent. This includes option, bundled and bonus line items.


allProductQuantities: HashMap (read-only)

Returns a hash mapping all products in the line item container to their total quantities. The total product quantity is used chiefly to validate the availability of the items in the cart. This method is not appropriate to look up prices because it returns products such as bundled line items which are included in the price of their parent and therefore have no corresponding price.

The method counts all direct product line items, plus dependent product line items that are not option line items. It also excludes product line items that are not associated to any catalog product.


allShippingPriceAdjustments: Collection (read-only)

Returns the collection of all shipping price adjustments applied somewhere in the container. This can be adjustments applied to individual shipments or to the container itself. Note that the promotions engine only applies shipping price adjustments to the the default shipping line item of shipments, and never to the container.

See Also:


billingAddress: OrderAddress (read-only)

Returns the billing address defined for the container. Returns null if no billing address has been created yet.


bonusDiscountLineItems: Collection (read-only)

Returns an unsorted collection of the the bonus discount line items associated with this container.


bonusLineItems: Collection (read-only)

Returns the collection of product line items that are bonus items (where ProductLineItem.isBonusProductLineItem() is true).


businessType: EnumValue (read-only)

Returns the type of the business this order has been placed in.

Possible values are BUSINESS_TYPE_B2C or BUSINESS_TYPE_B2B.


channelType: EnumValue (read-only)

The channel type defines in which sales channel this order has been created. This can be used to distinguish order placed through Storefront, Call Center or Marketplace.

Possible values are CHANNEL_TYPE_STOREFRONT, CHANNEL_TYPE_CALLCENTER, CHANNEL_TYPE_MARKETPLACE, CHANNEL_TYPE_DSS, CHANNEL_TYPE_STORE, CHANNEL_TYPE_PINTEREST, CHANNEL_TYPE_TWITTER, CHANNEL_TYPE_FACEBOOKADS, CHANNEL_TYPE_SUBSCRIPTIONS, CHANNEL_TYPE_ONLINERESERVATION, CHANNEL_TYPE_CUSTOMERSERVICECENTER, CHANNEL_TYPE_INSTAGRAMCOMMERCE, CHANNEL_TYPE_GOOGLE, CHANNEL_TYPE_YOUTUBE, CHANNEL_TYPE_TIKTOK, CHANNEL_TYPE_SNAPCHAT, CHANNEL_TYPE_WHATSAPP


couponLineItems: Collection (read-only)

Returns a sorted collection of the coupon line items in the container. The coupon line items are returned in the order they were added to container.


currencyCode: String (read-only)

Returns the currency code for this line item container. The currency code is a 3-character currency mnemonic such as 'USD' or 'EUR'. The currency code represents the currency in which the calculation is made, and in which the buyer sees all prices in the store front.


customer: Customer (read-only)

Returns the customer associated with this container.


customerEmail: String

Returns the email of the customer associated with this container.


customerName: String

Returns the name of the customer associated with this container.


customerNo: String (read-only)

Returns the customer number of the customer associated with this container.


defaultShipment: Shipment (read-only)

Returns the default shipment of the line item container. Every basket and order has a default shipment with the id "me". If you call a process that accesses a shipment, and you don't specify the shipment, then the process uses the default shipment. You can't remove a default shipment. Calling removeShipment(Shipment) on it throws an exception.


etag: String (read-only)

Returns the Etag of the line item container. The Etag is a hash that represents the overall container state including any associated objects like line items.


externallyTaxed: Boolean (read-only)

Use this method to check whether the LineItemCtnr is calculated based on external tax tables.

Note: a basket can only be created in EXTERNAL tax mode using SCAPI.


giftCertificateLineItems: Collection (read-only)

Returns all gift certificate line items of the container.


giftCertificatePaymentInstruments: Collection (read-only)

Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this container.


giftCertificateTotalGrossPrice: Money (read-only)

Returns the total gross price of all gift certificates in the cart. Should usually be equal to total net price.


giftCertificateTotalNetPrice: Money (read-only)

Returns the total net price (excluding tax) of all gift certificates in the cart. Should usually be equal to total gross price.


giftCertificateTotalPrice: Money (read-only)

Returns the gift certificate total price. If the line item container is based on net pricing the gift certificate total net price is returned. If the line item container is based on gross pricing the gift certificate total gross price is returned.


giftCertificateTotalTax: Money (read-only)

Returns the total tax of all gift certificates in the cart. Should usually be 0.0.


merchandizeTotalGrossPrice: Money (read-only)

Returns the total gross price (including tax) in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotions have been added.


merchandizeTotalNetPrice: Money (read-only)

Returns the total net price (excluding tax) in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotion have been added.


merchandizeTotalPrice: Money (read-only)

Returns the merchandize total price. If the line item container is based on net pricing the merchandize total net price is returned. If the line item container is based on gross pricing the merchandize total gross price is returned.


merchandizeTotalTax: Money (read-only)

Returns the total tax in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotions have been added.


notes: List (read-only)

Returns the list of notes for this object, ordered by creation time from oldest to newest.


paymentInstrument: OrderPaymentInstrument (read-only)

Returns the payment instrument of the line item container or null. This method is deprecated. You should use getPaymentInstruments() or getGiftCertificatePaymentInstruments() instead.

Deprecated:

Use getPaymentInstruments() or getGiftCertificatePaymentInstruments() to get the set of payment instruments.


paymentInstruments: Collection (read-only)

Returns an unsorted collection of the payment instruments in this container.


priceAdjustments: Collection (read-only)

Returns the collection of price adjustments that have been applied to the totals such as promotion on the purchase value (i.e. $10 Off or 10% Off). The price adjustments are sorted by the order in which they were applied to the order by the promotions engine.


productLineItems: Collection (read-only)

Returns the product line items of the container that are not dependent on other product line items. This includes line items representing bonus products in the container but excludes option, bundled, and bonus line items. The returned collection is sorted by the position attribute of the product line items.


productQuantities: HashMap (read-only)

Returns a hash map of all products in the line item container and their total quantities. The total product quantity is for example used to lookup the product price.

The method counts all direct product line items, plus dependent product line items that are not bundled line items and no option line items. It also excludes product line items that are not associated to any catalog product, and bonus product line items.

See Also:


productQuantityTotal: Number (read-only)

Returns the total quantity of all product line items. Not included are bundled line items and option line items.


shipments: Collection (read-only)

Returns all shipments of the line item container.

The first shipment in the returned collection is the default shipment (shipment ID always set to "me"). All other shipments are sorted ascending by shipment ID.


shippingPriceAdjustments: Collection (read-only)

Returns the of shipping price adjustments applied to the shipping total of the container. Note that the promotions engine only applies shipping price adjustments to the the default shipping line item of shipments, and never to the container.

See Also:


shippingTotalGrossPrice: Money (read-only)

Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments have been applied.


shippingTotalNetPrice: Money (read-only)

Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments have been applied.


shippingTotalPrice: Money (read-only)

Returns the shipping total price. If the line item container is based on net pricing the shipping total net price is returned. If the line item container is based on gross pricing the shipping total gross price is returned.


shippingTotalTax: Money (read-only)

Returns the tax of all shipping line items of the line item container before shipping adjustments have been applied.


taxRoundedAtGroup: Boolean (read-only)

Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation.

If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate.


taxTotalsPerTaxRate: SortedMap (read-only)

This method returns a SortedMap in which the keys are Decimal tax rates and the values are Money total tax for the tax rate. The map is unmodifiable.


totalGrossPrice: Money (read-only)

Returns the grand total price gross of tax for LineItemCtnr, in purchase currency. Total prices represent the sum of product prices, services prices and adjustments.


totalNetPrice: Money (read-only)

Returns the grand total price for LineItemCtnr net of tax, in purchase currency. Total prices represent the sum of product prices, services prices and adjustments.


totalTax: Money (read-only)

Returns the grand total tax for LineItemCtnr, in purchase currency. Total prices represent the sum of product prices, services prices and adjustments.


addNote(subject: String, text: String): Note

Adds a note to the object.

Parameters:

  • subject - The subject of the note.
  • text - The text of the note. Must be no more than 4000 characters or an exception is thrown.

Returns:

  • the added note.

createBillingAddress(): OrderAddress

Create a billing address for the LineItemCtnr. A LineItemCtnr (e.g. basket) initially has no billing address. This method creates a billing address for the LineItemCtnr and replaces an existing billing address.

Returns:

  • The new billing address of the LineItemCtnr.

createBonusProductLineItem(bonusDiscountLineItem: BonusDiscountLineItem, product: Product, optionModel: ProductOptionModel, shipment: Shipment): ProductLineItem

Creates a product line item in the container based on the passed Product and BonusDiscountLineItem. The product must be assigned to the current site catalog and must also be a bonus product of the specified BonusDiscountLineItem or an exception is thrown. The line item is always created in the default shipment. If successful, the operation always creates a new ProductLineItem and never simply increments the quantity of an existing ProductLineItem. An option model can optionally be specified.

Parameters:

  • bonusDiscountLineItem - Line item representing an applied BonusChoiceDiscount in the LineItemCtnr, must not be null.
  • product - Product The product to add to the LineItemCtnr. Must not be null and must be a bonus product of bonusDiscountLineItem.
  • optionModel - ProductOptionModel or null.
  • shipment - The shipment to add the bonus product to. If null, the product is added to the default shipment.

createCouponLineItem(couponCode: String): CouponLineItem

Creates a coupon line item that is not based on the B2C Commerce campaign system and associates it with the specified coupon code.

There may not be any other coupon line item in the container with the specific coupon code, otherwise an exception is thrown.

If you want to create a coupon line item based on the B2C Commerce campaign system, you must use createCouponLineItem(String, Boolean) with campaignBased = true.

Parameters:

  • couponCode - couponCode represented by the coupon line item.

Returns:

  • New coupon line item.

createCouponLineItem(couponCode: String, campaignBased: Boolean): CouponLineItem

Creates a new CouponLineItem for this container based on the supplied coupon code.

The created coupon line item is based on the B2C Commerce campaign system if campaignBased parameter is true. In that case, if the supplied coupon code is not valid, APIException with type 'CreateCouponLineItemException' is thrown.

If you want to create a custom coupon line item, you must call this method with campaignBased = false or to use createCouponLineItem(String).

Example:

An dw.order.CreateCouponLineItemException is thrown in case of campaignBased = true only. Indicates that the provided coupon code is not a valid coupon code to create a coupon line item based on the B2C Commerce campaign system. The error code property (CreateCouponLineItemException.errorCode) will be set to one of the following values:

Parameters:

  • couponCode - the coupon code to be represented by the coupon line item
  • campaignBased - the flag if the created coupon line item should be based on the B2C Commerce campaign system

Returns:

  • the created coupon line item

createGiftCertificateLineItem(amount: Number, recipientEmail: String): GiftCertificateLineItem

Creates a gift certificate line item.

Parameters:

  • amount - the amount of the gift certificate - mandatory
  • recipientEmail - the recipient's email address - mandatory

Returns:

  • The new gift certificate line item

createGiftCertificatePaymentInstrument(giftCertificateCode: String, amount: Money): OrderPaymentInstrument

Creates an OrderPaymentInstrument representing a Gift Certificate. The amount is set on a PaymentTransaction that is accessible via the OrderPaymentInstrument. By default, the status of the PaymentTransaction is set to CREATE. The PaymentTransaction must be processed at a later time.

Parameters:

  • giftCertificateCode - the redemption code of the Gift Certificate.
  • amount - the amount to set on the PaymentTransaction. If the OrderPaymentInstrument is actually redeemed, this is the amount that will be deducted from the Gift Certificate.

Returns:

  • the OrderPaymentInstrument.

createPaymentInstrument(paymentMethodId: String, amount: Money): OrderPaymentInstrument

Creates a payment instrument using the specified payment method id and amount. The amount is set on the PaymentTransaction that is attached to the payment instrument.

Parameters:

  • paymentMethodId - The payment method id. See the PaymentInstrument class for payment method types
  • amount - The payment amount or null

Returns:

  • The new payment instrument

createPaymentInstrumentFromWallet(walletPaymentInstrument: CustomerPaymentInstrument, amount: Money): OrderPaymentInstrument

Creates a payment instrument using the specified wallet payment instrument and amount. The amount is set on the PaymentTransaction that is attached to the payment instrument. All data from the wallet payment instrument will be copied over to the created payment instrument.

Parameters:

  • walletPaymentInstrument - The payment instrument from the customer's walled.
  • amount - The payment amount or null

Returns:

  • The new payment instrument

createPriceAdjustment(promotionID: String): PriceAdjustment

Creates an order price adjustment.

The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise an exception is thrown.

Parameters:

  • promotionID - Promotion ID

Returns:

  • The new price adjustment

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

Creates an order level price adjustment for a specific discount.

The promotion id is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise an exception is thrown.

The possible discount types are supported: PercentageDiscount and AmountDiscount.

Examples:

` var myOrder : dw.order.Order; // assume known

var paTenPercent : dw.order.PriceAdjustment = myOrder.createPriceAdjustment("myPromotionID1", new dw.campaign.PercentageDiscount(10));

var paReduceBy20 : dw.order.PriceAdjustment = myOrder.createPriceAdjustment("myPromotionID2", new dw.campaign.AmountDiscount(20);

`

Parameters:

  • promotionID - Promotion ID
  • discount - The discount

Returns:

  • The new price adjustment

createProductLineItem(product: Product, optionModel: ProductOptionModel, shipment: Shipment): ProductLineItem

Creates a new product line item in the container and assigns it to the specified shipment. An option model can be specified.

Please note that the product must be assigned to the current site catalog.

Parameters:

  • product - Product
  • optionModel - ProductOptionModel or null
  • shipment - Shipment

createProductLineItem(productListItem: ProductListItem, shipment: Shipment): ProductLineItem

Creates a new product line item in the basket and assigns it to the specified shipment.

If the product list item references a product in the site catalog, the method will associate the product line item with that catalog product and will copy all order-relevant information, like the quantity unit, from the catalog product. The quantity of the product line item is initialized with 1.0 or - if defined - the minimum order quantity of the product.

If the product list item references an option product, the option values are copied from the product list item.

If the product list item is associated with an existing product line item, and the BasketAddProductBehaviour setting is MergeQuantities, then the product line item quantity is increased by 1.0 or, if defined, the minimum order quantity of the product.

An exception is thrown if

  • the line item container is no basket.
  • the type of the product list item is not PRODUCT.
  • the product list item references a product which is not assigned to the site catalog.

Parameters:

  • productListItem - the product list item
  • shipment - the shipment the created product line item will be assigned to

Returns:

  • The new product line item

createProductLineItem(productID: String, shipment: Shipment): ProductLineItem

Creates a new product line item in the container and assigns it to the specified shipment.

If the specified productID represents a product in the site catalog, the method will associate the product line item with that catalog product and will copy all order-relevant information, like the quantity unit, from the catalog product. The quantity of the product line item is initialized with 1.0 or - if defined - the minimum order quantity of the product.

If the product represents a product in the site catalog and is an option product, the product is added with it's default option values.

If the specified productID does not represent a product of the site catalog, the method creates a new product line item and initializes it with the specified product ID and with a quantity, minimum order quantity, and step quantity value of 1.0.

If the provided SKU references a product that is not available as described in method ProductLineItem.isCatalogProduct(), the new product line item is considered a non-catalog product line item without a connection to a product. Such product line items are not included in reservation requests in either OCI-based inventory or eCom-based inventory when calling Basket.reserveInventory() or OrderMgr.createOrder(Basket).

Parameters:

  • productID - The product ID.
  • shipment - Shipment

Returns:

  • The new product line item

createProductLineItem(productID: String, quantity: Quantity, shipment: Shipment): ProductLineItem

Creates a new product line item in the container and assigns it to the specified shipment.

If the specified productID represents a product in the site catalog, the method will associate the product line item with that catalog product and will copy all order-relevant information, like the quantity unit, from the catalog product.

If the specified productID does not represent a product of the site catalog, the method creates a new product line item and initializes it with the specified product ID and quantity. If the passed in quantity value is not a positive integer, it will be rounded to the nearest positive integer. The minimum order quantity and step quantity will be set to 1.0.

For catalog products, the method follows the configured 'Add2Basket' strategy to either increment the quantity of an existing product line item or create a new product line item for the same product. For non-catalog products, the method creates a new product line item no matter if the same product is already in the line item container. If a negative quantity is specified, it is automatically changed to 1.0.

Parameters:

  • productID - The product ID.
  • quantity - The quantity of the product.
  • shipment - Shipment

Returns:

  • the product line item

Deprecated:

Use createProductLineItem(String, Shipment) or ProductLineItem.updateQuantity(Number) instead.


createShipment(id: String): Shipment

Creates a standard shipment for the line item container. The specified ID must not yet be in use for another shipment of this line item container.

Parameters:

  • id - ID of the shipment.

createShippingPriceAdjustment(promotionID: String): PriceAdjustment

Creates a shipping price adjustment to be applied to the container.

The promotion ID is mandatory and must not be the ID of any actual promotion defined in B2C Commerce; otherwise the method will throw an exception.

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

Parameters:

  • promotionID - Promotion ID

Returns:

  • The new price adjustment

getAdjustedMerchandizeTotalGrossPrice(): Money

Returns the adjusted total gross price (including tax) in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping, but after product-level and order-level adjustments.

Returns:

  • the adjusted total gross price (including tax) in purchase currency.

getAdjustedMerchandizeTotalNetPrice(): Money

Returns the total net price (excluding tax) in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping, but after product-level and order-level adjustments.

Returns:

  • the total net price (excluding tax) in purchase currency.

getAdjustedMerchandizeTotalPrice(): Money

Returns the adjusted merchandize total price including product-level and order-level adjustments. If the line item container is based on net pricing the adjusted merchandize total net price is returned. If the line item container is based on gross pricing the adjusted merchandize total gross price is returned.

Returns:

  • either the adjusted merchandize total net or gross price

getAdjustedMerchandizeTotalPrice(applyOrderLevelAdjustments: Boolean): Money

Returns the adjusted merchandize total price including order-level adjustments if requested. If the line item container is based on net pricing the adjusted merchandize total net price is returned. If the line item container is based on gross pricing the adjusted merchandize total gross price is returned.

Parameters:

  • applyOrderLevelAdjustments - controls if order-level price adjustements are applied. If true, the price that is returned includes order-level price adjustments. If false, only product-level price adjustments are applied.

Returns:

  • a price representing the adjusted merchandize total controlled by the applyOrderLevelAdjustments parameter.

getAdjustedMerchandizeTotalTax(): Money

Returns the subtotal tax in purchase currency. Adjusted merchandize prices represent the sum of product prices before services such as shipping have been added, but after adjustment from promotions have been added.

Returns:

  • the subtotal tax in purchase currency.

getAdjustedShippingTotalGrossPrice(): Money

Returns the adjusted sum of all shipping line items of the line item container, including tax after shipping adjustments have been applied.

Returns:

  • the adjusted sum of all shipping line items of the line item container, including tax after shipping adjustments have been applied.

getAdjustedShippingTotalNetPrice(): Money

Returns the sum of all shipping line items of the line item container, excluding tax after shipping adjustments have been applied.

Returns:

  • the sum of all shipping line items of the line item container, excluding tax after shipping adjustments have been applied.

getAdjustedShippingTotalPrice(): Money

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

Returns:

  • either the adjusted shipping total net or gross price

getAdjustedShippingTotalTax(): Money

Returns the tax of all shipping line items of the line item container after shipping adjustments have been applied.

Returns:

  • the tax of all shipping line items of the line item container after shipping adjustments have been applied.

getAllGiftCertificateLineItems(): Collection

Returns all gift certificate line items of the container.

Returns:

  • A collection of all GiftCertificateLineItems of the container.

Deprecated:

Use getGiftCertificateLineItems() to get the collection instead.


getAllLineItems(): Collection

Returns all product, shipping, price adjustment, and gift certificate line items of the line item container.

Returns:

  • A collection of all product, shipping, price adjustment, and gift certificate line items of the container, in that order.

getAllProductLineItems(): Collection

Returns all product line items of the container, no matter if they are dependent or independent. This includes option, bundled and bonus line items.

Returns:

  • An unsorted collection of all ProductLineItem instances of the container.

getAllProductLineItems(productID: String): Collection

Returns all product line items of the container that have a product ID equal to the specified product ID, no matter if they are dependent or independent. This includes option, bundled and bonus line items.

Parameters:

  • productID - The product ID used to filter the product line items.

Returns:

  • An unsorted collection of all ProductLineItem instances which have the specified product ID.

getAllProductQuantities(): HashMap

Returns a hash mapping all products in the line item container to their total quantities. The total product quantity is used chiefly to validate the availability of the items in the cart. This method is not appropriate to look up prices because it returns products such as bundled line items which are included in the price of their parent and therefore have no corresponding price.

The method counts all direct product line items, plus dependent product line items that are not option line items. It also excludes product line items that are not associated to any catalog product.

Returns:

  • A map of products and their total quantities.

getAllShippingPriceAdjustments(): Collection

Returns the collection of all shipping price adjustments applied somewhere in the container. This can be adjustments applied to individual shipments or to the container itself. Note that the promotions engine only applies shipping price adjustments to the the default shipping line item of shipments, and never to the container.

Returns:

  • an unsorted collection of the shipping PriceAdjustment instances associated with this container.

See Also:


getBillingAddress(): OrderAddress

Returns the billing address defined for the container. Returns null if no billing address has been created yet.

Returns:

  • the billing address or null.

getBonusDiscountLineItems(): Collection

Returns an unsorted collection of the the bonus discount line items associated with this container.

Returns:

  • An unsorted collection of BonusDiscountLine instances in the container.

getBonusLineItems(): Collection

Returns the collection of product line items that are bonus items (where ProductLineItem.isBonusProductLineItem() is true).

Returns:

  • the collection of product line items that are bonus items.

getBusinessType(): EnumValue

Returns the type of the business this order has been placed in.

Possible values are BUSINESS_TYPE_B2C or BUSINESS_TYPE_B2B.

Returns:

  • the type of the business this order has been placed in. or null, if the business type is not set

getChannelType(): EnumValue

The channel type defines in which sales channel this order has been created. This can be used to distinguish order placed through Storefront, Call Center or Marketplace.

Possible values are CHANNEL_TYPE_STOREFRONT, CHANNEL_TYPE_CALLCENTER, CHANNEL_TYPE_MARKETPLACE, CHANNEL_TYPE_DSS, CHANNEL_TYPE_STORE, CHANNEL_TYPE_PINTEREST, CHANNEL_TYPE_TWITTER, CHANNEL_TYPE_FACEBOOKADS, CHANNEL_TYPE_SUBSCRIPTIONS, CHANNEL_TYPE_ONLINERESERVATION, CHANNEL_TYPE_CUSTOMERSERVICECENTER, CHANNEL_TYPE_INSTAGRAMCOMMERCE, CHANNEL_TYPE_GOOGLE, CHANNEL_TYPE_YOUTUBE, CHANNEL_TYPE_TIKTOK, CHANNEL_TYPE_SNAPCHAT, CHANNEL_TYPE_WHATSAPP

Returns:

  • the sales channel this order has been placed in or null, if the order channel is not set

getCouponLineItem(couponCode: String): CouponLineItem

Returns the coupon line item representing the specified coupon code.

Parameters:

  • couponCode - the coupon code.

Returns:

  • coupon line item or null.

getCouponLineItems(): Collection

Returns a sorted collection of the coupon line items in the container. The coupon line items are returned in the order they were added to container.

Returns:

  • A sorted list of the CouponLineItem instances in the container.

getCurrencyCode(): String

Returns the currency code for this line item container. The currency code is a 3-character currency mnemonic such as 'USD' or 'EUR'. The currency code represents the currency in which the calculation is made, and in which the buyer sees all prices in the store front.

Returns:

  • the currency code for this line item container.

getCustomer(): Customer

Returns the customer associated with this container.

Returns:

  • the customer associated with this container.

getCustomerEmail(): String

Returns the email of the customer associated with this container.

Returns:

  • the email of the customer associated with this container.

getCustomerName(): String

Returns the name of the customer associated with this container.

Returns:

  • the name of the customer associated with this container.

getCustomerNo(): String

Returns the customer number of the customer associated with this container.

Returns:

  • the customer number of the customer associated with this container.

getDefaultShipment(): Shipment

Returns the default shipment of the line item container. Every basket and order has a default shipment with the id "me". If you call a process that accesses a shipment, and you don't specify the shipment, then the process uses the default shipment. You can't remove a default shipment. Calling removeShipment(Shipment) on it throws an exception.

Returns:

  • the default shipment of the container

getEtag(): String

Returns the Etag of the line item container. The Etag is a hash that represents the overall container state including any associated objects like line items.

Returns:

  • the Etag value

getGiftCertificateLineItems(): Collection

Returns all gift certificate line items of the container.

Returns:

  • A collection of all GiftCertificateLineItems of the container.

getGiftCertificateLineItems(giftCertificateId: String): Collection

Returns all gift certificate line items of the container, no matter if they are dependent or independent.

Parameters:

  • giftCertificateId - the gift certificate identifier.

Returns:

  • A collection of all GiftCertificateLineItems of the container.

getGiftCertificatePaymentInstruments(): Collection

Returns an unsorted collection of the PaymentInstrument instances that represent GiftCertificates in this container.

Returns:

  • an unsorted collection containing the set of PaymentInstrument instances that represent GiftCertificates.

getGiftCertificatePaymentInstruments(giftCertificateCode: String): Collection

Returns an unsorted collection containing all PaymentInstruments of type PaymentInstrument.METHOD_GIFT_CERTIFICATE where the specified code is the same code on the payment instrument.

Parameters:

  • giftCertificateCode - the gift certificate code.

Returns:

  • an unsorted collection containing all PaymentInstruments of type PaymentInstrument.METHOD_GIFT_CERTIFICATE where the specified code is the same code on the payment instrument.

getGiftCertificateTotalGrossPrice(): Money

Returns the total gross price of all gift certificates in the cart. Should usually be equal to total net price.

Returns:

  • the total gross price of all gift certificate line items

getGiftCertificateTotalNetPrice(): Money

Returns the total net price (excluding tax) of all gift certificates in the cart. Should usually be equal to total gross price.

Returns:

  • the total net price of all gift certificate line items

getGiftCertificateTotalPrice(): Money

Returns the gift certificate total price. If the line item container is based on net pricing the gift certificate total net price is returned. If the line item container is based on gross pricing the gift certificate total gross price is returned.

Returns:

  • either the gift certificate total net or gross price

getGiftCertificateTotalTax(): Money

Returns the total tax of all gift certificates in the cart. Should usually be 0.0.

Returns:

  • the total tax of all gift certificate line items

getMerchandizeTotalGrossPrice(): Money

Returns the total gross price (including tax) in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotions have been added.

Returns:

  • the total gross price (including tax) in purchase currency.

getMerchandizeTotalNetPrice(): Money

Returns the total net price (excluding tax) in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotion have been added.

Returns:

  • the total net price (excluding tax) in purchase currency.

getMerchandizeTotalPrice(): Money

Returns the merchandize total price. If the line item container is based on net pricing the merchandize total net price is returned. If the line item container is based on gross pricing the merchandize total gross price is returned.

Returns:

  • either the merchandize total net or gross price

getMerchandizeTotalTax(): Money

Returns the total tax in purchase currency. Merchandize total prices represent the sum of product prices before services such as shipping or adjustment from promotions have been added.

Returns:

  • the total tax in purchase currency.

getNotes(): List

Returns the list of notes for this object, ordered by creation time from oldest to newest.

Returns:

  • the list of notes for this object, ordered by creation time from oldest to newest.

getPaymentInstrument(): OrderPaymentInstrument

Returns the payment instrument of the line item container or null. This method is deprecated. You should use getPaymentInstruments() or getGiftCertificatePaymentInstruments() instead.

Returns:

  • the order payment instrument of the line item container or null.

Deprecated:

Use getPaymentInstruments() or getGiftCertificatePaymentInstruments() to get the set of payment instruments.


getPaymentInstruments(): Collection

Returns an unsorted collection of the payment instruments in this container.

Returns:

  • an unsorted collection containing the set of PaymentInstrument instances associated with this container.

getPaymentInstruments(paymentMethodID: String): Collection

Returns an unsorted collection of PaymentInstrument instances based on the specified payment method ID.

Parameters:

  • paymentMethodID - the ID of the payment method used.

Returns:

  • an unsorted collection of OrderPaymentInstrument instances based on the payment method.

getPriceAdjustmentByPromotionID(promotionID: String): PriceAdjustment

Returns the price adjustment associated to the specified promotion ID.

Parameters:

  • promotionID - Promotion id

Returns:

  • The price adjustment associated with the specified promotion ID or null if none was found.

getPriceAdjustments(): Collection

Returns the collection of price adjustments that have been applied to the totals such as promotion on the purchase value (i.e. $10 Off or 10% Off). The price adjustments are sorted by the order in which they were applied to the order by the promotions engine.

Returns:

  • the sorted collection of PriceAdjustment instances.

getProductLineItems(): Collection

Returns the product line items of the container that are not dependent on other product line items. This includes line items representing bonus products in the container but excludes option, bundled, and bonus line items. The returned collection is sorted by the position attribute of the product line items.

Returns:

  • A sorted collection of ProductLineItem instances which are not dependent on other product line items.

getProductLineItems(productID: String): Collection

Returns the product line items of the container that have a product ID equal to the specified product ID and that are not dependent on other product line items. This includes line items representing bonus products in the container, but excludes option, bundled and bonus line items. The returned collection is sorted by the position attribute of the product line items.

Parameters:

  • productID - The Product ID used to filter the product line items.

Returns:

  • A sorted collection of ProductLineItem instances which have the specified product ID and are not dependent on other product line items.

getProductQuantities(): HashMap

Returns a hash map of all products in the line item container and their total quantities. The total product quantity is for example used to lookup the product price.

The method counts all direct product line items, plus dependent product line items that are not bundled line items and no option line items. It also excludes product line items that are not associated to any catalog product, and bonus product line items.

Returns:

  • a map of products and their total quantities.

See Also:


getProductQuantities(includeBonusProducts: Boolean): HashMap

Returns a hash map of all products in the line item container and their total quantities. The total product quantity is for example used to lookup the product price in the cart.

The method counts all direct product line items, plus dependent product line items that are not bundled line items and no option line items. It also excludes product line items that are not associated to any catalog product.

If the parameter 'includeBonusProducts' is set to true, the method also counts bonus product line items.

Parameters:

  • includeBonusProducts - if true also bonus product line item are counted

Returns:

  • A map of products and their total quantities.

getProductQuantityTotal(): Number

Returns the total quantity of all product line items. Not included are bundled line items and option line items.

Returns:

  • The total quantity of all line items of the container.

getShipment(id: String): Shipment

Returns the shipment for the specified ID or null if no shipment with this ID exists in the line item container. Using "me" always returns the default shipment.

Parameters:

  • id - the shipment identifier

Returns:

  • the shipment or null

getShipments(): Collection

Returns all shipments of the line item container.

The first shipment in the returned collection is the default shipment (shipment ID always set to "me"). All other shipments are sorted ascending by shipment ID.

Returns:

  • all shipments of the line item container

getShippingPriceAdjustmentByPromotionID(promotionID: String): PriceAdjustment

Returns the shipping price adjustment associated with the specified promotion ID.

Parameters:

  • promotionID - Promotion id

Returns:

  • The price adjustment associated with the specified promotion ID or null if none was found.

getShippingPriceAdjustments(): Collection

Returns the of shipping price adjustments applied to the shipping total of the container. Note that the promotions engine only applies shipping price adjustments to the the default shipping line item of shipments, and never to the container.

Returns:

  • a collection of shipping price adjustments.

See Also:


getShippingTotalGrossPrice(): Money

Returns the sum of all shipping line items of the line item container, including tax before shipping adjustments have been applied.

Returns:

  • the sum of all shipping line items of the line item container, including tax before shipping adjustments have been applied.

getShippingTotalNetPrice(): Money

Returns the sum of all shipping line items of the line item container, excluding tax before shipping adjustments have been applied.

Returns:

  • the sum of all shipping line items of the line item container, excluding tax before shipping adjustments have been applied.

getShippingTotalPrice(): Money

Returns the shipping total price. If the line item container is based on net pricing the shipping total net price is returned. If the line item container is based on gross pricing the shipping total gross price is returned.

Returns:

  • either the shipping total net or gross price

getShippingTotalTax(): Money

Returns the tax of all shipping line items of the line item container before shipping adjustments have been applied.

Returns:

  • the tax of all shipping line items of the line item container before shipping adjustments have been applied.

getTaxTotalsPerTaxRate(): SortedMap

This method returns a SortedMap in which the keys are Decimal tax rates and the values are Money total tax for the tax rate. The map is unmodifiable.

Returns:

  • sorted map of tax rate against total tax

getTotalGrossPrice(): Money

Returns the grand total price gross of tax for LineItemCtnr, in purchase currency. Total prices represent the sum of product prices, services prices and adjustments.

Returns:

  • the grand total price.

getTotalNetPrice(): Money

Returns the grand total price for LineItemCtnr net of tax, in purchase currency. Total prices represent the sum of product prices, services prices and adjustments.

Returns:

  • the grand total price.

getTotalTax(): Money

Returns the grand total tax for LineItemCtnr, in purchase currency. Total prices represent the sum of product prices, services prices and adjustments.

Returns:

  • the grand total tax.

isExternallyTaxed(): Boolean

Use this method to check whether the LineItemCtnr is calculated based on external tax tables.

Note: a basket can only be created in EXTERNAL tax mode using SCAPI.

Returns:

  • true if the LineItemCtnr was calculated based on external tax tables.

isTaxRoundedAtGroup(): Boolean

Use this method to check if the LineItemCtnr was calculated with grouped taxation calculation.

If the tax is rounded on group level, the tax is applied to the summed-up tax basis for each tax rate.

Returns:

  • true if the LineItemCtnr was calculated with grouped taxation

removeAllPaymentInstruments(): void

Removes the all Payment Instruments from this container and deletes the Payment Instruments.


removeBonusDiscountLineItem(bonusDiscountLineItem: BonusDiscountLineItem): void

Removes the specified bonus discount line item from the line item container.

Parameters:

  • bonusDiscountLineItem - The bonus discount line item to remove, must not be null.

removeCouponLineItem(couponLineItem: CouponLineItem): void

Removes the specified coupon line item from the line item container.

Parameters:

  • couponLineItem - The coupon line item to remove

removeGiftCertificateLineItem(giftCertificateLineItem: GiftCertificateLineItem): void

Removes the specified gift certificate line item from the line item container.

Parameters:

  • giftCertificateLineItem - The gift certificate line item to remove

removeNote(note: Note): void

Removes a note from this line item container and deletes it.

Parameters:

  • note - The note to remove. Must not be null. Must belong to this line item container.

removePaymentInstrument(pi: PaymentInstrument): void

Removes the specified Payment Instrument from this container and deletes the Payment Instrument.

Parameters:

  • pi - the Payment Instrument to remove.

removePriceAdjustment(priceAdjustment: PriceAdjustment): void

Removes the specified price adjustment line item from the line item container.

Parameters:

  • priceAdjustment - The price adjustment line item to remove, must not be null.

removeProductLineItem(productLineItem: ProductLineItem): void

Removes the specified product line item from the line item container.

Parameters:

  • productLineItem - The product line item to remove, must not be null.

removeShipment(shipment: Shipment): void

Removes the specified shipment and all associated product, gift certificate, shipping and price adjustment line items from the line item container. It is not permissible to remove the default shipment.

Parameters:

  • shipment - Shipment to be removed, must not be null.

removeShippingPriceAdjustment(priceAdjustment: PriceAdjustment): void

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

Parameters:

  • priceAdjustment - The price adjustment line item to remove, must not be null.

setCustomerEmail(aValue: String): void

Sets the email address of the customer associated with this container.

Parameters:

  • aValue - the email address of the customer associated with this container.

setCustomerName(aValue: String): void

Sets the name of the customer associated with this container.

Parameters:

  • aValue - the name of the customer associated with this container.

updateOrderLevelPriceAdjustmentTax(): void

Calculates the tax for all shipping and order-level merchandise price adjustments in this LineItemCtnr.

The tax on each adjustment is calculated from the taxes of the line items the adjustment applies across.

This method must be invoked at the end of tax calculation of a basket or an order.


updateTotals(): void

Recalculates the totals of the line item container. It is necessary to call this method after any type of modification to the basket.


verifyPriceAdjustmentLimits(): Status

Verifies whether the manual price adjustments made for the line item container exceed the corresponding limits for the current user and the current site.

The results of this method are based on the current values held in the LineItemCtnr, such as the base price of manual price adjustments. It is important the method is only called after the calculation process has completed.

Status.OK is returned if NONE of the manual price adjustments exceed the correspondent limits.

Status.ERROR is returned if ANY of the manual price adjustments exceed the correspondent limits. If this case Status.getItems() returns all price adjustment limit violations. The code of each StatusItem represents the violated price adjustment type (see PriceAdjustmentLimitTypes). StatusItem.getDetails() returns a Map with the max amount and (where relevant) the item to which the violation applies.

Usage:

Returns:

  • a Status instance with - Status.OK if all manual price adjustments do not exceed the correspondent limits, otherwise Status.ERROR