Skip to main content
Create a usage entry
curl --request POST \
  --url https://api.salesbricks.com/api/v2/usage/ \
  --header 'Content-Type: application/json' \
  --header 'X-SALESBRICKS-KEY: <api-key>' \
  --data '
{
  "transaction_id": "<string>",
  "subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "value": 123,
  "time": "2023-11-07T05:31:56Z",
  "count": 123,
  "properties": "<unknown>"
}
'
{
  "message": "Usage entry submitted successfully."
}

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Body

Request serializer for creating a usage entry.

transaction_id
string
required

A unique identifier for this usage entry. Used to prevent duplicate entries and for later updates/deletes.

Maximum string length: 255
subscription_id
string<uuid>
required

The ID of the subscription this usage entry belongs to.

brick_id
string<uuid>
required

The ID of the metered brick this usage is for.

value
integer
required

The usage value to record (e.g., number of API calls, GB used).

time
string<date-time>
required

The timestamp when this usage occurred (ISO 8601 format).

count
integer

Deprecated: Use 'value' instead.

properties
any | null

Optional JSON object with additional properties for this usage entry.

Response

message
string
required

Success message indicating the usage entry was submitted.

warnings
object[]

Optional list of warnings, such as deprecation notices.