Get your key
Sign in, open API access and create a key. Choose read-only access or enable orders for your account.
Connect your storefront to VPS Ray. Import plans, check prices, place orders and track delivery from your own system.
Sign in, open API access and create a key. Choose read-only access or enable orders for your account.
Use the URL and key below. Test with /account, then import plans from /catalog.
Confirm a quote, create an invoice and pay using your wallet or the hosted checkout.
Use the base URL and your complete vpr_ key. No username or API secret is required. A successful GET /account confirms the connection without creating an order or spending credit.
https://vpsray.com/api/reseller/v1Authorization: Bearer vpr_…curl 'https://vpsray.com/api/reseller/v1/account' \
-H "Authorization: Bearer $VPSRAY_API_KEY"Run on your server. Store the key in an environment variable named VPSRAY_API_KEY.
For automation, fund your VPS Ray wallet in Billing and create a key with orders:write and wallet:pay. Read-only and existing order keys cannot spend credit.
const { data: plan } = await vpsray.quote(planId);
// Choose exact options from plan.locations and plan.osChoices.
// Persist this order key in your database BEFORE the request.
const { invoice } = await vpsray.createOrder({
planId: plan.id,
cycle: 'monthly',
location: selectedLocation,
os: selectedOS,
hostname: 'customer-server',
provider: 'wallet',
walletCurrency: 'USD',
expectedAmount: plan.prices.monthly.total,
billing: customerBilling
}, yourSavedOrderKey);
// Requires wallet:pay and enough prepaid credit.
await vpsray.payInvoiceFromWallet(invoice.id);
// Paid means accepted for setup. Poll until status is active.
const { data: service } = await vpsray.service(invoice.serviceId);customerBilling requires firstName, lastName, address, city, state, postcode, country (two uppercase letters) and phone. For domains, use GET /domains/check?domain=example.com first, choose annual billing, and include expectedRenewalAmount from the quote; registration checks availability again.
Insufficient customer credit leaves the invoice unpaid. Add funds, then retry payment on that invoice ID. If activation needs attention after payment, the order stays in the delivery queue. Payment confirmation and service activation are separate states.
For hosted payment, use nmi, cryptomus or binance as the order provider and open invoice.paymentUrl. The reseller signs in to the VPS Ray account that owns the order. Never send card details through this API.
/domains/check?domain=example.comCheck domain availability before registration.
Scope: catalog:read
/accountCheck connection, scopes, expiry and pricing tier.
Any valid key
/catalogPublished products with your assigned pricing.
Scope: catalog:read
/quotes/{id}Current price, location, OS and supported billing cycles.
Scope: catalog:read
/ordersCreate one unpaid order from your reviewed quote.
Scope: orders:write
/balanceYour prepaid credit, separated by currency.
Scope: wallet:read
/invoices/{id}/payPay an existing invoice from prepaid credit, once.
Scope: wallet:pay
/services/{id}Track activation, service details and dated infrastructure status.
Scope: services:read
/invoices/{id}Read invoice status and its direct payment link.
Scope: invoices:read
GET /services and GET /invoices list your records. Lists accept limit (1–100) and offset. Follow nextOffset until null. Catalog offsets stop at 5,000; account lists at 100,000. Contact support for larger exports.
API keys are attached to one customer, expire after 1–365 days, and can be revoked immediately. Named account tiers apply to new quotes automatically; existing invoices keep their agreed amounts.
Idempotency-Key per order. Reuse it with the same body after a timeout. Replays return the original invoice.checkedAt and freshness. Add ?refresh=1 to an individual service read to wait for a live status check.X-RateLimit-Remaining and honor Retry-After.| Status | Next step |
|---|---|
| 400 / 409 | Check the error, quote and current invoice. Fix the input before retrying. |
| 401 / 403 | Check key expiry, revocation and required permissions. |
| 404 | Check the endpoint or record ID. Other customers’ records are not accessible. |
| 429 | Wait for Retry-After. Do not create another key to evade the limit. |
| 502 / 503 / 504 | Back off and retry with the same order key or invoice ID. |
Responses include X-Request-Id for support. JSON errors include error, and runtime rejections include code and requestId. If the hosting security layer returns a non-JSON 403 before the API responds, the JavaScript client reports hosting_blocked with an edgeRequestId. Send that reference to support; do not repeatedly retry or change keys. Keys belong on your server, never in a public browser or URL.
The JavaScript client requires Node 20+ or a compatible server runtime. It retries transient failures at most twice; long rate-limit waits are returned to your queue through retryAfter. No dependencies are required.