> ## Documentation Index
> Fetch the complete documentation index at: https://developers.entri.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sell SDK

> The purchaseDomain() method, configuration options, and error handling for the Entri Sell modal.

## `entri.purchaseDomain(config)`

This method launches the [Entri Sell](/sell/overview) modal. The `config` object includes the same set of properties as those specified in [entri.showEntri(config)](/connect/configuration#entrishowentriconfig), plus additional Sell-specific options:

<Note>
  For browser callback events (`onSuccess`, `onEntriClose`), see [Sell Events](/sell/events#browser-callback-events).
</Note>

| Property                      | Type    | Required? | Default     | Description                                                                                                                                                                                                                                              |
| ----------------------------- | ------- | --------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `disableConnect`              | boolean | No        | false       | If true, the flow will only run the domain(s) purchase process, but no specific DNS records will be configured.                                                                                                                                          |
| `debugMode`                   | boolean | No        | false       | For testing purposes. It skips the actual payment process and takes the user to the congratulations step.                                                                                                                                                |
| `successCallbackUrl`          | string  | No        | N/A         | The URL where the user will be redirected after a successful domain purchase.                                                                                                                                                                            |
| `exitCallbackUrl`             | string  | No        | N/A         | The URL where the user will be redirected if they exit the purchase flow before completing it (e.g. closing the modal).                                                                                                                                  |
| `dnsRecords`                  | array   | Yes       | N/A         | An array of DNS records to configure for the purchased domain. Each record should include `type`, `host`, `value`, and `ttl`.                                                                                                                            |
| `freeDomain`                  | boolean | No        | false       | This feature allows you to offer your users their first domain at no cost. Should only be used on paid users on your platform. Please contact your account manager to enable this feature.                                                               |
| `locale`                      | string  | No        | `"en"`      | The language/locale used in the domain purchase flow.                                                                                                                                                                                                    |
| `disableMailUpsell`           | boolean | No        | false       | If set to true, the mail inbox upsell step is disabled and will not appear in the domain purchase flow. This property allows you to prevent the mail inbox upsell step seamlessly, ensuring a streamlined user experience without optional distractions. |
| `searchType`                  | string  | No        | `"classic"` | (IONOS only) Use "ai" to enable AI-generated domain suggestions instead of the default "classic" search.                                                                                                                                                 |
| `whiteLabel`                  | object  | No        | N/A         | Customizes the branding and appearance of the purchase flow. Includes options for setting the logo, theme colors, hiding logos, and customizing text on the initial screen.                                                                              |
| `whiteLabel.sell.flowTarget`  | string  | No        | `_parent`   | The target location where the purchase flow window will be displayed. If \_blank is specified, the flow will open in a new browser tab.                                                                                                                  |
| `whiteLabel.sell.partnerLogo` | string  | No        | N/A         | The URL of the partner’s logo, which will be displayed prominently in the cobranded header of the purchase flow.                                                                                                                                         |
| `whiteLabel.sell.partnerName` | string  | No        | N/A         | The name of the partner company to display within the purchase flow.                                                                                                                                                                                     |
| `whiteLabel.sell.contact`     | object  | No        | N/A         | Prefilled user data required for creating the domain. This includes fields like `firstName`, `lastName`, `email`, `phone`, `address`, `zip`, `city`, `state`, `postalCode`, and `country`.                                                               |

This `purchaseDomain` method includes all the latest theming options, cobranded elements, and features such as `successCallbackUrl` and `exitCallbackUrl`. Make sure to set the appropriate fields to customize the flow according to your needs.

### Possible `purchaseDomain()` Errors

When any of the following critical errors occur, a console error will be logged, and the user will only see “Entri is misconfigured. Please contact support for assistance.” in the UI.

| Error                                | Console Message                                                                                       | Reason                                                                                           |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| Failed to Fetch Application Settings | "Failed to fetch application settings"                                                                | API call failed (network error, invalid appId, or API down).                                     |
| Missing Preferred Registrar          | "Entri is misconfigured. Your preferred registrar is missing. Please contact support for assistance." | No `preferred_registrar` found in config or application settings (required for purchase flow).   |
| Unsupported Registrar                | "Preferred registrar {registrar} is not supported. Please contact support for assistance."            | The provided `preferred_registrar` is unsupported (currently supported: `ionos`, `squarespace`). |

## Asynchronous DNS configurations ([Entri Sell](/sell/overview) only)

You can make asynchronous DNS configurations after the initial **Entri Sell** flow has finished, with time limits depending on the registrar or plan tier.

* For **Squarespace** domains, it remains available for up to **1 year** after the initial domain purchase.
* For **IONOS** domains, it remains available for up to **1 year** after the initial domain purchase.

<Note>
  For IONOS domains, the 1-year async configuration window only applies to new domains ordered after **December 15, 2025**.
</Note>

This feature allows you to add or update DNS records after the initial setup without requiring users to repeat the full flow. (Not supported on `debugMode=true` flows.)

```bash theme={null}
POST https://api.goentri.com/connect/async
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Sample body:

```JSON JSON theme={null}
{
  "applicationId": "clickfunnels",
  "domain": "domain.com",
  "subdomain": "www",
  "wwwRedirect": false,
  "dnsRecords": [
    {
      "value": "13.248.155.104",
      "host": "@",
      "ttl": 300,
      "type": "A"
    }
  ]
}
```

### Properties:

| Type                       | Property      | Required? | Default | Description                                                                                   |
| -------------------------- | ------------- | --------- | ------- | --------------------------------------------------------------------------------------------- |
| string                     | applicationId | Yes       | N/A     | The ID of your application (set in the dashboard)                                             |
| string                     | domain        | Yes       | N/A     | The domain that will have the DNS records configured, e.g. example.com                        |
| array of DNSRecord objects | dnsRecords    | Yes       | N/A     | The DNS records you wish to configure for your users                                          |
| string                     | subdomain     | No        | N/A     | The subdomain that will have the DNS records configured, e.g. www                             |
| boolean                    | wwwRedirect   | No        | false   | If true, Entri will automatically set the redirect from the bare domain to the www subdomain. |
