QueryInstanceGaapCost

Updated at:
Copy as MD

This API is no longer updated. Use the following APIs to obtain the corresponding allocated costs. Use DescribeInstanceAmortizedCostByAmortizationPeriod to query the monthly amortized cost of an instance by amortization period. Use DescribeProductAmortizedCostByAmortizationPeriod to query the monthly amortized cost of a product by amortization period. Use DescribeInstanceAmortizedCostByConsumePeriod to query the monthly amortized cost of an instance by billing cycle. Use DescribeProductAmortizedCostByConsumePeriod to query the monthly amortized cost of a product by billing cycle.

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

bss:DescribeGaapBill

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

PageNum

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of entries per page. Default value: 20. Maximum value: 100.

20

BillingCycle

string

Yes

The billing cycle in the YYYY-MM format.

2020-03

ProductCode

string

No

The product code.

rds

ProductType

string

No

The product type.

rds

SubscriptionType

string

No

The subscription type. Valid values:

  • Subscription: subscription.

  • PayAsYouGo: pay-as-you-go.

PayAsYouGo

Response elements

Element

Type

Description

Example

object

Code

string

The status code.

Success

Message

string

The error message.

Successful!

RequestId

string

The request ID.

CCBB1BB9-22F1-4177-867B-7A75D665B488

Success

boolean

Indicates whether the request is successful.

true

Data

object

The returned data.

PageNum

integer

The page number.

1

PageSize

integer

The number of entries per page.

20

TotalCount

integer

The total number of entries.

20

HostId

string

The host ID.

1.1.1.1

Modules

object

Module

array<object>

The billing information.

object

GaapDeductedByCashCoupons

string

The allocated cash coupon deductions.

0

SubscriptionType

string

The subscription type. Valid values:

  • Subscription: subscription.

  • PayAsYouGo: pay-as-you-go.

PayAsYouGo

MonthGaapPretaxAmount

string

The allocated discounted amount for the current month.

0

DeductedByCoupons

string

The coupon deductions.

0

SubOrderId

string

The sub-order ID.

12434345

Region

string

The region.

cn-hangzhou

OrderType

string

The order type. Valid values:

  • New: new purchase.

  • Renewal: renewal.

  • Upgrade: upgrade.

  • Degrade: downgrade.

New

MonthGaapDeductedByPrepaidCard

string

The allocated prepaid card deductions for the current month.

0

UnallocatedDeductedByCashCoupons

string

The unallocated cash coupon deductions.

0

PretaxAmountLocal

string

The allocated discounted amount in the local currency for international sites.

0

BillingCycle

string

The billing cycle in the YYYY-MM format.

2020-03

PayerAccount

string

The payer account.

23534534

MonthGaapPretaxAmountLocal

string

The allocated discounted amount for the current month in the local currency for international sites.

0.99

AccountingUnit

string

The financial accounting unit. This is a reserved field and is not supported.

None

GaapPretaxAmountLocal

string

The allocated discounted amount in the local currency.

0

UnallocatedDeductedByPrepaidCard

string

The unallocated prepaid card deductions.

0

ProductType

string

The product type.

rds

PaymentAmount

string

The cash payment.

0

MonthGaapPretaxGrossAmount

string

The allocated original amount for the current month.

0.99

BillType

string

The bill type. Valid values:

  • SubscriptionOrder: subscription order.

  • PayAsYouGoBill: pay-as-you-go bill.

  • Refund: refund.

  • Adjustment: adjustment.

SubscriptionOrder

PayTime

string

The payment time.

2018-06-15 15:59:57

PretaxGrossAmount

string

The original amount.

123

OrderId

string

The order ID.

213123213123

UnallocatedPricingDiscount

string

The unallocated pricing discount.

0

MonthGaapDeductedByCashCoupons

string

The allocated cash coupon deductions for the current month.

0.75

UnallocatedPretaxGrossAmount

string

The unallocated original amount.

0

InstanceID

string

The instance ID.

OSSBAG-cn-0xl0xxxxxx

Tag

string

The tag.

tag

Currency

string

The currency. Valid values:

  • CNY

  • USD

  • JPY

CNY

GaapDeductedByCoupons

string

The allocated coupon deductions.

0

DeductedByCashCoupons

string

The cash coupon deductions.

0

GaapDeductedByPrepaidCard

string

The allocated prepaid card deductions.

0

GaapPaymentAmount

string

The allocated cash payment.

0

UnallocatedPretaxAmountLocal

string

The unallocated discounted amount in the local currency.

0

MonthGaapPricingDiscount

string

The allocated pricing discount for the current month.

0,.25

PricingDiscount

string

The pricing discount.

1

GaapPricingDiscount

string

The allocated pricing discount.

0

ResourceGroup

string

The resource group.

default resource group

UnallocatedDeductedByCoupons

string

The unallocated coupon deductions.

0

PretaxAmount

string

The discounted amount.

0

UnallocatedPretaxAmount

string

The unallocated discounted amount.

0

GaapPretaxGrossAmount

string

The allocated original amount.

0

UnallocatedPaymentAmount

string

The unallocated cash payment.

0

PaymentCurrency

string

The payment currency for international sites.

CNY

OwnerID

string

The owner ID.

123213123123

DeductedByPrepaidCard

string

The prepaid card deductions.

0

GaapPretaxAmount

string

The allocated discounted amount.

0

MonthGaapDeductedByCoupons

string

The allocated coupon deductions for the current month.

0

MonthGaapPaymentAmount

string

The allocated cash payment for the current month.

0

UsageEndDate

string

The service end time.

2019-05-01 00:00:00

UsageStartDate

string

The service start time.

2019-04-01 00:00:00

ProductCode

string

The product code.

rds

Examples

Success response

JSON format

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "CCBB1BB9-22F1-4177-867B-7A75D665B488",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "PageSize": 20,
    "TotalCount": 20,
    "HostId": "1.1.1.1",
    "Modules": {
      "Module": [
        {
          "GaapDeductedByCashCoupons": "0",
          "SubscriptionType": "PayAsYouGo",
          "MonthGaapPretaxAmount": "0",
          "DeductedByCoupons": "0",
          "SubOrderId": "12434345",
          "Region": "cn-hangzhou",
          "OrderType": "New",
          "MonthGaapDeductedByPrepaidCard": "0",
          "UnallocatedDeductedByCashCoupons": "0",
          "PretaxAmountLocal": "0",
          "BillingCycle": "2020-03",
          "PayerAccount": "23534534",
          "MonthGaapPretaxAmountLocal": "0.99",
          "AccountingUnit": "无",
          "GaapPretaxAmountLocal": "0",
          "UnallocatedDeductedByPrepaidCard": "0",
          "ProductType": "rds",
          "PaymentAmount": "0",
          "MonthGaapPretaxGrossAmount": "0.99",
          "BillType": "SubscriptionOrder",
          "PayTime": "2018-06-15 15:59:57",
          "PretaxGrossAmount": "123",
          "OrderId": "213123213123",
          "UnallocatedPricingDiscount": "0",
          "MonthGaapDeductedByCashCoupons": "0.75",
          "UnallocatedPretaxGrossAmount": "0",
          "InstanceID": "OSSBAG-cn-0xl0xxxxxx",
          "Tag": "tag",
          "Currency": "CNY",
          "GaapDeductedByCoupons": "0",
          "DeductedByCashCoupons": "0",
          "GaapDeductedByPrepaidCard": "0",
          "GaapPaymentAmount": "0",
          "UnallocatedPretaxAmountLocal": "0",
          "MonthGaapPricingDiscount": "0,.25",
          "PricingDiscount": "1",
          "GaapPricingDiscount": "0",
          "ResourceGroup": "默认资源组",
          "UnallocatedDeductedByCoupons": "0",
          "PretaxAmount": "0",
          "UnallocatedPretaxAmount": "0",
          "GaapPretaxGrossAmount": "0",
          "UnallocatedPaymentAmount": "0",
          "PaymentCurrency": "CNY",
          "OwnerID": "123213123123",
          "DeductedByPrepaidCard": "0",
          "GaapPretaxAmount": "0",
          "MonthGaapDeductedByCoupons": "0",
          "MonthGaapPaymentAmount": "0",
          "UsageEndDate": "2019-05-01 00:00:00",
          "UsageStartDate": "2019-04-01 00:00:00",
          "ProductCode": "rds"
        }
      ]
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 NotApplicable This API is not applicable for caller.
400 NotAuthorized This API is not authorized for caller.
400 MissingParameter Absent some mandatory parameter for this request.
400 InvalidParameter This request contain some invalid parameter
400 InvalidOwner The specified owner doesn't belong to caller. Invalid user identity.
400 DurationInvalid Parameter duration can only be positive integer.
400 ProductNotFound Product not found.
400 InvalidBillingCycle BillingCycle not Invalid.
500 InternalError The request processing has failed due to some unknown error.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.