API reference · /api/v1
Sandbox
The sandbox is a stateless copy of the API for testing. It accepts the same requests and returns the same response structure, HTTP status codes and error codes as the live API, with simulated values.
Base URL
https://www.domain.af/api/sandbox/v1
Getting started
- In the reseller portal, go to API access → Create credentials and choose Sandbox. Sandbox key IDs start with
daf_test_. - Sign requests exactly as for the live API. The signed path includes the sandbox prefix, e.g.
/api/sandbox/v1/domains/register. - Sandbox keys only work on the sandbox and live keys only on the live API (
403 sandbox_key/403 live_key), so a test can never place a real order. - Every sandbox response has a top-level
"sandbox": trueand anX-DomainAf-Sandbox: trueheader. - WHMCS: turn on Sandbox Mode and enter the sandbox base URL as the Sandbox API URL, with a sandbox key.
- Blesta: tick Sandbox mode on the API key and enter a sandbox key. The module switches to the sandbox URL itself.
What is simulated
- Nothing is stored: no orders, invoices, domains, credit transactions or request logs. A change (nameservers, lock, contacts, DNS records) is validated and echoed back, but a later read shows the defaults again.
- Nothing is sent: no registry, WHOIS, DNS server, payment, KYC, email or webhook activity.
- The sandbox account has a fixed balance of USD 1000.00. Billable calls return what would have been charged and the balance after it, but the balance never changes.
- Responses are deterministic: the same request returns the same values. Dates of new registrations are relative to today.
- Idempotency-Key is required and validated as on the live API, but not stored.
- Any valid name on .af, .com.af, .org.af, .net.af, .edu.af, .gov.af is treated as available, or as an active domain on your account for management calls.
Test domain names
Start the first label of a domain with one of these words to get a predictable result, e.g. taken-shop.af or nofunds1.com.af.
| Name starts with | Result |
|---|---|
taken | The domain is registered: availability "registered", register → 422 domain_unavailable. |
reserved | The domain is reserved: availability "reserved", register → 422 domain_unavailable. |
premium | Premium name: available at a premium price. |
nofunds | Any billable call → 402 insufficient_balance. |
registryerror | Any call for the domain → 502 registry_error. |
registrydown | Any call for the domain → 503 registry_unavailable. |
pending | Register succeeds with stage "pending"; transfer stays "pending_transfer". |
notfound | The domain is not on the account: /domains/{domain} calls → 404 not_found. |
suspended | The domain is suspended: management calls → 409 domain_not_active. |
transfer with "auth_code": "invalid" | 422 invalid_auth_code. |
renew with a wrong current_expiry | 409 expiry_mismatch (the response gives the simulated expiry). |
coupon SANDBOX10 | 10% off in /domains/check and /pricing; any other coupon → 422 coupon_invalid. |