Skip to content

Guest API: Domains & Currency

The endpoints on this page belong to the guest API role. They require no authentication and no CSRF token, and can be called from any server-side integration (for example a WordPress price list or a custom domain search form).

All endpoints follow the standard pattern /api/guest/{module}/{action}, accept GET or POST, and take parameters as JSON or form data. See the API Reference for the general response and error format.

TLD values are returned with the leading dot, e.g. .com, .se. Request parameters accept values with or without it (tld=com works the same as tld=.com).

Lists all active TLDs with their pricing. TLD records omit created_at and updated_at.

ParameterTypeRequiredDescription
allow_registerboolNoIf present, filters by registration flag. Omit to disable filtering.
allow_transferboolNoIf present, filters by transfer flag. Omit to disable filtering.
Terminal window
curl -s -X POST https://example.com/api/guest/servicedomain/tlds
{
"result": [
{
"id": 1,
"tld": ".com",
"price_registration": "11.99",
"price_renew": "11.99",
"price_transfer": "11.99",
"active": 1,
"allow_register": 1,
"allow_transfer": 1,
"require_transfer_code": false,
"min_years": 1,
"periods": null
}
],
"error": null
}
FieldDescription
price_registrationPrice per year for registration, in the default currency.
price_renewPrice per year for renewal.
price_transferPrice for transfer.
require_transfer_codeWhether an EPP/auth code is required for transfers.
min_yearsMinimum registration period in years.
periodsAllowed registration periods in years, or null if not restricted.

Prices are returned unformatted and in the system's default currency. Use guest/currency/format to convert and format them.

Returns pricing for a single TLD. The response object has the same fields as one entry from tlds.

ParameterTypeRequiredDescription
tldstringYesTLD, e.g. .se. The leading dot is optional.
Terminal window
curl -s -X POST https://example.com/api/guest/servicedomain/pricing -d 'tld=.com'

Errors

MessageCause
TLD is missingThe tld parameter was not sent.
TLD is invalid.The tld value is not a valid TLD.
TLD not foundThe TLD does not exist in FOSSBilling.
TLD is not active.The TLD exists but is inactive.

Checks whether a domain is available for registration. The result comes from the registrar module configured for the TLD, so a registrar must be set up for the answer to be accurate.

ParameterTypeRequiredDescription
sldstringYesSecond-level part of the domain, e.g. example for example.com.
tldstringYesTLD, e.g. .com. The leading dot is optional.
Terminal window
curl -s -X POST https://example.com/api/guest/servicedomain/check \
-d 'sld=example' -d 'tld=.com'

Returns true when the domain is available:

{ "result": true, "error": null }

A registered domain does not return false. It returns an error instead:

{
"result": null,
"error": { "message": "Domain is not available.", "code": 708 }
}

Errors

MessageCause
TLD is missing / SLD is missingA required parameter was not sent.
TLD is invalid.The tld value is not a valid TLD.
Domain is not available.The domain is already registered. Returned with code: 708 and HTTP 200.
Domain cannot be registered.The TLD exists and is active, but does not allow registration. Returned with code: 403 and HTTP 403, not code: 9999.
Domain example is invalidThe sld failed validation (the message includes the submitted value).
Domain availability could not be determined. TLD is not configured.Unknown TLD.
Domain availability could not be determined. TLD is not active.TLD exists but is inactive.

Registrar modules may return their own error messages when the registry cannot be reached, for example Domain availability check failed. Please try again later.

Checks whether a domain can be transferred in.

ParameterTypeRequiredDescription
sldstringYesSecond-level part of the domain.
tldstringYesTLD, e.g. .com. The leading dot is optional.
Terminal window
curl -s -X POST https://example.com/api/guest/servicedomain/can_be_transferred \
-d 'sld=example' -d 'tld=.com'

Returns true if the domain can be transferred.

Errors

MessageCause
TLD is missing / SLD is missingA required parameter was not sent.
TLD is invalid.The tld value is not a valid TLD.
TLD is not configured.Unknown TLD.
TLD is not active.TLD exists but is inactive.
Domain cannot be transferred.The TLD does not allow transfers. Returned with code: 403 and HTTP 403.
Domain cannot be transferred.The registrar reported that the domain cannot be transferred. Returned with code: 711 and HTTP 200.

This endpoint shares the domain_lookup_ip rate limit with check.

Returns the configured currencies as an object mapping currency code to title. Takes no parameters.

Terminal window
curl -s -X POST https://example.com/api/guest/currency/get_pairs
{
"result": {
"USD": "US Dollar",
"EUR": "Euro"
},
"error": null
}

Returns details of a currency, including its conversion_rate. The response omits created_at and updated_at.

ParameterTypeRequiredDescription
codestringNoCurrency code, e.g. SEK. If omitted, the default currency is returned.
Terminal window
curl -s -X POST https://example.com/api/guest/currency/get -d 'code=SEK'

Errors

MessageCause
Currency not found.Unknown currency code, or no default currency is set.

Formats a price as a localized string, optionally converting it from the default currency.

ParameterTypeRequiredDefaultDescription
pricefloatNo0Amount in the default currency.
codestringNodefault currencyTarget currency code.
convertboolNotrueMultiply price by the target currency's conversion_rate.
without_currencyboolNofalseReturn only the number, without currency symbol.

Formatting follows the active locale of the request.

Terminal window
curl -s -X POST https://example.com/api/guest/currency/format \
-d 'price=11.99' -d 'code=SEK'

Errors

MessageCause
Currency not found.Unknown currency code, or no default currency is set.
Terminal window
# 1. Fetch all TLDs that can be registered
curl -s -X POST https://example.com/api/guest/servicedomain/tlds -d 'allow_register=1'
# 2. Get the default currency (for symbol / formatting)
curl -s -X POST https://example.com/api/guest/currency/get

A single tlds call returns prices for every TLD, so there is no need to call pricing per TLD. Cache the response on your side; prices change rarely.