PHPackages                             estratos/domainname-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. estratos/domainname-api

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

estratos/domainname-api
=======================

Symfony bundle for DomainNameAPI/DomainResellerAPI integration with REST and SOAP support

1.0.1(4d ago)032MITPHPPHP &gt;=8.1

Since Oct 4Pushed 4d ago1 watchersCompare

[ Source](https://github.com/estratos/domainname-api)[ Packagist](https://packagist.org/packages/estratos/domainname-api)[ Docs](https://github.com/estratos/domainname-api)[ RSS](/packages/estratos-domainname-api/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (26)Versions (11)Used By (0)

DomainNameAPI Bundle for Symfony
================================

[](#domainnameapi-bundle-for-symfony)

[![Latest Version](https://camo.githubusercontent.com/6c936b97dffdb00957fd4af04ee84e74815c046116b676a3856327b75642e4c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6573747261746f732f646f6d61696e6e616d652d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/estratos/domainname-api)[![Total Downloads](https://camo.githubusercontent.com/c53e70aa85f2acb753cef9213130cb45801915290ae20598726e4715823b639b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6573747261746f732f646f6d61696e6e616d652d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/estratos/domainname-api)[![License](https://camo.githubusercontent.com/6c6956e945da2f70e0a81937b0d96e8b813e1bf72059982bc5b16158b9b752b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6573747261746f732f646f6d61696e6e616d652d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/estratos/domainname-api)[![PHP Version](https://camo.githubusercontent.com/c611f9375c7673e4b1bbc846c1008f671dcfa06443ba01ea7146d55ad0dd670b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6573747261746f732f646f6d61696e6e616d652d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/estratos/domainname-api)[![Symfony Version](https://camo.githubusercontent.com/95934f63bdbc92c794adf95c4b8cb87a6c9caf9b49684b02a83cd68fd75a5045/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d352e34253230253743253230362e30253230253743253230372e302d626c7565)](https://symfony.com)

A comprehensive Symfony bundle for integrating DomainNameAPI / DomainResellerAPI services with REST and SOAP support.

---

🚀 Features
----------

[](#-features)

### Current (v1.0)

[](#current-v10)

- ✅ **Domain Availability Check** - Check if a domain is available for registration
- ✅ **Domain Registration** - Register new domains with contact information
- ✅ **Account Balance** - Query your reseller account balance
- ✅ **Domain Listing** - List all domains in your account with pagination
- ✅ **TLD List** - Get all available TLDs with pricing information
- ✅ **REST API Support** - New REST API integration
- ✅ **SOAP API Support** - Legacy SOAP API support
- ✅ **Symfony Commands** - Full console commands for all operations
- ✅ **REST Controllers** - Ready-to-use API endpoints
- ✅ **Architecture** - Clean architecture with Ports &amp; Adapters

### Roadmap (v1.1+)

[](#roadmap-v11)

- 🔄 Domain Renewal
- 🔄 Domain Transfer
- 🔄 WHOIS Information
- 🔄 DNS Management
- 🔄 DNSSEC Support
- 🔄 Contact Management

---

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1 or higher
- Symfony 5.4, 6.0, or 7.0
- Composer

---

🔧 Installation
--------------

[](#-installation)

### Step 1: Install the bundle

[](#step-1-install-the-bundle)

```
composer require estratos/domainname-api
```

### Step 2: Register the bundle

[](#step-2-register-the-bundle)

```
// config/bundles.php

return [
    // ...
    Estratos\DomainNameApi\DomainNameApiBundle::class => ['all' => true],
];
```

### Step 3: Configure the bundle

[](#step-3-configure-the-bundle)

```
# config/packages/domain_name_api.yaml

domain_name_api:
    # Provider selection (rest | soap)
    provider: '%env(DOMAINNAME_API_PROVIDER)%'

    # REST API (recommended)
    api_key: '%env(DOMAINNAME_API_KEY)%'
    reseller_id: '%env(DOMAINNAME_RESELLER_ID)%'

    rest:
        endpoint: '%env(DOMAINNAME_API_ENDPOINT)%'
        verify_ssl: true
        timeout: 30
        retry_attempts: 3

    # SOAP API (legacy)
    username: '%env(DOMAINNAME_API_USERNAME)%'
    password: '%env(DOMAINNAME_API_PASSWORD)%'
    test_mode: '%env(bool:DOMAINNAME_API_TEST_MODE)%'

    # General
    timeout: 30

    default_nameservers:
        - 'ns1.domainnameapi.com'
        - 'ns2.domainnameapi.com'
```

### Step 4: Add environment variables

[](#step-4-add-environment-variables)

```
###> estratos/domainname-api ###

# REST API (recommended)
DOMAINNAME_API_PROVIDER=rest
DOMAINNAME_API_KEY=your_api_key_here
DOMAINNAME_RESELLER_ID=your_reseller_id_here
DOMAINNAME_API_ENDPOINT=https://api.domainresellerapi.com

# SOAP API (legacy - optional)
DOMAINNAME_API_USERNAME=your_username
DOMAINNAME_API_PASSWORD=your_password
DOMAINNAME_API_TEST_MODE=false

###< estratos/domainname-api ###
```

---

🛠️ Usage
--------

[](#️-usage)

### Console Commands

[](#console-commands)

```
# Test REST API connection
php bin/console domain:test-rest

# Check domain availability
php bin/console domain:check example.com

# Check domain with JSON output
php bin/console domain:check example.com --format=json

# Check account balance
php bin/console domain:balance

# Get balance with low balance notification
php bin/console domain:balance --notify --threshold=100

# List domains
php bin/console domain:list

# List domains with pagination
php bin/console domain:list --page=2 --limit=20

# List domains by status
php bin/console domain:list --status=active

# List available TLDs
php bin/console domain:tlds

# Search TLDs
php bin/console domain:tlds --search=.com

# Register a domain (interactive)
php bin/console domain:register example.com

# Register a domain with options
php bin/console domain:register example.com \
    --period=2 \
    --nameservers=ns1.example.com \
    --nameservers=ns2.example.com \
    --privacy \
    --autorenew
```

---

🌐 REST API Endpoints
--------------------

[](#-rest-api-endpoints)

Once the bundle is configured, the following endpoints are available:

```
GET /api/domain/{domain}/check
GET /api/domain/balance
GET /api/domain/list?page=1&limit=50
GET /api/domain/tlds
POST /api/domain/register
```

---

📦 Example: Register Domain via API
----------------------------------

[](#-example-register-domain-via-api)

```
curl -X POST http://localhost:8000/api/domain/register \
    -H "Content-Type: application/json" \
    -d '{
        "domain": "example.com",
        "period": 1,
        "registrant": {
            "firstName": "John",
            "lastName": "Doe",
            "company": "Example Inc.",
            "email": "john@example.com",
            "addressLine1": "123 Main St",
            "city": "New York",
            "state": "NY",
            "country": "US",
            "zipCode": "10001",
            "phone": "+1234567890"
        },
        "admin": {},
        "technical": {},
        "billing": {},
        "nameservers": [
            "ns1.example.com",
            "ns2.example.com"
        ],
        "privacyProtection": true
    }'
```

---

💻 Using the Service in Your Code
--------------------------------

[](#-using-the-service-in-your-code)

```
use Estratos\DomainNameApi\Domain\Contract\DomainProviderInterface;
use Estratos\DomainNameApi\Domain\DTO\RegisterDomainRequest;
use Estratos\DomainNameApi\Domain\DTO\ContactDto;

class MyService
{
    public function __construct(
        private readonly DomainProviderInterface $domainProvider
    ) {
    }

    public function checkDomain(string $domain): void
    {
        $result = $this->domainProvider->check($domain);

        if ($result->isAvailable()) {
            echo "Domain {$result->domain} is available for {$result->getFormattedPrice()}";
        }
    }

    public function registerDomain(string $domain): void
    {
        $contact = new ContactDto(
            firstName: 'John',
            lastName: 'Doe',
            email: 'john@example.com',
        );

        $request = new RegisterDomainRequest(
            domain: $domain,
            period: 1,
            registrant: $contact,
            admin: $contact,
            technical: $contact,
            billing: $contact,
            nameservers: [
                'ns1.example.com',
                'ns2.example.com'
            ]
        );

        $result = $this->domainProvider->register($request);

        if ($result->isSuccess()) {
            echo "Domain registered successfully! Order ID: {$result->orderId}";
        }
    }
}
```

---

🏗️ Architecture
---------------

[](#️-architecture)

The bundle follows a Clean Architecture approach with Ports &amp; Adapters.

```
┌─────────────────────────────────────────────────────────────┐
│                    Application Layer                        │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐      │
│  │ Use Cases   │  │   Services  │  │    Commands     │      │
│  └─────────────┘  └─────────────┘  └─────────────────┘      │
└─────────────────────────────────────────────────────────────┘
                              │
┌─────────────────────────────────────────────────────────────┐
│                      Domain Layer                           │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐      │
│  │ Contracts   │  │    DTOs     │  │ Value Objects   │      │
│  └─────────────┘  └─────────────┘  └─────────────────┘      │
└─────────────────────────────────────────────────────────────┘
                              │
┌─────────────────────────────────────────────────────────────┐
│                  Infrastructure Layer                       │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐      │
│  │ REST Client │  │ SOAP Client │  │ Controllers     │      │
│  └─────────────┘  └─────────────┘  └─────────────────┘      │
└─────────────────────────────────────────────────────────────┘

```

### Key Interfaces

[](#key-interfaces)

#### DomainProviderInterface

[](#domainproviderinterface)

Main interface for domain operations.

#### RestClientInterface

[](#restclientinterface)

HTTP client abstraction for REST API communication.

#### ProviderFactoryInterface

[](#providerfactoryinterface)

Factory responsible for creating provider implementations.

---

🧪 Testing
---------

[](#-testing)

```
# Run all tests
composer test

# Run tests with coverage
composer test-coverage

# Run PHPStan analysis
composer phpstan

# Run CS Fixer
composer cs-fix
```

---

🔧 Configuration Reference
-------------------------

[](#-configuration-reference)

ParameterTypeDefaultDescriptionproviderstringrestProvider to use (rest or soap)api\_keystring`%env(DOMAINNAME_API_KEY)%`REST API Keyreseller\_idstring`%env(DOMAINNAME_RESELLER_ID)%`Reseller IDrest.endpointstring`%env(DOMAINNAME_API_ENDPOINT)%`REST API endpointrest.verify\_sslbooleantrueVerify SSL certificaterest.timeoutinteger30Request timeout in secondsrest.retry\_attemptsinteger3Number of retry attemptsusernamestring`%env(DOMAINNAME_API_USERNAME)%`SOAP usernamepasswordstring`%env(DOMAINNAME_API_PASSWORD)%`SOAP passwordtest\_modebooleanfalseSOAP test modetimeoutinteger30General timeoutdefault\_nameserversarray`['ns1.domainnameapi.com', 'ns2.domainnameapi.com']`Default nameservers---

🤝 Contributing
--------------

[](#-contributing)

1. Fork the repository
2. Create your feature branch

```
git checkout -b feature/amazing-feature
```

3. Commit your changes

```
git commit -m "Add some amazing feature"
```

4. Push to the branch

```
git push origin feature/amazing-feature
```

5. Open a Pull Request

---

📝 Changelog
-----------

[](#-changelog)

### v0.2.6

[](#v026)

- Initial release with SOAP support

### v1.0.0

[](#v100)

- Initial release with REST API support
- Domain check functionality
- Domain registration
- Account balance retrieval
- Domain listing
- TLD listing
- Symfony commands
- Symfony controllers
- Clean Architecture implementation
- SOAP provider compatibility layer

### Planned for v1.1

[](#planned-for-v11)

- Domain Renewal
- Domain Transfer
- WHOIS Information
- DNS Management

---

📄 License
---------

[](#-license)

This bundle is licensed under the MIT License.

See the `LICENSE` file for more information.

---

🔗 Links
-------

[](#-links)

- DomainResellerAPI Documentation
- GitHub Repository
- Packagist

---

👨‍💻 Author
----------

[](#‍-author)

Julio Rodriguez

GitHub:

---

🙏 Support
---------

[](#-support)

For support, bug reports, or feature requests, please open an issue on GitHub.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance99

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~60 days

Total

10

Last Release

4d ago

Major Versions

0.2.6 → 1.0.02026-06-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6269348?v=4)[Estratos Consulting](/maintainers/estratos)[@estratos](https://github.com/estratos)

---

Top Contributors

[![estratos](https://avatars.githubusercontent.com/u/6269348?v=4)](https://github.com/estratos "estratos (33 commits)")

---

Tags

phpsymfonybundlerestsoapdomainregistrardomainnameapidomainresellerapi

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/estratos-domainname-api/health.svg)

```
[![Health](https://phpackages.com/badges/estratos-domainname-api/health.svg)](https://phpackages.com/packages/estratos-domainname-api)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
