Order
Order
Order
is the entity that handles purchasing of our service plans.
Endpoints Summary
POST
places an order.
POST
add a cart item. returns the cart item id. Carts items can be added to orders to place
DELETE
deletes the specified cart item
POST
Places a Change order, which is for adding add ons to existing subscriptions.
GET
Calcuates the change order total before placing the change order. Also check if the change order can be placed. This api call does not actually place a change order.
Create Order
Request: POST /order
account
string
(requiried) account id referred to in format of XX-11111111
currency
string
currency of order. only required if account has no currency set . The currency is set when there is a first order placed in your account and cannot be changed. If the account currency is already set, this field is ignored.
label
string
label of cloud server
cartItems
array
payment_type
string
currently, only credit cart payment is accepted, therefore the value of this parameter is ccard
.
Create Cart Item
Request: POST /order/add-to-cart
billing_cycle
int
(requiried) 1: monthly, 3: quarterly, 12: annually
plan_id
int
plan_type
string
currrently only cloud_servers_standard
(General Purpose Cloud Server), cloud_servers_highmemory
(Memory Optimized Cloud Server), cloud_servers_dedicatedcpu
(Dedicated CPU Cloud Server), and cloud_servers_highstorage_sas
(High Storage Cloud Server) are supported
quantity
int
the quantity of this item to add to cart
addons
array
password
string
password of Cloud Server if the plan_type
is cloud_servers_standard
, cloud_servers_highmemory
, cloud_servers_highstorage
, cloud_servers_highfrequency
, cloud_servers_dedicatedcpu
or cloud_servers_highstorage_sas
. This field is not required if the plan_type
are other types.
os_template_id
int
custom_ssh_key
string
base64 encoded string of ssh key. Only default linux templates supports custom_ssh_key. Windows and custom templates do not support ssh keys.
custom_script
string
base64 encoded string of custom script to run at provisioning time. Only default linux templates supports custom scripts. Windows and custom templates do not support custom scripts.
Sample Response:
Delete Cart Item
Request: DELETE /order/cartItems/delete/{cart_item_id}
where cart_item_id
is the cart item id (obtained from POST /order/add-to-cart api) to be deleted.
Change Order
Request: POST /order/changeorder
subscription_id
int
subscription id
resources
array
Key-value array {resource_name: resource->name, delta_value: value} format. Available resources are vm_backup
, china_route
, vm_antiddos
.
Sample Payload:
Change Order Total
Request: PUT /order/changeorder/total
subscription_id
int
subscription id
resources
array
Key-value array {resource_name: resource->name, delta_value: value} format. Available resources are vm_backup
, china_route
, vm_antiddos
.
The payload is the same as Change Order API above.
Sample Response:
Switch Order
Request: PUT /order/switch/{subscription_id}
plan_id
int
target plan's id. this plan need to have the same type as current plan
Sample Response:
Switch Order Total
Request: PUT /order/switch/total
subscription_id
int
subscription id
plan_id
int
target plan's id. this plan need to have the same type as current plan
Sample Response:
Last updated