ViewBillingCommand

Returns all the domain-related billing records for the current Amazon Web Services account for a specified period

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { Route53DomainsClient, ViewBillingCommand } from "@aws-sdk/client-route-53-domains"; // ES Modules import
// const { Route53DomainsClient, ViewBillingCommand } = require("@aws-sdk/client-route-53-domains"); // CommonJS import
const client = new Route53DomainsClient(config);
const input = { // ViewBillingRequest
  Start: new Date("TIMESTAMP"),
  End: new Date("TIMESTAMP"),
  Marker: "STRING_VALUE",
  MaxItems: Number("int"),
};
const command = new ViewBillingCommand(input);
const response = await client.send(command);
// { // ViewBillingResponse
//   NextPageMarker: "STRING_VALUE",
//   BillingRecords: [ // BillingRecords
//     { // BillingRecord
//       DomainName: "STRING_VALUE",
//       Operation: "REGISTER_DOMAIN" || "DELETE_DOMAIN" || "TRANSFER_IN_DOMAIN" || "UPDATE_DOMAIN_CONTACT" || "UPDATE_NAMESERVER" || "CHANGE_PRIVACY_PROTECTION" || "DOMAIN_LOCK" || "ENABLE_AUTORENEW" || "DISABLE_AUTORENEW" || "ADD_DNSSEC" || "REMOVE_DNSSEC" || "EXPIRE_DOMAIN" || "TRANSFER_OUT_DOMAIN" || "CHANGE_DOMAIN_OWNER" || "RENEW_DOMAIN" || "PUSH_DOMAIN" || "INTERNAL_TRANSFER_OUT_DOMAIN" || "INTERNAL_TRANSFER_IN_DOMAIN" || "RELEASE_TO_GANDI" || "TRANSFER_ON_RENEW" || "RESTORE_DOMAIN",
//       InvoiceId: "STRING_VALUE",
//       BillDate: new Date("TIMESTAMP"),
//       Price: Number("double"),
//     },
//   ],
// };

ViewBillingCommand Input

See ViewBillingCommandInput for more details

Parameter
Type
Description
End
Date | undefined

The end date and time for the time period for which you want a list of billing records. Specify the date and time in Unix time format and Coordinated Universal time (UTC).

Marker
string | undefined

For an initial request for a list of billing records, omit this element. If the number of billing records that are associated with the current Amazon Web Services account during the specified period is greater than the value that you specified for MaxItems, you can use Marker to return additional billing records. Get the value of NextPageMarker from the previous response, and submit another request that includes the value of NextPageMarker in the Marker element.

Constraints: The marker must match the value of NextPageMarker that was returned in the previous response.

MaxItems
number | undefined

The number of billing records to be returned.

Default: 20

Start
Date | undefined

The beginning date and time for the time period for which you want a list of billing records. Specify the date and time in Unix time format and Coordinated Universal time (UTC).

ViewBillingCommand Output

See ViewBillingCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
BillingRecords
BillingRecord[] | undefined

A summary of billing records.

NextPageMarker
string | undefined

If there are more billing records than you specified for MaxItems in the request, submit another request and include the value of NextPageMarker in the value of Marker.

Throws

Name
Fault
Details
InvalidInput
client

The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For AcceptDomainTransferFromAnotherAwsAccount, the password might be invalid.

Route53DomainsServiceException
Base exception class for all service exceptions from Route53Domains service.