Namecheap

Registering and renewing through Namecheap: API user and key, the whitelisted IP, every function, DNS host records, sandbox testing and troubleshooting.

The Namecheap registrar module registers, transfers and renews domains through your Namecheap account, using the Namecheap API. It also reads and changes nameservers, contact details, the registrar lock, ID protection (WhoisGuard) and DNS host records, and it keeps the expiry dates up to date. It is free and made for shops that buy their domains from Namecheap. Shared registrar behaviour (the page, Test Connection, the module log) is in Domain registrars; prices and the life of a domain are in Domains.

Switching it on

  1. Open Setup → Domain Registrars and press Activate on the Namecheap card, then Configure.
  2. Fill in the four account fields (below) and save.
  3. Press Test Connection. A good answer reads Connected to Namecheap. Available balance: ....
  4. Give it to your extensions: press Use for all extensions, or pick it for one extension in Setup → Domain Pricing.

Settings

SettingMeaning
API userYour Namecheap API user name, often the same as your account user name.
API keyFrom Profile > Tools > Namecheap API Access. Enable API access there first. Hidden field: leave empty to keep the saved key.
Account user nameThe Namecheap account the domains belong to.
Whitelisted IPThe public IP address of this server, exactly as you added it to the API whitelist at Namecheap.
Test modeUse api.sandbox.namecheap.com, which is a separate sandbox account with its own key.

All four of the first fields are needed. If one is empty every call fails with Namecheap is not set up yet: the API user, key, user name and whitelisted IP are all needed.

What Namecheap needs from you

  • A Namecheap account with API access switched on (Profile > Tools > Namecheap API Access). Namecheap sets its own conditions for enabling the API on an account (for example a minimum balance or number of domains); check them on its API page.
  • IP whitelisting. Namecheap refuses API calls from any address that is not on the whitelist. Add the public IP address your server uses to reach the internet, and type the same address in Whitelisted IP. On shared hosting ask your host which address that is; it can differ from the address of your website.
  • Money in the account. Registrations and renewals are paid from your Namecheap balance, so keep it topped up.
  • For the sandbox, a separate account at Namecheap's sandbox site, with its own API key and its own whitelist.
  • HTTPS to the outside (the PHP curl extension).

What it can do

FunctionBehaviour
AvailabilityChecks the name, and tells you when it is a premium name and what its registration price is.
RegisterRegisters for the number of years ordered, with free WhoisGuard added and switched on when the client chose ID protection. The client's details are used as registrant, technical, admin and billing contact. Nameservers are sent when the client gave some.
TransferStarts the transfer with the EPP code. The transfer ID is remembered so that Sync can follow it.
RenewRenews for the years asked and reads the new expiry date back.
SyncReads the status and expiry date. A domain that is gone from the account is marked Transferred Away (or, for a transfer in progress, the transfer status is read).
NameserversGet Nameservers and Save Nameservers work at Namecheap. An empty list sets Namecheap's default nameservers.
ContactsRead from and saved to Namecheap.
Registrar lockRead and changed at Namecheap.
EPP codeNamecheap does not hand out the code through the API. The module answers with the code you stored on the domain page, or a message telling you to ask for it from the Namecheap account.
ID protectionSwitches WhoisGuard on or off (the domain needs a WhoisGuard subscription).
DNS host recordsRead and saved. Saving replaces the whole list of host records, so read them first and save the full list. At least one record is needed. The default TTL is 1800 and the default MX priority is 10.

Typical workflow

  1. A client orders example.com for 2 years and pays the invoice.
  2. With Automatic Registration on, AIOBilling calls Namecheap, the domain becomes Active, the expiry date is set and the client gets Domain Registration Confirmation.
  3. Each day the cron syncs the expiry date. A renewal invoice is made before the expiry; when it is paid the module renews at Namecheap.
  4. If a call fails, the administrators get Domain Registration Failed (or Domain Renewal Failed) and the Module Log has Namecheap's own words.

Testing in the sandbox

  1. Make a sandbox account at Namecheap, enable its API and whitelist your server's IP there.
  2. Enter the sandbox API user, key and user name, the IP, and switch Test mode on. Test Connection should say Connected to Namecheap (sandbox).
  3. Order a cheap domain as a test client and pay the invoice. Check the sandbox site for the registration.
  4. Replace the details with the live ones and switch Test mode off.

Troubleshooting

Open Utilities → Module Log and filter by module namecheap; View shows the request and Namecheap's answer, with the key hidden.

MessageCure
Namecheap is not set up yet ...A required setting is empty.
Namecheap: ... IP ... or Invalid request IPThe IP is not whitelisted, or Whitelisted IP differs from the address your server really uses.
Namecheap: ... authentication ...Wrong API user, key or account user name, or the key belongs to the other environment (live or sandbox).
Namecheap could not be reached: ...The server cannot call Namecheap: curl, firewall or DNS.
Namecheap did not register (domain).Namecheap refused; the Module Log has its reason, often too little balance or a missing contact detail.
Namecheap answered with something that is not XML.A proxy or firewall is changing the answer.

More in Troubleshooting.

Was this helpful?

Updated 2026-11-03