View a markdown version of this page

GetCredits - AWS Billing and Cost Management

GetCredits

Returns the list of AWS account credits for the specified account. Each credit includes its identifier, type, monetary amounts, applicable products, expiration, sharing configuration, and current enabled status.

When the caller is the management account of a consolidated billing family and payerAccountFlag is true, the response aggregates credits across the entire family. Otherwise, the response includes only credits owned by the account specified in accountId.

Request Syntax

{ "accountId": "string", "endDate": number, "payerAccountFlag": boolean, "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. Must be a 12-digit numeric string.

Type: String

Required: Yes

endDate

The end date for the credit period as Unix epoch seconds. Must not be a future date and must be on or after startDate. Defaults to the current date when omitted.

Type: Timestamp

Required: No

payerAccountFlag

When true and the caller is the management account, the response aggregates credits across the entire consolidated billing family. When false or omitted, returns only credits for the specified accountId.

Type: Boolean

Required: No

startDate

The start date for the credit period as Unix epoch seconds. Must be a past date that is not more than one year before the current date.

Type: Timestamp

Required: Yes

Response Syntax

{ "credits": [ { "accountHasCreditSharingEnabled": boolean, "accountId": "string", "applicableProductNames": [ "string" ], "applicationType": "string", "costCategoryArn": "string", "creditConsoleVisibility": "string", "creditId": "string", "creditSharingType": "string", "creditStatus": "string", "creditType": "string", "description": "string", "endDate": number, "estimatedAmount": { "currencyAmount": "string", "currencyCode": "string" }, "exhaustDate": number, "initialAmount": { "currencyAmount": "string", "currencyCode": "string" }, "purchaseTypeApplications": [ "string" ], "remainingAmount": { "currencyAmount": "string", "currencyCode": "string" }, "ruleName": "string", "shareableAccounts": [ "string" ], "startDate": number } ] }

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.

credits

The list of credits matching the request. Returns an empty list when no credits exist.

Type: Array of CreditData objects

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