When ordering a service on the Zomro platform, it is necessary to follow several important steps: adding the service to the cart, activating a promo code (if available), and directly purchasing the service. These steps allow for effective use of the promo code functionality during the order. To place an order, it is necessary to pass certain parameters of the service, the details of which are presented below.
The process of creating an order consists of the following stages:
- Adding the service to the cart
- Activating the promo code
- Purchasing the service from the cart
Using these specific stages of purchase allows for the use of a promo code during the order.
To create an order, you need to pass the parameters of the service that interest us. How to obtain the available parameters is described here.
Request structure for placing an order for the Cloud VPS service from Zomro:
URL:
https://api.zomro.com/
Method: POST
Request body (Form-data):
Parameter | Example value | Required parameter | Description of the value |
func | v2.instances.order.param | Yes | Function for ordering the service |
auth | 21fc199...c43f71 | No | Session token. This is one of the authorization options. More details on other options are described here |
out | json | No | In what format to expect a response from the API |
sok | ok | Yes | Confirmation of the operation |
order_period | -50 | Yes | For cloudvps services, daily billing is used. To purchase the service, use the value: -50, 1, 3, 6, 12. -50 - daily billing, 1 - ordering the service for 1 month, 3 - ordering for 3 months, and so on. |
licence_agreement | on | Yes | Corresponds to the agreement with the license for use |
pricelist | 6740 | Yes | ID of the tariff to be ordered. The tariff ID can be obtained from the function v2.instances.order.pricelist. More details on how to use it are described here |
order_count | 1 | Yes | The number of services that can be ordered in one request |
force_use_new_cart | on | Yes | Adding the service to a new billmanager cart |
instances_ssh_keys | 490 | No | ID of the SSH key to be added to the server after the OS installation. Do not pass if the parameter use_ssh_key=off |
password | Mypassword1 | No | Access password to the server. In the case of Linux - password for the root user. In the case of Windows - password for the Administrator user. Do not pass if the parameter use_ssh_key=on. Also, the password must contain at least 1 uppercase English letter, 1 numeric character, and a minimum of 8 characters. |
servername | MyServer | No | Custom server name |
instances_os | 18d0ee2e-4d57-4f40-9b56-03c1773b5831 | Yes | UID of the operating system to be installed. The UID of the operating system can be obtained from the function v2.instances.order.pricelist. More details on how to use it are described here |
use_ssh_key | off | No | Whether to use an SSH key or not. Can take values off or on. |
addon_xxx | 260 | No | Additional parameters of the service. Can be RAM, number of CPUs, disk size, traffic volume, type of IPv4 or IPv6. Available parameters depend on the tariff. To find out which options are available, you can refer to the example described here |
datacenter | 13 | Yes | Datacenter number. To find out which options are available, you can refer to the example described here |
backups_schedule | on | No | Creating a backup schedule at the time of creating a backup |
backups_schedule_name | MyBackup | Yes, if the value backups_schedule is used | Name of the backup creation schedule |
backups_schedule_rotation_days | 1,2,3,4,5,6,0 | Yes, if the value backups_schedule is used | On which days to create backups. The week starts on Sunday, which has ID - 0. Accordingly, Monday has the value 1. The other days of the week have corresponding values. |
backups_schedule_rotation_time | 04:20 | Yes, if the value backups_schedule is used | At what time to create a backup |
Example of ordering a service
For example, we will use the Cloud Essential tariff with the Linux Ubuntu 20.04 OS, a server only with IPv6, and using the root user password.
URL:
https://api.zomro.com/
Method: POST
Request body (Form-data):
Parameter | Value |
func | v2.instances.order.param |
auth | 21fc199...c43f71 |
out | json |
sok | ok |
order_period | -50 |
licence_agreement | on |
pricelist | 6740 |
order_count | 1 |
password | MyPassword1 |
servername | MyServer-1 |
instances_os | 479c96f1-ccc6-47a2-952c-c9e3bbdc8d07 |
use_ssh_key | off |
addon_6746 | 260 |
force_use_new_cart | on |
datacenter | 13 |
Here is an example of a request that can be executed from the console:
curl --location 'https://api.zomro.com/' \
--form 'func="v2.instances.order.param"' \
--form 'auth="211a9ac6309a9f0c340bdebf"' \
--form 'out="json"' \
--form 'sok="ok"' \
--form 'order_period="-50"' \
--form 'licence_agreement="on"' \
--form 'use_ssh_key="off"' \
--form 'pricelist="6740"' \
--form 'servername="MyServer-1"' \
--form 'password="Mypassword1"' \
--form 'instances_os="479c96f1-ccc6-47a2-952c-c9e3bbdc8d07"' \
--form 'order_count="1"' \
--form 'addon_6746="260"' \
--form 'datacenter="13"' \
--form 'force_use_new_cart="on"'
After executing the request, we need the data that is located in the following nesting:
doc
Here are the values obtained as a result of executing the request:
...,
"lineitem.id": {
"$": "1818"
},
...
This value "1818", which is the order number in the cart, is needed for further activation of the service. We will remember it for future use.
After executing this request, the existing product can also be seen in the cart.
The next step will be to activate the promo code, if one is present. This step is not mandatory, but if the client has a promo code, it would be great to have the opportunity to use it.
URL:
https://api.zomro.com/
Method: POST
Request body (Form-data):
Parameter | Example value | Required parameter | Description of the value |
func | cart | Yes | Function name for working with the cart |
auth | 21fc199...c43f71 | No | Session token. This is one of the authorization options. More details on other options are described here |
out | json | No | In what format to expect a response from the API |
sok | ok | Yes | Confirmation of the operation |
promocode | PROMO_2024 | Yes | The promo code that is planned to be used. |
clicked_button | apply_promocode | Yes | Confirmation of the promo code activation |
Here is an example of a request that can be executed from the console:
curl --location 'https://api.zomro.com/' \
--form 'out="json"' \
--form 'auth="46ffb314c8d46ec1f2f1df16"' \
--form 'func="cart"' \
--form 'promocode="PROMO_2024"' \
--form 'sok="ok"' \
--form 'clicked_button="apply_promocode"'
After executing this request, the result of the promo code activation can be seen in the cart:
In the image, it can be seen that the promo code PROMO_2024 has been successfully activated.
PS: In reality, the promo code PROMO_2024 is not valid in your case; it was created solely for writing this instruction.
The next step will be to activate the service.
In case the promo code does not provide a 100% discount, it is necessary to additionally pay for the service from the personal account.
Let's consider the situation where the promo code does not cover 100% of the service cost. The API request will look as follows:
URL:
https://api.zomro.com/
Method: POST
Request body (Form-data):
Parameter | Example value | Required parameter | Description of the value |
func | cartorder.create.confirm | Yes | Function for working with the cart |
auth | 21fc199...c43f71 | No | Session token. This is one of the authorization options. More details on other options are described here |
out | json | No | In what format to expect a response from the API |
sok | ok | Yes | Confirmation of the operation |
elid | 1818 | Yes | Order ID. This value is obtained when adding the service to the cart |
paymethod_id | 0 | Yes | Payment method ID. The value 0 is standard and corresponds to the method of paying for the order from the personal account |
Here is an example of a request that can be executed from the console:
curl --location 'https://api.zomro.com/' \
--form 'out="json"' \
--form 'auth="cd63c7832f0ae5947c49ac06"' \
--form 'func="cartorder.create.confirm"' \
--form 'sok="ok"' \
--form 'elid="1818"' \
--form 'paymethod_id="0"'
After executing this request, the cart for this service should be empty, and in the general list of CloudVPS services, we see our service in the status "Activation in progress":
During the activation process of the service, there are no additional actions with the service. After the service is activated, we will have a list of available actions to manage the services, such as: Start, Stop, Delete, Resize, and others.
We also recommend studying articles that may be useful for interacting with the Cloud VPS products via the API:
- API - Obtaining information about available tariffs and their parameters
- API - Start & Stop Operation
- API - Reboot Operation
- API - Rebuild Operation
- API - Delete Operation
- API - Interaction with Image
- API - Interaction with Backup Schedule
- API - Interaction with Rescue
- API - Interaction with Backup
- API - Interaction with Snapshots
- API - Interaction with Boot From ISO