Skip to content

Retrieve Resource Statements

Access comprehensive financial records and billing statements for all resources, including transaction details, payment status, and temporal financial data.

HTTP Request

GET {API_URL}billing/resources/statements

Query Parameters

ParameterRequirementTypeDescription
limitOptionalintMaximum number of records to return
offsetOptionalintNumber of records to skip for pagination
sortFieldOptionalstringField identifier for result ordering
sortOrderOptionalstringSort direction: desc (descending) or asc (ascending)
filtersOptionalstringJSON-encoded filter criteria. Format: [{"key":"name","op":"contains","val":"hub"}]

Response Structure

status boolean

Operation result indicator. Returns true for successful execution, false when encountering an error.

message string

Descriptive response indicating the outcome of the statement retrieval request.

total int

Aggregate count of available records.

data object

Collection of financial statements containing detailed transaction records.

Statement Attributes
  • resource_id Unique resource identifier
  • resource_type Resource classification (vm for virtual machine, volume for storage)
  • status Transaction status
  • started_time Billing period commencement timestamp
  • due_time Payment deadline timestamp
  • type Transaction classification
  • amount Transaction value

Implementation Example

Request

bash
curl -X GET '{API_URL}billing/resources/statements' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'refresh-token: {REFRESH_TOKEN}' \
-H 'Content-Type: application/json'

Response

json
{
    "status": true,
    "message": "Financial statements retrieved successfully",
    "data": [
        {
            "id": "673f36d51f746bcc4b52c4b9",
            "resource_id": "66d08a01c0464845bb46e3af",
            "resource_type": "vm",
            "status": "paid",
            "started_time": 1725003272,
            "due_time": 1725003590,
            "type": "lease_fee",
            "amount": 2.5558
        },
        {
            "id": "6743ddea9164b541082003b8",
            "resource_id": "66d13748e0ec6a5d1d8ad82a",
            "resource_type": "vm",
            "status": "paid",
            "started_time": 1724987286,
            "due_time": 1724987341,
            "type": "lease_fee",
            "amount": 0.5112
        },
        {
            "id": "6758eaceaa5d7e0971fc5337",
            "resource_id": "66d175ce6d0d0c262463c3dd",
            "resource_type": "vm",
            "status": "paid",
            "started_time": 1724942899,
            "due_time": 1724943564,
            "type": "lease_fee",
            "amount": 5.6228
        }
    ],
    "total": 3
}