UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

89 lines • 4.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TransferIn = exports.BaseTransferIn = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const headers_1 = require("../../internal/headers.js"); const path_1 = require("../../internal/utils/path.js"); var BaseTransferIn = /* @__PURE__ */ (() => { class BaseTransferIn extends resource_1.APIResource { /** * Starts a domain transfer-in workflow. This is typically a billable operation — * successful transfers charge the account's default payment method, except for * extensions with zero transfer pricing (e.g. UK extensions). All successful * domain transfers are non-refundable. * * ### How transfers work * * Domain transfers move a domain from another registrar to Cloudflare. Transfers * typically take 1-10 days due to ICANN-mandated approval windows. * * ### Prerequisites * * - The domain must already have a zone in the Cloudflare account (added through * the dashboard or zone API). * - The zone must have DNSSec disabled. * - For billable transfers (i.e. extensions with non-zero transfer pricing), the * account must have a billing profile with a valid default payment method. Set * this up at `https://dash.cloudflare.com/{account_id}/billing/payment-info`. * - The domain must be unlocked at the current registrar. * - An authorization/EPP code from the current registrar is required, except for * UK extensions — see Auth code below. * * ### Auth code * * An authorization code (also called EPP code, transfer key, or auth-info code) is * required for most extensions, with the exception of UK extensions. Obtain this * from your current registrar's control panel. * * The auth code in the request body must be base64-encoded per RFC 4648 §4 * (standard alphabet, no line breaks). * * ### Response behavior * * Successful transfer initiation returns `202 Accepted`. Validation or initiation * failures return the documented `4XX` responses. Poll * `GET /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in-status` * to track progress. * * ### Premium domains * * Premium domain transfers are not currently supported by this API. Please use the * [dashboard](https://dash.cloudflare.com/) for now. * * ### Billing * * The account's default payment method is charged upon successful transfer * completion, unless the extension has zero transfer pricing (e.g. UK extensions). * The transfer adds time to the domain's existing expiration date (typically 1 * year). * * @example * ```ts * const workflowStatus = * await client.registrar.transferIn.create('example.com', { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * auth_code: 'bml4b3M+Pj5hcmNoLWxpbnV4', * }); * ``` */ create(domainName, params, options) { const { account_id, Prefer, ...body } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/registrar/registrations/${domainName}/transfer-in`, { body, ...options, headers: (0, headers_1.buildHeaders)([{ ...(Prefer != null ? { Prefer: Prefer } : undefined) }, options?.headers]), })._thenUnwrap((obj) => obj.result); } } BaseTransferIn._key = Object.freeze([ 'registrar', 'transferIn', ]); return BaseTransferIn; })(); exports.BaseTransferIn = BaseTransferIn; class TransferIn extends BaseTransferIn { } exports.TransferIn = TransferIn; //# sourceMappingURL=transfer-in.js.map