Use this API to set either a prorated gauge or increment a final value counter for a customer.
v2/usage REST API is designed to handle both setting a prorated gauge and incrementing a final value counter for a specific customer in Salesbricks.
v2/usage API endpoint:https://api.salesbricks.com/api/v2/usage| Field | Type | Required | Description |
|---|---|---|---|
transaction_id | String | Yes | The unique identifier for this usage entry transaction. |
subscription_id | UUID | Yes | The ID of the Salesbricks subscription associated with the customer. |
brick_id | UUID | Yes | The ID of the associated Usage Brick. |
value | Integer | Yes | Required. This is the value to set for the Counter or Gauge (e.g., 1). |
time | DateTime | Yes | The timestamp indicating when the operation occurs in ISO 8601 format. |
properties | Dict | No | Additional properties as a JSON dictionary object (optional). |
201 Created - if the usage entry is successfully submitted.400 Bad Request - if validation fails or required fields are missing.transaction_id in the request body.
| Field | Type | Required | Description |
|---|---|---|---|
transaction_id | String | Yes | The unique identifier for the usage entry. |
200 OK - if the usage entry is successfully deleted.404 Not Found - if the usage entry does not exist.transaction_id and the fields to be updated.
| Field | Type | Required | Description |
|---|---|---|---|
transaction_id | String | Yes | The unique identifier for the usage entry. |
value | Integer | Yes | Update the usage value. |
properties | Dict | Optional | Update the properties dictionary (if applicable). |
200 OK - if the usage entry is successfully updated.400 Bad Request - if validation fails or required fields are missing.404 Not Found - if the usage entry does not exist.