DescribeInstanceAmortizedCostByAmortizationPeriod

Updated at:
Copy as MD

Queries the monthly amortized costs of instances by amortization month.

Operation description

  • Amortized costs are not used as the basis for settlement and reconciliation. Amortized costs provide the cost allocation capability, which allocates the expenses incurred on the cloud (including upfront and pay-as-you-go expenses) based on specified allocation rules.

  • The final data for the current month is available after 12:00 on the 6th day of the next month. During the month, a few scenarios may occur, including but not limited to delayed billing, refunds, account adjustments, and overdue payment write-offs. The data for the current month does not include unsettled pay-as-you-go data (unbilled or being accumulated).

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

  • Data related to attached resources in amortized costs is updated 48 hours after the split bill data is generated. To use the costs of attached resources, activate the split bill feature in advance. Data not related to attached resources is updated 48 hours after the detailed bill is generated.

  • Amortized costs before August 2021 (exclusive) are not updated during the month. They are updated uniformly only after 12:00 on the 6th day of the next amortization month. Specific costs for each attached resource (such as domain names, buckets, and EIPs) of split cloud services (such as CDN, OSS, and Internet Shared Bandwidth) are not provided.

  • Amortized cost data is available only after you activate the amortized costs feature. The data is available 48 hours after activation.

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 number of elements: 10.

string

No

The billing cycle. Format: YYYY-MM.

2022-09

SubscriptionType

string

No

The subscription type. Valid values:

  • Subscription: Upfront.

  • PayAsYouGo: Pay-as-you-go.

Subscription

ProductCode

string

No

The product code. Reference sources for valid values: Call QueryProductList to query product information. Call DescribeResourcePackageProduct to query the information about a specific resource plan product.

rds

ProductDetail

string

No

The product detail.

rds

CostUnitCode

string

No

The cost unit code.

123#

BillUserIdList

array

No

The bill purchaser ID filter. The ID of the RAM user. Specify this parameter to view the bills of RAM users. If you do not specify this parameter, the bills of the current caller account and all its RAM users are viewed by default. Maximum number of elements: 10.

string

No

The bill purchaser ID.

123

BillOwnerIdList

array

No

The resource ownership account filter. The ID of the resource ownership account. The resource ownership account is the account that actually uses the resources. Maximum number of elements: 10.

string

No

The resource ownership account ID.

123

InstanceIdList

array

No

The instance ID filter. You can query multiple instances. If you do not specify this parameter, all instances are queried by default. Maximum number of elements: 10.

string

No

The instance ID.

abc

NextToken

string

No

The token that specifies the position from which the current call starts reading. The value must be empty or set to the NextToken value returned in the previous response. Otherwise, an error occurs. An empty value indicates that the reading starts from the beginning.

CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

MaxResults

integer

No

The maximum number of data records to read in the current call. Default value: 20. Maximum value: 300.

20

Response elements

Element

Type

Description

Example

object

BssResult

Code

string

The status code.

200

Data

object

The returned data.

AccountID

string

The account ID.

185766xxxx

AccountName

string

The user account.

test@test.aliyunid.com

Items

array<object>

The data items.

object

The data item.

AfterDiscountAmount

number

The amount after discount.

0

AmortizationPeriod

string

The amortization month. Format: YYYYMM.

202210

AmortizationStatus

string

The amortization status. Valid values:

  • amortized: amortized

  • unAmortized: unamortized

amortized

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 ownership account.

185xxxxx489

BillOwnerName

string

The name of the account to which the resource belongs.

test@test.aliyunid.com

BizType

string

The business type.

trusteeship

ConsumePeriod

string

The billing cycle. Format: YYYYMM.

202210

CostUnit

string

The cost unit.

Unallocated

CostUnitCode

string

The cost unit code.

1234

CurrentAmortizationAfterDiscountAmount

number

The current amortization amount after discount.

0

CurrentAmortizationDeductedByCashCoupons

number

The amount deducted by cash coupons for the current amortization period.

0

CurrentAmortizationDeductedByCoupons

number

The amount deducted by coupons for the current amortization period.

0

CurrentAmortizationDeductedByPrepaidCard

number

The amount paid by prepaid cards for the current amortization period.

0

CurrentAmortizationExpenditureAmount

number

The expenditure amount (invoiceable) for the current amortization period.

0

CurrentAmortizationInvoiceDiscount

number

The discount amount for the current amortization period.

0

CurrentAmortizationPretaxAmount

number

The amount payable for the current amortization period.

0

CurrentAmortizationPretaxGrossAmount

number

The list price for the current amortization period.

0

CurrentAmortizationRoundDownDiscount

number

The round-down discount for the current amortization period.

0

DeductedByCashCoupons

number

The amount deducted by cash coupons.

0

DeductedByCoupons

number

The amount deducted by coupons.

0

DeductedByPrepaidCard

number

The amount paid by prepaid cards.

0

ExpenditureAmount

number

The expenditure amount (invoiceable).

0

InstanceID

string

The instance ID.

i-kjhdskjgshfdlkjfdh

InternetIP

string

The public IP address.

34.xx.x.x

IntranetIP

string

The internal IP address.

192.xx.xx.xx

InvoiceDiscount

number

The discount amount.

0

PretaxAmount

number

The amount payable.

0

PretaxGrossAmount

number

The list price.

0

PreviouslyAmortizedAfterDiscountAmount

number

The previously amortized amount after discount.

0

PreviouslyAmortizedDeductedByCashCoupons

number

The amount deducted by cash coupons for the previously amortized period.

0

PreviouslyAmortizedDeductedByCoupons

number

The amount deducted by coupons for the previously amortized period.

0

PreviouslyAmortizedDeductedByPrepaidCard

number

The amount paid by prepaid cards for the previously amortized period.

0

PreviouslyAmortizedExpenditureAmount

number

The expenditure amount (invoiceable) for the previously amortized period.

0

PreviouslyAmortizedInvoiceDiscount

number

The discount amount for the previously amortized period.

0

PreviouslyAmortizedPretaxAmount

number

The amount payable for the previously amortized period.

0

PreviouslyAmortizedPretaxGrossAmount

number

The list price for the previously amortized period.

0

PreviouslyAmortizedRoundDownDiscount

number

The round-down discount for the previously amortized period.

0

ProductCode

string

The product code.

rds

ProductDetail

string

The product detail.

ApsaraDB RDS

ProductDetailCode

string

The product detail code.

rds

ProductName

string

The product name.

ApsaraDB RDS

Region

string

The region.

Hangzhou

RemainingAmortizationAfterDiscountAmount

number

The remaining amortization amount after discount.

0

RemainingAmortizationDeductedByCashCoupons

number

The amount deducted by cash coupons for the remaining amortization period.

0

RemainingAmortizationDeductedByCoupons

number

The amount deducted by coupons for the remaining amortization period.

0

RemainingAmortizationDeductedByPrepaidCard

number

The amount paid by prepaid cards for the remaining amortization period.

0

RemainingAmortizationExpenditureAmount

number

The expenditure amount (invoiceable) for the remaining amortization period.

0

RemainingAmortizationInvoiceDiscount

number

The discount amount for the remaining amortization period.

0

RemainingAmortizationPretaxAmount

number

The amount payable for the remaining amortization period.

0

RemainingAmortizationPretaxGrossAmount

number

The list price for the remaining amortization period.

0

RemainingAmortizationRoundDownDiscount

number

The round-down discount for the remaining amortization period.

0

ResourceGroup

string

The resource group.

Default resource group

RoundDownDiscount

number

The round-down discount.

0

SplitAccountName

string

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

test**1122

SplitItemID

string

The ID of the attached resource.

i-28bycvyb4

SplitItemName

string

The name of the attached resource.

iZ28bycvyb4Z

SplitProductDetail

string

The product detail name of the attached resource.

rds

SubscriptionType

string

The subscription type. Valid values:

  • Subscription: subscription.

  • PayAsYouGo: pay-as-you-go.

PayAsYouGo

Tag

string

The instance tag.

tag

Zone

string

The zone.

Hangzhou Zone 1

MaxResults

integer

The maximum number of records returned for the current request.

100

NextToken

string

The token that specifies the position from which the current call starts reading. The value must be empty or set to the NextToken value returned in the previous response. Otherwise, an error occurs. An empty value indicates that the reading starts from the beginning.

CAESEgoQCg4KCmdtdF9jcmVhdGUEARgBIkgKCQBwhGmPcAEAAAo7AzYAAAAxTDgwMDcxMjg3ZDJhNmM3ZDguTDgwMDAwMDAwMDAwMzE1MTIuTDgwMDcyZDMyZTJkYzg3N2U

TotalCount

integer

The total number of records.

100

Message

string

The message.

Successful!

RequestId

string

The request ID.

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

Success

boolean

Indicates whether the request is successful.

true

Examples

Success response

JSON format

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

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.