Skip to main content

Domain Registration

POST /order/domains/register

Registers a domain name.

This operation changes registry/account state and may incur a charge. Use only a controlled domain and account.

Authentication

Send the username and token headers described in Authentication.

Request Parameters

ParameterTypeRequiredDescriptionExample
domainstringYesDomain to register.example.invalid
regperiodintegerYesRequested registration period. Supported values require validation.1
nameservers[]array of stringsYesOne form field per nameserver value. Count constraints require validation.ns1.example.net
contactsobjectYesContainer for nested contact data.contacts[registrant][...]
contacts[registrant][firstname]stringYesRegistrant first name.John
contacts[registrant][lastname]stringYesRegistrant last name.Smith
contacts[registrant][fullname]stringYesRegistrant full name.John Smith
contacts[registrant][companyname]stringYesRegistrant organization/company value. Individual-contact rules require validation.Example Company
contacts[registrant][email]stringYesRegistrant email address.[email protected]
contacts[registrant][address1]stringYesPrimary street address.1 Example Street
contacts[registrant][address2]stringNoSecondary address information.Suite 2
contacts[registrant][city]stringYesCity or locality.Tripoli
contacts[registrant][state]stringYesState, province, or region value. Rules require validation.TR
contacts[registrant][postcode]stringYesPostal or ZIP code. Rules require validation.00000
contacts[registrant][country]stringYesTwo-letter country code according to the published schema.LY
contacts[registrant][phonenumber]stringYesRegistrant phone number. Format requires validation.+218000000000

Requiredness above reflects the current OpenAPI. It does not establish TLD-specific overrides or field validators.

Complete Request

curl --request POST \
--url "https://my.register.ly/modules/addons/DomainsReseller/api/index.php/order/domains/register" \
--header "Content-Type: application/x-www-form-urlencoded" \
--header "username: [email protected]" \
--header "token: <generated-token>" \
--data-urlencode "domain=example.invalid" \
--data-urlencode "regperiod=1" \
--data-urlencode "nameservers[]=ns1.example.net" \
--data-urlencode "nameservers[]=ns2.example.net" \
--data-urlencode "contacts[registrant][firstname]=John" \
--data-urlencode "contacts[registrant][lastname]=Smith" \
--data-urlencode "contacts[registrant][fullname]=John Smith" \
--data-urlencode "contacts[registrant][companyname]=Example Company" \
--data-urlencode "contacts[registrant][email][email protected]" \
--data-urlencode "contacts[registrant][address1]=1 Example Street" \
--data-urlencode "contacts[registrant][address2]=" \
--data-urlencode "contacts[registrant][city]=Tripoli" \
--data-urlencode "contacts[registrant][state]=TR" \
--data-urlencode "contacts[registrant][postcode]=00000" \
--data-urlencode "contacts[registrant][country]=LY" \
--data-urlencode "contacts[registrant][phonenumber]=+218000000000"

The .invalid top-level domain is deliberately non-registrable, so this request illustrates serialization without risking a real registration. Replace it only with an approved controlled test domain.

Success Response (200)

"success"

Error Response (400)

The OpenAPI associates this example with HTTP 400:

{
"error": "Registrar Error: \nObject exists; Domain is: newdomain.test.ly requested by client: registrar_test"
}

Notes

VALIDATION REQUIRED: Valid regperiod values.

VALIDATION REQUIRED: TLD-specific contact requirements, phone formatting, postal/state rules, and individual-versus-organization requirements.

VALIDATION REQUIRED: Whether "success" means final registry completion or successful request processing.

VALIDATION REQUIRED: Whether an identical registration retry is idempotent.

A successful availability lookup does not reserve the domain. Registration may still fail if the domain state changes before the registration request completes.

If the client times out, reconcile availability, domain state, and account transactions before retrying. A blind retry could duplicate a state-changing request or charge.