Skip to content

Creating a Registrar Integration

Registrar adapters let FOSSBilling communicate with domain registrars to register, transfer, and manage domains on behalf of your customers.

Place your adapter in:

  • Directorylibrary/Registrar/Adapter/
    • YourRegistrar.php

Your class must extend Registrar_AdapterAbstract and implement its required methods.

FOSSBilling passes a Registrar_Domain to domain operations. See Registrar_AdapterAbstract for every required method and its signature.

MethodPurpose
isDomainAvailable()Check domain availability
registerDomain()Register a new domain
transferDomain()Request a domain transfer
renewDomain()Renew a domain
getDomainDetails()Read domain details from the registrar
modifyNs()Update nameservers
modifyContact()Update contact information

The bundled Namecheap adapter illustrates availability checks and registration. Namecheap adapter source

  1. Configure the registrar. getConfig() defines the admin form and marks the API key as secret. The constructor requires an API key, a username, and the server’s public IP address. Configuration code
  2. Check availability. isDomainAvailable() builds the name from the domain object and sends namecheap.domains.check. It reads the availability flag and rejects premium domains. Availability check
  3. Register the domain. registerDomain() sends the name, registration period, contacts, and any configured nameservers. It returns true when Namecheap confirms the registration. Registration code
  4. Handle provider errors. Both operations use _makeRequest() to add authentication and parse the XML response. The helper raises Registrar_Exception for provider-reported error statuses. Request handling
  1. Create a test domain product in FOSSBilling
  2. Configure your registrar adapter in System → Domain Registration
  3. Test domain availability checks
  4. Test registration (if possible with registrar's test environment)
  5. Verify contact information syncing

Join our Discord if you need assistance with your registrar integration.