SDKs
...
Getting Started
.NET/C# Management SDK

Management SDK Configuration and Usage

9min
this guide is designed to help you configure your application and start using licensespring management sdk functionality as you navigate through this tutorial, you'll acquire the knowledge to issue licenses and manage orders within your net application configuration to initialize the sdk, you must fill in your licensespring management api key it can be found on your licensespring account under settings >keys note api keys for licensing and management sdks are different copy this value and create the configuration as shown below var configuration = new licensespring managementconfiguration( managementapikey ); now you can create managementservice using this configuration object var service = new managementservice( configuration ); creating licenses to create a key based license you need to generate a license key string productcode = "code"; var licensekeys = service licenseservice generatelicensekey( productcode ); then create a licensedetails object and set the necessary values var license1 = new licensedetails(); license1 licensekey = licensekeys\[0]; license1 enablemaintenanceperiod = true; license1 maintenanceduration = "3m"; now you can create an order var keybasedorderid = service orderservice createorder( new\[] { license1 }, productcode ); this method allows to specify order info such as customer var customer = new customer() { companyname = "testcompany", email = "someone\@test com" }; var orderinfo = new order( customer ); var keybasedorderid = service orderservice createorder( new\[] { license1 }, productcode, orderinfo ); managing orders use the returned order id to get order information and manage the order for example, get licenses from the order listordersrequestdto dto = new listordersrequestdto() { clientorderid = keybasedorderid }; uint count; var ret = service orderservice listorders( dto, out count ); license\[] licenses = null; if( count == 1 && ret != null ) licenses = service orderservice listorderlicenses( ret\[0] id ); you can also append licenses to an existing order licensekeys = service licenseservice generatelicensekey( productcode ); var license2 = new licensedetails { licensekey = licensekeys\[0], type = licensetype consumption, maxconsumptions = 100, allowoverages = true, maxoverages = 50, resetconsumption = true, consumptionperiod = consumptionperiod weekly }; orderinfo = new order( keybasedorderid, customer ); keybasedorderid = service orderservice createorder( new\[] { license2 }, productcode, orderinfo ); note one order cannot contain key based and user based licenses it contains licenses for one product user based licenses the process of creating a user based license is almost the same however, you do not need to generate keys also, ensure that the specified product is user based string productcode = "ubcode"; var license = new licensedetails { enablemaintenanceperiod = true, maintenanceduration = "7m", // 7 months type = licensetype consumption, maxconsumptions = 10 }; var userbasedorderid = service orderservice createorder( new\[] { license }, productcode ); to assign a user to the created license, retrieve the license using the order id as shown above and assign the user by license id licenseuser user = new licenseuser() { email = "example\@email com", ismanager = false }; service licenseservice assignuser( license id, user );