All URIs are relative to https://{customerId}.billabear.cloud/api/v1
Method | HTTP request | Description |
---|---|---|
createCustomerUsageLimit | POST /customer/{customerId}/uasge-limit | Create Usage Limit |
createEvent | POST /events | Create Event |
customerCustomerIdUasgeLimitLimitIdDelete | DELETE /customer/{customerId}/uasge-limit/{limitId} | Delete Usage Limit |
getCustomerCosts | GET /customer/{customerId}/costs | Usage Cost Estimate |
getCustomerUsageLimitsById | GET /customer/{customerId}/uasge-limit | Fetch Customer Usage Limits |
UsageLimit createCustomerUsageLimit(body, customerId)
Create Usage Limit
Create Usage Limit for the custoemr
// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.UsageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsageApi apiInstance = new UsageApi();
CustomerIdUasgelimitBody body = new CustomerIdUasgelimitBody(); // CustomerIdUasgelimitBody |
String customerId = "customerId_example"; // String | The id of the customer to retrieve
try {
UsageLimit result = apiInstance.createCustomerUsageLimit(body, customerId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsageApi#createCustomerUsageLimit");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | CustomerIdUasgelimitBody | ||
customerId | String | The id of the customer to retrieve |
- Content-Type: application/json
- Accept: application/json
createEvent(body)
Create Event
Creates an event that is used for usage billing
// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.UsageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsageApi apiInstance = new UsageApi();
Event body = new Event(); // Event |
try {
apiInstance.createEvent(body);
} catch (ApiException e) {
System.err.println("Exception when calling UsageApi#createEvent");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | Event |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
customerCustomerIdUasgeLimitLimitIdDelete(customerId, usageLimitId)
Delete Usage Limit
Delete Usage Limit for the custoemr
// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.UsageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsageApi apiInstance = new UsageApi();
String customerId = "customerId_example"; // String | The id of the customer to retrieve
String usageLimitId = "usageLimitId_example"; // String | The id of the usage limit
try {
apiInstance.customerCustomerIdUasgeLimitLimitIdDelete(customerId, usageLimitId);
} catch (ApiException e) {
System.err.println("Exception when calling UsageApi#customerCustomerIdUasgeLimitLimitIdDelete");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | The id of the customer to retrieve | |
usageLimitId | String | The id of the usage limit |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
InlineResponse2001 getCustomerCosts(customerId)
Usage Cost Estimate
The estimated costs from usage based billing for a customer
// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.UsageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsageApi apiInstance = new UsageApi();
String customerId = "customerId_example"; // String | The id of the customer to retrieve
try {
InlineResponse2001 result = apiInstance.getCustomerCosts(customerId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsageApi#getCustomerCosts");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | The id of the customer to retrieve |
- Content-Type: Not defined
- Accept: application/json
InlineResponse2005 getCustomerUsageLimitsById(customerId)
Fetch Customer Usage Limits
Usage Limits for a specific customer
// Import classes:
//import com.billabear.sdk.invoker.ApiClient;
//import com.billabear.sdk.invoker.ApiException;
//import com.billabear.sdk.invoker.Configuration;
//import com.billabear.sdk.invoker.auth.*;
//import com.billabear.sdk.api.UsageApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
UsageApi apiInstance = new UsageApi();
String customerId = "customerId_example"; // String | The id of the customer to retrieve
try {
InlineResponse2005 result = apiInstance.getCustomerUsageLimitsById(customerId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsageApi#getCustomerUsageLimitsById");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
customerId | String | The id of the customer to retrieve |
- Content-Type: Not defined
- Accept: application/json