Skip to main content
Want to sell domain registrations from your own website? BillingServ can handle the registrar lookup and payment flow while you keep control of the customer experience. This guide shows how to search for available domain extensions, create a hosted checkout link, support checkout-first customers, and send customers back to your site after payment.

Before you start

Prepare:
  • A BillingServ v2 API key
  • Your BillingServ API base URL
  • A callback URL on your website
  • A configured domain registrar with the extensions you want to sell enabled
  • An existing BillingServ customer ID if you want to skip customer details during checkout
Keep the API key on your server. These requests should not run in browser code where visitors could inspect the credential.

Authentication

Send the API key as a bearer token with every request:
The API uses the v2 base URL:

1. Search for available domain extensions

Use POST /domain/lookup to check a name across the domain extensions enabled in your BillingServ account. Send the name without an extension. For example, use billingserv, not billingserv.com. The optional limit field controls how many extensions are checked. It accepts values from 1 to 50 and defaults to 50.
The response includes one result for each enabled extension checked:
Use results with available: true when you build the domain selection step. Keep the premium value visible if premium domains need a different price or review process in your store. After the customer chooses a domain, call POST /checkout/create. BillingServ checks availability again before creating the checkout link. That second check helps prevent a customer from paying for a domain that became unavailable after the search. The request supports three checkout types: Every checkout request also needs callback_url. customer_id is optional. When you provide it, it must belong to a BillingServ customer account. Here is a one-domain checkout request:
BillingServ returns a hosted checkout URL:
Redirect the customer to url. The link is cached for 30 minutes and is invalidated after a completed payment. If the domain is unavailable, the API returns a 422 response and does not create a checkout link. If the registrar cannot confirm availability, the API returns 502.

3. Support checkout-first customers

You do not need a customer ID to create a domain checkout. Leave customer_id out when you want BillingServ to collect the customer’s details during the hosted checkout flow. If you provide customer_id, use the ID of an existing customer account. Client and staff account IDs are not valid for this endpoint.

4. Check out multiple domains in one flow

Send a domains array when the customer wants more than one registration. Each item needs a full domain name and a registration period in years.
You can include up to 50 domains in one request. BillingServ checks every domain before returning the checkout link. Do not combine domains with domain, package_id, or cycle_id in the same request.

5. Keep package checkout working

The same endpoint still supports checkout for an existing package. Send package_id and cycle_id instead of domain fields:
Use exactly one checkout type per request. This keeps package orders and domain registrations separate in the checkout flow.

6. Handle the payment callback

After the hosted checkout finishes, BillingServ redirects the customer to your callback_url. A successful payment includes:
A failed payment includes:
external_customer_id is included when you supplied customer_id in the checkout request. Treat the callback as a browser return, not as your only payment confirmation. For server-side reconciliation, use the transaction and order identifiers with the BillingServ API and configure webhooks for payment events.

Error handling

For a 422 response, show the returned error and ask the customer to choose another domain or correct the request. For a 502 response, retry from your server with a short backoff and keep the customer selection available.

Next steps

Read the API overview for authentication and response conventions. When you are ready to reconcile completed payments, use the webhook overview alongside the domain availability and hosted checkout API.