Vai al contenuto
Docs

Ordini salvati per la prima volta e ordini salvati che sono cambiati.

order.placed

Inviato quando Emailit salva un ordine per la prima volta: da Crea o aggiorna un ordine, dallo script di tracciamento o da Importa ordini in blocco con historical impostato su false. Le importazioni storiche non lo inviano. Lo stesso evento può avviare un’automazione. Vedi E-commerce.

Le richieste webhook contengono un array JSON di eventi come questo; vedi Richieste webhook.

Campi

event_idstring

ID dell’evento (evt_…). Una richiesta ritentata contiene lo stesso ID: usalo per saltare gli eventi che hai già gestito. Puoi anche consultare l’evento con Recupera un evento.

typestring

Sempre order.placed.

objectobject

L’ordine descritto dall’evento. I suoi campi sono elencati qui sotto.

data.objectobject

Di nuovo lo stesso oggetto, nella forma in cui l’API degli eventi lo restituisce in data.

Oggetto ordine

Lo stesso oggetto restituito da Recupera un ordine.

idstring

ID dell’ordine (ord_…).

objectstring

Sempre order.

external_idstring

L’ID dell’ordine nel tuo negozio.

contact_idstring | null

Il contatto dell’acquirente (con_…), oppure null.

emailstring | null

L’indirizzo email dell’acquirente, in minuscolo.

statusstring

placed, paid, fulfilled, canceled o refunded.

currencystring

Codice ISO 4217 di tre lettere degli importi.

subtotal, discount, shipping, taxnumber | null

Gli importi dell’ordine, oppure null quando non sono stati inviati.

totalnumber

Totale dell’ordine.

refunded_amountnumber

Importo rimborsato finora.

coupon_codesstring[]

Codici coupon o codici sconto usati nell’ordine.

cart_idstring | null

L’ID del carrello o del checkout nel tuo negozio da cui proviene l’ordine.

sourcestring

api, js (lo script di tracciamento) o import.

placed_atstring

Quando è stato effettuato l’ordine, in ISO 8601 UTC.

paid_at, fulfilled_at, canceled_at, refunded_atstring | null

Quando l’ordine ha avuto per la prima volta quello stato in Emailit.

attributionobject | null

L’email a cui è attribuito l’ordine, oppure null: email_id, campaign_id, campaign_name, variant_id, automation_id, automation_name, type (click o open) e touched_at. Vedi Come gli ordini vengono attribuiti alle email.

itemsobject[]

Righe dell’ordine, ognuna con product_id, variant_id, sku, title, quantity, unit_price, total, categories, url e image_url.

metadataobject

Dati chiave-valore tuoi dell’ordine.

created_at, updated_atstring

Quando Emailit ha salvato l’ordine e quando è cambiato l’ultima volta, in ISO 8601 UTC.

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"
    }
  }
}

order.updated

Inviato quando cambia un ordine che Emailit ha già salvato:

Quando lo stato è cambiato, l’evento contiene anche previous_status.

Le richieste webhook contengono un array JSON di eventi come questo; vedi Richieste webhook.

Campi

event_idstring

ID dell’evento (evt_…). Una richiesta ritentata contiene lo stesso ID: usalo per saltare gli eventi che hai già gestito. Puoi anche consultare l’evento con Recupera un evento.

typestring

Sempre order.updated.

objectobject

L’ordine dopo la modifica. Ha gli stessi campi che in order.placed e in Recupera un ordine.

previous_statusstring

Lo stato dell’ordine prima della modifica. Presente solo quando lo stato è cambiato. Si trova accanto a object, non al suo interno.

dataobject

Di nuovo object e previous_status, nella forma in cui l’API degli eventi li restituisce in data.

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"
  }
}

Questa pagina ti è stata utile?

Grazie del feedback.

Grazie, leggiamo ogni messaggio.