# com.bea.commerce.ebusiness.price.service
PriceService Interface

public interface PriceService
extends `EJBObject`

A stateless session EJB used to price Line objects based on discounts represented by QualificationDiscountDef objects. The Price service uses the DiscountMgmt and DiscountAssociation services to determine what discounts are available for a given customer and the definitions for those discounts. The Price service works on a model where each discount may only applied once and each quantity one (1) of a Line item may only be used as a trigger or have its price adjusted once. Likewise, the order or shipping cost may only be used as a trigger or have its price adjusted once. See the product documentation for more details.

Related Topics

``QualificationDiscountDef``
``DiscountMgmt``
``DiscountAssociation``
``Line``

All Superinterfaces
  `EJBObject`, `Remote`

## Method Summary

`public `PricingReply`` | `computeSubtotal`(`PricingRequest` request) This method applies a set of discounts to the collection of Line items provided in the PricingRequest.
`public `PricingReply`` | `computeTotal`(`PricingRequest` request) This method applies a set of discounts to the collection of Line items provided in the PricingRequest.

Methods from interface `javax.ejb.`EJBObject``
`getEJBHome, getHandle, getPrimaryKey, isIdentical, remove`

## Method Detail

### computeSubtotal(PricingRequest) Method

    public PricingReply computeSubtotal(PricingRequest request)
         throws PricingException, RemoteException

This method applies a set of discounts to the collection of Line items provided in the PricingRequest. computeSubtotal() is intended for pricing Lines during shopping as it does not require the CustomerPk to be set in the PricingRequest. If the CustomerPk is set, the service will use it to determine, through the association service, if the customer is eligible for additional discounts. This method requires that the base shipping be set in the PricingRequest, failure to set the base shipping will cause a RuntimeException to be thrown. The quote field in the PricingReply will not be populated by this method. Use computeTotal() if the Quote object is needed. The Line items from the PricingRequest are added to the PricingReply prior to this method returning. The Line items are returned in the same order as they were submitted. Each Line item that has been adjusted during the pricing operation will have one(1) to many DiscountPresentations attached to it on completion.

#### Parameters

request
  request parameters for the pricing operation.

#### Returns

a populated PricingReply object.

#### Exceptions

``PricingException``
``RemoteException``

Related Topics

``PricingRequest``
``PricingRequestImpl``
``PricingReply``
``Quote``
``Line``
``DiscountPresentation``
``CustomerPk``

### computeTotal(PricingRequest) Method

    public PricingReply computeTotal(PricingRequest request)
         throws PricingException, RemoteException

This method applies a set of discounts to the collection of Line items provided in the PricingRequest. computeTotal() is intended for pricing Lines for checkout as it requires the CustomerPk to be set in the PricingRequest. The CustomerPk is necessary to track the number of times a particular customer has used a specific discount. If the CustomerPk is not set this method will throw a PricingException. This method requires that the base shipping be set in the PricingRequest, failure to set the base shipping will cause a RuntimeException to be thrown. The quote field in PricingReply will be populated by this method. The Line items from the PricingRequest are added to the PricingReply prior to this method returning. The Line items are returned in the same order as they were submitted. Each Line item that has been adjusted during the pricing operation will have one(1) to many DiscountPresentations attached to it on completion.

#### Parameters

request
  request parameters for the pricing operation.

#### Returns

a populated PricingReply object.

#### Exceptions

``PricingException``
``RemoteException``

Related Topics

``PricingRequest``
``PricingRequestImpl``
``PricingReply``
``Quote``
``Line``
``DiscountPresentation``
``CustomerPk``