Updated on 2024-09-26 GMT+08:00

Querying Orders (Old)

Function

After a customer purchases yearly/monthly resources, it can query the orders in different statuses, such as in the pending approval, processing, canceled, completed, and pending payment statuses.

This API will be brought offline soon. For details about the new API for querying orders, see Querying Orders.

Web UI

Log in to the Billing Center and switch to the Orders page. On the displayed page, click the All tab to view the orders in different statuses, such as pending approval, processing, canceled, completed, and pending payment.

REST API

After a customer purchases yearly/monthly resources, it can query the orders in different status on the partner sales platform, such as in the pending approval, processing, canceled, completed, and pending payment statuses.

  • This API can be invoked using the AK/SK or token of the partner or of the partner's customer. If the partner AK/SK or token is used, orders of only the customers associated in the Reseller model can be queried.
  • If you want to query the resource information of a specified order, invoke this API to obtain the order ID and then invoke the API described in Querying Customer's Yearly/Monthly Resources (Old). Enter the order ID in the request to query the resource information.
  1. URI

    GET /v1.0/{domain_id}/common/order-mgr/orders/detail

    The following table describes the parameters.

    Table 1 URI parameters

    Parameter

    Mandatory

    Maximum Length of Characters

    Description

    domain_id

    Yes

    A maximum of 64 characters

    Table 2 Request parameters

    Parameter

    Mandatory

    Type

    Maximum Length of Characters/Value Range

    Description

    order_id

    No

    String

    A maximum of 64 characters

    Order ID.

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. If this parameter is set to "" or null, it can be used as a filter criterion.

    customer_id

    No

    String

    A maximum of 64 characters

    Customer account ID. For details, see How Do I Obtain Customer's customer_id and domain_id Values?

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. It cannot be set to "" or null.

    create_time_begin

    No

    String

    A maximum of 64 characters

    Start time of order creation.

    UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

    The range of HH is 0-23, and the range of mm and ss is 0-59.

    The range queried cannot exceed one year.

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. It cannot be set to "" or null.

    create_time_end

    No

    String

    A maximum of 64 characters

    End time of order creation.

    UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

    The range of HH is 0 - 23, and the range of mm and ss is 0 - 59.

    The range queried cannot exceed one year.

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. It cannot be set to "" or null.

    service_type

    No

    String

    A maximum of 64 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.

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. If this parameter is set to "" or null, it can be used as a filter criterion.

    status

    No

    String

    A maximum of 64 characters

    Order status. The value can be:

    • 1: Pending approval
    • 3: Processing
    • 4: Canceled
    • 5: Completed
    • 6: Pending payment
    • 9: To be confirmed

    If this parameter is not included in the request parameters, is left empty, or is set to null, it cannot be used as a filter criterion. It cannot be set to "".

    order_type

    No

    String

    A maximum of 64 characters

    Order type. The value can be:

    • 1: New purchase
    • 2: Renewal
    • 3: Change
    • 4: Unsubscription
    • 10: Yearly/monthly to pay-per-use
    • 11: Pay-per-use to yearly/monthly
    • 13: Trial
    • 14: Commercial use
    • 15: Price adjustment

    If this parameter is not included in the request parameters, is left empty, or is set to null, it cannot be used as a filter criterion. It cannot be set to "".

    page_size

    Yes

    Integer

    [1-100]

    Number of rows on a page.

    page_index

    Yes

    Integer

    [1-Maximum integer]

    Current page number. If the value of this parameter exceeds 1000000, the default value 1 is used.

    sort

    No

    String

    A maximum of 36 characters

    Sorting order of the orders.

    You can sort the orders by creation time.

    If you set the value to createTime, the system sorts orders by creation time in ascending order. If you set the value to -createTime, the system sorts orders by creation time in descending order.

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. It cannot be set to "" or null.

    payment_time_begin

    No

    String

    A maximum of 64 characters

    Start time of order payment.

    UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

    The range of HH is 0-23, and the range of mm and ss is 0-59.

    The interval between the order creation time and termination cannot exceed one year.

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. It cannot be set to "" or null.

    payment_time_end

    No

    String

    A maximum of 64 characters

    End time of order payment.

    UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

    The range of HH is 0-23, and the range of mm and ss is 0-59.

    The interval between the order creation time and termination cannot exceed one year.

    If this parameter is not included in the request parameters or is left empty, it cannot be used as a filter criterion. It cannot be set to "" or null.

    method

    No

    String

    64

    Query method.

    • oneself: Query your own orders.
    • sub_customer: Query customer orders that are paid for by you.

    If this parameter is not included in the request parameters, is set to "", or is set to null, the default value oneself is used.

  1. Request

    Request Parameters

    None

    Example Request

    GET https://bss-intl.myhuaweicloud.com/v1.0/{domain_id}/common/order-mgr/orders/detail?page_size=5&page_index=1 HTTP/1.1
    Content-Type: application/json
    X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

  1. Response

    Response Parameters

    Parameter

    Type

    Description

    error_code

    String

    Error code.

    For details, see 4.

    error_msg

    String

    Error description.

    data

    Result

    Order list

    For details, see Table 3.

    Table 3 Result

    Parameter

    Type

    Description

    pageSize

    Integer

    Number of rows on a page.

    pageIndex

    Integer

    Current page number.

    totalSize

    Integer

    Number of records that match the query conditions.

    orderInfos

    List<CustomerOrder>

    Order details.

    For details, see Table 4.

    Table 4 CustomerOrder

    Parameter

    Type

    Description

    orderId

    String

    Order ID.

    baseOrderId

    String

    Parent order ID (order ID before splitting).

    When a cloud service is renewed or changed or a cloud service is unsubscribed, a new order ID (orderId value) is generated. In this case, baseOrderId indicates the original ID before the renewal, change, or unsubscription.

    This field has been discarded.

    beId

    String

    Partner business entity ID.

    customerId

    String

    Customer ID.

    sourceType

    Integer

    Customer order source type. The value can be:

    • 1. Customer
    • 2. Agent
    • 3: Contract
    • 4: Distributor

    status

    Integer

    Order status. The value can be:

    • 1: Pending approval
    • 3: Processing
    • 4: Canceled
    • 5: Completed
    • 6: Pending payment
    • 9: To be confirmed

    orderType

    Integer

    Order Type:

    • 1: New purchase
    • 2: Renewal
    • 3: Change
    • 4: Unsubscription
    • 10: Yearly/monthly to pay-per-use
    • 11: Pay-per-use to yearly/monthly
    • 13: Trial
    • 14: Commercial use
    • 15: Price adjustment

    currency

    Double

    Order amount (original price).

    In the unsubscription order, the amount is equal to the value of currencyAfterDiscount.

    currencyAfterDiscount

    Double

    Order amount after a discount (excluding the vouchers or cards)

    measureId

    Integer

    Order amount unit.

    • 1: Dollar
    • 2: Dime
    • 3: Cent

    measureName

    String

    Amount unit name.

    createTime

    String

    Creation time.

    UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

    The range of HH is 0-23, and the range of mm and ss is 0-59.

    paymentTime

    String

    Payment time.

    UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

    The range of HH is 0-23, and the range of mm and ss is 0-59.

    lastUpdateTime

    String

    Latest status update time.

    UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

    The range of HH is 0-23, and the range of mm and ss is 0-59.

    needAudit

    Boolean

    Whether the approval is required.

    currencyType

    String

    Currency code.

    contractId

    String

    Contract ID.

    currencyOfficial

    Double

    Order amount (list price).

    In the unsubscription order, the amount is equal to the value of currencyAfterDiscount.

    amountInfo

    AmountInfo

    Order deduction details.

    For details, see Table 5.

    serviceType

    String

    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.

    Table 5 AmountInfo

    Parameter

    Type

    Description

    discountList

    List<DiscountItem>

    Fee item.

    For details, see Table 6.

    cashcouponAmount

    Double

    Flexi-purchase coupon amount (reserved).

    couponAmount

    Double

    Cash coupon amount.

    cardAmount

    Double

    Stored-value card amount (reserved).

    commissionAmount

    Double

    Handling fee (only for unsubscription orders).

    consumedAmount

    Double

    Consumption amount (only for unsubscription orders).

    Table 6 DiscountItem

    Parameter

    Type

    Description

    discountType

    String

    Discount type.

    200: Promotion product discount

    300: Promotion discount coupon

    301: Promotion coupon

    302: Promotion flexi-purchase coupon

    500: Specified discount for agent subscription

    501: Specified exemption for agent subscription

    502: Specified buy-it-now price for agent subscription

    600: Discount specified in the discount and rebate contract

    601: Discount specified in the channel frame contract

    602: Discount specified in the designated-purpose fund contract

    603: Discount specified in the directly signed offline contract

    604: Discount specified in the authorized telemarketing contract

    605: Discount specified in the commercial contract

    606: Discount specified in the channel commercial contract

    607: Partner authorized discount

    609: discount for adjusting an order price

    610: Discount amount

    700: Promotion discount

    800: Top-up account discount

    discountAmount

    Double

    Discounted amount.

    Example Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: length
    Date: response time  
    
    {
    	"error_code": "CBC.0000",
    	"error_msg": "success",
    	"data": {
    		"pageSize": 10,
    		"pageIndex": 1,
    		"totalSize": 1,
    		"orderInfos": [{
    			"orderId": "9Lw9b*****mqK5k",
    			"baseOrderId": null,
    			"beId": "0",
    			"customerId": "L3BnG*****jBdD",
    			"sourceType": 1,
    			"status": 4,
    			"orderType": 1,
    			"currency": 30,
    			"currencyAfterDiscount": 30,
    			"measureId": 1,
    			"measureName": null,
    			"createTime": "2019-04-01T11:28:20Z",
    			"paymentTime": null,
    			"lastUpdateTime": "2019-04-02T11:29:42Z",
    			"needAudit": false,
    			"currencyType": "USD",
    			"contractId": null,
    			"currencyOfficial": 30,
    			"amountInfo": {
    				"discountList": [{
    					"discountType": "901",
    					"discountAmount": 100
    				}],
    				"cashcouponAmount": 1,
    				"couponAmount": null,
    				"cardAmount": null,
    				"commissionAmount": 4,
    				"consumedAmount": 5
    			},
    			"serviceType": "hws.service.type.ebs"
    		}]
    	}
    }

  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

    200

    CBC.0000

    Succeeded.

    400

    CBC.0100

    Incorrect parameter.

    400

    CBC.0101

    Invalid parameter.

    403

    CBC.0151

    Access denied.

    403

    CBC.0155

    Request denied.

    The possible causes are as follows: The account authentication information is incorrect. The account or member account does not have the permission to call the API.

    500

    CBC.0999

    Other errors.