JSON REST API




Order request




{
        "action": "order_create"

        ,"items": [
                {
                        "name": "My testserver 1"
                        , "product":
                        {
                                "name": "VPS"
                                , "options":
                                {
                                        "quantity_ram_gb": 0.5
                                        , "quantity_cpu": 9
                                        , "quantity_storage_gb": 25
                                        , "os": 2

                                        , "features":
                                        {
                                             "ipv4": 1

                                             , "sshd":
                                             {
                                                , "authorized_keys": "ssh-rsa ......"
                                                , "ip_allow": "fec0:aaa:1:2::ff,192.168.0.0/24"
                                                , "public_ports_allow": "80,443,12000:12010"
                                               
                                             }

                                        }
                                }
                        }
               }
        ]
        , "reference": "Optional order reference"


}



Return data is HTTP 2xx JSON with created order id. HTTP response codes other than 2xx is an error
If your profile do not have enough credit, you might get a response asking for payment. The invoice is already created if so.

Order response example


{"order_id": 73, "status": 200, "message": "Order is being processed"}


Order status


{
        "action": "order_status"
        ,"order_id": NNNN
}

Order status response example


{
  "order_id": 73
  , "status": 200
  , "message": "Order is being processed"

  , "order_items": [
     {
         "id": 1293
          , "status": 200
          , "name": "VPS"
          , "reference":"My testserver 1"
          , "message": "Order is being processed"
     }
   ]
}


Order list

Lists all orders

{
        "action": "order_list"
}

Order cancel


Cancel the entire order

{
        "action": "order_cancel"
        ,"order_id": NNNN
}

Cancel an item of the order

{
        "action": "order_cancel"
        ,"order_id": NNNN
        ,"order_item_id": NNNN
}

The order items will not be renewed and will be cancelled after end period.
Response is an empty 200 OK, or 404 not found for not found.



Server list

Lists all servers

{
        "action": "server_list"
        ,"order_item_id": 0  // 0 or blank for all servers
}



Status codes