POST
/api/public/v1/domains

Buy a domain

Purchase a new custom domain for your organization. The endpoint looks up Vercel availability and price, deducts the yearly cost (in cents) from your organization credits, and registers the domain with Vercel. DNS records are configured automatically by a background job once you assign the domain to a business.

Request Body

PropertyTypeDescription
domainstringFully-qualified domain name to purchase.
expectedPriceMaxnumberMaximum acceptable yearly price in cents. If the actual price exceeds this value, the request fails before any charge is made. Guard against TLD price changes.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/domains" \
  -H "X-Organization-Id: your_org_id" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "expectedPriceMax": 5000
  }'
200Example response
json
{
  "message": "Domain purchased successfully! DNS records will be configured automatically once you assign the domain to a business.",
  "content": {
    "domain": {
      "id": "dom_123",
      "name": "example.com"
    },
    "pricePaid": 1200
  }
}
403Example response
json
{
  "message": "Forbidden",
  "err": "Domain price exceeds the API purchase limit ($500). Please contact support to complete this purchase."
}
409Example response
json
{
  "message": "Conflict",
  "err": "Domain is not available for purchase."
}