Aller au contenu
Docs

Commandes enregistrées pour la première fois et commandes enregistrées qui ont changé.

order.placed

Envoyé lorsqu’Emailit enregistre une commande pour la première fois : depuis Créer ou mettre à jour une commande, depuis le script de suivi, ou depuis Importer des commandes par lots avec historical défini à false. Les imports historiques ne l’envoient pas. Le même événement peut démarrer une automatisation. Consultez Commerce.

Les requêtes de webhook contiennent un tableau JSON d’événements comme celui-ci ; consultez Requêtes de webhook.

Champs

event_idstring

ID de l’événement (evt_…). Une requête relancée porte le même ID : utilisez-le pour ignorer les événements déjà traités. Vous pouvez aussi consulter l’événement avec Récupérer un événement.

typestring

Toujours order.placed.

objectobject

La commande décrite par l’événement. Ses champs sont détaillés ci-dessous.

data.objectobject

Le même objet, sous la forme que l’API des événements renvoie dans data.

Objet commande

Le même objet que celui renvoyé par Récupérer une commande.

idstring

ID de la commande (ord_…).

objectstring

Toujours order.

external_idstring

L’ID de la commande dans votre boutique.

contact_idstring | null

Le contact de l’acheteur (con_…), ou null.

emailstring | null

L’adresse e-mail de l’acheteur, en minuscules.

statusstring

placed, paid, fulfilled, canceled ou refunded.

currencystring

Code ISO 4217 à trois lettres des montants.

subtotal, discount, shipping, taxnumber | null

Les montants de la commande, ou null s’ils n’ont pas été envoyés.

totalnumber

Total de la commande.

refunded_amountnumber

Montant remboursé jusqu’ici.

coupon_codesstring[]

Codes de coupon ou de réduction utilisés dans la commande.

cart_idstring | null

L’ID du panier ou du paiement (checkout) dans votre boutique dont provient la commande.

sourcestring

api, js (le script de suivi) ou import.

placed_atstring

Date de la commande, au format ISO 8601 UTC.

paid_at, fulfilled_at, canceled_at, refunded_atstring | null

Date à laquelle la commande a eu ce statut pour la première fois dans Emailit.

attributionobject | null

L’e-mail auquel la commande est attribuée, ou null : email_id, campaign_id, campaign_name, variant_id, automation_id, automation_name, type (click ou open) et touched_at. Consultez Attribution des commandes aux e-mails.

itemsobject[]

Les articles, chacun avec product_id, variant_id, sku, title, quantity, unit_price, total, categories, url et image_url.

metadataobject

Vos propres données clé-valeur provenant de la commande.

created_at, updated_atstring

Dates auxquelles Emailit a enregistré la commande et l’a modifiée pour la dernière fois, au format 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

Envoyé lorsqu’une commande déjà enregistrée par Emailit change :

Quand le statut a changé, l’événement contient aussi previous_status.

Les requêtes de webhook contiennent un tableau JSON d’événements comme celui-ci ; consultez Requêtes de webhook.

Champs

event_idstring

ID de l’événement (evt_…). Une requête relancée porte le même ID : utilisez-le pour ignorer les événements déjà traités. Vous pouvez aussi consulter l’événement avec Récupérer un événement.

typestring

Toujours order.updated.

objectobject

La commande après la modification. Elle a les mêmes champs que dans order.placed et Récupérer une commande.

previous_statusstring

Le statut de la commande avant la modification. Présent uniquement si le statut a changé. Il se trouve à côté de object, pas à l’intérieur.

dataobject

De nouveau object et previous_status, sous la forme que l’API des événements renvoie dans 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"
  }
}

Cette page vous a-t-elle été utile ?

Merci pour votre retour.

Merci, nous lisons chaque message.