The operations described in this section enable developers to manage estimated charges.
Get estimated charges
GET /v2/accounts/{ran}/estimated_charges
Returns a list of summarized estimated charges for the current billing period. Currently, the call is supported only for current billing cycle.
Request
The request has the following URI and header parameters:
Name | Type | Description |
---|---|---|
{ran} | URI string (Required) | A billing account number. |
chargeType | String | The type of billable charge. Refer the Appendix to know the valid values |
offeringCode | String | This parameter is used to filter results specific to a product. Refer the Appendix to know the valid values. |
X-Auth-Token | Header string (Required) | A valid authentication token associated with the particular role. |
Accept | Header string | Value: application/json |
This operation does not accept a request body.
Response
Example Get estimated charges - Cloud (partial example): JSON response
{
"estimatedCharges": {
"total": 30,
"discountTotal": "-50.00",
"chargeSubTotal": "100.00",
"chargeHierarchyTotal": "0.00",
"currency": "USD",
"currentBillingPeriodStartDate":"2016-10-16T21:32:52",
"currentBillingPeriodEndDate":"2016-11-16T21:32:52",
"durationRemainingInCycle": "P15D",
"estimatedCharge": [{
"offeringCode": "DBAAS",
"quantity": "10.00",
"amount": "1000.00",
"unitOfMeasure": "HRS",
"rate": ".40",
"category": "CHARGE",
"chargeType": "UPTIME"
}, {
"offeringCode": "MAAS",
"amount": "3.09",
"chargeType": "NUM_CHKS_HRS",
"quantity": "3000.00",
"category": "CHARGE",
"rate": "2.00",
"unitOfMeasure": "CHKS_HRS"
}, {
"offeringCode": "CSITES",
"rate": ".12",
"quantity": "12.00",
"category": "CHARGE",
"amount": "3.14",
"unitOfMeasure": "COUNT",
"chargeType": "COMPUTE_CYCLE_OVERAGE"
}, {
"offeringCode": "RCDN",
"amount": "3.14",
"chargeType": "BWOUT",
"quantity": "12.00",
"category": "CHARGE",
"unitOfMeasure": "GB"
},{
"rate": "100.00",
"quantity": "1.00",
"category": "DISCOUNT",
"amount": "-100.00",
"unitOfMeasure": "COUNT",
"endDate": "2016-05-30T09:30:10Z",
"chargeType": "Commit Discount",
"chargeDetails":"10% off spending over $1,000.00.",
"chargeDescription": "10% off spending over $1,000.00."
}],
"link": [{
"rel": "next",
"href": "https://billing.api.rackspacecloud.com/v2/accounts/{ran}/estimated-charges?marker=0&limit=10"
}, {
"rel": "prev",
"href": "https://billing.api.rackspacecloud.com/v2/accounts/{ran}/estimated-charges?marker=0&limit=10"
}]
}
}
Example Get estimated charges – Dedicated: JSON response
{
"estimatedCharges": {
"total": 30,
"discountTotal": "-50.00",
"chargeSubTotal": "100.00",
"chargeTotal": "50.00",
"chargeHierarchyTotal": "0.00",
"currency": "USD",
"currentBillingPeriodStartDate":"2016-10-16T21:32:52",
"currentBillingPeriodEndDate":"2016-11-16T21:32:52",
"durationRemainingInCycle": "P15D"
"link": [{
"rel": "next",
"href": "https://billing.api.rackspacecloud.com/v2/accounts/{ran}/estimated-charges?marker=0&limit=10"
}, {
"rel": "prev",
"href": "https://billing.api.rackspacecloud.com/v2/accounts/{ran}/estimated-charges?marker=0&limit=10"
}]
}
}
This table shows the possible response codes for this operation:
Response code | Name | Description |
---|---|---|
200 | OK | The request succeeded. |
400 | Bad Request | A general error has occurred. |
401 | Unauthorized | The request has not been applied because it lacks valid authentication credentials for the target resource. The credentials are either expired or invalid. |
404 | Not Found | The server could not find what was requested. |
405 | Method Not Allowed | The method received in the request line is known by the origin server but is not supported by the target resource. |
406 | Not Acceptable | The server cannot produce a response matching the list of acceptable values defined in the request. |
415 | Unsupported Media Type | This error might result if the wrong media type is used in the cURL request. |
500 | Internal Server Error | The server encountered an unexpected condition that prevented it from fulfilling the request. |
Users with any of the following roles can access this API:
- identity:user-admin
- admin
- billing:admin
- observer
- billing:observer