cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/usages" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"usage": {
"charge_item_id": "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period": "2026-10-01-2026-10-31",
"quantity": 1,
"start_time": "2026-10-01T09:00:00Z",
"end_time": "2026-10-01T09:05:00Z",
"type": "INCREMENTAL"
}
}'from exsited import build_client
client = build_client()
response = client.usages.create_usage(
{
"usage": {
"charge_item_id": "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period": "2026-10-01-2026-10-31",
"quantity": 1,
"start_time": "2026-10-01T09:00:00Z",
"end_time": "2026-10-01T09:05:00Z",
"type": "INCREMENTAL",
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.usages.createUsage({
usage: {
charge_item_id: '6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c',
charging_period: '2026-10-01-2026-10-31',
quantity: 1,
start_time: '2026-10-01T09:00:00Z',
end_time: '2026-10-01T09:05:00Z',
type: 'INCREMENTAL',
},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->usages->createUsage([
'usage' => [
'charge_item_id' => '6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c',
'charging_period' => '2026-10-01-2026-10-31',
'quantity' => 1,
'start_time' => '2026-10-01T09:00:00Z',
'end_time' => '2026-10-01T09:05:00Z',
'type' => 'INCREMENTAL',
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.usages.usages_dto.UsagesDto;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<UsagesDto.Usages> response = client.usages().createUsage(
Map.of(
"usage", Map.of(
"charge_item_id", "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period", "2026-10-01-2026-10-31",
"quantity", 1,
"start_time", "2026-10-01T09:00:00Z",
"end_time", "2026-10-01T09:05:00Z",
"type", "INCREMENTAL")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Usages.CreateUsageAsync(new Dictionary<string, object?>
{
["usage"] = new Dictionary<string, object?>
{
["charge_item_id"] = "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
["charging_period"] = "2026-10-01-2026-10-31",
["quantity"] = 1,
["start_time"] = "2026-10-01T09:00:00Z",
["end_time"] = "2026-10-01T09:05:00Z",
["type"] = "INCREMENTAL",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.usages.createUsage({
'usage': {
'charge_item_id': '6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c',
'charging_period': '2026-10-01-2026-10-31',
'quantity': 1,
'start_time': '2026-10-01T09:00:00Z',
'end_time': '2026-10-01T09:05:00Z',
'type': 'INCREMENTAL',
},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Usages().CreateUsage(context.Background(), map[string]any{
"usage": map[string]any{
"charge_item_id": "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period": "2026-10-01-2026-10-31",
"quantity": 1,
"start_time": "2026-10-01T09:00:00Z",
"end_time": "2026-10-01T09:05:00Z",
"type": "INCREMENTAL",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"usage": {
"object": "<string>",
"id": "<string>",
"event_id": "<string>",
"href": "<string>",
"activity_logs": "<array>"
},
"usages": {
"activity_logs": "<array>",
"failed": [
{
"charge_item_id": "<string>",
"charging_period": "<string>",
"error": {}
}
],
"success": [
{
"href": "<string>",
"id": "<string>",
"object": "<string>"
}
]
}
}{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Usages
Create usages
Records one usage, or several in one call, against a metered order line.
POST
/
usages
cURL
curl -X POST "$EXSITED_BASE_URL/api/v4/usages" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"usage": {
"charge_item_id": "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period": "2026-10-01-2026-10-31",
"quantity": 1,
"start_time": "2026-10-01T09:00:00Z",
"end_time": "2026-10-01T09:05:00Z",
"type": "INCREMENTAL"
}
}'from exsited import build_client
client = build_client()
response = client.usages.create_usage(
{
"usage": {
"charge_item_id": "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period": "2026-10-01-2026-10-31",
"quantity": 1,
"start_time": "2026-10-01T09:00:00Z",
"end_time": "2026-10-01T09:05:00Z",
"type": "INCREMENTAL",
}
}
)
print(response.data)
import {buildClient} from 'exsited';
const client = await buildClient();
const response = await client.usages.createUsage({
usage: {
charge_item_id: '6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c',
charging_period: '2026-10-01-2026-10-31',
quantity: 1,
start_time: '2026-10-01T09:00:00Z',
end_time: '2026-10-01T09:05:00Z',
type: 'INCREMENTAL',
},
});
console.log(response.data);
use Exsited\Client\ClientRegistry;
$client = ClientRegistry::buildClient();
$response = $client->usages->createUsage([
'usage' => [
'charge_item_id' => '6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c',
'charging_period' => '2026-10-01-2026-10-31',
'quantity' => 1,
'start_time' => '2026-10-01T09:00:00Z',
'end_time' => '2026-10-01T09:05:00Z',
'type' => 'INCREMENTAL',
],
]);
print_r($response->data);
import com.exsited.client.ApiResponse;
import com.exsited.client.ClientRegistry;
import com.exsited.client.ExsitedClient;
import com.exsited.resources.usages.usages_dto.UsagesDto;
import java.util.Map;
ExsitedClient client = ClientRegistry.buildClient();
ApiResponse<UsagesDto.Usages> response = client.usages().createUsage(
Map.of(
"usage", Map.of(
"charge_item_id", "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period", "2026-10-01-2026-10-31",
"quantity", 1,
"start_time", "2026-10-01T09:00:00Z",
"end_time", "2026-10-01T09:05:00Z",
"type", "INCREMENTAL")));
System.out.println(response.getMap());
using Exsited.Client;
await using var client = ExsitedClient.BuildClient();
var response = await client.Usages.CreateUsageAsync(new Dictionary<string, object?>
{
["usage"] = new Dictionary<string, object?>
{
["charge_item_id"] = "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
["charging_period"] = "2026-10-01-2026-10-31",
["quantity"] = 1,
["start_time"] = "2026-10-01T09:00:00Z",
["end_time"] = "2026-10-01T09:05:00Z",
["type"] = "INCREMENTAL",
},
});
Console.WriteLine(response.Json);
import 'package:exsited/exsited.dart';
final client = buildClient();
final response = await client.usages.createUsage({
'usage': {
'charge_item_id': '6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c',
'charging_period': '2026-10-01-2026-10-31',
'quantity': 1,
'start_time': '2026-10-01T09:00:00Z',
'end_time': '2026-10-01T09:05:00Z',
'type': 'INCREMENTAL',
},
});
print(response.map);
import (
"context"
"fmt"
"log"
exsited "github.com/exsited/exsited-sdk-go/v4"
)
client, err := exsited.BuildClient(nil)
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Usages().CreateUsage(context.Background(), map[string]any{
"usage": map[string]any{
"charge_item_id": "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"charging_period": "2026-10-01-2026-10-31",
"quantity": 1,
"start_time": "2026-10-01T09:00:00Z",
"end_time": "2026-10-01T09:05:00Z",
"type": "INCREMENTAL",
},
}, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Map)
{
"usage": {
"object": "<string>",
"id": "<string>",
"event_id": "<string>",
"href": "<string>",
"activity_logs": "<array>"
},
"usages": {
"activity_logs": "<array>",
"failed": [
{
"charge_item_id": "<string>",
"charging_period": "<string>",
"error": {}
}
],
"success": [
{
"href": "<string>",
"id": "<string>",
"object": "<string>"
}
]
}
}{
"object": "<string>",
"request_id": "<string>",
"status": 123,
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"errors": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>"
}
]
}Send one usage as an object under
usage, or several as a list under usages. charge_item_id is the id of an order line whose item is charged as METERED, and charging_period names the billing period the usage falls in. For several usages the response lists each one under usages.success or usages.failed.
The SDK samples get their client from credentials your app registers once when it starts, as shown in Authentication. To try the call here, click Try it, set
host to your Exsited API host name and paste an access token from Get an access token. To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its -d payload.Authorizations
An access token from POST /api/v4/oauth2/token. The SDKs get and renew it for you.
Body
application/json