CdekSdk.CalculateTariffList

CSharp · Console

/Program.cs

using System;
using CdekSdk;
using CdekSdk.DataContracts;

public class Program
{
	public static void Main()
	{
		var client = new CdekClient
		{
			// Tracer = Console.WriteLine // optional: trace API calls to the console
		};

		// calculate tariff list
		var tariffs = client.CalculateTariffList(new TariffListRequest
		{
			DeliveryType = DeliveryType.Delivery,
			Date = DateTime.Today,
			Lang = Lang.Eng,
			FromLocation = new Location { CityCode = 270 },
			ToLocation = new Location { CityCode = 44 },
			Packages =
			{
				new PackageSize
				{
					Weight = 4000,
					Height = 10,
					Width = 10,
					Length = 10,
				}
			}
		});
		
		// display server's response
		FiddleHelper.WriteTable(tariffs.TariffCodes);
	}
}
;