Updated on 2023-09-28 GMT+08:00

Querying Monthly Bills

Function

This API is used to query monthly bills.

This API will be brought offline. For details about how to query the monthly bills, see Querying Monthly Bills.

Web UI

Partners can log in to the Partner Center to query their monthly bills.

  1. Choose Financial Information > Partner Bills.
  2. In the Amount Due pane, you can query the amount to be paid, including the unpaid fees of current month and those of previous months.

    • Click Repay to pay the bill. For details, see Repayment.
    • You can click Unpaid Bills to see the bills that you need to pay.
    • You can click Payment record to switch to the Revenue & Expenditure page to view the payment records.

  1. In the Monthly Bills pane, select the month and query the bills of this month.

  2. Export partner bills.

    • Exporting the bills.

      In the Monthly Bills area, select Export Bill Summary to PDF File. The system displays "Records exported successfully."

    • Export bill details.

      In the Monthly Bills area, select Export Bill Details to XLSX File. The system displays "Records exported successfully."

    • View the export history.
      1. Select View Export to go to the Export History page.
      2. Click Download in the Operation column to download and view the exported bills.

REST API

The partner sales platform displays the monthly bills, and then you can settle the bills with HUAWEI CLOUD.

  • This API can be invoked only by the partner account AK/SK or token.
  • The partner bill for each month is generated before 12:00 (Beijing Time) on the fifth day of the next month.

  1. URI

    GET /v1.0/{partner_id}/partner/account-mgr/postpaid-bill-summary

    The following table describes the parameter.

    Table 1 URI parameters

    Parameter

    Mandatory

    Maximum Length of Characters

    Description

    partner_id

    Yes

    A maximum of 64 characters

    Partner ID (assigned by Huawei).

    For details about how to obtain the partner ID, see How Do I Check the Partner ID?.

    Table 2 Request parameter

    Parameter

    Mandatory

    Type

    Maximum Length of Characters

    Description

    consume_month

    Yes

    String

    A maximum of 10 characters

    Month in the yyyy-MM format.

  1. Request

    Request Parameters

    None

    Example Request

    GET https://bss-intl.myhuaweicloud.com/v1.0/{partner_id}/partner/account-mgr/postpaid-bill-summary?consume_month=2019-01 HTTP/1.1
    Content-Type: application/json
    X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

  1. Response

    Response Parameters

    Parameter

    Mandatory

    Type

    Maximum Length of Characters

    Description

    error_code

    No

    String

    A maximum of 16 characters

    Error code. For details, see 4. This parameter is returned only when a failure occurs.

    error_msg

    No

    String

    A maximum of 1024 characters

    Error description. This parameter is returned only when a failure occurs.

    billCycle

    No

    String

    A maximum of 10 characters

    Billing cycle. This parameter is returned only when the query is successful. It indicates the month for which the bills are queried.

    Format: YYYY-MM

    creditDebtAmount

    No

    BigDecimal

    -

    Bill amount, which is calculated based on the special commercial discount of the partner. This parameter is returned only when the query is successful. The value does not contain the tax.

    consumeAmount

    No

    BigDecimal

    -

    Consumption amount, which is calculated based on the special commercial discount of the partner. This parameter is returned only when the query is successful. The value does not contain the tax.

    writeoffdebt

    No

    BigDecimal

    -

    Write-off amount (negative value), which is calculated based on the special commercial discount of the partner. This parameter is returned only when the query is successful. The value does not contain the tax.

    unsubscribeAmount

    No

    BigDecimal

    -

    Unsubscription amount (negative value), which is calculated based on the special commercial discount of the partner. This parameter is returned only when the query is successful. The value does not contain the tax.

    measureId

    No

    Integer

    -

    Unit. This parameter is returned only when the query is successful.

    1: Dollar

    currency

    No

    String

    A maximum of 8 characters

    This parameter is returned only when the query is successful.

    USD

    taxAmount

    No

    BigDecimal

    -

    Tax amount, which is the tax amount in the creditDebtAmount field. Currently, this field is reserved and no value is returned.

    unclearedAmount

    No

    BigDecimal

    -

    Bill amount that is not settled, which is calculated based on the special commercial discount of the partner. This parameter is returned only when the query is successful.

    dueDate

    No

    String

    A maximum of 32 characters

    Due date for bills. This parameter is returned only when the query is successful.

    billList

    No

    List<PostpaidBillInfo>

    -

    Bill list. For details, see Table 3. This parameter is returned only when the query is successful.

    Table 3 PostpaidBillInfo

    Parameter

    Mandatory

    Type

    Maximum Length of Characters

    Description

    billType

    Yes

    String

    A maximum of 1 character

    Bill type:

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

    cloudServiceTypeCode

    Yes

    String

    A maximum of 100 characters

    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.

    resourceTypeCode

    Yes

    String

    A maximum of 100 characters

    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.

    payMethod

    Yes

    String

    A maximum of 1 character

    Billing mode. The options are as follows:

    0: Yearly/monthly

    1: Pay-per-use

    2: Reserved instance–upfront payment

    3: Reserved instance–hourly billing

    creditDebtAmount

    Yes

    BigDecimal

    -

    Transaction amount/unsubscription amount/refund amount of the customer, including the vouchers, flexi-purchase coupons, reserved flexi-purchase coupons, and stored-value cards. Flexi-purchase coupons and stored-value cards are not supported currently.

    For bill types with billType being 1 and 2, the value is negative.

    customerAmountDue

    Yes

    BigDecimal

    -

    Transaction amount/unsubscription amount/refund amount of the customer, not including the vouchers, flexi-purchase coupons, reserved flexi-purchase coupons, or stored-value cards. Flexi-purchase coupons and stored-value cards are not supported currently.

    For bill types with billType being 1 and 2, the value is negative.

    settlementType

    Yes

    Integer

    -

    Settlement product type. The optional values are as follows:

    0: List-price offering

    1: Promotional offering

    2: Hybrid hosting products

    5: Stored-value card

    6: KooGallery

    7: Spot ECSs

    8: FCS (reserved)

    partnerRatio

    No

    Bigdecimal

    -

    Partner discount percentage. This parameter is valid only when partnerPreferentialType is set to 0.

    partnerAmount

    Yes

    Bigdecimal

    -

    Amount that the partner needs to refund/Amount that the partner has refund

    For bill types with billType being 1 and 2, the value is negative.

    periodType

    No

    Integer

    -

    Yearly/monthly unit.

    0: Daily

    1: Weekly

    2: Monthly

    3: Yearly

    periodNum

    No

    Integer

    -

    Number of yearly/monthly periods.

    categoryCode

    No

    String

    64

    Product category code.

    salePrice

    No

    BigDecimal

    -

    Fixed Price

    This parameter is valid only when partnerPreferentialType is set to 1.

    stepNum

    No

    Integer

    -

    Step size of fixed unit price.

    This parameter is valid only when partnerPreferentialType is set to 1.

    stepNumMeasureId

    No

    Integer

    -

    Unit for the step size of fixed unit price.

    This parameter is valid only when partnerPreferentialType is set to 1.

    partnerPreferentialType

    No

    Integer

    [0-1]

    Partner preferential type. The options are as follows:

    • 0: Discount
    • 1: Fixed unit price. If this parameter is left empty, the product discount is used by default

    Example Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: length
    Date: response time
      
    {
        "billCycle": "2019-01",
        "creditDebtAmount": 22500,
        "consumeAmount": 22500,
        "writeoffdebt": 0,
        "unsubscribeAmount": 0,
        "measureId": 1,
        "currency": "USD",
        "taxAmount": null,
        "unclearedAmount": 10,
        "dueDate": "2019-02-15",
        "billList": [
            {
                "billType": "0",
                "cloudServiceTypeCode": "hws.service.type.kms",
                "resourceTypeCode": "hws.resource.type.dev.codehub",
                "payMethod": "1",
                "creditDebtAmount": 30000,
                "customerAmountDue": 30000,
                "settlementType": 0,
                "partnerRatio": 0.75,
                "partnerAmount": 22500,
                "periodType":3,
                "periodNum":1,
                "categoryCode": "hws.resource.storage1.evs",
                "salePrice": null,
                "stepNum": null,
                "stepNumMeasureId": null,
                "partnerPreferentialType": 0
            }
        ]
    }

  1. Status Code
    • 4xx: This class of HTTP status code is intended for situations in which the error seems to have been caused by the client, for example, the request contains bad syntax or incorrect parameters. You must ensure the request is correct.
    • 5xx: This class of HTTP status code is intended for cases in which the Huawei Cloud server is aware that it has encountered an error or is otherwise incapable of performing the request. In this case, contact Huawei Cloud customer service.

    HTTP Status Code

    Error Code

    Description

    400

    CBC.0100

    Invalid input parameter.

    403

    CBC.0151

    Access denied.

    500

    CBC.0999

    Other errors.