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": "12345",
  "subscription_id": "00000000-0000-0000-0000-000000000000",
  "brick_id": "00000000-0000-0000-0000-000000000000",
  "value": 1,
  "properties": {
    "source": "api",
    "notes": "This is a test entry",
    "region": "US"
  },
  "time": "2024-09-16T10:15:30Z"
}'
{
  "message": "Usage entry submitted successfully."
}

To use this endpoint, ensure that you are using the v2/usage API endpoint:

https://api.salesbricks.com/api/v2/usage

Authorizations

X-SALESBRICKS-KEY
string
header
required

Use your Salesbricks API key to authenticate requests.

Body

application/json
transaction_id
string

The unique identifier for this usage entry transaction.

Example:

"12345"

subscription_id
string

The UUID of the Salesbricks subscription associated with the customer.

Example:

"00000000-0000-0000-0000-000000000000"

brick_id
string

The UUID of the associated Usage Brick.

Example:

"00000000-0000-0000-0000-000000000000"

value
integer

The value to set for the Brick.

Example:

1

properties
object

Additional properties for the usage entry.

Example:
{
  "source": "api",
  "notes": "This is a test entry",
  "region": "US"
}
time
string

The timestamp indicating when the operation occurs in ISO 8601 format.

Example:

"2024-09-16T10:15:30Z"

Response

201
application/json
Usage entry created successfully.
message
string
Example:

"Usage entry submitted successfully."