CrownPanel API Overview

CrownPanel's API allows you to manage your VPS programmatically - including actions like power control, hostname changes, snapshot management, billing operations, renewals, and more.

You can use the API with:

  • PHP scripts
  • CLI tools like curl
  • Monitoring systems
  • Custom control panels or dashboards

Ideal for automation, integration into management panels, or performing bulk operations across multiple VPS instances.


🔄 Renew Service

Use this API to pay an unpaid invoice and automatically renew the associated service.

This API will:

  • Validate the invoice
  • Process the payment
  • Renew the VPS service
  • Return renewal confirmation status

🔐 Key(s) and variable(s) required for this call,

KeyVariableDescriptionRequired
API_KEYYOUR_API_KEYReplace with your API key from Account Settings → API✅ Yes
QUERYrenew_serviceFixed value: must be "renew_service"✅ Yes
VMIDVMIDReplace the VMID with your VPS VMID to renew. Retrieve it from the List All VPSes API Call.✅ Yes

Example Responses


✅ Success Output

Success Output

{ "query_status": "Success", "query": "renew_service", "invoice_id": "43210", "amount_paid": "5.00", "renewal_status": "Success", "query_result": "Invoice Paid and Service Renewed." }



❌ Error Output (Invoice Already Paid)

Error Output - Already Paid

{ "query_status": "Error", "query": "renew_service", "invoice_id": "43210", "renewal_status": "Failed", "query_result": "Invoice Already Paid." }


❌ Error Output (Invalid API Key)

Error Output - Invalid API Key

{ "query_status": "Error", "query": "renew_service", "query_result": "Invalid API Key." }

Error Output - Renewal Failed

{ "query_status": "Error", "query": "renew_service", "invoice_id": "43210", "amount_paid": "5.00", "renewal_status": "Error", "query_result": "Contact support, Invoice was not paid automatically. Credit is moved to Client Area Balance." }

Error Output - API Processing Issue

{ "query_status": "Error", "query": "renew_service", "invoice_id": "293764", "amount_paid": "5.00", "renewal_status": "API Error", "query_result": "Success, $5 was reversed back to account due to an API issue." }


Error Output - Low Wallet Balance

{ "query_status": "Error", "query": "renew_service", "invoice_id": "43210", "amount_paid": "5.00", "renewal_status": "Low Balance", "query_result": "Wallet Balance not enough to renew this service." }

Error Output - No Unpaid Invoice Found

{ "query_status": "Error", "query": "renew_service", "invoice_id": "43210", "amount_paid": "5.00", "renewal_status": "Not Available", "query_result": "No Unpaid Invoice Found For Service. Contact Support." }

Error Output - Unknown Renewal Status

{ "query_status": "Error", "query": "renew_service", "invoice_id": "43210", "amount_paid": "5.00", "renewal_status": "Unknown", "query_result": "Service Not Renewed" }

CURL Example

curl -d "API_KEY=API-KEY-HERE&QUERY=renew_service&VMID=VMID" -X POST https://api.crownpanel.com

🌐 Other Language Examples

If you prefer to use another language or environment, here are examples for PHP, Python and Node.js:


PHP Example
<?php
$url = "https://api.crownpanel.com";

$post = [
  'API_KEY' => 'YOUR_API_KEY',
  'QUERY' => 'renew_service',
  'VMID' => 'VMID',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));

$response = curl_exec($ch);
var_export($response);
?>
Python Example

âš™ī¸ Install (only once): Required to install necessary libraries before running the code.

pip install requests
import requests

url = "https://api.crownpanel.com"

data = {
    "API_KEY": "YOUR_API_KEY",
    "QUERY": "renew_service",
    "VMID": "VMID",
}

response = requests.post(url, data=data)
print(response.text)
Node.js Example

âš™ī¸ Install (only once): Required to install necessary libraries before running the code.

npm install axios
const axios = require('axios');

const data = new URLSearchParams({
  API_KEY: 'YOUR_API_KEY',
  QUERY: 'renew_service',
  VMID: 'VMID',
});

axios.post('https://api.crownpanel.com', data)
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error('Error:', error);
  });

Need help? Visit our Support Portal or reach out via our live chat.