All Products
Search
Document Center

BSS OpenAPI:QueryOrders

Last Updated:Mar 01, 2024

Queries the orders of your Alibaba Cloud account or distributors. By default, orders within the last hour are queried. To query earlier orders, specify the CreateTimeStart and CreateTimeEnd parameters.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
bssapi:QueryOrdersREAD
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CreateTimeEndstringNo

The end time of the period during which the orders were created. By default, orders within the last hour are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2016-05-23T12:00:00Z
PageNumintegerNo

The page number of the page to return.

1
PageSizeintegerNo

The number of entries to return per page.

20
ProductCodestringNo

The code of the service.

rds
ProductTypestringNo

The type of the service.

rds
SubscriptionTypestringNo

The billing method. Valid values:

  • Subscription: subscription
  • PayAsYouGo: pay-as-you-go
Subscription
OrderTypestringNo

The type of the order. Valid values:

  • New: purchases an instance.
  • Renew: renews an instance.
  • Upgrade: upgrades the configurations of an instance.
  • Refund: applies for a refund.
New
PaymentStatusstringNo

The status of payment. Valid values for a non-refund order:

  • Unpaid: The order is not paid.
  • Paid: The order is paid.
  • Cancelled: The order is canceled.
Note : You can set this parameter to NULL for a refund order.
Paid
CreateTimeStartstringNo

The start time of the period during which the orders were created. By default, orders within the last hour are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

2016-05-23T13:00:00Z

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The status code.

Success
Messagestring

The error message returned.

Successful!
RequestIdstring

The ID of the request.

61293E7A-3406-4447-8620-EC88B0AA66AD
Successboolean

Indicates whether the request was successful.

true
Dataobject

The message returned.

HostNamestring

The hostname.

test
PageNuminteger

The page number of the returned page.

1
PageSizeinteger

The number of entries returned per page.

20
TotalCountinteger

The total number of returned entries.

1
OrderListobject []

The orders returned.

PretaxAmountstring

The pretax amount of the order.

0
CommodityCodestring

The service code.

ecs
RelatedOrderIdstring

The ID of the associated order.

234535345345342
CreateTimestring

The time when the order was created.

2017-06-08T09:41:30Z
Currencystring

The currency.

CNY
SubscriptionTypestring

The billing method. Valid values:

  • Subscription: subscription
  • PayAsYouGo: pay-as-you-go
PayAsYouGo
PaymentCurrencystring

The currency of payment.

CNY
ProductTypestring

The type of the main service.

rds
AfterTaxAmountstring

The aftertax amount of the order.

66
PaymentTimestring

The time of payment.

2017-06-08T09:41:30Z
PretaxGrossAmountstring

The pretax gross amount of the order.

0
OrderTypestring

The type of the order. Valid values:

  • New: purchases an instance.
  • Renew: renews an instance.
  • Upgrade: upgrades the configurations of an instance.
  • Refund: applies for a refund.
New
PaymentStatusstring

The status of payment. Valid values for a non-refund order:

  • Unpaid: The order is not paid.
  • Paid: The order is paid.
  • Cancelled: The order is canceled.
Note : The value is NULL for a refund order.
Paid
OrderIdstring

The ID of the order.

34532532
Taxstring

The tax of the order.

1
PretaxAmountLocalstring

The pretax amount of the order in local currency.

0
ProductCodestring

The code of the main service.

rds

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidOwnerThe specified owner doesn't belong to caller.Invalid user identity.
500InternalErrorThe request processing has failed due to some unknown error.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history