is*hosting API

In this document, we will explain how to authorize requests and walk you through the process of creating a new VPS service, including placing and paying for an order.

is*hosting API allows you to automate basic actions such as:

  • Orders creation
  • Invoices payment 
  • Service status checking 
  • Service management

These actions can be performed using HTTP requests to:

https://api.ishosting.com

Examples of requests will be given as curl commands. cURL (client URL) is a utility available by default for Linux and macOS OS. It allows you to work with the HTTP protocol using the command line. If you use Windows, the examples can be easily converted into PowerShell commands using any online converter.

The Swagger version of the is*hosting API specification is available in your account. You can also test and generate any request from the is*hosting API as curl commands. To do this, just click the Try it out button.


1

Requests are subject to restrictions:

  • 150 requests in 10 seconds (if exceeded – blocked for 1 hour)
  • 300 requests in 1 minute (check CF managedChallenge)

Authorization

To gain access, you need an API key, which can be generated in your Client Area.

To add an API key, follow the steps:

  1. In your Client Area, in the API section, click Add API key.
    2
  2. The key is added to the request as a header:

    -H 'X-Authorization: YOUR_API_KEY'

The key validity period is 6,048,000 seconds or 70 days.

Service Selection

To place an order, we need to know the type of service and tariff plan.

  • Service type – the type parameter. It can take the following expected value: vps, storage, dedicated, vpn, ssl.
  • Tariff plan code – the plan parameter. Information about VPS tariff plans can be obtained upon request:
    https://api.ishosting.com/services/vps/plans 

    curl -X 'GET' \

      'https://api.ishosting.com/services/list' \

      -H 'accept: application/json' \

      -H 'X-Api-Token: YOUR_API_KEY' \

      -H 'Accept-Language: en'

The above request returns a list of tariff plans with codes and descriptions. Issue can be limited by the following parameters:

  • locations – country where the data center is located. Expected value: letter country code. For example: NL, PL, EE.
  • platforms – operating system platform. Expected value: windows, linux.
  • period – payment cycle. Expected value: 1m, 3m, 6m, 1y.

We can also modify the tariff plan options by adding alternative options to the additions parameter. A list of alternative options can be obtained upon request: https://api.ishosting.com/services/vps/configs/:code, where the code parameter is the tariff plan code. The request returns a list of available alternative tariff plan options.

curl -X 'GET' \

  'https://api.ishosting.com/vps/configs/29_6m' \

  -H 'accept: application/json' \

  -H 'X-Api-Token: YOUR_API_KEY' \

  -H 'Accept-Language: en'

 

Tip: You can also view the tariff plan code in your personal account when ordering a service:
3

Example:

For example, let's take:

  • VPS service
  • Lite plan – Linux NVMe
  • in the Netherlands location
  • with a 6-month payment cycle 

By default, the tariff plan includes:

  • zero additional IP addresses
  • 1GB RAM
  • Ubuntu 22 x64 OS

Selecting alternative options:

  • 4 additional IP addresses
  • 2 GB RAM
  • Debian 12 x64 OS

Using the request https://api.ishosting.com/services/vps/plans we find out the tariff plan code: 29_6m.

Using the request https://api.ishosting.com/services/vps/configs/:code we get the alternative tariff plan options we need:

  • {"quantity": 4,"category": "ip"}
  • {"code": "2g","category": "ram"}
  • {"code": "linux/debian11#64", "category": "os"}

Order Placing

From the data obtained above, we collect the body of the request to place an order in JSON format:

  1. Basic tariff plan without modifications:
    {

     "items": [

       {

         "action": "new",

         "type": "vps",

         "plan": "29_6m"

        

       }

     ]

    }
  2. Modified tariff plan:
    {

    "items": [

      {

        "action": "new",

        "type": "vps",

        "plan": "29_6m",

        "additions": [

          {

            "code": "linux/debian11#64",

            "category": "os"

          },

          {

            "quantity": 4,

            "category": "ip"

          },

          {

            "code": "2g",

            "category": "ram"

          }

        ]

      }

    ]

    }

    Optional: Before placing an order, you can request detailed information, including current prices, to make sure that the order suits you. To do this, we use the request:

    https://api.ishosting.com/billing/validate

    curl -X 'POST' \

      'https://api.ishosting.com/billing/order/validate' \

      -H 'accept: application/json' \

      -H 'X-Api-Token: YOUR_API_KEY' \

      -H 'Accept-Language: en' \

      -H 'Content-Type: application/json' \

      -d '{

     "items": [

       {

         "action": "new",

         "type": "vps",

         "plan": "29_6m"

        

       }

     ]

    }

    '
  3. If everything is good, we place the order using the request:
    https://api.ishosting.com/billing/order
    curl -X 'POST' \

      'https://api.ishosting.com/billing/order' \

      -H 'accept: application/json' \

      -H 'X-Api-Token: YOUR_API_KEY' \

      -H 'Accept-Language: en' \

      -H 'Content-Type: application/json' \

      -d '{

     "items": [

       {

         "action": "new",

         "type": "vps",

         "plan": "29_6m"

        

       }

     ]

    }

    '

     

  4. If everything is good, and the order has been placed, the response contains detailed information about the order and the invoice number for payment in the id parameter. 

Attention! The invoice is valid for 3 days. After three days, the unpaid order/invoice is automatically canceled.

Order Payment

Knowing the invoice number, we can pay it using the request:

https://api.ishosting.com/billing/invoice/:id/pay

To pay for your order, use the following adjustments:

  1. Enter the invoice number using the request https://api.ishosting.com/billing/invoice/:id/pay.
    curl -X 'POST' \

      'https://api.ishosting.com/billing/invoice/YOUR_INVOICE_ID/pay' \

      -H 'accept: application/json' \

      -H 'X-Api-Token: YOUR_API_KEY' \

      -H 'Accept-Language: en' \

      -H 'Content-Type: application/json' \

      -d '{

       "balance": "true",

       "renew": "false",

       "method": "not set",

     "redirect": "not set"

    }

    '
  2. To pay from balance, use the following JSON:
    {

       "balance": "true",

       "renew": "false",

       "method": "not set",

     "redirect": "not set"

    }
  3. If no errors occur, the order is sent for activation and the VPS will become available in the near future.

Conclusion

We hope this article will help you easily understand placing orders using the is*hosting API.

If you have questions or suggestions for improvements, we will be grateful for your feedback. You can ask questions in the online chat in the lower right corner of the site or by sending a ticket to technical support with the subject “API Questions”, and we will definitely pay attention to your request.

 

Thank you for your attention and enjoy using our services,

is*hosting Team