> ## 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 Events

> Entri Sell webhook events (domain.purchased, purchase.error, purchase.confirmation.expired) and browser callback events (onSuccess, onEntriClose).

This page documents the webhook events and payload fields relevant to Entri Sell. For the payload envelope and signature verification, see [Webhooks Overview](/webhooks-overview).

## Webhook event types

* `"domain.purchased"`: Indicates that the domain *order* creation has been completed.
* `"domain.transfer.in.initiated"`: Only applicable for **Entri Sell Enterprise**. An inbound domain transfer has been initiated by the user.
* `"domain.transfer.in.started"`: Only applicable for **Entri Sell Enterprise**. The inbound domain transfer has been accepted and is now in progress at the registry level.
* `"domain.transfer.in.ack"`: Only applicable for **Entri Sell Enterprise**. The inbound domain transfer has been acknowledged by the registry.
* `"domain.transfer.in.failed"`: Only applicable for **Entri Sell Enterprise**. The inbound domain transfer has failed.
* `"domain.transfer.out.initiated"`: Only applicable for **Entri Sell Enterprise**. An outbound domain transfer away from Entri has been initiated.
* `"purchase.error"`: Indicates an error during the domain purchase process.
* `"purchase.confirmation.expired"`: The purchase confirmation has expired (abandoned flow).

## Payload fields

* **`purchased_domains`**: An array of domains that were purchased during the transaction. This field is only relevant for Entri Sell. Example:

  ```json theme={null}
  ["domain1.com", "domain2.com", "domainN.com"]
  ```

* **`free_domain`**: Indicates whether the domain was obtained through a free domain flow. Possible values:
  * `true`: The domain was free.
  * `false`: The domain was not free.

## Browser callback events

The Entri Sell modal emits browser events you can listen for to react when a purchase completes or the modal is closed. Each is a `window` event whose `event.detail` carries the payload described below.

### `onSuccess` Callback Event

Fired when the user reaches the **Congratulations** screen after a successful purchase. Use it to capture a definitive success signal and the `jobId` that identifies the flow.

<Note>
  Both the IONOS and Squarespace Sell flows fire `onSuccess`.
</Note>

#### Sample usage:

```JavaScript JavaScript theme={null}
function handleOnSuccess(event) {
  console.log('onSuccess', event.detail);
}
window.addEventListener('onSuccess', handleOnSuccess, false);
```

#### Sample `event.detail` object response:

```JSON JSON theme={null}
{
  "domain": "example.com",
  "success": true,
  "setupType": "purchase",
  "provider": "squarespace",
  "freeDomain": false,
  "jobId": "2132b20f-e522-42fc-9604-5a53b1f13a4b"
}
```

#### Event details object description

| Name       | Type    | Description                                                                                               |
| ---------- | ------- | --------------------------------------------------------------------------------------------------------- |
| domain     | string  | The purchased domain. When multiple domains are purchased, they are returned as a comma-separated string. |
| success    | boolean | Always `true` for this event.                                                                             |
| setupType  | string  | Always `purchase` for Sell flows.                                                                         |
| provider   | string  | The Sell registrar handling the purchase (e.g. `squarespace`).                                            |
| freeDomain | boolean | `true` when the purchase used an Entri Sell free-domain flow; otherwise `false`.                          |
| jobId      | string  | The unique identifier for the Sell flow. It is also included in the related webhooks.                     |

<Note>
  The `onSuccess` event is the recommended source to capture the `jobId` for subsequent server-side operations (e.g., retrieving the last webhook).
</Note>

### `onEntriClose` Callback Event

Fired as soon as the modal is closed, with the latest status of the flow.

#### Sample usage:

```JavaScript JavaScript theme={null}
function handleOnEntriClose(event) {
  console.log('onEntriClose', event.detail);
}
window.addEventListener('onEntriClose', handleOnEntriClose, false);
```

#### Sample `event.detail` object response:

```JSON JSON theme={null}
{
  "domain": "example.com",
  "success": true,
  "lastStatus": "FINISHED_SUCCESSFULLY",
  "provider": "squarespace",
  "setupType": "purchase"
}
```

#### Event details object description

| Name       | Type    | Description                                                                                                                       |
| ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| domain     | string  | The domain the user entered. May be an empty string if the user closed the modal before selecting a domain.                       |
| success    | boolean | `true` if the purchase completed before the modal closed; otherwise `false`.                                                      |
| lastStatus | string  | `FINISHED_SUCCESSFULLY` when the purchase completed successfully. Omitted when the modal is closed without completing a purchase. |
| provider   | string  | The Sell registrar handling the purchase (e.g. `squarespace`).                                                                    |
| setupType  | string  | Always `purchase` for Sell flows.                                                                                                 |

<Note>
  The payload depends on the registrar and the outcome. The **IONOS** close event includes only `domain` and `success`. When the modal is closed without a completed purchase, `success` is `false` and `lastStatus` is omitted.
</Note>
