Service provider

Current version: 10.2

Each service layer has its own interface that you can customize. These providers contain the service methods for interacting with the appropriate subsystem. All service providers must inherit from the ServiceProvider class and we recommend that you have a generics version of the class in which each service method is generics based.

Sample service method:

public virtual GetCartsResult GetCarts([NotNull] GetCartsRequest request)
return this.RunPipeline<GetCartsRequest, GetCartsResult>(PipelineName.GetCarts, request);

Generics extension method example:

public static TGetCartsResult GetCarts<TGetCartsRequest, TGetCartsResult>([NotNull] this CartServiceProvider cartProvider, [NotNull] TGetCartsRequest request)
where TGetCartsRequest : GetCartsRequest
where TGetCartsResult : GetCartsResult, new()
return cartProvider.RunPipeline<GetCartsRequest, TGetCartsResult>(PipelineName.GetCarts, request);

If an existing service provider requires a new service method, consider extending the service provider and adding the new method instead of creating a new service provider. The following lists the various subsystems and their service providers:

  • Shopping Cart


  • Orders


  • Pricing


  • Product Synchronization


  • Customers and Users


  • Inventory


Do you have some feedback for us?

If you have suggestions for improving this article,