1. Shipping service layer

Shipping domain model

Version:

This section describes the domain model that represents shipping objects where the following three assertions hold true:

  • The domain model primarily serves as DTO objects for transferring information between the external commerce system and Sitecore.
  • The domain model contains the minimum required information as contracts and will typically be extended when integrated with a specific commerce system.
  • The domain model is used when a Sitecore developer needs to retrieve shipping data with the external commerce system.

The following class diagram shows the domain model.

Class diagram of the Shipping domain model.
Note

The domain model consists of abstract classes that make up the contracts with the external system. The contracts are defined as abstract classes instead of interfaces to allow the model to be easily extended later if needed. This follows the best practice guidelines defined in the Framework Design Guidelines.

Default implementation of the contracts are delivered as part of Connect. If an actual Connect provider with an external commerce system contains more functionality than that provided by default, the implementation can be replaced. All instantiation of actual classes will be handled through dependency injection.

Class: ShippingMethod

The ShippingMethod class is responsible for representing a type of shipping option, for example, FedEx is a ShipToAddress type option.

NameTypeDescription
ExternalIdStringUnique identifier for the shipment method in the commerce system.
DescriptionStringA description of the shipment method.
NameStringThe name of the shipment method.
Shipping OptionIdStringThe shipment option associated with this shipment method.
ShopNameStringThe shop name if any associated with this shipment method.

Class: ShippingMethodPerItem

The ShippingMethodPerItem class is used to return the valid shipping options on a per cart line item basis.

NameTypeDescription
LineIdStringThe line item identifier.
ShippingMethodsListThe list of allowable shipping methods for the line item.

Class: ShippingOptionType

The ShippingOptionType class is a virtual enum class that is responsible for representing known shipping option types, for example, pick up from store, electronic delivery, and so on.

NameTypeDescription
NoneShippingOptionTypeAn unassigned shipping option.
ElectronicDeliveryShippingOptionTypeDownloadable content.
PickupFromStoreShippingOptionTypeBuy on the site and pick from a specific store.
ShipToAddressShippingOptionTypeShip to a physical address.

Class: ShippingOption

The ShippingOption class is responsible for representing different shipping option types, for example, ShipToAddress.

NameTypeDescription
ExternalIdStringUnique identifier for the shipping option in the commerce system.
DescriptionStringA description of the shipping option.
NameStringName of the shipping option.
ShopNameStringThe shop name, if any, associated with the shipping option.

Class: LineShippingOption

The LineShippingOption class is used to hold shipping information for a particular line item.

NameTypeDescription
LineIdStringThe ID of the line item this is associated to.
ShippingOptionsListThe shipping options associated to this line item.

Class: ShippingLookup

The ShippingLookup class is used to hold the information required to look up shipping prices for a collection of line items.

NameTypeDescription
OptionIdStringThe ID of the desired shipping option.
MethodIdStringThe ID of the desired shipping method.
LineItemIdsListThe collection of line item IDs to look up the shipping costs for.

Class: ShippingPrice

The ShippingPrice class inherits from the Price object and is used to hold the pricing information for a shipping option, method, and list of line items.

NameTypeDescription
OptionIdStringThe ID of the shipping option.
MethodIdStringThe ID of the shipping method.
LineItemIdsListThe collection of line item IDs that the price is for.
If you have suggestions for improving this article, let us know!