DescribeInstanceAmortizedCostByAmortizationPeriod

Updated at:
Copy as MD

Queries the monthly amortized costs of instances for a specified amortization month.

Operation description

  • Amortized costs cannot be used for settlement or reconciliation. They allocate your subscription and pay-as-you-go fees based on specified allocation rules.

  • The final data for a month is available after 12:00 on the sixth day of the following month. During the month, delayed billing, refunds, bill adjustments, and overdue payment write-offs may occur. The data for the current month does not include unsettled pay-as-you-go fees for which bills have not yet been generated.

  • Amortized cost data from the last 12 months is available.

  • Data for attached resources is reflected in amortized costs 48 hours after the split bill is generated. To use this feature, you must first enable split bills. Data for non-attached resources is updated 48 hours after the detailed bill is generated.

  • For months before August 2021, amortized costs are not updated intra-month. They are updated only after 12:00 on the sixth day of the following month. As a result, certain costs for attached resources such as domain names, buckets, and EIPs for products like CDN, OSS, and Internet Shared Bandwidth are not available for these months.

  • Amortized cost data is available 48 hours after you enable the Amortized Cost feature.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

bssapi:DescribeCostBill

get

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

BillingCycle

string

Yes

The amortization month. Format: YYYY-MM.

2022-10

ConsumePeriodFilter

array

No

The billing cycle filter. Maximum: 10 elements.

string

No

The billing cycle. Format: YYYY-MM.

2022-09

SubscriptionType

string

No

The subscription type. Valid values:

  • Subscription: subscription.

  • PayAsYouGo: pay-as-you-go.

Subscription

ProductCode

string

No

The product code. To obtain the value of this parameter, call QueryProductList or DescribeResourcePackageProduct.

rds

ProductDetail

string

No

The details of the product.

rds

CostUnitCode

string

No

The cost center code.

123#

BillUserIdList

array

No

The bill owner ID filter. Specify a RAM user ID to query its bills. If not set, bills of the current account and all its RAM users are returned. Maximum: 10 elements.

string

No

The bill owner ID.

123

BillOwnerIdList

array

No

The resource owner account filter. The resource owner is the account that actually uses the resource. Maximum: 10 elements.

string

No

The resource owner account ID.

123

InstanceIdList

array

No

The instance ID filter. You can query multiple instances. If not set, all instances are queried. Maximum: 10 elements.

string

No

The instance ID.

abc

NextToken

string

No

The pagination token. Use the NextToken value returned in the previous call. Otherwise, an error is reported. Leave empty to start from the beginning.

CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

MaxResults

integer

No

The maximum number of entries to return. Default: 20. Maximum: 300.

20

Response elements

Parameter

Type

Description

Example

object

BssResult

RequestId

string

The request ID.

79EE7556-0CFD-44EB-9CD6-B3B526E3A85F

Success

boolean

Whether the request was successful.

true

Code

string

The status code.

200

Message

string

The response message.

Successful!

Data

object

The returned data.

NextToken

string

The pagination token. Use the NextToken value returned in the previous call. Otherwise, an error is reported. Leave empty to start from the beginning.

CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

AccountID

string

The account ID.

185766xxxx

AccountName

string

The account name.

test@test.aliyunid.com

MaxResults

integer

The maximum number of entries returned.

100

TotalCount

integer

The total number of entries returned.

100

Items

array<object>

The data entries.

object

The data item.

CostUnit

string

The cost center.

Not allocated

CostUnitCode

string

The cost center code.

1234

InstanceID

string

The instance ID.

i-kjhdskjgshfdlkjfdh

ResourceGroup

string

The resource group.

Default resource group

Tag

string

The instance tags.

tag

InternetIP

string

The public IP address.

34.xx.x.x

IntranetIP

string

The internal IP address.

192.xx.xx.xx

Region

string

The region.

China (Hangzhou)

Zone

string

The zone.

cn-hangzhou

SplitAccountName

string

The attached resource account name.

test**1122

SplitProductDetail

string

The product detail name of the attached resource.

rds

SplitItemID

string

The attached resource ID.

i-28bycvyb4

SplitItemName

string

The attached resource name.

iZ28bycvyb4Z

ConsumePeriod

string

The billing cycle. Format: YYYYMM.

202210

AmortizationStatus

string

The amortization status. Valid values:

  • amortized: amortized

  • unAmortized: unamortized

amortized

AmortizationPeriod

string

The amortization month. Format: YYYYMM.

202210

BillAccountID

integer

The account ID of the bill owner.

185xxxxx489

BillAccountName

string

The account name of the bill owner.

test@test.aliyunid.com

BillOwnerID

integer

The resource owner account ID.

185xxxxx489

BillOwnerName

string

The resource owner account name.

test@test.aliyunid.com

ProductCode

string

The product code.

rds

ProductName

string

The product name.

ApsaraDB RDS

ProductDetailCode

string

The product detail code.

rds

ProductDetail

string

The product details.

ApsaraDB RDS

BizType

string

The business type.

trusteeship

SubscriptionType

string

The subscription type. Valid values:

  • Subscription: subscription.

  • PayAsYouGo: pay-as-you-go.

PayAsYouGo

PretaxGrossAmount

number

The list price.

0

InvoiceDiscount

number

The discount amount.

0

RoundDownDiscount

number

The rounded-down discount.

0

PretaxAmount

number

The pretax amount.

0

DeductedByCashCoupons

number

The amount deducted by cash coupons.

0

DeductedByCoupons

number

The amount deducted by coupons.

0

DeductedByPrepaidCard

number

The amount paid with a prepaid card.

0

ExpenditureAmount

number

The expenditure amount (invoicable).

0

PreviouslyAmortizedPretaxGrossAmount

number

Previously amortized list price.

0

PreviouslyAmortizedInvoiceDiscount

number

Previously amortized discount amount.

0

PreviouslyAmortizedRoundDownDiscount

number

Previously amortized rounding discount.

0

PreviouslyAmortizedPretaxAmount

number

Previously amortized pretax amount.

0

PreviouslyAmortizedDeductedByCashCoupons

number

Previously amortized deduction by cash coupons.

0

PreviouslyAmortizedDeductedByCoupons

number

Previously amortized deduction by coupons.

0

PreviouslyAmortizedDeductedByPrepaidCard

number

Previously amortized payment by prepaid card.

0

PreviouslyAmortizedExpenditureAmount

number

Previously amortized expenditure amount (invoicable).

0

CurrentAmortizationPretaxGrossAmount

number

Current amortized list price.

0

CurrentAmortizationInvoiceDiscount

number

Current amortized discount amount.

0

CurrentAmortizationRoundDownDiscount

number

Current amortized rounded-down discount.

0

CurrentAmortizationPretaxAmount

number

Current amortized pretax amount.

0

CurrentAmortizationDeductedByCashCoupons

number

Current amortized deduction by cash coupons.

0

CurrentAmortizationDeductedByCoupons

number

Current amortized deduction by coupons.

0

CurrentAmortizationDeductedByPrepaidCard

number

Current amortized payment by prepaid card.

0

CurrentAmortizationExpenditureAmount

number

Current amortized expenditure amount (invoicable).

0

RemainingAmortizationPretaxGrossAmount

number

Remaining unamortized list price.

0

RemainingAmortizationInvoiceDiscount

number

Remaining unamortized discount amount.

0

RemainingAmortizationRoundDownDiscount

number

Remaining unamortized rounding discount.

0

RemainingAmortizationPretaxAmount

number

Remaining unamortized pretax amount.

0

RemainingAmortizationDeductedByCashCoupons

number

Remaining unamortized deduction by cash coupons.

0

RemainingAmortizationDeductedByCoupons

number

Remaining unamortized deduction by coupons.

0

RemainingAmortizationDeductedByPrepaidCard

number

Remaining unamortized payment by prepaid card.

0

RemainingAmortizationExpenditureAmount

number

Remaining unamortized expenditure amount (invoicable).

0

AfterDiscountAmount

number

The amount after discount.

0

PreviouslyAmortizedAfterDiscountAmount

number

Previously amortized amount after discount.

0

CurrentAmortizationAfterDiscountAmount

number

Current amortized amount after discount.

0

RemainingAmortizationAfterDiscountAmount

number

Remaining unamortized amount after discount.

0

Examples

Success response

JSON format

{
  "RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
  "Success": true,
  "Code": "200",
  "Message": "Successful!",
  "Data": {
    "NextToken": "CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U",
    "AccountID": "185766xxxx",
    "AccountName": "test@test.aliyunid.com",
    "MaxResults": 100,
    "TotalCount": 100,
    "Items": [
      {
        "CostUnit": "Not allocated\n",
        "CostUnitCode": "1234",
        "InstanceID": "i-kjhdskjgshfdlkjfdh",
        "ResourceGroup": "Default resource group\n",
        "Tag": "tag",
        "InternetIP": "34.xx.x.x",
        "IntranetIP": "192.xx.xx.xx",
        "Region": "China (Hangzhou)\n",
        "Zone": "cn-hangzhou\n",
        "SplitAccountName": "test**1122",
        "SplitProductDetail": "rds",
        "SplitItemID": "i-28bycvyb4",
        "SplitItemName": "iZ28bycvyb4Z",
        "ConsumePeriod": "202210",
        "AmortizationStatus": "amortized",
        "AmortizationPeriod": "202210",
        "BillAccountID": 0,
        "BillAccountName": "test@test.aliyunid.com",
        "BillOwnerID": 0,
        "BillOwnerName": "test@test.aliyunid.com",
        "ProductCode": "rds",
        "ProductName": "ApsaraDB RDS\n",
        "ProductDetailCode": "rds",
        "ProductDetail": "ApsaraDB RDS\n",
        "BizType": "trusteeship",
        "SubscriptionType": "PayAsYouGo",
        "PretaxGrossAmount": 0,
        "InvoiceDiscount": 0,
        "RoundDownDiscount": 0,
        "PretaxAmount": 0,
        "DeductedByCashCoupons": 0,
        "DeductedByCoupons": 0,
        "DeductedByPrepaidCard": 0,
        "ExpenditureAmount": 0,
        "PreviouslyAmortizedPretaxGrossAmount": 0,
        "PreviouslyAmortizedInvoiceDiscount": 0,
        "PreviouslyAmortizedRoundDownDiscount": 0,
        "PreviouslyAmortizedPretaxAmount": 0,
        "PreviouslyAmortizedDeductedByCashCoupons": 0,
        "PreviouslyAmortizedDeductedByCoupons": 0,
        "PreviouslyAmortizedDeductedByPrepaidCard": 0,
        "PreviouslyAmortizedExpenditureAmount": 0,
        "CurrentAmortizationPretaxGrossAmount": 0,
        "CurrentAmortizationInvoiceDiscount": 0,
        "CurrentAmortizationRoundDownDiscount": 0,
        "CurrentAmortizationPretaxAmount": 0,
        "CurrentAmortizationDeductedByCashCoupons": 0,
        "CurrentAmortizationDeductedByCoupons": 0,
        "CurrentAmortizationDeductedByPrepaidCard": 0,
        "CurrentAmortizationExpenditureAmount": 0,
        "RemainingAmortizationPretaxGrossAmount": 0,
        "RemainingAmortizationInvoiceDiscount": 0,
        "RemainingAmortizationRoundDownDiscount": 0,
        "RemainingAmortizationPretaxAmount": 0,
        "RemainingAmortizationDeductedByCashCoupons": 0,
        "RemainingAmortizationDeductedByCoupons": 0,
        "RemainingAmortizationDeductedByPrepaidCard": 0,
        "RemainingAmortizationExpenditureAmount": 0,
        "AfterDiscountAmount": 0,
        "PreviouslyAmortizedAfterDiscountAmount": 0,
        "CurrentAmortizationAfterDiscountAmount": 0,
        "RemainingAmortizationAfterDiscountAmount": 0
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400

NotActiveService

You are not active Amotized Cost ,please use after activation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.