All Products
Search
Document Center

Expenses and Costs:QueryOrders

Last Updated:Oct 28, 2025

Queries the orders of a user or a distribution customer. By default, the query returns orders created within the last hour. To query orders over a longer period, set the CreateTimeStart and CreateTimeEnd parameters.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

bss:DescribeOrderList

get

*All Resource

*

None

None

Request parameters

Parameter

Type

Required

Description

Example

CreateTimeEnd

string

No

The end of the time range to query. If you do not set this parameter, orders created within the past hour are queried. The format is YYYY-MM-ddTHH:mm:ssZ. The time zone is UTC.

2016-05-23T12:00:00Z

PageNum

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page.

20

ProductCode

string

No

The product code.

rds

ProductType

string

No

The product type.

rds

SubscriptionType

string

No

The subscription type. Valid values:

  • Subscription: subscription.

  • PayAsYouGo: pay-as-you-go.

Subscription

OrderType

string

No

The order type. Valid values:

  • New: a new purchase

  • Renew: a renewal

  • Upgrade: an upgrade

  • TempUpgrade: a temporary upgrade

  • Downgrade: a downgrade

  • Refund: a refund

  • Convert: a billing method change

  • ResizeDisk: a disk resize

  • CompensatoryRenew: a compensatory renewal

  • IncreaseUpgrade: a bandwidth upgrade

  • Exchange: an exchange

  • ChangeOperatingSystem: an operating system change

New

PaymentStatus

string

No

The payment status. For orders that are not refunds, valid values are:

  • Unpaid: The order is unpaid.

  • Paid: The order is paid.

  • Cancelled: The order is canceled.

Note

For refund orders, you can leave this parameter empty.

Paid

CreateTimeStart

string

No

The beginning of the time range to query. If you do not set this parameter, orders created within the last hour are queried. The format is YYYY-MM-ddTHH:mm:ssZ. The time zone is UTC.

2016-05-23T13:00:00Z

Response elements

Parameter

Type

Description

Example

object

Code

string

The status code.

Success

Message

string

Error message.

Successful!

RequestId

string

The ID of the request.

61293E7A-3406-4447-8620-EC88B0AA66AD

Success

boolean

Indicates whether the request was successful.

true

Data

object

The returned information.

HostName

string

The hostname.

test

PageNum

integer

The page number.

1

PageSize

integer

The number of entries on each page. Many entries can cause a timeout. We recommend a maximum of 20 entries per page.

20

TotalCount

integer

The total number of records.

1

OrderList

object

Order

array<object>

A list of orders.

object

PretaxAmount

string

The pre-tax amount of the order.

0

CommodityCode

string

The commodity code.

ecs

RelatedOrderId

string

The associated order ID.

234535345345342

CreateTime

string

The time when the order was created.

2017-06-08T09:41:30Z

Currency

string

The currency.

CNY

SubscriptionType

string

The subscription type. Valid values:

  • Subscription: subscription.

  • PayAsYouGo: pay-as-you-go.

PayAsYouGo

PaymentCurrency

string

The payment currency.

CNY

ProductType

string

The product type.

rds

AfterTaxAmount

string

The amount after tax.

66

PaymentTime

string

The payment time.

2017-06-08T09:41:30Z

PretaxGrossAmount

string

The original amount.

0

OrderType

string

The type of the order. Valid values:

  • New: A new purchase.

  • Renew: A renewal.

  • Upgrade: An upgrade.

  • TempUpgrade: A temporary upgrade.

  • Downgrade: A downgrade.

  • Refund: A refund.

  • Convert: A billing method change.

  • ResizeDisk: A disk resize.

  • CompensatoryRenew: A compensatory renewal.

  • IncreaseUpgrade: A bandwidth upgrade.

  • Exchange: An exchange.

  • ChangeOperatingSystem: An operating system change.

New

PaymentStatus

string

The payment status. For non-refund orders, valid values:

  • Unpaid: The order has not been paid.

  • Paid: The order has been paid.

  • Canceled: The order has been canceled.

Note

This parameter can be NULL for refund orders.

Paid

OrderId

string

The order ID.

34532532

Tax

string

The tax amount.

1

PretaxAmountLocal

string

The amount in local currency.

0

ProductCode

string

The product code.

rds

Examples

Success response

JSON format

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "61293E7A-3406-4447-8620-EC88B0AA66AD",
  "Success": true,
  "Data": {
    "HostName": "test",
    "PageNum": 1,
    "PageSize": 20,
    "TotalCount": 1,
    "OrderList": {
      "Order": [
        {
          "PretaxAmount": "0",
          "CommodityCode": "ecs",
          "RelatedOrderId": "234535345345342",
          "CreateTime": "2017-06-08T09:41:30Z",
          "Currency": "CNY",
          "SubscriptionType": "PayAsYouGo",
          "PaymentCurrency": "CNY",
          "ProductType": "rds",
          "AfterTaxAmount": "66",
          "PaymentTime": "2017-06-08T09:41:30Z",
          "PretaxGrossAmount": "0",
          "OrderType": "New",
          "PaymentStatus": "Paid",
          "OrderId": "34532532",
          "Tax": "1",
          "PretaxAmountLocal": "0",
          "ProductCode": "rds"
        }
      ]
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400

InvalidOwner

The specified owner doesn't belong to caller.

Invalid user identity.

500

InternalError

The request processing has failed due to some unknown error.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.