Customers

Events

Action Event name
customer sign up customer.created
create a customer via admin page customer.created
purchase by a new customer customer.created
purchase completed customer.updated
edit customer via admin page customer.updated
cancellation of a purchase customer.updated
customer account activation customer.updated
delete a customer customers.deleted
customers merge customers.merged

Payload example

{
  "id": "string",
  "attemptId": "string",
  "livemode": "boolean",
  "created": "int",
  "event": "string",
  "data": {
    "_id": "string",
    "zip": "string",
    "userId": "string",
    "title": "string",
    "street": "string",
    "province": "string",
    "phoneType": "string",
    "phone": "string",
    "optIn": "boolean",
    "normalizedPhone": "string",
    "mergedTo": "string",
    "mergedFrom": [],
    "lastName": "string",
    "gender": "string",
    "firstName": "string",
    "email": "string",
    "customerNumber": "string",
    "country": "string",
    "cloutCategory": "string",
    "city": "string",
    "agencyId": "string",
    "activeCustomerAccount": "boolean",
    "accountId": "string",
    "deleted": "boolean",
    "createdAt": {
      "value": "string",
      "offset": "int"
    },
    "updatedAt": {
      "value": "string",
      "offset": "int"
    }
  }
}

Payload fields (customer.created / customer.updated)

Field Type Description
id string Webhook event id
attemptId string Delivery attempt id
livemode boolean Whether the account is in live mode
created int Unix timestamp when the event was created
event string Event name: customer.created or customer.updated
data object Customer document: _id, accountId, customerNumber, email, firstName, lastName, phone, street, city, province, country, zip, activeCustomerAccount, deleted, createdAt, updatedAt, mergedTo, mergedFrom, etc.

Payload example deleted

{
  "attemptId": "fb29c7cd-6c24-4e14-ae40-cc3c413775b4",
  "created": 1665591574,
  "data": {
    "customerId": "6346e71043f36306722673f5",
    "customerNumber": "388-864-739"
  },
  "event": "customers.deleted",
  "id": "6fb8a462-9673-4ef2-9efb-f0471b8f263f",
  "livemode": false
}

Payload fields (customers.deleted)

Field Type Description
id string Webhook event id
attemptId string Delivery attempt id
created int Unix timestamp
event string customers.deleted
livemode boolean Whether the account is in live mode
data.customerId string Id of the deleted (anonymized) customer
data.customerNumber string Customer number of the deleted customer

Payload example merged

Event: customers.merged

{
  "attemptId": "a71e1989-4840-4ec1-9387-e2bcfe5f2417",
  "created": 1730902554,
  "data": {
    "_id": "672b7a1930bf68a1ac484a97",
    "accountId": "595f9c7007ee12686d000032",
    "createdAt": {
      "offset": 0,
      "value": "2024-11-06T14:15:53.725Z"
    },
    "createdBy": "6669a9ad5cf945f3e1dd42d3",
    "destinationCustomerId": "66d722fed7009c4b9632689f",
    "logs": [
      {
        "affectedDocuments": [],
        "attributeChanged": "customerNumber",
        "collection": "tickets",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.735Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [],
        "attributeChanged": "customerNumber",
        "collection": "transactions",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.740Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [],
        "attributeChanged": "customerNumber",
        "collection": "sold_items",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.744Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [],
        "attributeChanged": "customerNumber",
        "collection": "manual_sales",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.748Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [],
        "attributeChanged": "customerNumber",
        "collection": "refunds",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.752Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [],
        "attributeChanged": "customerNumber",
        "collection": "loans",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.767Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [],
        "attributeChanged": "customerNumber",
        "collection": "gift_certificates",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.772Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [],
        "attributeChanged": "customerId",
        "collection": "travellers",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:53.776Z"
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "collection": "movements",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:54.099Z"
        },
        "db": "loyalty",
        "operationType": "none",
        "status": "ok"
      },
      {
        "affectedDocuments": "66d722fed7009c4b9632689f",
        "attributeChanged": "clout",
        "collection": "customers",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:54.104Z"
        },
        "oldValue": {
          "p0000_00": {
            "purchases": 915,
            "purchasesValue": 7750000000,
            "travels": 0,
            "travelsValue": 0
          },
          "p2024_10": {
            "purchases": 915,
            "purchasesValue": 18505000000,
            "travels": 0,
            "travelsValue": 0
          }
        },
        "operationType": "update",
        "status": "ok"
      },
      {
        "affectedDocuments": [
          "67055060add402a1553290ae"
        ],
        "collection": "customers",
        "createdAt": {
          "offset": 0,
          "value": "2024-11-06T14:15:54.109Z"
        },
        "operationType": "soft-delete",
        "status": "ok"
      }
    ],
    "sourceCustomerIds": [
      "67055060add402a1553290ae"
    ],
    "status": "success"
  },
  "event": "customers.merged",
  "id": "9fe09339-310d-450a-a012-0b6543ee91d9",
  "livemode": false
}

Payload fields (customers.merged)

Field Type Description
id string Webhook event id
attemptId string Delivery attempt id
created int Unix timestamp
event string customers.merged
livemode boolean Whether the account is in live mode
data._id string Customer merge record id
data.accountId string Account id
data.destinationCustomerId string Customer id that received merged data
data.sourceCustomerIds array Customer ids that were merged into destination
data.status string Merge status (e.g. success)
data.logs array Per-collection operation logs (collection, operationType, status, etc.)
data.createdBy string User id who triggered the merge
data.createdAt object Timestamp with value and offset