Home
Running with the power of GOD Alle systemen operationeel

API documentation

Two ways to drive RoyalNetwork programmatically: the native Standard API and a drop-in PerfectPanels-compatible endpoint, so an existing panel integration keeps working.

Base URL: https://royalnet.work Auth: Bearer token Format: JSON Currency: USD
1 · Check the token
curl
curl https://royalnet.work/api/v1/account/balance \
  -H "Authorization: Bearer $TOKEN"
2 · Price a plan, then buy it
curl
curl -X POST https://royalnet.work/api/v1/order/create \
  -H "Authorization: Bearer $TOKEN" \
  -d "region=eu" -d "traffic=30" -d "period=90"

Overview

Every subscription sold by the platform can also be sold through an API. Both APIs operate on the same orders, balances and servers as the dashboard: an order created by API appears in the customer panel, and a renewal done there is visible to the API.

APIBase pathUse it when
Standard API https://royalnet.work/api/v1 You are writing your own client and want the full feature set (renewals, limit changes, key rotation, order metadata).
PerfectPanels API https://royalnet.work/api/perfect You already run PerfectPanel and want to resell these subscriptions without changing your panel.

Units and money

  • All amounts are US dollars. The display currencies on the website never change what an order costs.
  • traffic is gigabytes, users is the number of simultaneous connections.
  • period is the subscription length in days (30, 60, 90, 120, 240).
  • An order has one limit type: traffic or connections, never both.

Available regions

CodeRegionOrderable
iri Iran yes
ind India yes
chn China no
usa Verenigde Staten yes
eu Europa yes

Authentication

Every request carries the API token of an active customer or reseller account as a bearer token. The token is shown in the customer panel (Account → API token) and can be rotated there at any time; rotation invalidates the old token immediately.

HTTP header
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json

The token identifies the account, so an order lookup is already scoped: an API client can only ever see and change its own orders.

Keep the token server-side. It gives full access to the account balance and to every subscription on it.

Errors

The Standard API answers with a consistent envelope. Check success first, then error when it is false.

200 / error
{
  "success": false,
  "error": "order_not_found",
  "message": "Order not found or does not belong to you"
}
HTTPerrorMeaning
401missing_tokenNo bearer token was sent.
401invalid_tokenThe token is wrong, rotated or the account is not active.
400invalid_parametersA field is missing or out of range; the message names it.
404order_not_foundNo such order, or it belongs to another account.
400insufficient_balanceThe balance does not cover the order; the response includes required.
400order_cannot_renewThe renewal window rules are not met (see below).
400order_cannot_cancelledTrial or already finished orders cannot be cancelled.
500renewal_failed / modification_failedA server-side operation failed; retry, then contact support.

The PerfectPanels API answers in its own shape: { "error": "..." } with HTTP 400 for a bad request and the documented object on success.

Limits & rate limits

RuleValue
Traffic per order1 – 100 GB
Connections per order1 – 20
Periods30, 60, 90, 120, 240 days
IncreaseTraffic may not exceed 100 GB, connections may not exceed 20
Renewal windowTraffic left ≤ 20% of the limit, or days left ≤ 10% of the period
TrialOne per region per account per 7 days
Rate limitThrottled per token; a 429 means slow down
A trial is free and expires quickly. Trials cannot be renewed or cancelled; create a paid order instead.

Standard API /api/v1

All paths below are relative to https://royalnet.work/api/v1.

Create an order

POST /order/create charges the balance immediately
FieldTypeNotes
regionstringOne of the region codes above.
periodint30, 60, 90, 120 or 240.
trafficintGB. Required for a traffic order, omit for a connection order.
usersintConnections. Required for a connection order.
linkstringOptional owner contact: an email address or a phone in +1234567890 form.
curl
curl -X POST https://royalnet.work/api/v1/order/create \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" \
  -d "region=eu" -d "traffic=30" -d "period=90"
200
{
  "success": true,
  "message": "Order created successfully",
  "data": {
    "id": 1042,
    "region": "eu",
    "traffic": 30,
    "users": 0,
    "period": 90,
    "expire": "2026-01-23T10:00:00.000000Z",
    "cost": 12.5,
    "balance": 87.5,
    "subscription": "https://sub.example.com/abc123"
  }
}

Request a trial

POST /order/trial free, one per region per week
FieldTypeNotes
regionstringRegion code.
linkstringOptional contact, same format as above.

Read an order

GET /order/detail?id=1042
GET /order/key?id=1042 client credentials
GET /order/link?id=1042 subscription link

Renew

POST /order/renew

Renewal is only allowed once the subscription is finishing:

  • traffic-based order: remaining traffic ≤ 20% of the limit;
  • connection-based order: remaining days ≤ 10% of the period.
FieldTypeNotes
idintOrder to renew.
periodintNew period in days.
traffic / usersintOptional new limit; unused traffic or days are added on top.

Increase / decrease a limit

PUT /order/increase amount in GB or connections
PUT /order/decrease cannot cut below current usage

Activate, deactivate, regenerate

PUT /order/activate
PUT /order/deactivate
PUT /order/regenerate new credentials; devices must re-import

All three take only id.

Update order metadata

PUT /order/update
FieldTypeNotes
namestringFriendly label, max 30 characters.
emailemailNotification address.
phone_numberstringMax 20 characters.

Cancel

DELETE /order/cancel?id=1042 refunds the unused part

The unused share of the subscription is credited back to the balance. Trials and finished orders cannot be cancelled.

Account

GET /account/balance
GET /account/keys
GET /account/links

Metadata

GET /meta/regions
GET /meta/locations
GET /meta/protocols

Use /meta/regions to discover what can be ordered right now instead of hard-coding region codes.

Network check

GET /network/check which server answers this IP
GET /network/verify?id=1042 probe a subscription end to end

PerfectPanels API /api/perfect

How it works

This is a single endpoint that speaks the PerfectPanel protocol: one POST to https://royalnet.work/api/perfect with an action field. It exists so a PerfectPanel installation can resell these subscriptions as a provider without any custom code.

  • Authentication is the same bearer token.
  • Services are generated from the live price list, so the panel always sees current availability and rates.
  • Rates are returned in the panel's convention: USD × 1000.

action=services

Lists everything that can be sold. Categories follow [REGION] Traffic Based (30D) and [REGION] User Based (30D).

curl
curl -X POST https://royalnet.work/api/perfect \
  -H "Authorization: Bearer $TOKEN" \
  -d "action=services"
200
[
  {
    "service": 1,
    "name": "10GB - Unlimited User - 30 Days",
    "type": "Default",
    "category": "[EU] Traffic Based (30D)",
    "rate": "1250.000",
    "min": 1,
    "max": 10,
    "refill": false,
    "cancel": false
  }
]

action=add

Creates an order and charges the balance.

FieldTypeNotes
actionstringadd
serviceintA service id from action=services.
linkstringCustomer contact: email or +1234567890.
quantityintBetween the service's min and max.
200
{ "order": 1042 }

action=status

Accepts one or more order ids (orders, comma separated).

200
{
  "charge": "1250.000",
  "start_count": null,
  "status": "active",
  "remains": 30,
  "currency": "USD"
}

remains is remaining gigabytes for a traffic order and remaining days for a connection order. Status values mirror the panel: active, inactive, finished, blocked.

action=balance

200
{ "balance": "87.5000", "current": "USD" }

Connect a PerfectPanel

  1. In PerfectPanel: Providers → Add provider → API.
  2. URL: https://royalnet.work/api/perfect
  3. Key: the customer's API token from the RoyalNetwork panel.
  4. Save, then press Sync services. The generated catalogue appears as categories grouped by region and period.
Prices come from the platform's own price list, so keep the reseller balance topped up: orders are paid from it, exactly like an API order.

Need help?

Open a ticket from the dashboard (Support) or contact us. Include the order id and the timestamp of the failing call - both are logged.

Begin nu