/kilometer-dotnet-client

.NET wrapper for Kilometer.io API.

Primary LanguageC#MIT LicenseMIT

Kilometer.io .NET Client

This project is intended to be a very lean .NET wrapper for kilometer.io API.

Build status NuGet infos

Get started

Install the package via the NuGet package manager console.

Install-Package Kilometer

Start by getting a new KilometerClient instance and set your app ID using SetAppId method.

var client = new KilometerClient()
    .SetAppId("YOUR_APP_ID");

Create new user

To create a new user, use the CreateUser method. The second parameter, userPropertiesis an object that must contains the properties you want to persist in kilometer.io.

await client.CreateUser("USER_ID", new {
    Email = "client@email.com",
    Subscription = "Monthly",
    FullName = "Client's name"
});

Update existing user

To update an existing user, user the UpdateUser method. The second parameter, userPropertiesis an object that must contains the properties you want to persist in kilometer.io.

await client.UpdateUser("USER_ID", new {
   Email = "newemail@email.com"
});

Cancelling a user

To cancel a user, user the CancelUser method.

await client.CancelUser("USER_ID");

Billing a user

To add a new bill to user revenues, use the BillUser method. The second parameter is the bill amount.

await client.BillUser("USER_ID", 20m);