Lago API allows your application to push customer information and metrics (events) from your application to the billing application.
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 0.36.0-beta
- SDK version: 1.0.0
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- RestSharp - 106.13.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.
Generate the DLL using your preferred tool (e.g. dotnet build
)
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.getlago.com/api/v1";
// Configure Bearer token for authorization: bearerAuth
config.AccessToken = "YOUR_BEARER_TOKEN";
var apiInstance = new AddOnsApi(config);
var appliedAddOnInput = new AppliedAddOnInput(); // AppliedAddOnInput | Apply add-on payload
try
{
// Apply an add-on to a customer
AppliedAddOn result = apiInstance.ApplyAddOn(appliedAddOnInput);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AddOnsApi.ApplyAddOn: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
All URIs are relative to https://api.getlago.com/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
AddOnsApi | ApplyAddOn | POST /applied_add_ons | Apply an add-on to a customer |
AddOnsApi | CreateAddOn | POST /add_ons | Create a new add-on |
AddOnsApi | DestroyAddOn | DELETE /add_ons/{code} | Delete an add-on |
AddOnsApi | FindAddOn | GET /add_ons/{code} | Find add-on by code |
AddOnsApi | FindAllAddOns | GET /add_ons | Find add-ons |
AddOnsApi | UpdateAddOn | PUT /add_ons/{code} | Update an existing add-on |
BillableMetricsApi | CreateBillableMetric | POST /billable_metrics | Create a new billable metric |
BillableMetricsApi | DestroyBillableMetric | DELETE /billable_metrics/{code} | Delete a billable metric |
BillableMetricsApi | FindAllBillableMetricGroups | GET /billable_metrics/{code}/groups | Find Billable metric groups |
BillableMetricsApi | FindAllBillableMetrics | GET /billable_metrics | Find Billable metrics |
BillableMetricsApi | FindBillableMetric | GET /billable_metrics/{code} | Find billable metric by code |
BillableMetricsApi | UpdateBillableMetric | PUT /billable_metrics/{code} | Update an existing billable metric |
CouponsApi | ApplyCoupon | POST /applied_coupons | Apply a coupon to a customer |
CouponsApi | CreateCoupon | POST /coupons | Create a new coupon |
CouponsApi | DestroyCoupon | DELETE /coupons/{code} | Delete a coupon |
CouponsApi | FindAllAppliedCoupons | GET /applied_coupons | Find Applied Coupons |
CouponsApi | FindAllCoupons | GET /coupons | Find Coupons |
CouponsApi | FindCoupon | GET /coupons/{code} | Find coupon by code |
CouponsApi | UpdateCoupon | PUT /coupons/{code} | Update an existing coupon |
CreditNotesApi | CreateCreditNote | POST /credit_notes | Create a new Credit note |
CreditNotesApi | DownloadCreditNote | POST /credit_notes/{id}/download | Download an existing credit note |
CreditNotesApi | FindAllCreditNotes | GET /credit_notes | Find Credit notes |
CreditNotesApi | FindCreditNote | GET /credit_notes/{id} | Find credit note |
CreditNotesApi | UpdateCreditNote | PUT /credit_notes/{id} | Update an existing credit note |
CreditNotesApi | VoidCreditNote | PUT /credit_notes/{id}/void | Void existing credit note |
CustomersApi | CreateCustomer | POST /customers | Create a customer |
CustomersApi | DeleteAppliedCoupon | DELETE /customers/{customer_external_id}/applied_coupons/{applied_coupon_id} | Delete customer's appplied coupon |
CustomersApi | DestroyCustomer | DELETE /customers/{external_id} | Delete a customer |
CustomersApi | FindAllCustomers | GET /customers | Find customers |
CustomersApi | FindCustomer | GET /customers/{external_id} | Find customer by external ID |
CustomersApi | FindCustomerCurrentUsage | GET /customers/{customer_external_id}/current_usage | Find customer current usage |
CustomersApi | GetCustomerPortalUrl | GET /customers/{customer_external_id}/portal_url | Get customer portal URL |
EventsApi | CreateBatchEvents | POST /events/batch | Create batch events |
EventsApi | CreateEvent | POST /events | Create a new event |
EventsApi | EventEstimateFees | POST /events/estimate_fees | Estimate fees for an pay in advance charge |
EventsApi | FindEvent | GET /events/{id} | Find event by transaction ID |
FeesApi | FindAllFees | GET /fees | Find all fees |
FeesApi | FindFee | GET /fees/{id} | Find fee by ID |
FeesApi | UpdateFee | PUT /fees/{id} | Update an existing fee |
InvoicesApi | CreateInvoice | POST /invoices | Create a new invoice |
InvoicesApi | DownloadInvoice | POST /invoices/{id}/download | Download an existing invoice |
InvoicesApi | FinalizeInvoice | PUT /invoices/{id}/finalize | Finalize a draft invoice |
InvoicesApi | FindAllInvoices | GET /invoices | Find all invoices |
InvoicesApi | FindInvoice | GET /invoices/{id} | Find invoice by ID |
InvoicesApi | RefreshInvoice | PUT /invoices/{id}/refresh | Refresh a draft invoice |
InvoicesApi | RetryPayment | POST /invoices/{id}/retry_payment | Retry invoice payment |
InvoicesApi | UpdateInvoice | PUT /invoices/{id} | Update an existing invoice status |
OrganizationsApi | UpdateOrganization | PUT /organizations | Update an existing Organization |
PlansApi | CreatePlan | POST /plans | Create a new plan |
PlansApi | DestroyPlan | DELETE /plans/{code} | Delete a plan |
PlansApi | FindAllPlans | GET /plans | Find plans |
PlansApi | FindPlan | GET /plans/{code} | Find plan by code |
PlansApi | UpdatePlan | PUT /plans/{code} | Update an existing plan |
SubscriptionsApi | CreateSubscription | POST /subscriptions | Assign a plan to a customer |
SubscriptionsApi | DestroySubscription | DELETE /subscriptions/{external_id} | Terminate a subscription |
SubscriptionsApi | FindAllSubscriptions | GET /subscriptions | Find subscriptions |
SubscriptionsApi | UpdateSubscription | PUT /subscriptions/{external_id} | Update an existing subscription |
WalletsApi | CreateWallet | POST /wallets | Create a new wallet |
WalletsApi | CreateWalletTransaction | POST /wallet_transactions | Create a new wallet transaction |
WalletsApi | DestroyWallet | DELETE /wallets/{id} | Delete a wallet |
WalletsApi | FindAllWalletTransactions | GET /wallets/{id}/wallet_transactions | Find wallet transactions |
WalletsApi | FindAllWallets | GET /wallets | Find wallets |
WalletsApi | FindWallet | GET /wallets/{id} | Find wallet |
WalletsApi | UpdateWallet | PUT /wallets/{id} | Update an existing wallet |
WebhooksApi | FetchPublicKey | GET /webhooks/public_key | Fetch webhook public key |
- Model.AddOn
- Model.AddOnInput
- Model.AddOnInputAddOn
- Model.AddOnObject
- Model.AddOnsPaginated
- Model.ApiResponseBadRequest
- Model.ApiResponseForbidden
- Model.ApiResponseNotAllowed
- Model.ApiResponseNotFound
- Model.ApiResponseUnauthorized
- Model.ApiResponseUnprocessableEntity
- Model.AppliedAddOn
- Model.AppliedAddOnInput
- Model.AppliedAddOnInputAppliedAddOn
- Model.AppliedAddOnObject
- Model.AppliedCoupon
- Model.AppliedCouponInput
- Model.AppliedCouponInputAppliedCoupon
- Model.AppliedCouponObject
- Model.AppliedCouponObjectExtended
- Model.AppliedCouponObjectExtendedAllOf
- Model.AppliedCouponsPaginated
- Model.BatchEventInput
- Model.BatchEventInputEvent
- Model.BillableMetric
- Model.BillableMetricGroup
- Model.BillableMetricGroupValuesInner
- Model.BillableMetricInput
- Model.BillableMetricInputBillableMetric
- Model.BillableMetricObject
- Model.BillableMetricsPaginated
- Model.BillingConfigurationCustomer
- Model.BillingConfigurationOrganization
- Model.ChargeObject
- Model.ChargeUsageObject
- Model.ChargeUsageObjectBillableMetric
- Model.ChargeUsageObjectCharge
- Model.ChargeUsageObjectGroupsInner
- Model.Coupon
- Model.CouponInput
- Model.CouponInputCoupon
- Model.CouponInputCouponAppliesTo
- Model.CouponObject
- Model.CouponsPaginated
- Model.CreditNote
- Model.CreditNoteInput
- Model.CreditNoteInputCreditNote
- Model.CreditNoteInputCreditNoteItemsInner
- Model.CreditNoteItemObject
- Model.CreditNoteObject
- Model.CreditNoteUpdateInput
- Model.CreditNoteUpdateInputCreditNote
- Model.CreditNotes
- Model.CreditObject
- Model.CreditObjectInvoice
- Model.CreditObjectItem
- Model.Customer
- Model.CustomerInput
- Model.CustomerInputCustomer
- Model.CustomerInputCustomerMetadataInner
- Model.CustomerMetadataObject
- Model.CustomerObject
- Model.CustomerUsage
- Model.CustomerUsageObject
- Model.CustomersPaginated
- Model.Event
- Model.EventEstimateFeesInput
- Model.EventEstimateFeesInputEvent
- Model.EventInput
- Model.EventInputEvent
- Model.EventObject
- Model.FeeObject
- Model.FeeObjectItem
- Model.FeeUpdateInput
- Model.FeeUpdateInputInvoice
- Model.Fees
- Model.FeesPaginated
- Model.FeesPaginatedAllOf
- Model.GetCustomerPortalUrl200Response
- Model.GetCustomerPortalUrl200ResponseCustomer
- Model.GroupObject
- Model.GroupPropertiesObject
- Model.GroupsPaginated
- Model.Invoice
- Model.InvoiceInput
- Model.InvoiceInputInvoice
- Model.InvoiceInputInvoiceMetadataInner
- Model.InvoiceMetadataObject
- Model.InvoiceObject
- Model.InvoiceObjectExtended
- Model.InvoiceObjectExtendedAllOf
- Model.InvoiceOneOffInput
- Model.InvoiceOneOffInputInvoice
- Model.InvoiceOneOffInputInvoiceFeesInner
- Model.InvoicesPaginated
- Model.Organization
- Model.OrganizationInput
- Model.OrganizationInputOrganization
- Model.OrganizationObject
- Model.PaginationMeta
- Model.Plan
- Model.PlanInput
- Model.PlanInputPlan
- Model.PlanInputPlanChargesInner
- Model.PlanInputPlanChargesInnerGroupPropertiesInner
- Model.PlanObject
- Model.PlansPaginated
- Model.Subscription
- Model.SubscriptionCreateInput
- Model.SubscriptionCreateInputSubscription
- Model.SubscriptionObject
- Model.SubscriptionUpdateInput
- Model.SubscriptionUpdateInputSubscription
- Model.SubscriptionsPaginated
- Model.Wallet
- Model.WalletInput
- Model.WalletInputWallet
- Model.WalletObject
- Model.WalletTransactionInput
- Model.WalletTransactionInputWalletTransaction
- Model.WalletTransactionObject
- Model.WalletTransactions
- Model.WalletTransactionsPaginated
- Model.WalletUpdateInput
- Model.WalletUpdateInputWallet
- Model.WalletsPaginated
Authentication schemes defined for the API:
- Type: Bearer Authentication