Crapplet Cloud Website Dashboard

Reseller API

Sell Crapplet VPS, hosting and servers on your own website under your own brand. Your site calls this API; orders are paid from your Crapplet wallet at your wholesale price; we set the service up and tell your site when it's ready.

Base URL  https://crapplet.co.in/api/v1/reseller

Everything is JSON over HTTPS. Your customers never see Crapplet — they buy from you, and you manage their services through this API or your reseller dashboard.

Before you start: you need an approved reseller account (apply in the client area under Reseller) and money in your wallet (client area → Wallet & credit → Add funds).

Quick start

  1. Open your reseller dashboard → API tab → Create API key. Copy the key (it starts with ck_) — it's shown once.
  2. List the plans you can sell and their wholesale prices:
    curl -H "Authorization: Bearer ck_YOUR_KEY" \
      https://crapplet.co.in/api/v1/reseller/plans
  3. Place an order when your customer pays you:
    curl -X POST -H "Authorization: Bearer ck_YOUR_KEY" -H "Content-Type: application/json" \
      -d '{"planId":"PLAN_ID","cycle":"MONTHLY","hostname":"vps1.customer.com","osTemplateId":"OS_ID","reference":"ORDER-1001"}' \
      https://crapplet.co.in/api/v1/reseller/orders
  4. Set a webhook to hear when the server is ready, or poll GET /services/{id} until status is ACTIVE, then give your customer the IP and login.

Authentication

Send your API key as a Bearer token on every request:

Authorization: Bearer ck_ab12cd34_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Amounts, errors and limits

Money

All amounts are integers in paise (₹1 = 100). 45000 means ₹450.00. Prices are before GST; invoices show the GST added.

Billing cycles

MONTHLY, QUARTERLY, SEMIANNUAL, ANNUAL, BIENNIAL, TRIENNIAL — only the cycles a plan lists in prices can be ordered.

Errors

Errors return a non-2xx status and a JSON body:

{ "error": "Plan not found — list plans with GET /plans", "code": "NOT_FOUND" }
StatusMeaning
400Invalid request. Validation errors include details with the field problems.
401No key, a wrong key, or a revoked key.
402INSUFFICIENT_FUNDS — your wallet can't cover it. Top up, then pay the invoice.
403Your reseller account isn't approved (or is suspended).
404Not found — or not yours.
409Conflict, e.g. that domain already has a hosting account.
429RATE_LIMITED — more than 300 requests a minute on one key. Wait for the time in the RateLimit-Reset header.
5xxOur side. Safe to retry orders when you send a reference (see below).

Selling on your website — the full flow

  1. Show plans. Call GET /plans (cache it for a few minutes). Show your price — wholesale is what you pay us.
  2. Customer pays you on your website, with your own payment gateway.
  3. Order from us with POST /orders, passing your own order number as reference. If your request times out, send it again with the same reference — you'll get the same order back, never a second one.
  4. Wait for setup. The service goes PROVISIONING → ACTIVE (usually 1–5 minutes for a VPS). The service.active webhook tells you; or poll GET /services/{id}.
  5. Hand over. GET /services/{id} returns the IP, username and password. Email them to your customer.
  6. Renewals. Before each due date we create a renewal invoice for you. It's paid from your wallet automatically when the balance covers it — keep your wallet topped up. If not, pay it with POST /invoices/{id}/pay. Unpaid renewals are suspended and later terminated, as for any customer.

Account

GET/me

Your reseller account and wallet balance.

{
  "reseller": { "id": "cm…", "brandName": "HostBiz", "status": "APPROVED", "discountPct": 10 },
  "wallet": { "balance": 250000, "currency": "INR" }
}
GET/plans

Every plan you can sell, with your wholesale price per billing cycle.

{
  "plans": [
    {
      "id": "cmplan123",
      "name": "Linux VPS G2",
      "type": "VPS_LINUX",
      "category": "vps",                         // vps | hosting | other
      "requires": ["hostname", "osTemplateId"],    // what POST /orders needs for this plan
      "specs": { "cpuCores": 2, "ramMb": 4096, "diskGb": 80, "bandwidthGb": 10240, "ipv4": 1, "virtType": "KVM" },
      "allowIpSelection": false,
      "locations": [ { "serverId": "cmsrv1", "name": "Noida" } ],
      "os": [ { "id": "cmos1", "name": "Ubuntu 24.04" }, { "id": "cmos2", "name": "Windows Server 2022" } ],
      "prices": [
        { "cycle": "MONTHLY", "retailList": 54900, "wholesale": 44910, "yourRetail": null },
        { "cycle": "ANNUAL",  "retailList": 658800, "wholesale": 538920, "yourRetail": null }
      ]
    }
  ]
}
FieldMeaning
wholesaleWhat you pay us per cycle, after your reseller discount.
retailListOur own public price, for reference.
yourRetailThe retail price you saved in your dashboard (optional, for your records).
requireshostname + osTemplateId for VPS, domain for hosting.

Orders

POST/orders

Order any plan. Paid from your wallet; the service is set up as soon as it's paid.

FieldTypeDescription
planIdrequiredstringFrom GET /plans.
cyclestringDefault MONTHLY.
hostnamestringVPS hostname, e.g. vps1.customer.com. Required for VPS.
domainstringThe website domain for hosting plans, e.g. customer.com. Required for hosting.
osTemplateIdstringOperating system from the plan's os list. Required for VPS.
serverIdstringLocation from the plan's locations (optional).
ipIdstringA specific IP from GET /ips — only for plans with allowIpSelection.
customerIdstringYour end customer from POST /customers (optional, for your records).
retailAmountintegerWhat you charge your customer, in paise (optional, for your reports).
referencestringYour own order number. Strongly recommended: repeating a request with the same reference returns the original order instead of creating another. The Idempotency-Key header works the same way.
curl -X POST https://crapplet.co.in/api/v1/reseller/orders \
  -H "Authorization: Bearer ck_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{
    "planId": "cmplan123",
    "cycle": "MONTHLY",
    "hostname": "vps1.customer.com",
    "osTemplateId": "cmos1",
    "reference": "ORDER-1001",
    "retailAmount": 79900
  }'
<?php
$ch = curl_init('https://crapplet.co.in/api/v1/reseller/orders');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('CRAPPLET_KEY'), 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'planId' => 'cmplan123', 'cycle' => 'MONTHLY',
    'hostname' => 'vps1.customer.com', 'osTemplateId' => 'cmos1',
    'reference' => 'ORDER-' . $orderId,   // your order number — makes retries safe
  ]),
]);
$body = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status === 402) { /* top up your wallet, then POST /invoices/{$body['invoiceId']}/pay */ }
$serviceId = $body['serviceId'];
const r = await fetch("https://crapplet.co.in/api/v1/reseller/orders", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.CRAPPLET_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ planId: "cmplan123", cycle: "MONTHLY", hostname: "vps1.customer.com", osTemplateId: "cmos1", reference: `ORDER-${orderId}` }),
});
const body = await r.json();
if (r.status === 402) { /* top up, then POST /invoices/${body.invoiceId}/pay */ }
const { serviceId } = body;

Responses

201 — paid and being set up:

{ "serviceId": "cmsvc1", "orderId": "cmord1", "invoiceId": "cminv1", "amount": 44910, "paid": true, "status": "PROVISIONING" }

200 — the same reference was ordered before (nothing new is created):

{ "serviceId": "cmsvc1", "invoiceId": "cminv1", "status": "ACTIVE", "duplicate": true }

402 — your wallet is short. The order and invoice exist but nothing is set up until it's paid:

{ "serviceId": "cmsvc1", "orderId": "cmord1", "invoiceId": "cminv1", "amount": 44910, "paid": false, "status": "PENDING",
  "error": "Insufficient wallet balance — top up, then POST /invoices/{invoiceId}/pay", "code": "INSUFFICIENT_FUNDS" }

Services

GET/services?status=ACTIVE&reference=ORDER-1001&page=1&limit=50

Your services, newest first. All filters are optional: status, reference, customerId, page, limit (max 200).

{
  "services": [
    { "id": "cmsvc1", "reference": "ORDER-1001", "plan": "Linux VPS G2", "planId": "cmplan123", "status": "ACTIVE",
      "hostname": "vps1.customer.com", "ip": "103.0.0.10", "ips": ["103.0.0.10"], "os": "Ubuntu 24.04",
      "customerId": null, "suspendReason": null, "terminationReason": null }
  ],
  "page": 1, "limit": 50, "total": 1
}
GET/services/{id}

One service with its login details, billing and — for a running VPS — live state.

{
  "service": {
    "id": "cmsvc1", "reference": "ORDER-1001", "plan": "Linux VPS G2", "status": "ACTIVE",
    "hostname": "vps1.customer.com", "ip": "103.0.0.10", "ips": ["103.0.0.10"], "os": "Ubuntu 24.04",
    "username": "root", "password": "Xy7#…",
    "billingCycle": "MONTHLY", "nextDueDate": "2026-12-14T00:00:00.000Z",
    "wholesaleAmount": 44910, "retailAmount": 79900, "createdAt": "2026-11-14T12:00:00.000Z",
    "live": { "state": "running", "cpuPct": 3.2, "memUsedMb": 612, "memTotalMb": 4096, "diskTotalGb": 80 }
  }
}
Windows VPS log in as Administrator, Linux as root. The password changes after reset_password or reinstall — read it again afterwards.
POST/services/{id}/action

Queue an action. Returns 202 { "queued": true }; the result shows in GET /services/{id} and as a webhook.

actionForNotes
start · stop · shutdown · rebootVPSstop is a hard power-off; shutdown asks the OS.
reinstallVPSPass osTemplateId. Erases the disk. Optional password (10–64 characters, upper case, lower case and a number); otherwise a new one is generated.
reset_passwordVPS, hostingNew root / Administrator / cPanel password.
suspend · unsuspendAllOptional reason. Services we suspended for non-payment unsuspend only when the invoice is paid.
{ "action": "reinstall", "osTemplateId": "cmos2", "password": "N3w-Strong-Pass" }
POST/services/{id}/login

For hosting: a one-time link that logs your customer straight into cPanel (or webmail with {"service":"webmaild"}). Valid for 60 seconds — redirect to it immediately.

{ "url": "https://server.example.com:2083/cpsess…/login/?session=…", "expiresInSeconds": 60 }
DELETE/services/{id}

Cancel or terminate. A service not yet set up is cancelled at once (200 {"ok":true,"status":"CANCELLED"}). A live one is terminated — the server and its data are deleted (202 {"queued":true}, then the service.terminated webhook). It stops renewing.

GET/ips?productId=PLAN_ID&serverId=&search=

Free IPs for plans with allowIpSelection, so your customer can pick one. Hold one for checkout with POST /ips/{ipId}/reserve {"productId":"…"}, then pass it as ipId in the order.

POST/customers

Optional: keep a record of your end customers here and attach services to them with customerId. They are yours — we never email them or let them log in to Crapplet.

{ "email": "asha@customer.com", "firstName": "Asha", "lastName": "Rao", "phone": "+919900000000", "companyName": "Asha Designs", "country": "IN" }

Returns 201 { "customer": { "id": "cmcus1", "email": "asha@customer.com" } }. GET /customers lists them.

Wallet & invoices

GET/wallet

Balance and the last 100 wallet movements. Add funds in the client area (Wallet & credit).

{ "balance": 155000, "currency": "INR",
  "transactions": [ { "amount": -44910, "balanceAfter": 155000, "description": "Applied to invoice PF-000412", "createdAt": "…" } ] }
GET/invoices?status=UNPAID&page=1&limit=50

Your invoices (orders and renewals). GET /invoices/{id} adds the lines.

{
  "invoice": {
    "id": "cminv1", "number": "CIPL/2026-27/00042", "status": "PAID", "currency": "INR",
    "subtotal": 44910, "tax": 8084, "total": 52994, "amountDue": 0,
    "issueDate": "…", "dueDate": "…", "paidAt": "…",
    "items": [ { "description": "Linux VPS G2 — vps1.customer.com (14 Nov – 14 Dec 2026)", "quantity": 1, "unitPrice": 44910, "amount": 44910, "serviceId": "cmsvc1" } ]
  }
}
POST/invoices/{id}/pay

Pay an unpaid invoice from your wallet. 200 {"paid":true,"applied":52994}, or 402 if the balance is short. Paying an order's invoice starts the setup; paying an overdue renewal restores a suspended service.

Webhooks

Instead of polling, give us a URL and we POST a signed JSON event to it whenever something changes.

EventWhen
service.activeA new service is ready (IP and login are in GET /services/{id}).
service.failedSetup failed. Our team is alerted and will retry or refund.
service.suspendedSuspended — by you, by us, or for an overdue renewal (suspendReason).
service.unsuspendedRunning again.
service.terminatedTerminated; the server is gone (terminationReason).
service.reinstalledReinstall finished — fetch the new password.
invoice.paidAn order, renewal or top-up invoice was paid.

What we send

POST https://yourwebsite.com/crapplet-webhook
Content-Type: application/json
X-Crapplet-Event: service.active
X-Crapplet-Timestamp: 1763112345
X-Crapplet-Signature: sha256=5f0c…

{
  "id": "evt_9c2f…",
  "event": "service.active",
  "createdAt": "2026-11-14T12:03:10.000Z",
  "data": { "id": "cmsvc1", "reference": "ORDER-1001", "plan": "Linux VPS G2", "status": "ACTIVE",
            "hostname": "vps1.customer.com", "ip": "103.0.0.10", "ips": ["103.0.0.10"], "os": "Ubuntu 24.04", … }
}

invoice.paid carries { id, number, total, currency, paidAt, serviceIds }.

Verify every request

Compute HMAC-SHA256 of timestamp + "." + raw body with your signing secret and compare it to the header. Reject requests older than 5 minutes.

<?php
$secret = getenv('CRAPPLET_WEBHOOK_SECRET');            // whsec_…
$body   = file_get_contents('php://input');              // the raw body, before json_decode
$ts     = $_SERVER['HTTP_X_CRAPPLET_TIMESTAMP'] ?? '';
$sig    = $_SERVER['HTTP_X_CRAPPLET_SIGNATURE'] ?? '';
$expect = 'sha256=' . hash_hmac('sha256', $ts . '.' . $body, $secret);
if (!hash_equals($expect, $sig) || abs(time() - (int)$ts) > 300) { http_response_code(400); exit; }

$event = json_decode($body, true);
// ignore events you've already processed: store $event['id']
if ($event['event'] === 'service.active') {
  // look up your order by $event['data']['reference'], then fetch login details:
  // GET /services/{$event['data']['id']} → email IP + password to your customer
}
http_response_code(200);
import crypto from "node:crypto";
import express from "express";
const app = express();
app.post("/crapplet-webhook", express.raw({ type: "application/json" }), (req, res) => {
  const ts = req.get("X-Crapplet-Timestamp") ?? "";
  const expect = "sha256=" + crypto.createHmac("sha256", process.env.CRAPPLET_WEBHOOK_SECRET).update(`${ts}.${req.body}`).digest("hex");
  const sig = req.get("X-Crapplet-Signature") ?? "";
  const fresh = Math.abs(Date.now() / 1000 - Number(ts)) < 300;
  if (!fresh || sig.length !== expect.length || !crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expect))) return res.sendStatus(400);
  const event = JSON.parse(req.body.toString());
  // dedupe on event.id, then handle event.event
  res.sendStatus(200);
});

Delivery

PUT/webhook

Set or change your URL (you can also do this in the dashboard). The response contains a new signing secret, shown once.

{ "url": "https://yourwebsite.com/crapplet-webhook" }
→ { "url": "https://yourwebsite.com/crapplet-webhook", "secret": "whsec_…", "note": "Store this secret now…" }

GET /webhook shows the URL and the last delivery · POST /webhook/test sends a test service.active event (with "test": true) and returns the result · DELETE /webhook stops events.

Status values

Service statusMeaning
PENDINGOrdered, waiting for payment (or for our team on a manually set-up plan).
PROVISIONINGPaid; being set up.
ACTIVERunning.
SUSPENDEDSuspended (see suspendReason).
FAILEDSetup failed; our team is on it.
TERMINATED · CANCELLEDEnded (see terminationReason).

Invoice status: UNPAID, PAID, CANCELLED, REFUNDED.

Older /vps endpoints

Integrations built before /orders keep working: GET /vps, GET /vps/{id}, POST /vps (VPS only), POST /vps/{id}/action, DELETE /vps/{id}. New integrations should use /orders and /services, which cover every product and support reference.