# Order events

> Orders stored for the first time, and stored orders that changed.



## order.placed

> Sent when an order is stored for the first time. Includes the items and the campaign or automation email the order is credited to. Alpha: open to the Emailit team only.

# order.placed

Sent when Emailit stores an order for the first time: from [Create or update an order](/docs/api-reference/orders/create/), from the tracking script, or from [Import orders in bulk](/docs/api-reference/orders/batch/) with `historical` set to `false`. Historical imports don't send it. The same event can start an automation. See [Commerce](/docs/commerce/).

> **Commerce is in alpha:** Commerce is open only to the Emailit team while we test it. See [Who can use Commerce](/docs/commerce/#who-can-use-commerce).

Webhook requests carry a JSON array of events like this one; see [Webhook requests](/docs/webhooks/webhook-requests/).

```json
{
  "event_id": "evt_381an2bijq9dF40JdqYLuJT43Z4",
  "type": "order.placed",
  "object": {
    "object": "order",
    "id": "ord_3aMEK4No62Zw8S1fcHNznAnnbfp",
    "external_id": "1042",
    "contact_id": "con_3EwrXnu9OaQWlfI1AyPUUEoYjQs",
    "email": "ada@example.com",
    "status": "paid",
    "currency": "USD",
    "subtotal": 107,
    "discount": 10.7,
    "shipping": 5,
    "tax": 0,
    "total": 101.3,
    "refunded_amount": 0,
    "coupon_codes": [
      "WELCOME-7KQ2M9XA"
    ],
    "cart_id": "c-58f1a2",
    "source": "api",
    "placed_at": "2026-10-08T14:32:10.000Z",
    "paid_at": "2026-10-08T14:32:11.204Z",
    "fulfilled_at": null,
    "canceled_at": null,
    "refunded_at": null,
    "attribution": {
      "email_id": "eml_3TSvDAUQi7vqxvAQ1UEVN7k4igq",
      "campaign_id": "cmp_3zNrBaNjAoPK1l0IL2GQ3pDkubN",
      "campaign_name": "October newsletter",
      "variant_id": null,
      "automation_id": null,
      "automation_name": null,
      "type": "click",
      "touched_at": "2026-10-08T09:41:52.000Z"
    },
    "items": [
      {
        "product_id": "8123456789",
        "variant_id": "42-blue",
        "sku": "TRS-BLU-42",
        "title": "Trail running shoe",
        "quantity": 1,
        "unit_price": 89,
        "total": 89,
        "categories": [
          "Shoes",
          "Running"
        ],
        "url": "https://shop.example.com/products/trail-running-shoe",
        "image_url": "https://shop.example.com/images/trail-running-shoe.jpg"
      }
    ],
    "metadata": {
      "channel": "web"
    },
    "created_at": "2026-10-08T14:32:11.204Z",
    "updated_at": "2026-10-08T14:32:11.204Z"
  },
  "data": {
    "object": {
      "object": "order",
      "id": "ord_3aMEK4No62Zw8S1fcHNznAnnbfp",
      "external_id": "1042",
      "contact_id": "con_3EwrXnu9OaQWlfI1AyPUUEoYjQs",
      "email": "ada@example.com",
      "status": "paid",
      "currency": "USD",
      "subtotal": 107,
      "discount": 10.7,
      "shipping": 5,
      "tax": 0,
      "total": 101.3,
      "refunded_amount": 0,
      "coupon_codes": [
        "WELCOME-7KQ2M9XA"
      ],
      "cart_id": "c-58f1a2",
      "source": "api",
      "placed_at": "2026-10-08T14:32:10.000Z",
      "paid_at": "2026-10-08T14:32:11.204Z",
      "fulfilled_at": null,
      "canceled_at": null,
      "refunded_at": null,
      "attribution": {
        "email_id": "eml_3TSvDAUQi7vqxvAQ1UEVN7k4igq",
        "campaign_id": "cmp_3zNrBaNjAoPK1l0IL2GQ3pDkubN",
        "campaign_name": "October newsletter",
        "variant_id": null,
        "automation_id": null,
        "automation_name": null,
        "type": "click",
        "touched_at": "2026-10-08T09:41:52.000Z"
      },
      "items": [
        {
          "product_id": "8123456789",
          "variant_id": "42-blue",
          "sku": "TRS-BLU-42",
          "title": "Trail running shoe",
          "quantity": 1,
          "unit_price": 89,
          "total": 89,
          "categories": [
            "Shoes",
            "Running"
          ],
          "url": "https://shop.example.com/products/trail-running-shoe",
          "image_url": "https://shop.example.com/images/trail-running-shoe.jpg"
        }
      ],
      "metadata": {
        "channel": "web"
      },
      "created_at": "2026-10-08T14:32:11.204Z",
      "updated_at": "2026-10-08T14:32:11.204Z"
    }
  }
}
```

## Fields

- `event_id` (string): Event ID (`evt_…`). A retried request carries the same ID, so use it to skip events you already handled. You can also look the event up with [Retrieve an event](/docs/api-reference/events/get/).

- `type` (string): Always `order.placed`.

- `object` (object): The order the event describes. Its fields are listed below.

- `data.object` (object): The same object again, in the shape that the [Events API](/docs/api-reference/events/get/) returns in `data`.

### Order object

The same object as [Retrieve an order](/docs/api-reference/orders/get/) returns.

- `id` (string): Order ID (`ord_…`).

- `object` (string): Always `order`.

- `external_id` (string): The order ID in your shop.

- `contact_id` (string | null): The buyer's contact (`con_…`), or `null`.

- `email` (string | null): The buyer's email address, in lowercase.

- `status` (string): `placed`, `paid`, `fulfilled`, `canceled` or `refunded`.

- `currency` (string): Three-letter ISO 4217 code of the amounts.

- `subtotal, discount, shipping, tax` (number | null): The order's amounts, or `null` when not sent.

- `total` (number): Order total.

- `refunded_amount` (number): Amount refunded so far.

- `coupon_codes` (string[]): Coupon or discount codes used in the order.

- `cart_id` (string | null): The cart or checkout ID in your shop that the order came from.

- `source` (string): `api`, `js` (the tracking script) or `import`.

- `placed_at` (string): When the order was placed, in ISO 8601 UTC.

- `paid_at, fulfilled_at, canceled_at, refunded_at` (string | null): When the order first had that status in Emailit.

- `attribution` (object | null): The email the order is credited to, or `null`: `email_id`, `campaign_id`, `campaign_name`, `variant_id`, `automation_id`, `automation_name`, `type` (`click` or `open`) and `touched_at`. See [How orders are credited to emails](/docs/commerce/#how-orders-are-credited-to-emails).

- `items` (object[]): Line items, each with `product_id`, `variant_id`, `sku`, `title`, `quantity`, `unit_price`, `total`, `categories`, `url` and `image_url`.

- `metadata` (object): Your own key-value data from the order.

- `created_at, updated_at` (string): When Emailit stored the order and when it last changed, in ISO 8601 UTC.

---
Source: https://emailit.com/docs/webhooks/events/order/order-placed/

## order.updated

> Sent when a stored order changes, for example its status or a refund. When the status changed, the event includes the previous status. Alpha: open to the Emailit team only.

# order.updated

Sent when an order that Emailit already stored changes:

- You change its status, refund or metadata with [Update an order](/docs/api-reference/orders/update/).
- You send the same order again with [Create or update an order](/docs/api-reference/orders/create/), or the tracking script sends it again.
- [Import orders in bulk](/docs/api-reference/orders/batch/) with `historical` set to `false` updates it. Historical imports don't send the event.

When the status changed, the event also carries `previous_status`.

> **Commerce is in alpha:** Commerce is open only to the Emailit team while we test it. See [Who can use Commerce](/docs/commerce/#who-can-use-commerce).

Webhook requests carry a JSON array of events like this one; see [Webhook requests](/docs/webhooks/webhook-requests/).

```json
{
  "event_id": "evt_3sRH2D1JwRBeo2uyN9p2NM4VX3i",
  "type": "order.updated",
  "object": {
    "object": "order",
    "id": "ord_3aMEK4No62Zw8S1fcHNznAnnbfp",
    "external_id": "1042",
    "contact_id": "con_3EwrXnu9OaQWlfI1AyPUUEoYjQs",
    "email": "ada@example.com",
    "status": "fulfilled",
    "currency": "USD",
    "subtotal": 107,
    "discount": 10.7,
    "shipping": 5,
    "tax": 0,
    "total": 101.3,
    "refunded_amount": 0,
    "coupon_codes": [
      "WELCOME-7KQ2M9XA"
    ],
    "cart_id": "c-58f1a2",
    "source": "api",
    "placed_at": "2026-10-08T14:32:10.000Z",
    "paid_at": "2026-10-08T14:32:11.204Z",
    "fulfilled_at": "2026-10-09T11:05:43.019Z",
    "canceled_at": null,
    "refunded_at": null,
    "attribution": {
      "email_id": "eml_3TSvDAUQi7vqxvAQ1UEVN7k4igq",
      "campaign_id": "cmp_3zNrBaNjAoPK1l0IL2GQ3pDkubN",
      "campaign_name": "October newsletter",
      "variant_id": null,
      "automation_id": null,
      "automation_name": null,
      "type": "click",
      "touched_at": "2026-10-08T09:41:52.000Z"
    },
    "items": [
      {
        "product_id": "8123456789",
        "variant_id": "42-blue",
        "sku": "TRS-BLU-42",
        "title": "Trail running shoe",
        "quantity": 1,
        "unit_price": 89,
        "total": 89,
        "categories": [
          "Shoes",
          "Running"
        ],
        "url": "https://shop.example.com/products/trail-running-shoe",
        "image_url": "https://shop.example.com/images/trail-running-shoe.jpg"
      }
    ],
    "metadata": {
      "channel": "web"
    },
    "created_at": "2026-10-08T14:32:11.204Z",
    "updated_at": "2026-10-09T11:05:43.019Z"
  },
  "previous_status": "paid",
  "data": {
    "object": {
      "object": "order",
      "id": "ord_3aMEK4No62Zw8S1fcHNznAnnbfp",
      "external_id": "1042",
      "contact_id": "con_3EwrXnu9OaQWlfI1AyPUUEoYjQs",
      "email": "ada@example.com",
      "status": "fulfilled",
      "currency": "USD",
      "subtotal": 107,
      "discount": 10.7,
      "shipping": 5,
      "tax": 0,
      "total": 101.3,
      "refunded_amount": 0,
      "coupon_codes": [
        "WELCOME-7KQ2M9XA"
      ],
      "cart_id": "c-58f1a2",
      "source": "api",
      "placed_at": "2026-10-08T14:32:10.000Z",
      "paid_at": "2026-10-08T14:32:11.204Z",
      "fulfilled_at": "2026-10-09T11:05:43.019Z",
      "canceled_at": null,
      "refunded_at": null,
      "attribution": {
        "email_id": "eml_3TSvDAUQi7vqxvAQ1UEVN7k4igq",
        "campaign_id": "cmp_3zNrBaNjAoPK1l0IL2GQ3pDkubN",
        "campaign_name": "October newsletter",
        "variant_id": null,
        "automation_id": null,
        "automation_name": null,
        "type": "click",
        "touched_at": "2026-10-08T09:41:52.000Z"
      },
      "items": [
        {
          "product_id": "8123456789",
          "variant_id": "42-blue",
          "sku": "TRS-BLU-42",
          "title": "Trail running shoe",
          "quantity": 1,
          "unit_price": 89,
          "total": 89,
          "categories": [
            "Shoes",
            "Running"
          ],
          "url": "https://shop.example.com/products/trail-running-shoe",
          "image_url": "https://shop.example.com/images/trail-running-shoe.jpg"
        }
      ],
      "metadata": {
        "channel": "web"
      },
      "created_at": "2026-10-08T14:32:11.204Z",
      "updated_at": "2026-10-09T11:05:43.019Z"
    },
    "previous_status": "paid"
  }
}
```

## Fields

- `event_id` (string): Event ID (`evt_…`). A retried request carries the same ID, so use it to skip events you already handled. You can also look the event up with [Retrieve an event](/docs/api-reference/events/get/).

- `type` (string): Always `order.updated`.

- `object` (object): The order after the change. It has the same fields as in [`order.placed`](/docs/webhooks/events/order/placed/#order-object) and [Retrieve an order](/docs/api-reference/orders/get/).

- `previous_status` (string): The order's status before the change. Only present when the status changed. It sits next to `object`, not inside it.

- `data` (object): `object` and `previous_status` again, in the shape that the [Events API](/docs/api-reference/events/get/) returns in `data`.

---
Source: https://emailit.com/docs/webhooks/events/order/order-updated/
