Buy a domain
POST
https://api.vercel.com/v1/registrar/domains/{domain}/buyBuy a domain
https://api.vercel.com/v1/registrar/domains/{domain}/buy
const response = await fetch('https://api.vercel.com/v1/registrar/domains/domain/buy?teamId=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "autoRenew": "true", "years": "123", "expectedPrice": "123", "contactInformation": { "firstName": "Example Name", "lastName": "Example Name", "email": "user@example.com", "phone": "string", "address1": "string", "address2": "string", "city": "string", "state": "string", "zip": "string", "country": "string", "companyName": "Example Name", "fax": "string", "additional": {} }, "languageCode": "string" }),});
const data = await response.json();console.log(data);Response
{ "orderId": "example_id", "_links": "value"}Errors
{ "status": "400", "code": "domain_too_short", "message": "string"}AuthorizationbearerToken
Default authentication mechanism
domainanyRequired
teamIdstringOptional
application/json
autoRenewbooleanRequired
Whether the domain should be auto-renewed before it expires. This can be configured later through the Vercel Dashboard or the Update auto-renew for a domain endpoint.
yearsnumberRequired
The number of years to purchase the domain for.
expectedPricenumberRequired
contactInformationobjectRequired
The contact information for the domain. Some TLDs require additional contact information. Use the Get contact info schema endpoint to retrieve the required fields.
languageCodestringOptional
The language code for the domain. For punycode domains, this must be provided. The list of supported language codes for a TLD can be retrieved from the Get TLD endpoint.
200Success
orderIdstringRequired
A valid order ID
_linksobjectRequired
400There was something wrong with the request
statusnumberRequired
codestringRequired
messagestringRequired
401Unauthorized
statusnumberRequired
codestringRequired
messagestringRequired
403NotAuthorizedForScope
statusnumberRequired
codestringRequired
messagestringRequired
429TooManyRequests
statusnumberRequired
codestringRequired
messagestringRequired
retryAfterobjectRequired
limitobjectRequired
500InternalServerError
statusnumberRequired
codestringRequired
messagestringRequired