Free open-source Magento 2 modules — professional installation & support available
Magendoo
magendoo-abandoned-cart-api
Digital

Abandoned Cart API for Magento 2

SKU: magendoo-abandoned-cart-api

Free
Quantity
  • Instant access after order confirmation
  • Open source — MIT licensed
  • Free updates included
  • Professional support available

Need help?

Contact our support team for product questions.

Instant Download

After payment

MIT Licensed

Use in any project

Secure Payment

SSL encrypted

Support Included

With every purchase

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_subscriber table)
  • 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&currentPage=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

Compatibility & Installation

The package is not on Packagist; per the repository README the module installs under app/code/Magendoo/AbandonedCart:

bin/magento module:enable Magendoo_AbandonedCart
bin/magento setup:upgrade
bin/magento cache:flush

Key Features

  • REST endpoint GET /V1/abandoned-carts with standard Magento searchCriteria filtering (store, date range, email, cart value)
  • Each cart includes items, customer activity, order count, and newsletter opt-in status
  • Zero new tables — reads quote, customer_log, newsletter_subscriber, and sales_order, with 5 composite indexes on quote
  • Batch loading with N+1 query prevention plus dual-layer caching (configurable TTL)
  • ACL-based access control and input validation on all parameters
  • Full multi-store / multi-website support
  • Extensible via plugins, dispatched events, and extension attributes
  • Unit, integration, and Playwright API test suites

API Example

Carts created after a given date, one per page:

GET /rest/V1/abandoned-carts?searchCriteria[pageSize]=1
    &searchCriteria[filter_groups][0][filters][0][field]=created_at
    &searchCriteria[filter_groups][0][filters][0][value]=2025-11-10
    &searchCriteria[filter_groups][0][filters][0][condition_type]=gteq
Authorization: Bearer {admin_token}

Trimmed response:

{
  "items": [
    {
      "quote_id": 143,
      "customer_email": "[email protected]",
      "store_id": 1,
      "created_at": "2025-11-19T12:18:25-05:00",
      "items_count": 3,
      "items_qty": 3,
      "grand_total": 125.5,
      "quote_currency_code": "USD",
      "customer_is_guest": true,
      "opt_in_status": {
        "newsletter_subscribed": false,
        "subscription_status_label": "Not Active"
      }
    }
  ],
  "total_count": 1
}

Last updated: November 2025 · f17621e

FAQ(5)

Have a question?