Interface ShipEngineService
- All Known Implementing Classes:
DefaultShipEngineService
public interface ShipEngineService
Encapsulates supported functions of the ShipEngine API.
- Author:
- Cade Rea (cade-rea)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetBulkRates
(List<com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest> fulfillmentPricingRequests) Get rates for a list ofFulfillmentPricingRequest
.Get a list ofCarrier
that are configured in the ShipEngine account.getEstimate
(com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest fulfillmentPricingRequest) Get rate estimates from all carriers for the givenFulfillmentPricingRequest
.getRates
(com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest fulfillmentPricingRequest) Get all available rates for the givenFulfillmentPricingRequest
.purchaseLabel
(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment, com.broadleafcommerce.order.common.domain.Address fromAddress) Purchase a label with anOrderFulfillment
.purchaseLabelFromRate
(String rateId) Purchase a label from a previously quotedRate
.retrieveLabel
(String labelId) Retrieve an existing shipping label.retrieveRate
(String rateId) Retrieve an existingRate
.retrieveRateForShipment
(String shipmentId) Retrieve a previously calculated rate with the shipment id.
-
Method Details
-
getEstimate
EstimateResponse getEstimate(com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest fulfillmentPricingRequest) Get rate estimates from all carriers for the givenFulfillmentPricingRequest
. Estimates can be retrieved with less information than is required for a rate quote.- Parameters:
fulfillmentPricingRequest
- Provides addresses and items for a shipment.- Returns:
- An
EstimateResponse
with estimatedRate
s
-
getRates
RatesResponse getRates(com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest fulfillmentPricingRequest) Get all available rates for the givenFulfillmentPricingRequest
.- Parameters:
fulfillmentPricingRequest
- Provides addresses and items for a shipment.- Returns:
- A
RatesResponse
with a list ofRate
s.
-
getBulkRates
BulkRateResponseList getBulkRates(List<com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest> fulfillmentPricingRequests) Get rates for a list ofFulfillmentPricingRequest
. This is an asynchronous operation on ShipEngine. Rates should be retrieved withretrieveRateForShipment(java.lang.String)
- Parameters:
fulfillmentPricingRequests
- Provides addresses and items for a shipment.- Returns:
- A
BulkRateResponseList
with a list of statuses for each shipment submitted. - See Also:
-
retrieveRateForShipment
Retrieve a previously calculated rate with the shipment id. This can be used withgetBulkRates(java.util.List<com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest>)
to retrieve the rates from a bulk request.- Parameters:
shipmentId
- The ShipEngine id of the shipment- Returns:
- A
RatesResponse
with a list ofRate
s.
-
purchaseLabel
LabelResponse purchaseLabel(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment, @Nullable com.broadleafcommerce.order.common.domain.Address fromAddress) Purchase a label with anOrderFulfillment
. TheFulfillmentOption
should be set on theOrderFulfillment
.- Parameters:
orderFulfillment
- Provides addresses and items for a shipment.fromAddress
- The address that the package will be sent from. If not provided, will use the default address configured with properties. SeeShipEngineProperties.DefaultFromAddress
.- Returns:
- A
LabelResponse
with a URL to download the shipping label.
-
purchaseLabelFromRate
Purchase a label from a previously quotedRate
.- Parameters:
rateId
- The ShipEngine rate id.- Returns:
- A
LabelResponse
with a URL to download the shipping label.
-
getCarriers
Get a list ofCarrier
that are configured in the ShipEngine account.- Returns:
- A list of Carriers that are configured in the ShipEngine dashboard.
-
retrieveRate
Retrieve an existingRate
.- Parameters:
rateId
- The ShipEngine rate id.- Returns:
- The
Rate
associated with the given rateId.
-
retrieveLabel
Retrieve an existing shipping label. This method does not purchase labels.- Parameters:
labelId
- The ShipEngine label id.- Returns:
- A
LabelResponse
with a URL to download the shipping label.
-