docs
api
Billing Management(UBill)
ListUBillDetail

Obtain Billing Details - ListUBillDetail

Overview

Retrieve all expenditures within a certain billing period.

💡 Obtaining the details of the current month's bill usually has a one-day delay.

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is ListUBillDetail.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
BillingCyclestringBilling period, YYYY-MM, for example 2021-08, only supports queries after 2018-05.Yes
ProjectNamestringProject Name (Filter option, default all)No
ResourceIds.NstringResource ID (Filter option, all by default)
Supports multiple filters, please add multiple fields in the request parameters for multiple filters
Example
ResourceIds.0: uhost-bzgf1gh5,
ResourceIds.1: uhost-gu1xpspa,
No
OrderTypestringOrder Type (Filter option, default is all). Enumeration values:

> OT_BUY: New Purchase

> OT_RENEW: Renewal

> OT_UPGRADE: Upgrade

> OT_DOWNGRADE: Downgrade

> OT_SUSPEND: Settlement

> OT_ADDITIONAL: Additional Order

> OT_REFUND: Deletion

> OT_POSTPAID_RENEW: Expiration

> OT_POSTPAID_PAYMENT: Postpaid

> OT_RECOVER: Deletion Recovery
No
ChargeTypestringBilling Method (Filter option, default all). Enumerated values:

> Year: Yearly

> Month: Monthly

> Day: Daily

> Dynamic: Hourly

> Used: Pay-as-you-go

> Donate: Gift

> Trial: Trial

> Post: Postpaid

> Spot: Spot Instance
No
ShowZerointDisplay $0 orders or not (0 for not displaying, 1 for displaying, default is 0)No
PaidStateintPayment Status (Filter option, 1: Display unpaid orders only; 2: Display paid orders only; 0: Display both) Current month pass 1 or 0, will return all historical unpaid bills; Historical months do not support unpaid query, please do not pass 1No
UserEmailstringUser email, can be filtered according to the user's emailNo
LimitintNumber per page, default value is 25, maximum value: 100.No
OffsetintData Offset (Default 0)No
ResourceTypes.NstringProduct Type (Filter option, default is all),
Supports multiple filters, please add multiple fields in the request parameters for multiple filtering. Enumerated values:

> uhost: UHost

> udisk: UDisk

> udb: UDB

> eip: Elastic IP

> ufile: Object Storage

> fortress_host: Fortress Machine

> ufs: UFS

> waf: WEB Application Firewall

> ues: Elastic Search

> udisk_ssd: SSD UDisk

> rssd: RSSD UDisk
No

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
Itemsarray[BillDetailItem]Bill Details ArrayYes
TotalCountintTotal Length of Billing DetailsYes

Data Model

BillDetailItem

Field NameTypeDescription InformationRequired
ProjectIdstringProject IDYes
AmountstringTotal Order AmountYes
AmountRealstringPayment from Cash AccountYes
AmountFreestringDeductible Gift AmountYes
AmountCouponstringVoucher DeductionYes
AzGroupCNamestringAvailability ZoneYes
ChargeTypestringBilling Method (Filter option, default is all). Enumeration values:

> Year: Yearly

> Month: Monthly

> Day: Daily

> Dynamic: Hourly

> Used: Pay-as-you-go

> Donate: Gift

> Trial: Trial

> Post: Postpaid

> Spot: Spot Instance
Yes
CreateTimeintCreation Time (Timestamp)Yes
StartTimeintStart Time (Timestamp)Yes
EndTimeintEnd Time (Timestamp)Yes
OrderNostringOrder NumberYes
OrderTypestringOrder Type (Filter option, default is all). Enumeration values:

> OT_BUY: New Purchase

> OT_RENEW: Renewal

> OT_UPGRADE: Upgrade

> OT_DOWNGRADE: Downgrade

> OT_SUSPEND: Settlement

> OT_ADDITIONAL: Supplement

> OT_REFUND: Deletion

> OT_POSTPAID_RENEW: Expired

> OT_POSTPAID_PAYMENT: Postpaid

> OT_RECOVER: Deletion Recovery
Yes
ProjectNamestringProject NameYes
BusinessGroupstringBusiness GroupYes
ResourceIdstringResource IDYes
ResourceTypestringProduct type. Enumerated values:

> uhost: UHost

> udisk: UDisk

> udb: UDB

> eip: Elastic IP

> ufile: US3

> fortress_host: Fortress Host

> ufs: UFS

> waf: WEB Application Firewall

> ues: Elastic Search

> udisk_ssd: SSD UDisk

> rssd: RSSD UDisk
Yes
ResourceTypeCodeintProduct Type CodeYes
ItemDetailsarray[ItemDetail]Product ConfigurationYes
ResourceExtendInfoarray[ResourceExtendInfo]Resource IdentifierYes
ResourceLabelobjectResource Tags. Map of string key-value pairs: {"cs_label": "cs_label_value"}Yes
ShowHoverintOrder payment status. Enumerated values:

> 0: Unpaid

> 1: Paid
Yes
UserEmailstringAccount EmailYes
UserNamestringAccount NameYes
UserDisplayNamestringAccount NicknameYes
AdminintWhether it is a main account. Enumerated values:

> 0: Sub-account

> 1: Main account
Yes

ItemDetail

Field NameTypeDescription InformationRequired
ProductNamestringSubcategory NameYes
ValuestringProduct Subcategory SpecificationsYes

ResourceExtendInfo

Field NameTypeDescription InformationRequired
KeyIdstringResource Health IndicatorYes
ValuestringResource Identifier ValueYes

Example

Request Example

https://api.surfercloud.com/?Action=ListUBillDetail
&BillingCycle= 2022-01,
&ResourceTypes.0= uhost,
&ResourceTypes.1= udisk,
&ProjectName= Default,
&ResourceIds.0= uhost-bzgf1gh5,
&ResourceIds.1= uhost-gu1xpspa,
&OrderType= OT_RENEW,
&ChargeType= Dynamic,
&ShowZero= 0,
&PaidState= 0,
&Limit= 25,
&Offset= 0

Response Example

{
  "Action": "ListUBillDetailResponse",
  "Items": [
    {
      "Admin": 1,
      "Amount": "4.21",
      "AmountCoupon": "0.00",
      "AmountFree": "0.00",
      "AmountReal": "4.21",
      "AzGroupCName": "北京二",
      "ChargeType": "Dynamic",
      "CreateTime": 1643641241,
      "EndTime": 1643644800,
      "ItemDetails": [
        {
          "ProductName": "主机CPU",
          "Value": "4核"
        },
        {
          "ProductName": "主机内存",
          "Value": "16384MB"
        },
        {
          "ProductName": "GPU_P40",
          "Value": "1颗"
        },
        {
          "ProductName": "SSD云盘(系统盘)",
          "Value": "40GB"
        }
      ],
      "OrderNo": "20220131033108259519838",
      "OrderType": "OT_RENEW",
      "ProjectName": "Default",
      "ResourceExtendInfo": [
        {
          "KeyId": "name",
          "Value": "UHost-hl4"
        },
        {
          "KeyId": "private_ip",
          "Value": "10.25.113.204"
        }
      ],
      "ResourceId": "uhost-bzgf1gh5",
      "ResourceType": "uhost",
      "ResourceTypeCode": 1,
      "ShowHover": 1,
      "StartTime": 1643641200,
      "UserDisplayName": "数据学院",
      "UserEmail": "daseucloud@foxmail.com",
      "UserName": "root"
    },
    {
      "Admin": 1,
      "Amount": "4.21",
      "AmountCoupon": "0.00",
      "AmountFree": "0.00",
      "AmountReal": "4.21",
      "AzGroupCName": "北京二",
      "ChargeType": "Dynamic",
      "CreateTime": 1643641239,
      "EndTime": 1643644800,
      "ItemDetails": [
        {
          "ProductName": "主机CPU",
          "Value": "4核"
        },
        {
          "ProductName": "主机内存",
          "Value": "16384MB"
        },
        {
          "ProductName": "GPU_P40",
          "Value": "1颗"
        },
        {
          "ProductName": "SSD云盘(系统盘)",
          "Value": "40GB"
        }
      ],
      "OrderNo": "20220131032808257245615",
      "OrderType": "OT_RENEW",
      "ProjectName": "Default",
      "ResourceExtendInfo": [
        {
          "KeyId": "name",
          "Value": "UHost-hl2"
        },
        {
          "KeyId": "private_ip",
          "Value": "10.25.98.190"
        }
      ],
      "ResourceId": "uhost-gu1xpspa",
      "ResourceType": "uhost",
      "ResourceTypeCode": 1,
      "ShowHover": 1,
      "StartTime": 1643641200,
      "UserDisplayName": "数据学院",
      "UserEmail": "daseucloud@foxmail.com",
      "UserName": "root"
    }
  ],
  "RetCode": 0,
  "TotalCount": 2
}
  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved