QueryCostByCostCenter
Query cost center expense overview
Operation description
Query cost center expense overview results for a specified billing period
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| BillingMonth |
integer |
Yes |
Billing month (format: YYYYMM) |
202506 |
| GroupByCostCenterLevel |
boolean |
No |
Whether to aggregate and display by cost center level |
false |
| OwnerAccountId |
integer |
No |
Account ID that owns the resource |
1374729705039203 |
| Metrics |
string |
Yes |
Cost type |
REQUIRE_AMOUNT |
| DisplayZeroAmountBills |
boolean |
No |
Whether to display data rows with zero payable amount |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Metadata |
any |
Response structure metadata |
{} |
| RequestId |
string |
Request ID. |
79EE7556-0CFD-44EB-9CD6-B3B526E3A85F |
| TotalAmount |
string |
Sum of totalAllocatedAmount across all cost centers |
130296.64 |
| ConsumeAmountList |
array<object> |
Cost center consumption amount details list |
|
|
object |
|||
| CostCenterId |
integer |
Cost center ID |
530658 |
| CostCenterName |
string |
Cost center name |
Project Group A |
| CostCenterCode |
string |
Cost center code |
15945703968# |
| ParentCostCenterId |
integer |
Parent cost center ID |
637537 |
| PreCostCenterId |
integer |
Previous cost center ID |
6375371 |
| OwnerAccountId |
integer |
Account ID that owns the resource |
1857464601594004 |
| OwnerAccountName |
string |
Account name that owns the resource |
R&D Team Test Account |
| Level |
integer |
Level |
1 |
| TotalAllocatedAmount |
string |
Total (sum of cost type amount and shared allocation amount) |
100 |
| DirectAmount |
string |
Cost type amount |
80 |
| AllocatedAmount |
string |
Shared allocation amount |
20 |
| TotalAllocatedAmountPercent |
string |
Cost type amount percentage |
0.01 |
Examples
Success response
JSON format
{
"Metadata": "{}",
"RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
"TotalAmount": "130296.64",
"ConsumeAmountList": [
{
"CostCenterId": 530658,
"CostCenterName": "Project Group A",
"CostCenterCode": "15945703968#",
"ParentCostCenterId": 637537,
"PreCostCenterId": 6375371,
"OwnerAccountId": 1857464601594004,
"OwnerAccountName": "R&D Team Test Account",
"Level": 1,
"TotalAllocatedAmount": "100",
"DirectAmount": "80",
"AllocatedAmount": "20",
"TotalAllocatedAmountPercent": "0.01"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | AccountNoQueryPricePermission | This page cannot be accessed because you do not have discount rights query permissions. Please contact the main account to go to the cost center for authorization. The permission point that needs authorization is queryprice. | This page cannot be accessed because you do not have discount query permissions. Please contact the primary account to go to the Billing Center for authorization. The permission point that needs to be authorized is queryprice. |
| 400 | InvalidParameter | The specified request contains invalid parameters. | |
| 400 | MissingParameter | The specified request lacks essential parameters. | |
| 400 | CostCenter.UnitNotBelongToUser | Cost unit is not belong to this user. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.