# Introduction

> What the DNA Rest API does, its base URL and versioning, the test environment, and four decisions to make before you write any code.

The DNA Rest API lets you register and manage domain names, contacts, DNS, SSL certificates and hosting from your own system. Everything is JSON over HTTPS. There is no SDK to install — any HTTP client will do.

## Base URL and versioning

```text
https://api.domainresellerapi.com/api/v1/...
```

The version is part of the path. `v1` is the current version. When a future version arrives, `v1` keeps working — we do not change the meaning of an existing endpoint or error code.

## Test environment

Your reseller panel issues a separate **test API key** alongside your live key. Use it to build and test against the operational test environment, where registry operations are simulated and your balance is not charged.

| | Live | Test |
| --- | --- | --- |
| Base URL | `https://api.domainresellerapi.com` | `https://ote.domainresellerapi.com` |
| `X-API-KEY` | Your API key | Your **test** API key |
| `__reseller` | Your reseller ID | The **same** reseller ID |

Paths and request formats are the same in both, so switching is a configuration change. Each key works only at its own address: the test key sent to the live URL, or the live key sent to the test URL, gets `Unauthorized! Invalid API Key.`

Not every TLD exists in the test environment. The catalogue field `availableInTestEnvironment` tells you which ones do — see the [TLD catalogue](https://www.domainnameapi.com/docs/catalogue/).

## Before you write any code

1. **Fetch the TLD catalogue once** (`GET /api/v1/products/tlds`) and cache it. It answers "how many years can I sell this for", "does it support privacy / DNSSEC / transfer", "which extra fields are required" and "what does it cost" — in one free call. Most integration bugs come from guessing these instead of reading them.
2. **Decide how you will store handle codes.** Contacts are addressed by a handle code. If you plan to register more than a handful of domains, create contacts once and reuse their handles.
3. **Plan for asynchronous outcomes.** A successful call does not always mean a finished operation. Transfers wait for approval, SSL waits for validation, hosting provisions in the background, and some registrations wait for documents. Each section says what to poll.
4. **Log the correlation ID and the balance transaction ID** for every paid operation. These two make support investigations quick.
