All Known Implementing Classes:
DefaultShipEngineService

public interface ShipEngineService
Encapsulates supported functions of the ShipEngine API.
Author:
Cade Rea (cade-rea)
See Also:
  • Method Details

    • getEstimate

      EstimateResponse getEstimate(com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest fulfillmentPricingRequest)
      Get rate estimates from all carriers for the given FulfillmentPricingRequest. 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 estimated Rates
    • getRates

      RatesResponse getRates(com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest fulfillmentPricingRequest)
      Get all available rates for the given FulfillmentPricingRequest.
      Parameters:
      fulfillmentPricingRequest - Provides addresses and items for a shipment.
      Returns:
      A RatesResponse with a list of Rates.
    • getBulkRates

      BulkRateResponseList getBulkRates(List<com.broadleafcommerce.shipping.domain.FulfillmentPricingRequest> fulfillmentPricingRequests)
      Get rates for a list of FulfillmentPricingRequest. This is an asynchronous operation on ShipEngine. Rates should be retrieved with retrieveRateForShipment(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

      RateResponse retrieveRateForShipment(String shipmentId)
      Retrieve a previously calculated rate with the shipment id. This can be used with getBulkRates(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 of Rates.
    • purchaseLabel

      LabelResponse purchaseLabel(com.broadleafcommerce.order.client.domain.OrderFulfillment orderFulfillment, @Nullable com.broadleafcommerce.order.common.domain.Address fromAddress)
      Purchase a label with an OrderFulfillment. The FulfillmentOption should be set on the OrderFulfillment.
      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. See ShipEngineProperties.DefaultFromAddress.
      Returns:
      A LabelResponse with a URL to download the shipping label.
    • purchaseLabelFromRate

      LabelResponse purchaseLabelFromRate(String rateId)
      Purchase a label from a previously quoted Rate.
      Parameters:
      rateId - The ShipEngine rate id.
      Returns:
      A LabelResponse with a URL to download the shipping label.
    • getCarriers

      List<String> getCarriers()
      Get a list of Carrier that are configured in the ShipEngine account.
      Returns:
      A list of Carriers that are configured in the ShipEngine dashboard.
    • retrieveRate

      Rate retrieveRate(String rateId)
      Retrieve an existing Rate.
      Parameters:
      rateId - The ShipEngine rate id.
      Returns:
      The Rate associated with the given rateId.
    • retrieveLabel

      LabelResponse retrieveLabel(String labelId)
      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.