অনিরাপদ সংযোগ সনাক্ত করা হয়েছে নিরাপদ সংযোগ আইপি:Unknown IP আপনি নিরাপদ নন কর্নেলভিপিএন দ্বারা সুরক্ষিত

কর্নেলভিপিএন

ColonelVPN reseller API

তৈরি করুন, renew and manage VPN services for your customers from your own system.

একটি এপিআই টার্মিনাল একটি কাঠামোগত অনুরোধ এবং প্রতিক্রিয়া পথ সহ. এটি একটি ধারণাগত বিকাশকারী চিত্র, একটি কার্যকরী এন্ডপয়েন্ট বা লাইভ ইন্টিগ্রেশন নয়.

For approved resellers. The API does what the reseller panel does, paid from your reseller balance. You make your keys in the panel under সেটিংস, API keys. Not a reseller yet? দিয়ে শুরু করুন reseller programme.

Basics

Addresshttps://colonelvpn.com/wp-json/cvpn-reseller/v1/
FormatJSON in, JSON out. Times are Unix seconds; expires_iso gives the same end date as text.
MoneyEuro, without VAT. Every paid call is taken from your reseller balance at your own price level. Nothing is refunded.
Limit120 requests a minute for each key. Above that the answer is 429.
User-AgentSend a User-Agent that names your own software. It must not contain the word “colonel”.

Keys

Send your key in the header X-API-Key, or as Authorization: Bearer. A key is shown once, when you create it.

Three permissions

read only looks. sell also creates customers, adds time and makes codes. manage also stops access and changes devices and names.

Test keys

A test key checks your input and answers like the real call, with "test": true. It creates nothing and charges nothing.

Limits you set

A key can be limited to your own IP addresses or IPv4 ranges. Revoking a key in the panel stops it at once.

Never pay twice

Send external_id, your own order number, with every call that costs money, or the header Idempotency-Key. If you repeat the call with the same value, you get the first result back with "repeated": true and nothing is charged again.

Calls

Method and pathNeedsWhat it does
GET /meপড়াBalance, currency, price level, active customers, permission and kind of the key
GET /pricesপড়াEvery period and device count on sale, with your price
GET /locationsপড়াLocations for WireGuard files
GET /balance/historyপড়াBalance rows, newest first. Takes limit এবং offset
GET /servicesপড়াYour customers. Takes state (active, expiring, expired, suspended), search, limit, offset
POST /servicessellNew customer. Body: label, days, devices, optional device_name, external_id
GET /services/{id}পড়াOne customer with devices and links. usage=1 adds the data used per device
POST /services/{id}manageChange label বা auto_renew
POST /services/{id}/renewsellAdd time. Body: days, external_id
POST /services/{id}/suspendmanageStop access. The end date keeps running
POST /services/{id}/resumemanageRestore access
POST /services/{id}/devicesmanageএকটি ডিভাইস যোগ করুন. Body: name. The answer holds its link
DELETE /services/{id}/devices/{device}manageRemove a device. Its link stops working
POST /services/{id}/devices/{device}/relinkmanageNew link for a device. The old one stops working
GET /services/{id}/devices/{device}/wireguardপড়াOne WireGuard configuration as text. Takes location
POST /codessellA batch of codes. Body: count (1 to 500), days, devices, optional note, external_id
GET /codesপড়াYour batches. With batch, the codes of one batch and whether each was used

A customer in the answers

{
  "id": 41,
  "label": "Anna",
  "status": "active",
  "expires": 1798761600,
  "expires_iso": "2027-01-01T00:00:00+00:00",
  "device_limit": 3,
  "device_count": 1,
  "auto_renew": false,
  "held_by_you": true,
  "created": 1796169600,
  "devices": [
    { "id": "aB3dE5fG7hJ9", "name": "phone", "link": "https://...", "created": 1796169600 }
  ]
}

status is active, expired বা suspended. held_by_you is false for a service that sits in a customer’s own account because it was made from one of your codes; that customer manages its devices, not the API.

POST /services answers 201 with the service, the price and your new balance. If the first device could not be set up at that moment the answer also carries warning: the customer is paid for, and adding the device later costs nothing.

Errors

Every error has the same shape: { "code": "...", "message": "...", "data": { "status": 422 } }.

HTTPCodeMeaning
401no_key, bad_keyNo key, or a wrong or revoked key
402fundsThe balance does not cover the price. Nothing was charged
403ip_not_allowed, not_permitted, account_closed, closedWrong IP address, a key without this permission, or a reseller account that cannot be used now
404no_service, no_deviceNot found, or it belongs to somebody else
409limit, inactive, not_managed, busyDevice limit reached, service not active, service in the customer’s own account, or the balance is busy
422input, not_on_saleA missing or wrong field, or this period and device count has no price
429too_many_requestsMore than 120 requests in a minute
503vpn_unreachableThe VPN service could not be reached. Nothing was lost; try again

Example

curl -s https://colonelvpn.com/wp-json/cvpn-reseller/v1/services \
  -H "X-API-Key: cvr_test_..." -H "Content-Type: application/json" -A "my-shop/1.0" \
  -d '{"label":"Anna","days":30,"devices":3,"external_id":"order-1001"}'

Keep keys on your server. Never put a key in a web page or in a mobile app.

Ready-made connections

You do not have to write the integration yourself. Ready-made connections for WordPress, WooCommerce, WHMCS, Blesta, HostBill (beta) and Shopify use this API with your key. See what each one does on the রিসেলার পৃষ্ঠা.

Good to know

  • Money. Every amount is in the currency of your reseller account (EUR or USD), without VAT. GET /me এবং GET /prices name it in the field currency; read it from there.
  • Services that are about to end. Your software asks for them with GET /services?state=expiring; nothing is sent to your address by itself.
  • Free test codes are made in the panel only.

Reseller programme আমাদের সাথে যোগাযোগ করুন

API প্রশ্ন

Who can use the ColonelVPN API?

Approved resellers. The API does what the reseller panel does and is paid from the reseller balance.

How do I get an API key?

Sign in as a reseller, open Settings in the reseller panel and create a key under API keys. The key is shown once.

Can I test without spending money?

হ্যাঁ. A test key checks your input and answers like the real call, but creates nothing and charges nothing.

What happens if my request is sent twice?

Send your own order number as external_id, or an Idempotency-Key header. A repeated call returns the first result and is not charged again.

Is there a WooCommerce or WHMCS plugin?

হ্যাঁ. There are ready-made connections for WordPress, WooCommerce, WHMCS, Blesta, HostBill (beta) and Shopify. They use this same API.