com.worldpac.fulfillment
Class Order

java.lang.Object
  |
  +--com.worldpac.fulfillment.Order

public class Order
extends java.lang.Object

Represents an order for Worldpac to fulfill.


Constructor Summary
Order()
           
 
Method Summary
 java.lang.String addItem(java.lang.String productID, java.lang.String brandID, int quantity, java.lang.String applicationID, java.lang.String catalogProductID, java.lang.String year)
          Add an item to the order.
 java.lang.String delete()
          Delete the order.
 java.lang.String getEstimatedFreight()
          Get the estimated total freight price for all items on this order, using the currently selected shipping service.
 java.lang.String getOrderID()
          Get Worldpac order identifier.
 java.lang.String getShippingServices()
          Get the available shipping services for this order.
 java.lang.String initialize(java.lang.String fulfillerID, java.lang.String name, java.lang.String addressLine1, java.lang.String addressLine2, java.lang.String city, java.lang.String state, java.lang.String postalID, java.lang.String shippingService, java.lang.String userData)
          Initialize the Order object by creating a new Worldpac order.
 java.lang.String initializeFromID(java.lang.String fulfillerID, java.lang.String orderID)
          Initialize the Order object using an existing Worldpac order identifier.
 java.lang.String setShippingService(java.lang.String shippingService)
          Set the shipping service for this order.
 java.lang.String submit()
          Submit the order to be shipped.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Order

public Order()
Method Detail

initialize

public java.lang.String initialize(java.lang.String fulfillerID,
                                   java.lang.String name,
                                   java.lang.String addressLine1,
                                   java.lang.String addressLine2,
                                   java.lang.String city,
                                   java.lang.String state,
                                   java.lang.String postalID,
                                   java.lang.String shippingService,
                                   java.lang.String userData)
Initialize the Order object by creating a new Worldpac order. You must provide the address of the consumer to whom this order is to be shipped. This method creates a new empty order at Worldpac. Use getOrderID to learn the ID.

Parameters:
fulfillerID - Fulfiller identifier. Obtain by calling getID() on the Fulfiller.
name - Consumer name. Maximum 30 characters.
addressLine1 - Line 1 of consumer address. Maximum 30 characters.
addressLine2 - Line 2 of consumer address. Maximum 30 characters.
city - Consumer city. Maximum 16 characters.
state - Consumer state or region code. Maximum 2 characters.
postalID - Consumer ZIP or postal code. Maximum 10 characters.
shippingService - Service to be used to ship the order. Maximum 10 characters. Valid values are:
  • "UPG" - UPS Ground
  • "UPB" - UPS Blue (Second-day)
  • "UPR" - UPS Red (Next-day)
  • "UPRSAT" - UPS Red (Next-day with Saturday Delivery)
userData - Additional data associated with this order. Maximum 20 characters. The first 10 characters will print on the packing slip.
Returns:
Error text. null if successful.

initializeFromID

public java.lang.String initializeFromID(java.lang.String fulfillerID,
                                         java.lang.String orderID)
Initialize the Order object using an existing Worldpac order identifier.

Parameters:
fulfillerID - Fulfiller identifier. Obtain by calling getID() on the Fulfiller.
orderID - Worldpac order identifier.
Returns:
Error text. null if successful.

addItem

public java.lang.String addItem(java.lang.String productID,
                                java.lang.String brandID,
                                int quantity,
                                java.lang.String applicationID,
                                java.lang.String catalogProductID,
                                java.lang.String year)
Add an item to the order.

Parameters:
productID - Worldpac product identifier. May contain embedded spaces, which are significant.
brandID - Worldpac brand identifier.
quantity - Requested quantity.
applicationID - A Worldpac application identifier provided by the Worldpac catalog. May be null.
catalogProductID - A secondary Worldpac product identifier provided by the Worldpac catalog. May be null.
year - Vehicle year provided by the Worldpac catalog. May be null.
Returns:
Error text. null if successful.

submit

public java.lang.String submit()
Submit the order to be shipped.

Returns:
Error text. null if successful.

delete

public java.lang.String delete()
Delete the order. Call this method if you plan never to call submit(). An order cannot be deleted after it is submitted.

Returns:
Error text. null if successful.

getOrderID

public java.lang.String getOrderID()
Get Worldpac order identifier.

Returns:
Worldpac order identifier.

getEstimatedFreight

public java.lang.String getEstimatedFreight()
Get the estimated total freight price for all items on this order, using the currently selected shipping service.

Returns:
The estimated total freight price for all items on this order.

getShippingServices

public java.lang.String getShippingServices()
Get the available shipping services for this order. An available service is one that is either selected for at least one line on the order, or is eligible to be selected for the entire order.

Returns:
A string containing one line per available shipping service. The format of the string is shipping service code, colon, selected freight, colon, complete freight, CR/LF.
Selected freight is the estimated amount that will be charged under this shipping service given the current configuration of the order.
Complete freight is the estimated amount that would be charged under this shipping service if the entire order were shipped using the service.
See Also:
initialize

setShippingService

public java.lang.String setShippingService(java.lang.String shippingService)
Set the shipping service for this order.

Parameters:
shippingService - Worldpac shipping service identifier. All lines on the order will be shipped via this method. Use getShippingServices to determine the cost of doing this.
Returns:
Error text. null if successful.
See Also:
getShippingServices