SIGN IN / UP
    opened image

    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 purchasing the service. These steps allow for the effective use of promo codes during the order process. To place an order, certain service parameters need to be passed, details of which are provided below.

    The process of creating an order consists of the following steps:

    • Adding the service to the cart
    • Activating the promo code
    • Purchasing the service from the cart

    Using these specific purchase steps allows for the use of a promo code during the order.

    To create an order, you need to pass the service parameters that interest us. How to obtain the available parameters is described here

     

    Request structure for ordering the Cloud VPS Zomro service:
     

    URL: 

    https://api.zomro.com/

    Method: POST

    Request body (Form-data):
     

    Parameter Example value Mandatory parameter Value description
    func v2.instances.order.param Yes Service order function
    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 the API response
    sok ok Yes Operation confirmation
    order_period -50 Yes For cloudvps services, hourly payment is used. To purchase a service with hourly payment, use the value -50
    licence_agreement on Yes Corresponds to the license agreement acceptance
    pricelist 6740 Yes ID of the tariff to be ordered. The tariff ID can be obtained from the v2.instances.order.pricelist function. More details on how to use it are described here
    order_count 1 Yes 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 OS installation. Not required if the use_ssh_key parameter is off
    password Mypassword1 No Server access password. For Linux, it's the root user password. For Windows, it's the Administrator user password. Not required if the use_ssh_key parameter is 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 OS UID can be obtained from the v2.instances.order.pricelist function. 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 service parameters. 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, see the example described here

     

    Example of ordering a service

    For example, we use the Cloud Essential tariff with the Linux Ubuntu 20.04 OS, a server with only 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

     

    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="on"' \
    --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 'force_use_new_cart="on"'

     

    After executing the request, we need the data 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 service activation. Remember it for future use.

     

    After executing this request, the item can also be seen in the cart.


     

    The next step will be the activation of the promo code, if available. 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 Mandatory parameter Value description
    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 the API response
    sok ok Yes Operation confirmation
    promocode PROMO_2024 Yes Promo code to be used. 
    clicked_button apply_promocode Yes Promo code activation confirmation

     

    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 ofactivating the promo code can be seen in the cart:

     

     

    The image shows 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 the activation of the service.

    If the promo code does not provide a 100% discount, you need to additionally pay for the service from your personal account. 

    Let's consider a 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 Mandatory parameter Value description
    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 the API response
    sok ok Yes Operation confirmation
    elid 1818 Yes Order ID. This value was 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 using funds 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="on"' \
    --form 'elid="1818"' \
    --form 'paymethod_id="0"'

     

     

    After executing this request, the service should no longer be in the cart, and in the general list of CloudVPS services, we see our service in the status "Activation in progress":

     

     

    During the service activation process, no additional actions with the service are required. After the service is activated, we will have a list of available actions for managing the services, such as: Start, Stop, Delete, Resize, and others.
     

    We also suggest studying articles that may be useful for interacting with Cloud VPS products using the API: