Abandoned Cart API
From €0.00
To €350.00
In stock
REST API access to abandoned shopping cart data from Magento 2. Designed for Klaviyo, Mailchimp, ActiveCampaign, and custom email flows. Batch-optimised with 5 composite indexes, configurable abandonment threshold, and multi-store support. No new tables — reads from native Magento quote tables.
Abandoned Cart API for Magento 2
Recover lost revenue without expensive third-party cart recovery platforms. This module exposes a performant, filterable REST API endpoint that your email marketing platform can poll to retrieve abandoned carts — complete with customer details, cart contents, and newsletter opt-in status.
What It Returns Per Cart
- Cart ID, creation date, last activity timestamp
- Customer email, name, and login activity
- Newsletter opt-in status (from
newsletter_subscribertable) - Cart items with SKU, name, quantity, and price
- Cart subtotal and currency
- Order count — to distinguish first-time from repeat customers
- Store view and website context
Flexible Filtering
- Filter by store view, date range, customer email
- Filter by minimum cart value (exclude low-value carts)
- Include or exclude guest carts
- Configurable abandonment threshold (default: 24 hours)
- Cursor-based pagination for large datasets
Performance Architecture
- Zero new tables — reads from
quote,customer_log,newsletter_subscriber,sales_order - 5 composite indexes on the quote table for sub-100 ms queries
- Batch loading — N+1 query prevention via data loader pattern
- Cache layer — configurable TTL (default 3 600 s) for repeated polling
- Target: list 100 carts in < 500 ms; cache hit < 50 ms
API Endpoint
GET /V1/abandoned-carts
Authorization: Bearer {admin_token}
?store_id=1
&threshold_hours=24
&include_guests=false
&min_value=10.00
&created_after=2024-01-01T00:00:00Z
&pageSize=50¤tPage=1
Configuration
Admin → Stores → Configuration → Sales → Abandoned Cart API
- Enable/disable the API
- Default abandonment threshold (hours)
- Include guest carts toggle
- Default and maximum page size
- Cache lifetime
Security & Access Control
- ACL resource:
Magendoo_AbandonedCart::view - Integration token support for external systems
- Input validation and sanitisation on all filter parameters
Installation
composer require magendoo/module-abandoned-cart
bin/magento module:enable Magendoo_AbandonedCart
bin/magento setup:upgrade && bin/magento setup:di:compile
bin/magento cache:flush
Requirements
- Magento 2.4.8 or higher
- PHP 8.1, 8.2, or 8.3
License: MIT | View on GitHub