Buy a domain
POST
https://api.vercel.com/v1/registrar/domains/{domain}/buyBuy a domain
Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.domainsRegistrar.buySingleDomain({ domain: "metallic-simple.com", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", requestBody: { autoRenew: false, years: 7602.67, expectedPrice: 7390.34, contactInformation: { firstName: "Lexie", lastName: "Lemke", email: "Lionel21@gmail.com", phone: "550.220.6330 x258", address1: "<value>", city: "Spencerport", state: "West Virginia", zip: "46432", country: "MM", }, }, });
console.log(result);}
run();Response
{ "orderId": "example_id", "_links": "value"}Errors
{ "status": "400", "code": "domain_too_short", "message": "string"}AuthorizationbearerToken
Default authentication mechanism
application/json
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.
The contact information for the domain. Some TLDs require additional contact information. Use the Get contact info schema endpoint to retrieve the required fields.
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.
400There was something wrong with the request
429TooManyRequests