Purchase new virtual machine
Purchase and setup a new virtual machine.
Purchase and setup a new virtual machine.
If virtual machine setup fails for any reason, login to hPanel and complete the setup manually.
If no payment method is provided, your default payment method will be used automatically.
If the response is 202 Accepted, the payment is still being processed and the virtual machine
was not set up. Login to
hPanel and complete the setup manually.
Use this endpoint to create new VPS instances.
API Token authentication
Catalog price item ID
hostingercom-vps-kvm2-usd-1mPayment method ID, default will be used if not provided
1327362Success response
Payment is being processed, the order will complete asynchronously
Unauthenticated response
Validation error response
Error response
POST /api/vps/v1/virtual-machines HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 376
{
"item_id": "hostingercom-vps-kvm2-usd-1m",
"payment_method_id": 1327362,
"setup": {
"template_id": 1130,
"data_center_id": 19,
"post_install_script_id": 6324,
"password": "oMeNRustosIO",
"hostname": "my.server.tld",
"install_monarx": false,
"enable_backups": true,
"ns1": "4.3.2.1",
"ns2": "1.2.3.4",
"public_key": {
"name": "my-key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2X..."
}
},
"coupons": []
}{
"order": {
"id": 2957086,
"subscription_id": "Azz353Uhl1xC54pR0",
"status": "completed",
"currency": "USD",
"subtotal": 899,
"total": 1088,
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"company": null,
"address_1": null,
"address_2": null,
"city": null,
"state": null,
"zip": null,
"country": "NL",
"phone": null,
"email": "john@doe.tld"
},
"created_at": "2025-02-27T11:54:22Z",
"updated_at": "2025-03-27T11:54:22Z"
},
"virtual_machine": {
"id": 17923,
"firewall_group_id": null,
"subscription_id": "Azz353Uhl1xC54pR0",
"data_center_id": 521,
"plan": "KVM 4",
"hostname": "srv17923.hstgr.cloud",
"state": "running",
"actions_lock": "unlocked",
"cpus": 4,
"memory": 8192,
"disk": 51200,
"bandwidth": 1073741824,
"ns1": "1.1.1.1",
"ns2": "8.8.8.8",
"ipv4": [
{
"id": 52347,
"address": "213.331.273.15",
"ptr": "something.domain.tld"
}
],
"ipv6": [
{
"id": 52347,
"address": "213.331.273.15",
"ptr": "something.domain.tld"
}
],
"template": {
"id": 6523,
"name": "Ubuntu 20.04 LTS",
"description": "Ubuntu 20.04 LTS",
"documentation": "https://docs.ubuntu.com"
},
"created_at": "2024-09-05T07:25:36.00000Z"
}
}Last updated
Was this helpful?