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
Authentication
Send the API key as a bearer token with every request: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, usebillingserv, not billingserv.com.
The optional limit field controls how many extensions are checked. It accepts values from 1 to 50 and defaults to 50.
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.
2. Create a hosted checkout link
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:
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. Leavecustomer_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 adomains array when the customer wants more than one registration. Each item needs a full domain name and a registration period in years.
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. Sendpackage_id and cycle_id instead of domain fields:
6. Handle the payment callback
After the hosted checkout finishes, BillingServ redirects the customer to yourcallback_url.
A successful 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.