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 |
\BillaBear\Model\UsageLimit createCustomerUsageLimit($body, $customer_id)
Create Usage Limit
Create Usage Limit for the custoemr
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\UsageApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \BillaBear\Model\CustomerIdUasgelimitBody(); // \BillaBear\Model\CustomerIdUasgelimitBody |
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve
try {
$result = $apiInstance->createCustomerUsageLimit($body, $customer_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UsageApi->createCustomerUsageLimit: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \BillaBear\Model\CustomerIdUasgelimitBody | ||
customer_id | string | The id of the customer to retrieve |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createEvent($body)
Create Event
Creates an event that is used for usage billing
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\UsageApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \BillaBear\Model\Event(); // \BillaBear\Model\Event |
try {
$apiInstance->createEvent($body);
} catch (Exception $e) {
echo 'Exception when calling UsageApi->createEvent: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \BillaBear\Model\Event |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
customerCustomerIdUasgeLimitLimitIdDelete($customer_id, $usage_limit_id)
Delete Usage Limit
Delete Usage Limit for the custoemr
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\UsageApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve
$usage_limit_id = "usage_limit_id_example"; // string | The id of the usage limit
try {
$apiInstance->customerCustomerIdUasgeLimitLimitIdDelete($customer_id, $usage_limit_id);
} catch (Exception $e) {
echo 'Exception when calling UsageApi->customerCustomerIdUasgeLimitLimitIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
customer_id | string | The id of the customer to retrieve | |
usage_limit_id | string | The id of the usage limit |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\BillaBear\Model\InlineResponse2001 getCustomerCosts($customer_id)
Usage Cost Estimate
The estimated costs from usage based billing for a customer
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\UsageApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve
try {
$result = $apiInstance->getCustomerCosts($customer_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UsageApi->getCustomerCosts: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
customer_id | string | The id of the customer to retrieve |
\BillaBear\Model\InlineResponse2001
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\BillaBear\Model\InlineResponse2005 getCustomerUsageLimitsById($customer_id)
Fetch Customer Usage Limits
Usage Limits for a specific customer
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = BillaBear\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = BillaBear\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$apiInstance = new BillaBear\Api\UsageApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$customer_id = "customer_id_example"; // string | The id of the customer to retrieve
try {
$result = $apiInstance->getCustomerUsageLimitsById($customer_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling UsageApi->getCustomerUsageLimitsById: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
customer_id | string | The id of the customer to retrieve |
\BillaBear\Model\InlineResponse2005
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]