API Name
QueryInstanceBill
Overview
You can call this operation to query the bill information of the monthly instacne or billing item in a specified billing cycle.
Request parameters
Name | Type | Required | Description |
---|---|---|---|
BillingCycle | String | Yes | The billing cycle. Format: YYYY-MM. Example: 2018-07 |
ProductCode | String | No | The code of the specified product. |
ProductType | String | No | The type of the specified product. |
SubscriptionType | String | No | The type of billing method. Valid values: Subscription and PayAsYouGo. |
IsBillingItem | String | No | Whether to get data in BillingItem level. True is BillingItem, false is Instance level. By default is Instance. |
IsHideZeroCharge | String | No | According to the PretaxGrossAmount and the PretaxAmount are 0 that to filter data. By default is False (compatible with existing logic) |
PageNum | Integer | No | Page number,default:1 |
PageSize | Integer | No | Number of per page,default:20,max:300 |
OwnerId | Long | No | The ID of the owner. OwnerID must be specified in BID scene/distribution scene |
Granularity | String | No | The granularity of the billing, Valid values: MONTHLY or DAILY |
BillingDate | String | No | The billing date,Only used when Granularity is DAILY,format: YYYY-MM-DD |
Response parameters
Name | Type | Required |
---|---|---|
BillingCycle | String | The billing cycle. Format: YYYY-MM. |
AccountID | String | Account unique ID |
AccountName | String | Account name. |
TotalCount | String | Total count number. |
PageNum | Integer | |
PageSize | Integer | |
Items | Item | The billing details of Alibaba Cloud services. |
Item:
Name | Type | Required |
---|---|---|
OwnerID | String | Subaccount accountid |
CostUnit | String | Cost unit defined by user. |
SubscriptionType | String | The type of billing method. Valid values: Subscription and PayAsYouGo. |
Item | String | SubscriptionOrder/PayAsYouGoBill/Refund/Adjustment |
ProductCode | String | The code of the specified product. |
ProductName | String | The name of the specified product. |
ProductType | String | The type of the specified product. |
ProductDetail | String | Product detail information |
BillingType | String | Billing type. |
InstanceID | String | Instance name |
NickName | String | Instance nick name. |
ResourceGroup | String | Resource group name |
Tag | String | Tag information,format:key1:value1;key2:value2… |
InstanceConfig | String | Instance configuration information, for example,OS:1970324836975976;CPU:12 |
InstanceSpec | String | Instance spec, for example: ecs.sn1ne.3xlarge |
InternetIP | String | Internet IP address |
IntranetIP | String | Intranet IP address |
Region | String | Region |
Zone | String | Availability zone |
BillingItem | String | Billing item information,only available when the input parameter ‘isBillingItem’ is true |
ListPrice | String | List price,only available when the input parameter ‘isBillingItem’ is true |
ListPriceUnit | String | Unit of list price,only available when the input parameter ‘isBillingItem’ is true |
Usage | String | Usage,only available when the input parameter ‘isBillingItem’ is true |
UsageUnit | String | Unit of usage,only available when the input parameter ‘isBillingItem’ is true |
DeductedByResourcePackage | String | Dedecuted with resource package,only available when the input parameter ‘isBillingItem’ is true |
PretaxGrossAmount | Double | The pretax gross amount. |
InvoiceDiscount | Double | The invoice discount amount. |
DeductedByCoupons | Double | The amount deducted with coupons. |
PretaxAmount | Double | The pretax amount, which is the total refunded amount when the system handles a refund request. |
DeductedByCashCoupons | Double | Vouchers deduction |
DeductedByPrepaidCard | Double | Stored value card deduction |
PaymentAmount | Double | The amount paid with cash. |
OutstandingAmount | Double | The outstanding amount of a common user or the amount of credit used by a credit customer. |
Currency | String | CNY/USD/JPY |
BillingDate | String | The date of billing, only avaliable when granularity is DAILY |
Note 1: The instance bill is generated based on the bill data split, usually one day delay;
Note 2: The instance information will change during the accounting period. The monthly summary instances Config and Spec correspond to the record generation time information. For details, please refer to the corresponding detailed bill;
Note 3: The instance and billing bills do not include Ali Communications and Domain Name products.
Sample requests
&Action=QueryInstanceBill
&BillingCycle=2018-10
Sample responses
"Data": {
"Items": {
"Item": [
{
"ListPrice": "",
"BillingItem": "",
"NickName": "",
"PretaxAmount": 0,
"Usage": "",
"Region": "",
"InstanceConfig": "-",
"Item": "SubscriptionOrder",
"UsageUnit": "",
"IntranetIP": "",
"ProductType": "cmjj011736",
"Tag": "",
"ProductName": "Third-Party Services in Marketplace",
"Zone": "",
"PretaxGrossAmount": 0,
"Currency": "USD",
"InvoiceDiscount": 0,
"SubscriptionType": "Subscription",
"ResourceGroup": "",
"ProductCode": "mpintl-mt9-dt41",
"InstanceID": "5000000124771",
"ProductDetail": "",
"ListPriceUnit": "",
"CostUnit": "Not Allocated",
"DeductedByResourcePackage": "",
"InternetIP": "",
"DeductedByCoupons": 0,
"InstanceSpec": "",
"OwnerID": "54**********188",
"BillingType": "Others"
},
{
"ListPrice": "",
"BillingItem": "",
"NickName": "",
"PretaxAmount": 0,
"Usage": "",
"Region": "",
"InstanceConfig": "-",
"Item": "SubscriptionOrder",
"UsageUnit": "",
"IntranetIP": "",
"ProductType": "cmjj011736",
"Tag": "",
"ProductName": "Third-Party Services in Marketplace",
"Zone": "",
"PretaxGrossAmount": 0,
"Currency": "USD",
"InvoiceDiscount": 0,
"SubscriptionType": "Subscription",
"ResourceGroup": "",
"ProductCode": "mpintl-mt9-dt41",
"InstanceID": "5000000124647",
"ProductDetail": "",
"ListPriceUnit": "",
"CostUnit": "Not Allocated",
"DeductedByResourcePackage": "",
"InternetIP": "",
"DeductedByCoupons": 0,
"InstanceSpec": "",
"OwnerID": "54**********188",
"BillingType": "Others"
},
{
"ListPrice": "",
"BillingItem": "",
"NickName": "",
"PretaxAmount": 0,
"Usage": "",
"Region": "",
"InstanceConfig": "-",
"Item": "SubscriptionOrder",
"UsageUnit": "",
"IntranetIP": "",
"ProductType": "cmjj016159",
"Tag": "",
"ProductName": "Third-Party Services in Marketplace",
"Zone": "",
"PretaxGrossAmount": 0,
"Currency": "USD",
"InvoiceDiscount": 0,
"SubscriptionType": "Subscription",
"ResourceGroup": "",
"ProductCode": "mpintl-mt9-dt41",
"InstanceID": "5000000137147",
"ProductDetail": "",
"ListPriceUnit": "",
"CostUnit": "Not Allocated",
"DeductedByResourcePackage": "",
"InternetIP": "",
"DeductedByCoupons": 0,
"InstanceSpec": "",
"OwnerID": "54**********188",
"BillingType": "Others"
},
]
},
"TotalCount": 17,
"BillingCycle": "2018-10",
"AccountID": "54**********188",
"PageSize": 20,
"AccountName": "w********",
"PageNum": 1
},
"Message": "Successful!",
"RequestId": "A1161648-6BBE-4AFF-A347-070CA5558B30",
"Success": true,
"Code": "Success"