All URIs are relative to https://api.getlago.com/api/v1
Method | HTTP request | Description |
---|---|---|
createBatchEvents | POST /events/batch | Batch multiple events |
createEvent | POST /events | Send usage events |
eventEstimateFees | POST /events/estimate_fees | Estimate fees for a pay in advance charge |
findEvent | GET /events/{transaction_id} | Retrieve a specific event |
createBatchEvents(eventBatchInput)
Batch multiple events
This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
// Import classes:
import org.getlago.client.ApiClient;
import org.getlago.client.ApiException;
import org.getlago.client.Configuration;
import org.getlago.client.auth.*;
import org.getlago.client.models.*;
import org.getlago.client.api.EventsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.getlago.com/api/v1");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
EventsApi apiInstance = new EventsApi(defaultClient);
EventBatchInput eventBatchInput = new EventBatchInput(); // EventBatchInput | Batch events payload
try {
apiInstance.createBatchEvents(eventBatchInput);
} catch (ApiException e) {
System.err.println("Exception when calling EventsApi#createBatchEvents");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
eventBatchInput | EventBatchInput | Batch events payload |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Event received | - |
400 | Bad Request error | - |
401 | Unauthorized error | - |
422 | Unprocessable entity error | - |
Event createEvent(eventInput)
Send usage events
This endpoint is used for transmitting usage measurement events to either a designated customer or a specific subscription.
// Import classes:
import org.getlago.client.ApiClient;
import org.getlago.client.ApiException;
import org.getlago.client.Configuration;
import org.getlago.client.auth.*;
import org.getlago.client.models.*;
import org.getlago.client.api.EventsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.getlago.com/api/v1");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
EventsApi apiInstance = new EventsApi(defaultClient);
EventInput eventInput = new EventInput(); // EventInput | Event payload
try {
Event result = apiInstance.createEvent(eventInput);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EventsApi#createEvent");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
eventInput | EventInput | Event payload |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Event | - |
400 | Bad Request error | - |
401 | Unauthorized error | - |
422 | Unprocessable entity error | - |
Fees eventEstimateFees(eventEstimateFeesInput)
Estimate fees for a pay in advance charge
Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance charges
// Import classes:
import org.getlago.client.ApiClient;
import org.getlago.client.ApiException;
import org.getlago.client.Configuration;
import org.getlago.client.auth.*;
import org.getlago.client.models.*;
import org.getlago.client.api.EventsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.getlago.com/api/v1");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
EventsApi apiInstance = new EventsApi(defaultClient);
EventEstimateFeesInput eventEstimateFeesInput = new EventEstimateFeesInput(); // EventEstimateFeesInput | Event estimate payload
try {
Fees result = apiInstance.eventEstimateFees(eventEstimateFeesInput);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EventsApi#eventEstimateFees");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
eventEstimateFeesInput | EventEstimateFeesInput | Event estimate payload |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Fees estimate | - |
400 | Bad Request error | - |
401 | Unauthorized error | - |
404 | Not Found error | - |
422 | Unprocessable entity error | - |
Event findEvent(transactionId)
Retrieve a specific event
This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
// Import classes:
import org.getlago.client.ApiClient;
import org.getlago.client.ApiException;
import org.getlago.client.Configuration;
import org.getlago.client.auth.*;
import org.getlago.client.models.*;
import org.getlago.client.api.EventsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.getlago.com/api/v1");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
EventsApi apiInstance = new EventsApi(defaultClient);
String transactionId = "transaction_1234567890"; // String | This field represents the unique identifier sent for this specific event.
try {
Event result = apiInstance.findEvent(transactionId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EventsApi#findEvent");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
transactionId | String | This field represents the unique identifier sent for this specific event. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Event | - |
401 | Unauthorized error | - |
404 | Not Found error | - |