Show / Hide Table of Contents

Getting Started

Install the nuget package

You should install the NuGet package

Install-Package EC.ProductsAndPricing.Client

The package is hosted by the EC Visual Studio Online nuget feed so make sure that you've added it to you list of nuget feeds.

Creating a client instance

You can create a api client and use it to send messages to the API.

using System;
using EC.ProductsAndPricing.Client;
using EC.ProductsAndPricing.ServiceContract;

namespace Example 
{
    public static void Program
    {
        public static void Main()
        {
            ProductsAndPricingClientConfig cfg = new ProductsAndPricingClientConfig();
            cfg.BaseUri = new Uri("https://intsvcs.ecenglish.com/products-and-pricing");
            cfg.ApiKey = "XX787";

            ProductsAndPricingClient client = new ProductsAndPricingClient(cfg);

            QueryPriceRequest request = GetPricingRequest();
            QueryPriceResponse response = client.Post(request)

            Console.WriteLine("Price is {0}", response.GrossPrice});
        }

        static QueryPriceRequest GetPricingRequest()
        {
            return new QueryPriceRequest
            {
                // Details omitted for clarity
            };
        }
    }
}
  • Improve this Doc
Back to top Copyright © 2017 EC English