Skip to content

WebhookPayload ​

Type: schema

Description ​

The inner event record. properties carries the event-specific model documented on each webhook, and each webhook lists the ids it carries at the top level: its entity's (e.g. order_number, cart_id) and related entities'. The other keys are common to all events.

TypeScript Definition ​

typescript
WebhookPayload: {{
            /** @description Event name, identical to the envelope `event` and the `X-CE-Event` header. */
            event: string
}

OpenAPI Schema ​

json
{
  "title": "WebhookPayload",
  "description": "The inner event record. `properties` carries the event-specific model documented on each webhook, and each webhook lists the ids it carries at the top level: its entity's (e.g. `order_number`, `cart_id`) and related entities'. The other keys are common to all events.",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/WebhookPayload",
    "description": "API reference for the WebhookPayload schema"
  },
  "required": [
    "event",
    "event_id",
    "store_id",
    "properties"
  ],
  "properties": {
    "event": {
      "description": "Event name, identical to the envelope `event` and the `X-CE-Event` header.",
      "type": "string"
    },
    "event_id": {
      "description": "ULID of the event. Identical to the envelope `event_id`.",
      "type": "string"
    },
    "store_id": {
      "description": "Store the event belongs to. For `seller.*` events this is the marketplace store; the seller store is in `seller_id`.",
      "type": "string"
    },
    "store_type": {
      "description": "Type of the originating store: `b2c`, `b2b`, `marketplace`, or `seller` (seller-side copies of marketplace records). May be `null` when the producer had no store context.",
      "type": [
        "string",
        "null"
      ]
    },
    "user_id": {
      "description": "Storefront user the event concerns, when applicable: the shopper who caused it, or the one whose order, payment or other record an admin or the system changed (the admin is in `admin_user_id`).",
      "type": [
        "string",
        "null"
      ]
    },
    "customer_id": {
      "description": "Customer the event relates to. Present on customer, KYC, loyalty and invoice events.",
      "type": [
        "string",
        "null"
      ]
    },
    "admin_user_id": {
      "description": "Admin user that caused the event, when triggered from the admin API.",
      "type": [
        "string",
        "null"
      ]
    },
    "tenant_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "seller_id": {
      "description": "Seller store the event is addressed to. Present on `seller.*` events only.",
      "type": [
        "string",
        "null"
      ]
    },
    "timestamp": {
      "description": "Time the event was produced by the originating service (ISO 8601, UTC). Absent on a few events; prefer the envelope `timestamp` for ordering.",
      "type": "string"
    },
    "is_test": {
      "description": "`true` for payloads generated by the admin *Send test webhook* action.",
      "type": "boolean"
    },
    "changes": {
      "description": "What this event changed, as `{name: {\"from\": old, \"to\": new}}`: the fields of `properties` that changed and, for some events, details of the action (e.g. `user.account.created`'s `signup_method` and `guest`). `{}` when there is nothing to list.",
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "from": {
            "description": "The value before the change."
          },
          "to": {
            "description": "The value after the change."
          }
        }
      }
    },
    "context": {
      "description": "Where the action came from: `channel` (the sales channel's type) and `channel_id`, `ip`, `user_agent`, `locale`, `anonymous_id`, `session_id`, `page`, `campaign`. Delivered only to webhooks that opt in; ad identifiers only with the shopper's marketing consent.",
      "type": "object"
    },
    "properties": {
      "description": "Event-specific model. See the individual webhook for the concrete schema.",
      "type": "object"
    }
  },
  "additionalProperties": true
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: