Get Shipping Methods

Developer tasks for using service method GetShippingMethods.

GetShippingMethods is used to retrieve the available shipping methods from Commerce Server to be used with the order system and placing orders.

At your Visual Studio Solution setup:

  1. Reference the Sitecore.Commerce.Connect.CommerceServer and Sitecore.Commerce.dll.
  2. Select the class in your solution where you want to use this service method.
  3. To use the service method, paste the following code:
    var provider = new CommerceOrderServiceProvider();
    var request = new GetShippingMethodsRequest("en-us");
    var result = provider.GetShippingMethods(request);
    var shippingMethods = result.ShippingMethods;