Terminate the service via the WHMCS module hook (asynchronous)
DELETE/services/:id
WhmcsApiClient::moduleTerminate is called. The WHMCS provisioning queue runs the Virtualizor delvs job async (~60s queue + ~30s delvs). For this reason the response returns HTTP 202 Accepted; the reseller then tracks it with GET /services/{id}/status.
Idempotency-Key: REQUIRED (without the header, 400 missing_idempotency_key). Destructive op + double-click protection. A repeat request with the same key within 24 hours returns the cached response — a 2nd delvs is not queued.
Rate limit: Default bucket (60 rpm).
Body: {"confirm": true} STRICT bool === true. Truthy values (1, "true", "yes") are rejected → 400 invalid_terminate_request.
vps_id null: SKIP (allowed). A cleanup scenario for pending/whitelabel services — WHMCS moduleTerminate does not look at vps_id, it works by serviceid.
Side effect: mod_reseller_provisions.status='terminated' is set + the service.terminated event (status='skipped') is written to the webhook queue.
Request
Responses
- 202
- 400
- 401
- 403
- 404
- 429
- 502
Termination scheduled (async — WHMCS queue + Virtualizor delvs)
Response Headers
The per-minute limit defined for this key
Number of requests remaining in the current window
Unix epoch of the start of the next window (UTC seconds)
Invalid terminate request (invalid_terminate_request or missing_idempotency_key)
Authentication failed — missing header, wrong credential, outside the IP whitelist, or a revoked key. No detail is leaked; all cases return a single message.
Response Headers
RFC 7617 Basic Auth challenge
Insufficient authorization — the reseller tried to access another reseller's service_id, or has insufficient scope for an endpoint requiring admin scope. The message is kept generic (ServiceOwnershipMiddleware prevents leakage).
Service not found
Per-minute limit exceeded
Response Headers
Seconds to wait before retrying after a 429 (RFC 7231 §7.1.3)
The per-minute limit defined for this key
Unix epoch of the start of the next window (UTC seconds)
WHMCS API upstream error