This document explains how to use and configure the Moniker domain registration API integration.
Quick Start
The system is pre-configured with test credentials and ready to use immediately. No setup required!
Configuration
Test API (Default - Already Configured)
The system uses Moniker's test API by default:
MONIKER_BASE_URL=https://testapi.moniker.com
MONIKER_API_KEY=monikerapi
MONIKER_PASSWORD=monikerpass
These credentials are already set in your .env file and work out of the box for testing.
Production API (When Ready)
When you receive your production Moniker credentials, update .env:
MONIKER_BASE_URL=https://api.moniker.com
MONIKER_API_KEY=your_production_api_key
MONIKER_PASSWORD=your_production_password
NODE_ENV=production
Testing the Integration
Run the test script to verify everything works:
node scripts/test_moniker.js
Expected output:
๐งช Testing Moniker API Integration
==================================================
๐ Test 1: Checking domain availability
--------------------------------------------------
Checking: example.com
[Moniker] Using TEST API with default credentials
โ
Result: {
"domain": "example.com",
"available": false,
"status": "UNAVAILABLE",
...
}
๐ Test 2: Checking multiple domains
--------------------------------------------------
โ
All tests passed!
๐ Moniker API integration is working correctly
Available Functions
Check Domain Availability
const moniker = require('./services/moniker');
const result = await moniker.checkDomain('example.com');
console.log(result);
// {
// domain: 'example.com',
// available: false,
// status: 'UNAVAILABLE',
// isPremium: false,
// minRegPeriod: '1Y',
// maxRegPeriod: '10Y',
// currency: 'USD'
// }
Check Multiple Domains
const results = await moniker.checkDomains([
'example1.com',
'example2.com',
'example3.com'
]);
Register Domain
const result = await moniker.registerDomain({
domain: 'newdomain.com',
years: 1,
nameservers: ['ns1.example.com', 'ns2.example.com'],
ownercontact: {
firstName: 'John',
lastName: 'Doe',
email: 'john@example.com',
// ... other contact details
}
});
Get Domain Info
const info = await moniker.getDomainInfo('example.com');
Update Nameservers
const result = await moniker.updateNameservers('example.com', [
'ns1.newhost.com',
'ns2.newhost.com'
]);
Transfer Domain
const result = await moniker.transferDomain({
domain: 'example.com',
authcode: 'EPP-CODE-HERE',
years: 1
});
Renew Domain
const result = await moniker.renewDomain('example.com', 1); // 1 year
API Response Format
Moniker's test API returns data in key=value format, one per line:
transactid=abc123
status=AVAILABLE
domain=example.com
minregperiod=1Y
Our service automatically parses this into a JavaScript object:
{
transactid: 'abc123',
status: 'AVAILABLE',
domain: 'example.com',
minregperiod: '1Y'
}
Domain Request Approval Workflow
- User submits request โ Creates domain_registration_requests record with status pending
- Notification created โ Root tenant admins receive notification
- Admin reviews โ Views request in dashboard
- Admin approves/denies โ Updates request status
- If approved โ Can trigger Moniker registration
Check API From Dashboard
When logged in as admin, open browser console and run:
// Check domain availability
fetch('/api/domains/check?domain=example.com', {
headers: { 'Authorization': 'Bearer ' + localStorage.getItem('token') }
}).then(r => r.json()).then(console.log)
// View pending requests
fetch('/api/domain-requests?status=pending', {
headers: { 'Authorization': 'Bearer ' + localStorage.getItem('token') }
}).then(r => r.json()).then(console.log)
Creating Notifications for Domain Requests
To backfill notifications for existing domain requests:
// In browser console while logged in as admin:
fetch('/api/domain-requests/backfill-notifications', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + localStorage.getItem('token'),
'Content-Type': 'application/json'
}
}).then(r => r.json()).then(console.log)
This will create notifications for all domain requests that don't have one yet.
Troubleshooting
Test API Not Responding
The test API credentials are publicly available and may be rate-limited. If you encounter issues:
- Wait a few minutes and try again
- Check the error message in console
- Verify network connectivity
Production API Issues
When using production credentials:
- Verify credentials are correct
- Ensure NODE_ENV=production is set
- Check your Moniker account has sufficient credits
- Review Moniker's API documentation for specific error codes
API Case Insensitivity
Moniker's API is case-insensitive for all parameters:
Domain/Check?ApiKey=... โ
domain/check?apikey=... โ
DOMAIN/CHECK?APIKEY=... โ
All are equivalent and work the same way.
Next Steps
- โ
Test API integration is working (run test script)
- โ
Demo data with domain requests is created
- โ
Notifications are backfilled
- โณ Request production Moniker API credentials
- โณ Update .env with production credentials
- โณ Test domain registration in production
Support