DescribeInstanceAmortizedCostByConsumePeriod

Updated at:
Copy as MD

Queries the monthly amortized cost of an instance by billing cycle.

Operation description

  • Amortized costs are for expense allocation only, not for settlement or reconciliation. Both subscription and pay-as-you-go fees are allocated based on your specified rules.

  • Final monthly data is available after 12:00 on the 6th of the following month, accounting for delayed billing, refunds, adjustments, and overdue payment write-offs. Current-month data excludes unsettled pay-as-you-go fees.

  • Amortized cost data is available for the past 12 months.

  • Attached resource data updates 48 hours after the split bill is generated and requires split bills to be enabled. Other resource data updates 48 hours after the detailed bill is generated.

  • Before August 2021, amortized costs update only after 12:00 on the 6th of the following month, with no mid-month updates. Attached resource costs (domain names, buckets, EIPs) for CDN, OSS, and Internet Shared Bandwidth are unavailable for this period.

  • You must enable the Amortized Cost feature before data is available. Data appears 48 hours after enablement.

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 billing cycle. Format: YYYY-MM.

2022-10

AmortizationPeriodFilter

array

No

The filter for the amortization month. Maximum number of elements: 10.

string

No

The amortization month. 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. Call QueryProductList for product information or DescribeResourcePackageProduct for resource plan details.

rds

ProductDetail

string

No

The details of the product.

rds

CostUnitCode

string

No

The code of the cost center.

123#

BillUserIdList

array

No

The RAM user IDs to filter by bill payer. If empty, returns bills for the current account and all RAM users. Maximum: 10 elements.

string

No

The ID of the bill payer.

123

BillOwnerIdList

array

No

The IDs to filter by resource owner (the account that uses the resource). Maximum: 10 elements.

string

No

The ID of the resource owner.

123

InstanceIdList

array

No

The instance IDs to filter by. If empty, all instances are queried. Maximum: 10 elements.

string

No

The instance ID.

abc

NextToken

string

No

The pagination token from the previous response. Leave empty for the first request.

CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

MaxResults

integer

No

Maximum records per request. Default: 20. Maximum: 300.

20

Response elements

Parameter

Type

Description

Example

object

BssResult

RequestId

string

The ID of the request.

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

Success

boolean

Whether the request was successful.

true

Code

string

The status code.

200

Message

string

The message returned.

Successful!

Data

object

The data returned.

NextToken

string

Pagination token for the next page. Empty if no more results.

CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

AccountID

string

The ID of the account.

185766xxxx

AccountName

string

The name of the account.

test@test.aliyunid.com

MaxResults

integer

Maximum entries on the current page.

100

TotalCount

integer

Total number of entries.

100

Items

array<object>

The data entries.

object

The data item.

CostUnit

string

The cost center.

CostUnitCode

string

The code of the cost center.

1234

InstanceID

string

The instance ID.

i-kjhdskjgshfdlkjfdh

ResourceGroup

string

The resource group.

Tag

string

The tags of the instance.

tag

InternetIP

string

The public IP address.

34.xx.x.x

IntranetIP

string

The private IP address.

192.xx.xx.xx

Region

string

The region.

Zone

string

The zone.

1

SplitAccountName

string

The name of the account to which the attached resource belongs.

test**1122

SplitProductDetail

string

The name of the attached resource's product details.

rds

SplitItemID

string

The ID of the attached resource.

i-28bycvyb4

SplitItemName

string

The name of the attached resource.

iZ28bycvyb4Z

ConsumePeriod

string

The billing cycle. Format: YYYYMM.

202210

AmortizationStatus

string

The amortization status. Valid values:

  • amortized: The cost is amortized.

  • unAmortized: The cost is not amortized.

amortized

AmortizationPeriod

string

The amortization month. Format: YYYYMM.

202210

BillAccountID

integer

The ID of the account to which the bill belongs.

185xxxxx489

BillAccountName

string

The name of the account to which the bill belongs.

test@test.aliyunid.com

BillOwnerID

integer

The ID of the resource owner.

185xxxxx489

BillOwnerName

string

The name of the resource owner.

test@test.aliyunid.com

ProductCode

string

The product code.

rds

ProductName

string

The product name.

RDS

ProductDetailCode

string

The code of the product details.

rds

ProductDetail

string

The details of the product.

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.

0

RoundDownDiscount

number

The amount deducted by rounding down.

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

The list price of the cost that was amortized before the current amortization period.

0

PreviouslyAmortizedInvoiceDiscount

number

The discount on the cost that was amortized before the current amortization period.

0

PreviouslyAmortizedRoundDownDiscount

number

The rounding discount of the cost that was amortized before the current amortization period.

0

PreviouslyAmortizedPretaxAmount

number

The pretax amount of the cost that was amortized before the current amortization period.

0

PreviouslyAmortizedDeductedByCashCoupons

number

The amount deducted by cash coupons from the cost that was amortized before the current amortization period.

0

PreviouslyAmortizedDeductedByCoupons

number

The amount deducted by coupons from the cost that was amortized before the current amortization period.

0

PreviouslyAmortizedDeductedByPrepaidCard

number

The amount paid with a prepaid card for the cost that was amortized before the current amortization period.

0

PreviouslyAmortizedExpenditureAmount

number

The expenditure amount of the cost that was amortized before the current amortization period.

0

CurrentAmortizationPretaxGrossAmount

number

The list price of the cost that is amortized in the current amortization period.

0

CurrentAmortizationInvoiceDiscount

number

The discount on the cost that is amortized in the current amortization period.

0

CurrentAmortizationRoundDownDiscount

number

The rounding discount of the cost that is amortized in the current amortization period.

0

CurrentAmortizationPretaxAmount

number

The pretax amount of the cost that is amortized in the current amortization period.

0

CurrentAmortizationDeductedByCashCoupons

number

The amount deducted by cash coupons from the cost that is amortized in the current amortization period.

0

CurrentAmortizationDeductedByCoupons

number

The amount deducted by coupons from the cost that is amortized in the current amortization period.

0

CurrentAmortizationDeductedByPrepaidCard

number

The amount paid with a prepaid card for the cost that is amortized in the current amortization period.

0

CurrentAmortizationExpenditureAmount

number

The expenditure amount of the cost that is amortized in the current amortization period.

0

RemainingAmortizationPretaxGrossAmount

number

The list price of the cost that is not amortized at the end of the current amortization period.

0

RemainingAmortizationInvoiceDiscount

number

The discount on the cost that is not amortized at the end of the current amortization period.

0

RemainingAmortizationRoundDownDiscount

number

The rounding discount of the cost that is not amortized at the end of the current amortization period.

0

RemainingAmortizationPretaxAmount

number

The pretax amount of the cost that is not amortized at the end of the current amortization period.

0

RemainingAmortizationDeductedByCashCoupons

number

The amount deducted by cash coupons from the cost that is not amortized at the end of the current amortization period.

0

RemainingAmortizationDeductedByCoupons

number

The amount deducted by coupons from the cost that is not amortized at the end of the current amortization period.

0

RemainingAmortizationDeductedByPrepaidCard

number

The amount paid with a prepaid card for the cost that is not amortized at the end of the current amortization period.

0

RemainingAmortizationExpenditureAmount

number

The expenditure amount of the cost that is not amortized at the end of the current amortization period.

0

AfterDiscountAmount

number

The amount after a discount.

0

PreviouslyAmortizedAfterDiscountAmount

number

The amount after a discount for the cost that was amortized before the current amortization period.

0

CurrentAmortizationAfterDiscountAmount

number

The amount after a discount for the cost that is amortized in the current amortization period.

0

RemainingAmortizationAfterDiscountAmount

number

The amount after a discount for the cost that is not amortized at the end of the current amortization period.

0

Examples

Success response

JSON format

{
  "RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F\n",
  "Success": true,
  "Code": "200",
  "Message": "Successful!\n",
  "Data": {
    "NextToken": "CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U\n",
    "AccountID": "185766xxxx\n",
    "AccountName": "test@test.aliyunid.com\n",
    "MaxResults": 100,
    "TotalCount": 100,
    "Items": [
      {
        "CostUnit": "\n",
        "CostUnitCode": "1234",
        "InstanceID": "i-kjhdskjgshfdlkjfdh\n",
        "ResourceGroup": "\t\n",
        "Tag": "tag",
        "InternetIP": "34.xx.x.x\n",
        "IntranetIP": "192.xx.xx.xx\n",
        "Region": "",
        "Zone": "1\n",
        "SplitAccountName": "test**1122\n",
        "SplitProductDetail": "rds",
        "SplitItemID": "i-28bycvyb4\n",
        "SplitItemName": "iZ28bycvyb4Z\n",
        "ConsumePeriod": "202210",
        "AmortizationStatus": "amortized",
        "AmortizationPeriod": "202210",
        "BillAccountID": 0,
        "BillAccountName": "test@test.aliyunid.com\n",
        "BillOwnerID": 0,
        "BillOwnerName": "test@test.aliyunid.com\n",
        "ProductCode": "rds",
        "ProductName": "RDS\n",
        "ProductDetailCode": "rds\n",
        "ProductDetail": "RDS\t\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.