Guides
These docs are for v1.13.1. Click to read the latest docs for v2.0.0.

ShipmentService

Documentation for Merch's ShipmentService

The Shipment service is used to manage shipments in Merch.

Instantiating

The ShipmentService is exposed through the MerchelloContext

var shipmentService = MerchelloContext.Current.Services.ShipmentService;

Class

public class ShipmentService : MerchelloRepositoryService, 
	IShipmentService, IService

Constructors

NameDescription
ShipmentService()Initializes a new instance of the ShipmentService class.
ShipmentService(ILogger)Initializes a new instance of the ShipmentService class.
ShipmentService(RepositoryFactory, ILogger)Initializes a new instance of the ShipmentService class.
ShipmentService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger, IStoreSettingService)Initializes a new instance of the ShipmentService class.
ShipmentService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger, IEventMessagesFactory, IStoreSettingService)Initializes a new instance of the ShipmentService class.

Public Methods

NameDescription
CreateShipment(IShipmentStatus, Boolean)Creates a IShipment without persisting it to the database.
CreateShipment(IShipmentStatus, IAddress, IAddress, Boolean)Creates a IShipment without persisting it to the database.
CreateShipment(IShipmentStatus, IAddress, IAddress, LineItemCollection, Boolean)Creates a IShipment without persisting it to the database.
Delete(IShipment, Boolean)Deletes a single IShipment
Delete(IEnumerable(IShipment), Boolean)Deletes a collection of IShipment
GetAllShipmentStatusesReturns a collection of all IShipmentStatus
GetByKeyGets an IShipment object by its 'UniqueId'
GetByKeysGets list of IShipment objects given a list of Unique keys
GetShipmentsByOrderKeyGets a collection of IShipment give an order key
GetShipmentsByShipMethodKeyGets a list of IShipment object given a ship method Key
GetShipmentStatusByKeySaves a single IShipment
Save(IShipment, Boolean)Saves a single IShipment
Save(IEnumerable(IShipment), Boolean)Saves a collection of IShipment

Events

NameDescription
CreatingOccurs before create
DeletingOccurs before delete
DeletedOccurs after delete
SavingOccurs before save
SavedOccurs after save
StatusChangingOccurs before a shipment status has changed
StatusChangedOccurs after a shipment status has changed
UpdatedOrderSpecial event that fires when an order record is updated

Interface on GitHub

https://github.com/Merchello/Merchello/blob/master/src/Merchello.Core/Services/Interfaces/IShipmentService.cs