# Wonderweb Registrar 1.1 — unified integration

Production endpoint: `https://api.wonderweb.co.zw/v1/integration/`.
Use `Authorization: Bearer ww_tenant_…`. GET reads and form-encoded POST writes. Use a separate key per reseller, never a master key in a storefront. Sandbox remains isolated and uses `ww_sandbox_…`.

Read `capabilities` and `catalogue` before enabling production. Only individually qualified standard one-year USD routes can purchase. Price ceilings are integer USD cents; `150` means USD 1.50. All writes require explicit `confirm=1` (except existing sandbox operations). Contact JSON contains firstname, lastname, companyname, address1, address2, city, state, postcode, country, email, phonenumber; use actual owner data and international phone. Nameservers JSON array: 2–4 distinct hosts. Use the reseller business profile ID from the existing Registrar contact dashboard. Never include a key or EPP code in URLs or logs.

## Acquisition and order status
POST `submit`: `domain`, `operation` (register/renew/transfer), `reference` (stable 16–100 characters), `years=1`, `max_price_cents`, `confirm=1`. Acquisitions need `contact`, `nameservers`, `business_profile`; transfer needs `epp`, renewal exact `previous_expiry`. The background worker accepts a fresh quote only within the authorized ceiling. GET `order&reference=...` retrieves the existing request. Do not create another reference after a timeout. `requested`, `quoted`, `authorized`, `queued`, `submitting`, `pending_transfer`, `uncertain`, `transfer_review` are not fulfillment. `fulfilled` means completion; `declined`, `cancelled`, `expired`, `failed`, `rejected` require review before a new order. A receipt-backed pending transfer retains its wallet reservation until provider-confirmed completion; failed or uncertain transfers require financial review.

For `.co.zw` supply also `postal_same=same|separate`, `postal_address` (empty only when same), `core_business`, `brief_description`. No automated assertion of availability from DNS absence. Operator records genuine availability evidence. The existing official WHMCS AI, validator, renderer and sender are reused unchanged. GET order returns the exact polished `application`, `quote_id`, `application_sha256`, and `amount_cents`. Review the complete application, then POST `authorize_application` with `reference`, `quote_id`, `price_cents`, `application_sha256`, `confirm=1`. The worker may then reserve funds and submit with a current review. Successful official application submission completes the local order, activates the domain and settles wallet funds; the term is not independent registry status. Local renewals/transfers remain subject to official operator procedures; local contact/nameserver requests are recorded for review, not automatically sent.

## Read and management actions

| GET action | Parameters | Scope |
|---|---|---|
| capabilities | none | account:read |
| catalogue | none | pricing:read |
| availability | domain | domains:check |
| domain | domain | domains:read |
| wallet | none | wallet:read |
| order | reference | orders:read |
| portfolio | after (last domain, optional) | domains:read |
| registry_contacts | domain | domains:read + contacts:write |
| job | id | orders:read |
| renewal_preferences | none | domains:read |
| events | after (sequence, default 0) | orders:read |
| cases | none | orders:read |
| webhooks | none | account:read |

POST set_nameservers (`domain`, `reference`, `nameservers` JSON), set_contact (`domain`, `reference`, `contact` JSON), set_lock (`domain`, `reference`, `locked=0|1`) create an account-owned management job. Read `job&id=...` until `completed` or `review`. Uncertain operations are not retried. Management requires `orders:create` and `domains:read`; contact changes also require `contacts:write`. EPP retrieval is POST `epp` with `domain`, `confirm=1`, `orders:create`, `domains:read`, `contacts:write`; only unlocked verified international domains. Never persist the returned EPP code in a URL. A provider method or field format that cannot be verified fails closed.

POST `auto_renew`: domain, enabled=0|1, max_price_cents, confirm=1. International renewals are attempted once per term within 30 days of expiry, using a fresh quote and only an active authorizing identity. Requires orders:create, domains:read, domains:quote. Expiry and order events appear in the portal and events feed; webhook subscription can forward them. No automatic email delivery is implied. Registry observations are stored separately; a conflicting expiry triggers reconciliation rather than silently overwriting a financial term.

POST `bulk_submit`: `items` JSON array of 1–5 distinct independently confirmed submit requests; each contains its own reference, ceiling and confirm=1. Non-atomic: inspect every result. Same reference on retries.

POST `payment_case`: deposit_id, kind=payment_review|refund|dispute, reason, confirm=1. A case does not move funds. Merchant refunds and external chargeback balance changes are not executed by this API.

## Signed webhooks
POST `webhook_create`: endpoint (public HTTPS, port 443, no credentials, query or fragment), confirm=1. Requires orders:create, orders:read, domains:read. Returned secret is shown once. POST `webhook_revoke`: id, confirm=1. Receive JSON event id, sequence, type, data, created_at. Verify `X-Wonderweb-Signature: sha256=HEX` with HMAC-SHA256(secret, `X-Wonderweb-Timestamp + '.' + raw_request_body`). Reject stale timestamps (e.g. >5 minutes), compare in constant time and deduplicate event ID. Delivery retries at most eight times. No redirects, private networks or non-HTTPS endpoints. GET events permits catch-up. The subscription starts with new events, not historical delivery.

## External module and WondaResell
External WHMCS module: install in an isolated instance first, preserve stable InstallationId and scope. Version 1.1 retains synthetic sandbox flows and accepts production management only with explicit AuthorizeManagement. Pending management is not successful. Repeating a previously completed but now divergent change requires a new explicit Registrar request. `.co.zw` requires exact official additional fields or use the Registrar dashboard, then review and approve polished application separately. Do not interpret local submitted status as registry verification.

WondaResell: in My Domain, open Wonderweb Registrar workspace. Connect a separate scoped Registrar key for that reseller; this new workspace uses the Registrar wallet, supports availability, portfolio, new wholesale requests, order tracking and exact local application approval. Existing legacy customer billing/provisioning is preserved and not migrated by this release. Use the Registrar portal for full management.

The installer qualifies real source/configuration and uses synthetic regression checks only. No paid test orders, real refunds, new domains or registry submissions are created by installation. Actual funded execution, external WHMCS runtime, native management writes, and webhook delivery with a real configured endpoint remain production acceptance items.
