This project is intended to be a very lean .NET wrapper for kilometer.io API.
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");
To create a new user, use the CreateUser
method. The second parameter, userProperties
is 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"
});
To update an existing user, user the UpdateUser
method. The second parameter, userProperties
is an object that must contains the properties you want to persist in kilometer.io.
await client.UpdateUser("USER_ID", new {
Email = "newemail@email.com"
});
To cancel a user, user the CancelUser
method.
await client.CancelUser("USER_ID");
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);