Basket Events
Basket events track the lifecycle of Mimeeq's built-in B2B cart — from creation through item management to order submission. These events only fire when using Mimeeq's own basket system (Integration = Mimeeq in the embed template). If you're using the HTML integration type and managing the cart yourself, see Finish & Cart Events for the mimeeq-add-to-cart event instead.
Basket Lifecycle Flow
User adds first item to cart
│
▼
mimeeq-basket-created ← new cartId assigned
│
▼
mimeeq-basket-item-added ← cartId + cartItemId
│
▼
mimeeq-basket-updated ← full cart state (items, totals, currency)
│
▼
┌─── User continues configuring ──────────────────────────────┐
│ │
│ adds another item ──► mimeeq-basket-item-added │
│ │ │
│ ▼ │
│ mimeeq-basket-updated │
│ │
│ changes quantity ───► mimeeq-basket-updated │
│ │
│ removes item ───────► mimeeq-basket-updated │
│ │
│ price recalculation ► mimeeq-basket-updated │
│ (company/price type │
│ change) │
└──────────────────────────────────────────────────────────────┘
│
▼
User submits order
│
▼
mimeeq-basket-submitted ← cartId + referenceCode
The key pattern: mimeeq-basket-item-added fires for each individual item, then mimeeq-basket-updated fires with the full cart state. Every change to the cart — adding, removing, quantity adjustment, or price recalculation — produces a mimeeq-basket-updated event with the current totals.
Events
mimeeq-basket-created
A new basket was created. This fires when the first item is added and no active basket exists yet. The cartId is the persistent identifier for this basket — store it if you need to reference the basket in your backend or via the Cart Operations API.
A basket is created once per session (or per user, if authentication is enabled). Subsequent items are added to the existing basket without triggering this event again.
Payload: BasketCreatedEventPayload
| Field | Type | Description |
|---|---|---|
cartId | string | Unique identifier for the newly created basket (e.g., "CART-40e54c8a-...") |
document.addEventListener('mimeeq-basket-created', (event) => {
const { cartId } = event.detail;
// Store cart ID for server-side operations
sessionStorage.setItem('mimeeqCartId', cartId);
// Initialize your cart tracking
analytics.track('basket_created', { cartId });
});