Update Usage: /usages/{usage_uuid}
Purpose
This API is used to fully update an existing usage record. It replaces the existing data with the new provided data, ensuring the usage record reflects the latest and most accurate information.
Use Case
This API is useful when a usage entry must be completely redefined. For example, when the total quantity used during a billing cycle is finalized or when the entire record needs correction after an audit.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| usage_uuid | UUID | Unique identifier of the usage record to be updated. |
Query Parameters
This endpoint does not have any query parameters.
Request Body
{
"usage": {
"quantity": "{{quantity}}",
"end_time": "{{end_time}}"
// "custom_attributes": [
// {
// "name": "{{attribute_name}}",
// "value": "{{attribute_value}}"
// }
// ]
}
}
| Attribute | Type | Description |
|---|---|---|
| usage | Object | Container for usage data. |
| quantity | String | Total quantity to be updated for the usage record. |
| end_time | DateTime | Updated end time of the usage record in YYYY-MM-DD HH:MM:SS format. |
| custom_attributes | Array | Optional list of user-defined custom attributes. |
| name | String | Name of the custom attribute. |
| value | String | Value of the custom attribute. |
Response
The response returns the updated usage record containing all relevant fields after the complete update. It includes usage details such as UUID, version, associated charge item information, charging period, quantity, timestamps, and system metadata like creator and last updater. This confirms that the record has been successfully overwritten with the provided data.
Response Body
{
"usage": {
"uuid": "{{usage_uuid}}",
"version": "{{version}}",
"charge_item_uuid": "{{charge_item_uuid}}",
"charge_item_name": "{{charge_item_name}}",
"charging_period": "{{charging_period}}",
"quantity": "{{quantity}}",
"uom": "{{uom}}",
"start_time": "{{start_time}}",
"end_time": "{{end_time}}",
"type": "{{type}}",
"charge_status": "{{charge_status}}",
"source": "{{source}}",
"created_by": "{{created_by}}",
"created_on": "{{created_on}}",
"last_updated_by": "{{last_updated_by}}",
"last_updated_on": "{{last_updated_on}}",
"custom_attributes": []
}
}
| Attribute | Type | Description |
|---|---|---|
| usage | Object | Contains the fully updated usage record details. |
| uuid | UUID | Unique identifier of the usage record. |
| version | String | Version number of the record after full update. |
| charge_item_uuid | UUID | Identifier of the associated charge item. |
| charge_item_name | String | Name of the charge item linked with the usage. |
| charging_period | String | The period applicable for the usage. |
| quantity | String | Updated total quantity for the usage record. |
| uom | String | Unit of measurement used for the usage. |
| start_time | DateTime | Start time of the recorded usage. |
| end_time | DateTime | Updated end time of the recorded usage. |
| type | String | Type of the usage (example: INCREMENTAL). |
| charge_status | String | Status of the associated charge (example: ACTIVE). |
| source | String | Indicates the origin of the record if available. |
| created_by | String | User who created the record. |
| created_on | DateTime | Creation timestamp of the record. |
| last_updated_by | String | User who last updated the record. |
| last_updated_on | DateTime | Last updated timestamp. |
| custom_attributes | Array | List of custom attributes, if defined. |