GetCreditAllocationHistory
Returns the per-billing-month allocation history for credits applied to an AWS account's bills. Traverses the consolidated billing family to capture cross-account credit applications. Supports pagination and optional filtering to a single credit.
Request Syntax
{
"accountId": "string",
"creditId": number,
"endDate": number,
"maxResults": number,
"nextToken": "string",
"startDate": number
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- accountId
-
The AWS account ID whose allocation history to retrieve. Must be a 12-digit numeric string.
Type: String
Pattern:
[0-9]{12}Required: Yes
- creditId
-
Filters the result to a single credit. When omitted, returns allocation entries for all credits.
Type: Long
Required: No
- endDate
-
Inclusive end date as Unix epoch seconds.
Type: Timestamp
Required: Yes
- maxResults
-
The maximum number of records to return per page. Range: 1 to 1000. Default: 100.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 1000.
Required: No
- nextToken
-
Pagination token from a previous response. Pass the value returned in
nextTokento retrieve the next page of results.Type: String
Length Constraints: Minimum length of 1. Maximum length of 4095.
Pattern:
[-a-zA-Z0-9+=/_]+Required: No
- startDate
-
Inclusive start date as Unix epoch seconds. Must be on or before
endDate. The range fromstartDatetoendDatecannot exceed 24 billing months.Type: Timestamp
Required: Yes
Response Syntax
{
"creditAllocationHistoryList": [
{
"accountId": "string",
"appliedServiceName": "string",
"billingMonth": "string",
"creditAmount": {
"currencyAmount": "string",
"currencyCode": "string"
},
"creditId": "string",
"description": "string",
"isEstimatedBill": boolean
}
],
"failedMonths": [ "string" ],
"nextToken": "string",
"partialResults": boolean
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- creditAllocationHistoryList
-
Allocation entries sorted by
billingMonthin descending order.Type: Array of CreditAllocationHistoryEntry objects
- failedMonths
-
Billing months in
YYYY-MMformat that failed to return data. Non-empty only whenpartialResultsistrue.Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 7.
- nextToken
-
Pagination token. Present when more pages are available;
nullwhen there are no more results.Type: String
Length Constraints: Minimum length of 1. Maximum length of 4095.
Pattern:
[-a-zA-Z0-9+=/_]+ - partialResults
-
truewhen data could not be retrieved for one or more billing months. ThefailedMonthsfield lists which months are missing.Type: Boolean
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You don't have sufficient access to perform this action.
HTTP Status Code: 400
- InternalServerException
-
The request processing failed because of an unknown error, exception, or failure.
HTTP Status Code: 500
- ThrottlingException
-
The request was denied due to request throttling.
HTTP Status Code: 400
- ValidationException
-
The input fails to satisfy the constraints specified by an AWS service.
- fieldList
-
The input fails to satisfy the constraints specified by an AWS service.
- reason
-
The input fails to satisfy the constraints specified by an AWS service.
HTTP Status Code: 400