Billing
Our APIs also expose platform usage, this information is available in two formats:
- CSV
- JSON
Usage information is divided by Server and by Template
Server Usage
To receive server usage, the following endpoint is exposed:
HTTP Request
GET /ecs/v2/billing/servers/<year>/<month>
Server Usage CSV
To obtain usage in CSV format, the "type" parameter must be used in the request query:
HTTP Request
GET /ecs/v2/billing/servers/<year>/<month>?type=csv
A response of type text/csv containing the requested usage will be received
Server Usage JSON
To obtain usage in JSON format, the "type" parameter must be used in the request query:
HTTP Request
GET /ecs/v2/billing/servers/<year>/<month>?type=json
[
{
"plan": "ECS1",
"name": "ec200200",
"group": null,
"notes": "centos-ecs1-it-fr2-1713866700891",
"status": "Booted",
"year": 2024,
"month": 4,
"creation_date": "2024-04-23T10:06:22.973332+00:00",
"deletion_date": null,
"billed_hours": 182,
"cost": 2.64,
"summary": {
"online_hour": 1,
"online_price": 0.02,
"offline_hour": 0,
"offline_discount": 20,
"offline_price": 0.0,
"offline_reduction": 0.0,
"reserved_discounts": [
{
"reserved_plan": 26,
"reserved_hour": 181,
"reserved_discount": 15,
"reserved_price": 2.62,
"reserved_reduction": 0.46,
"reserved_start_date": "2024-04-23T10:06:22.973332+00:00",
"reserved_end_date": "2024-10-23T10:06:22.973332+00:00"
}
],
"original_cost": 3.09
}
},
]
Template Usage
To receive template usage, the following endpoint is exposed:
HTTP Request
GET /ecs/v2/billing/templates/<year>/<month>
Template Usage CSV
To obtain usage in CSV format, the "type" parameter must be used in the request query:
HTTP Request
GET /ecs/v2/billing/templates/<year>/<month>?type=csv
A response of type text/csv containing the requested usage will be received
Template Usage JSON
To obtain usage in JSON format, the "type" parameter must be used in the request query:
HTTP Request
GET /ecs/v2/billing/templates/<year>/<month>?type=json
HTTP Response
[
{
"cost": 2,
"name": "ei100026",
"status": "Created",
"creation_date": "2024-04-16T08:19:04.106163+00:00",
"deletion_date": null,
"notes": "",
"year": 2024,
"month": 4
},
]