Updated on 2026-05-21 GMT+08:00

Creating an Order

Function

Creates an order.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    workspace:orders:create

    Write

    -

    • workspace:CreateOrderType

    • workspace:AssociatePublicIp

    • workspace:AccessMode

    -

    • ims:images:list
    • vpc:vpcs:get
    • vpc:networks:get
    • vpc:subnets:get
    • vpc:ports:get
    • bss:order:update
    • kms:cmk:createGrant
    • kms:cmk:listGrants
    • kms:cmk:get
    • kms:cmk:list
    • iam:agencies:pass

URI

POST /v1/{project_id}/bundles/subscribe/order

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a project

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

resources

Yes

Array of Resource objects

Yearly/Monthly resource object.

type

Yes

String

createApps (adding a cloud application).

Table 4 Resource

Parameter

Mandatory

Type

Description

add_volumes

No

AddVolumes object

Disk order request.

cloud_service_console_url

No

String

URL displayed after payment.

create_services

Yes

CreateServices object

Structure of cloud service order placement.

is_auto_renew

No

Integer

Indicates whether the subscription is automatically renewed. 0: no; 1: yes.

period_num

No

Integer

The number of subscription periods is greater than 0.

period_type

No

Integer

Mandatory. There are multiple subscription period options. 2: monthly; 3: yearly; 4: hourly (only for bandwidth add-on packages); 5: absolute time (for supplemented resources such as EVS disks attached to ECSs); 6: once-off (chargingMode set to 1).

subscription_num

Yes

Integer

Subscription quantity.

Table 5 AddVolumes

Parameter

Mandatory

Type

Description

service_id

No

String

Service ID.

volumes

No

Array of Volume objects

Disk order details.

Table 6 CreateServices

Parameter

Mandatory

Type

Description

availability_zone

No

String

AZ.

NOTE:
  • Creating a cloud service in a specified AZ. If the AZ is not specified, a random AZ will be used.

  • For details about AZs, see ListAvailabilityZone: "GET /v1/{project_id}/availability-zone".

data_volumes

No

Array of Volume objects

Data disk.

nics

No

Array of Nic objects

NIC information. This field is not used yet.

ou_name

No

String

OU name, which is used for connecting to the AD. An OU must be created in the AD in advance.

product_id

Yes

String

Product ID.

NOTE:
  • For details, see ListProduct: "GET /v1/{project_id}/product".

flavor_id

No

String

Specification ID.

os_type

No

String

OS type. Currently, only Windows is supported.

  • Linux

  • Windows

root_volume

Yes

Volume object

Default system volume size. Options: minLength: 10; maxLength: 1024.

server_group_id

Yes

String

Server group ID, which is generated when a service group is created for a cloud application.

service_type

No

String

Specifies the cloud service type. The value is fixed to DEDICATED for Workspace.

subnet_id

Yes

String

Subnet ID.

vpc_id

Yes

String

This parameter is transferred during the first registration of the LiteAS during automatic registration.

security_groups

No

Array of SecurityGroup objects

Security group used by the server. If not specified, the security group specified in the server agent is used by default.

⚠ Warning: This attribute is reserved and is not used currently.

update_access_agent

No

Boolean

Indicates whether to enable automatic HDA upgrade.

Table 7 Volume

Parameter

Mandatory

Type

Description

type

Yes

String

Disk type. For details about how to obtain available disk types, see parameter ListVolumeType. Options:

ESSD: Extreme SSD

SSD: Ultra-high I/O

GPSSD: General-purpose SSD

SAS: High I/O

SATA: Common I/O

size

Yes

Integer

Disk capacity (a multiple of 10, in GB). Options:

  • System disk: minLength: 10; maxLength: 1024

  • Data disk: minLength: 10; maxLength: 32768.

cluster_id

No

String

ID of the storage pool used by the ECS system disk.

Table 8 Nic

Parameter

Mandatory

Type

Description

ip_address

No

String

IP address.

subnet_id

No

String

ID of the NIC subnet.

Table 9 SecurityGroup

Parameter

Mandatory

Type

Description

id

No

String

Security group ID.

name

No

String

Security group name.

Response Parameters

Status code: 200

Table 10 Response body parameters

Parameter

Type

Description

order_id

String

Order ID.

Status code: 400

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 401

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 403

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 404

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 405

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 500

Table 16 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 503

Table 17 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Example Requests

{
  "resources" : [ {
    "add_volumes" : {
      "service_id" : "string",
      "volumes" : [ {
        "type" : "SSD",
        "size" : 10,
        "cluster_id" : "c950ee97-587c-4f24-8a74-3367e3da570f"
      } ]
    },
    "cloud_service_console_url" : "http://10.*.*.0:8003/v1/{project_id}/bundles/services/create",
    "create_services" : {
      "availability_zone" : "cn-north-5a",
      "data_volumes" : [ {
        "type" : "SSD",
        "size" : 10,
        "cluster_id" : "c950ee97-587c-4f24-8a74-3367e3da570f"
      } ],
      "nics" : [ {
        "ip_address" : "string",
        "subnet_id" : "197c1aa4-2611-48bd-a3af-ac4ce2c17c4c"
      } ],
      "ou_name" : "string",
      "product_id" : "workspacehost.s.large2.p01",
      "flavor_id" : "c3.large.4",
      "os_type" : "Windows",
      "root_volume" : {
        "type" : "SSD",
        "size" : 10,
        "cluster_id" : "c950ee97-587c-4f24-8a74-3367e3da570f"
      },
      "server_group_id" : "1",
      "service_type" : "string",
      "subnet_id" : "197c1aa4-2611-48bd-a3af-ac4ce2c17c4c",
      "vpc_id" : "string",
      "security_groups" : [ {
        "id" : "string",
        "name" : "string"
      } ],
      "update_access_agent" : "true"
    },
    "is_auto_renew" : 1,
    "period_num" : 3,
    "period_type" : 3,
    "subscription_num" : 3
  } ],
  "type" : "createApps"
}

Example Responses

Status code: 200

Response to a successful request.

{
  "order_id" : "CS23060117315YQ6Z"
}

Status Codes

Status Code

Description

200

Response to a successful request.

400

The request cannot be understood by the server due to malformed syntax.

401

Authentication failed.

403

Permissions required.

404

Resources not found.

405

The method specified in the request is not allowed.

500

An internal service error occurred. For details, see the error code description.

503

Service unavailable.

Error Codes

See Error Codes.