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 {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new BillaBear.UsageApi();
let body = new BillaBear.CustomerIdUasgelimitBody(); // CustomerIdUasgelimitBody |
let customerId = "customerId_example"; // String | The id of the customer to retrieve
apiInstance.createCustomerUsageLimit(body, customerId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| 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 {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new BillaBear.UsageApi();
let body = new BillaBear.Event(); // Event |
apiInstance.createEvent(body, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| 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 {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new BillaBear.UsageApi();
let customerId = "customerId_example"; // String | The id of the customer to retrieve
let usageLimitId = "usageLimitId_example"; // String | The id of the usage limit
apiInstance.customerCustomerIdUasgeLimitLimitIdDelete(customerId, usageLimitId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});| 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 {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new BillaBear.UsageApi();
let customerId = "customerId_example"; // String | The id of the customer to retrieve
apiInstance.getCustomerCosts(customerId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| 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 {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';
let apiInstance = new BillaBear.UsageApi();
let customerId = "customerId_example"; // String | The id of the customer to retrieve
apiInstance.getCustomerUsageLimitsById(customerId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});| Name | Type | Description | Notes |
|---|---|---|---|
| customerId | String | The id of the customer to retrieve |
- Content-Type: Not defined
- Accept: application/json