Help Center/ Partner Center/ API Reference/ Bill Management/ Managing Partner Bill/ Querying Bill Details of Monthly Expenditures
Updated on 2024-02-06 GMT+08:00

Querying Bill Details of Monthly Expenditures

Function

This API is used to query bill details of monthly expenditures.

For details about how to query the bill details of monthly expenditures in the Partner Center, click here.

Bill File

A partner can subscribe to the partner bill (customer resource usage) in the HUAWEI CLOUD Partner Center. For details, see File Subscription. Your sales platform will calculate the customer expenditures and generate the customer bills based on this bill and then you can perform reconciliation with HUAWEI CLOUD.

  1. Link to Obtain the File

    https://bucketname.obs.Endpoint.myhuaweicloud.com/customerBill/filename

    Table 1 Parameter descriptions

    Parameter

    Description

    bucketname

    OBS bucket name. Only OBS buckets purchased on Huawei Cloud in the Hong Kong region can be used. For details about how to create a bucket, see Creating a Bucket.

    NOTE:

    You cannot use your account to buy OBS buckets. Instead, you can use your customers' accounts to do so.

    Endpoint

    Domain name or IP address of the server bearing the REST service endpoint. Obtain this value from Regions and Endpoints.

    customerBill

    Name of the folder for storing the partner bill details file uploaded by the system.

    filename

    File name.

    • The name of a bill details file is in customerBill_YYYYMM.tar.gz format.

      In the preceding command, customerBill_YYYYMM.tar.gz is a compressed package. The files contained in the package are named in customerBill_YYYYMM_xxxx.csv format. Each CSV file contains 100,000 records.

  1. File Generation Cycle

    The file is generated each natural month.

    The system automatically creates the file of previous month before 12:00 (Beijing Time) at the fifth day of each month and uploads the file to the created OBS bucket. If the upload fails on the current day, the system uploads the file again next day. If the upload still fails, the system uploads the file the day after that day. The system can try a maximum of five times. Every time when the upload fails, the system sends a failure notification email to the email address of the partner.

  1. File Fields

    Parameter

    Type

    Value Limit

    Description

    Customer ID

    String

    64

    Domain ID of a customer.

    Product ID

    String

    64

    Product ID

    Product type code

    String

    64

    Cloud service type code. For example, the cloud service type code of OBS is hws.service.type.obs. To obtain a specific service type, call the API in Querying Cloud Service Types.

    Resource type code

    String

    100

    Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. To obtain a specific resource type, call the API in Querying Resource Types.

    Cloud service region code

    String

    64

    Cloud service region code, for example, ap-southeast-1. Obtain the value from the Region column in Regions and Endpoints.

    Billing mode

    String

    2

    0: Yearly/monthly

    1: Pay-per-use

    2: Reserved instance–upfront payment

    3: Reserved instance–hourly billing

    4: Savings plan-subscription

    5: Savings plan-hourly billing

    6: Savings plan-discount

    Official website price

    BigDecimal

    -

    List price or promotional price at which customers purchased Huawei Cloud products, in USD.

    Fee generation time

    String

    32

    Time when fees are generated. The format is YYYY-MM, indicating year-month.

    Order ID

    String

    64

    Order ID. This field is available only for yearly/monthly subscriptions.

    Usage

    BigDecimal

    -

    Usage (usage of packages and reserved instances not included). This field is available only for pay-per-use subscriptions.

    Usage Unit

    Integer

    -

    Usage unit. You can call the API in Querying Measurement Units to obtain the value.

    Whether a spot ECS

    String

    1

    2: Yes

    Cash coupon amount

    BigDecimal

    -

    Cash coupon amount, in USD. It specifies the amount deducted using cash coupons.

    Flexi-purchase coupon amount

    BigDecimal

    -

    Flexi-purchase coupon amount

    Stored-value card amount

    BigDecimal

    -

    Stored-value card amount

    Settlement product type

    Integer

    -

    0: Common product

    1: Promotional product

    2: Hybrid hosting products

    5: Stored-value card

    6: Marketplace products

    7: Spot ECSs

    8: FCS (reserved)

    11: Special price request

    60: KooGallery product discounts in resales

    Partner preference ratio

    BigDecimal

    -

    Discount percentage for each settlement type. Leave this parameter empty when Partner Preferential Type is set to 1.

    Currency

    String

    3

    USD

    Billing cycle

    String

    32

    Billing cycle, in the YYYY-MM format.

    Customer account

    String

    64

    HUAWEI CLOUD username of the customer.

    Customer name

    String

    192

    Name used by the customer for real-name authentication. If the customer does not perform real-name authentication, this field is left blank.

    Product name

    String

    576

    Product name.

    Product type name

    String

    192

    Cloud service name, which can be obtained by calling the API in Querying Cloud Service Types.

    Resource type name

    String

    192

    Resource type name, which can be obtained by calling the API in Querying Resource Types.

    Cloud service region name

    String

    96

    Cloud service region. Obtain the value from the Region column in Regions and Endpoints.

    Package Usage

    BigDecimal

    -

    Used amount of the package. The used resources are not calculated using the pay-per-use price.

    Unit (Package Usage)

    Integer

    -

    Package usage unit. For details, see Usage Unit. If the package usage is 0, this field is left blank.

    Reserved Instance Usage

    BigDecimal

    -

    Used reserved instance. The used resources are not calculated using the pay-per-use price.

    Unit (Reserved Instance Usage)

    Integer

    -

    Reserved instance usage unit. For details, see Usage Unit. If the reserved instance usage is 0, this field is left blank.

    Bill Type

    String

    1

    Type of a bill item.

    • 0: Expenditure
    • 1: Unsubscription
    • 2: Huawei write-off

    BizID

    String

    64

    Business ID.

    BizItemID

    String

    64

    Business item ID.

    Amount After Coupons

    BigDecimal

    -

    Consumption amount of a customer, excluding the amount of flexi-purchase coupons, cash coupons, and stored-value cards.

    Amount Due

    BigDecimal

    -

    Bill amount that a partner must pay.

    Specifications

    String

    256

    Product specifications, such as General Computing|s2.small.1|1vCPUs|1GB|linux.

    General Computing|s2.small.1|1vCPUs|1GB|linux

    Billing item

    String

    256

    Billing item To obtain a specific billing item, call the API in Querying Usage Types.

    The value is the same as the usage type in SDRs. The mappings between cloud services and usage types are as follows:

    • ECS: Duration
    • EVS: Duration
    • EIP: Duration
    • Bandwidth: Duration (by bandwidth) or upflow (by traffic)
    • Marketplace image: Duration

    Unit Price

    BigDecimal

    -

    Unit price.

    • For the unit price of a pay-per-use product, this parameter has a value only when the price is the same. For tiered billing, this parameter is left empty.
    • Unit price of a yearly/monthly product is returned only in the following scenarios:
      • Yearly/monthly subscription, renewal, specification downsizing, specification upgrade, and capacity expansion
      • Simple pricing
    • Unit price of a reserved instance is returned only in the following scenarios:
      • Subscription, renewal, specification downsizing, specification upgrade, capacity expansion, and pay-per-use
      • Simple pricing

    Unit

    String

    256

    Price unit

    For example, the price is 0.6 yuan/10,000 times. The unit price is 0.6, the price unit is yuan, and the step is 10,000 times. The unit price is 0.6 and the price unit is yuan/10,000 times.

    Payment

    BigDecimal

    -

    • When Partner Preferential Type is set to 0, the settlement amount is calculated as follows: Settlement amount = List price x (1 – Partner discount ratio).
    • When Partner Preferential Type is set to 1, the settlement amount is calculated based on the fixed unit price. The settlement amount includes the cash coupon amount and does not include the tax amount.

    Unit: USD ($)

    This parameter is returned only when a partner uses coupons.

    Partner cash coupon amount

    BigDecimal

    -

    Amount of the cash coupon that is deducted after a discount is used. Unit: USD ($)

    Whether to Refund Coupons

    String

    -

    Whether to refund partner's cash coupon generated during the refund. Unit: USD ($)

    • Y: yes
    • N: no

    This parameter is returned only when a coupon quota has been converted for partner use only.

    Cash Payment

    BigDecimal

    -

    Amount that needs to pay after partner's cash coupons are deducted. Unit: USD ($)

    This parameter is returned only when a partner uses coupons.
    NOTE:
    • If Scene is set to Y, this parameter value is calculated as follows: Partner amount without tax = Settlement amount – Partner coupon
    • If Scene is set to N, the partner amount without tax equals the settlement amount.

    Tax Amount

    BigDecimal

    -

    Tax amount. If tax determination is not involved or the tax base is 0, the tax amount is 0. Unit: USD ($)

    This parameter is returned only when a coupon quota has been converted for partner use only.

    Billing Item Name

    String

    -

    Usage type name. To obtain a specific type, call the API in Querying Usage Types.

    Partner Preferential Type

    String

    -

    Partner Preferential Type. The options are as follows:

    • 0: Discount
    • 1: Fixed unit price

    Combined Order No.

    String

    256

    The combined order number generated when a customer places orders. This parameter is available only for yearly/monthly products. In other cases, this parameter is left empty.

    • When Partner Preferential Type is set to 0, Amount due = List price x (1 – Partner discount ratio) – Partner coupon + Tax amount.
    • When Partner Preferential Type is set to 1, Amount due = Settlement amount - Partner coupon + Tax amount.
  1. Sample File

    Customer ID, Product ID, Product type code, Resource type code, Cloud service region code, Billing mode, Official website price, Fee generation time, Order ID, Usage, Usage Unit, Whether a spot ECS, Cash coupon amount, Flexi-purchase coupon amount, Stored-value card amount, Settlement product type, Partner preference ratio, Currency, Billing cycle, Customer account, Customer name, Product name, Product type name, Resource type name, Cloud service region name, Package Usage, Unit (Package Usage), Reserved Instance Usage,Unit(Reserved Instance Usage), Bill Type, BizID, BizItemID, Amount After Coupons, Amount Due, Specifications, Billing item, Unit Price, Unit, Payment, Partner cash coupon amount, Whether to Refund Coupons, Cash Payment, Tax Amount, Partner Preferential Type, Combined Order No.

    05876442ca80d5cc0f2dc01c66d6d0c0, 00301-25435-0--0, hws.service.type.ebs, hws.resource.type.volume, cn-east-2, 0, 30.3, Jan-21, CS2008210926C178U, 2664000, 6, 2, 0, 0, 0, 11, 0.75, USD, Jan-21, xiajing_zs_hff, Ai********Company, GD3 linear EVS Ondemand, Elastic Volume Service, Volume, CN North-Ulanqab3, 0, 6, 0, 6, 0, 1100886031001, 0310015570361001_ONDEMAND, 210.1008, 147.07056, mon IO|4056.000000GB, Duration, 0.00007, Dollar/GB/Hour, 147.07056, 0, N, 147.07056, 0, 147.07056, 0, N, 147.07056, 0, Duration, 147.07056, 0, N, 147.07056, 0, Duration, 0, BO2023050900011.