Abandoned Carts

An abandoned cart is a purchase process a customer started on one of your connected channels but never converted into an order. Fenicia adds them automatically so you can analyze them, attempt to recover them, or close them as unrecoverable.

Canonical route vs. legacy alias

The canonical route for this domain is /orders/abandoned-carts/*. There is an alias /abandoned-carts/* (without the /orders prefix) that points to the same lambda for compatibility, but it has been deprecated since June 1, 2026 and every call generates a warning in the server logs. Always use /orders/abandoned-carts/* in new integrations.

This domain's envelope differs from the rest of Orders

Every other Orders endpoint returns paginated lists as { data: [...], meta: { pagination: {...} } }. The abandoned carts listing does not follow that pattern. Its response is double-nested:

{
  "data": {
    "data": [{ "_id": "65f3a1b2c4d5e6f7a8b9c0d1", "totalAmount": 1250.5 }],
    "pagination": { "page": 0, "limit": 20, "total": 87, "totalPages": 5, "hasMore": true }
  }
}

That is, pagination is a sibling of data.data, not of data on its own, and there is no meta object. This is a real inconsistency in the API (not a documentation error) — if you write a generic Orders client that assumes the {data, meta:{pagination}} shape, this endpoint will break it. Read it with response.data.data and response.data.pagination. The search endpoint, below, uses this exact same double-nested envelope.

Permissions and error codes: two different vocabularies

This domain uses two different text conventions that you must not confuse:

  • Permissions (API key scopes) are written with a hyphen: abandoned-carts:read, abandoned-carts:sync, abandoned-carts:recover, abandoned-carts:update, abandoned-carts:send-reminder.
  • Error codes in the catalog are written with an underscore: abandoned_carts:not_found, abandoned_carts:already_recovered, abandoned_carts:already_closed, abandoned_carts:recovery_failed.

They are two independent catalogs (the permissions one lives in PERMISSIONS.ABANDONED_CARTS.*, the errors one in the library's error catalog). This is not a typo on this page — that's literally how they are defined in the API.

Base URL

https://api.fenicia.io

All endpoints require Authorization: Bearer fkapi_....


List abandoned carts

Paginated list of abandoned carts with filters. Requires abandoned-carts:read.

200Paginated list of abandoned carts (double-nested envelope, see warning above)
{
  "data": {
    "data": [
      {
        "_id": "65f3a1b2c4d5e6f7a8b9c0e1",
        "channelId": "chn_shopify_01",
        "origin": "shopify",
        "status": "open",
        "recoveryStatus": "none",
        "totalAmount": 1250.00,
        "currency": "MXN",
        "abandonedAt": "2026-04-10T09:15:00.000Z"
      }
    ],
    "pagination": {
      "page": 0,
      "limit": 20,
      "total": 87,
      "totalPages": 5,
      "hasMore": true
    }
  }
}
curl "https://api.fenicia.io/orders/abandoned-carts?limit=20&status=open&hasBeenContacted=false" \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns the paginated list of abandoned carts, with the double-nested envelope described above (data.data, data.pagination). Each element is the raw Mongo document (the identifier is _id, not id; the channel origin is origin, not channelType; there is no hasBeenContacted field on the document — that query filter is resolved internally against recoveryStatus).

Required permission: abandoned-carts:read

Parameters

pagenumber

Page number (0-based).

limitnumber

Items per page.

statusstring

Filter by cart status.

statusGroupstring

Filter by visual status group.

recoveryStatusstring

Filter by recovery process status. Accepted values: none, pending, email_sent, sms_sent, whatsapp_sent, multiple.

channelIdstring

Filter by a specific channel.

channelIdsstring

Filter by several channels. Plural alias of channelId.

originstring

Filter by channel origin/type.

startDatestring

ISO start date of the abandonment range (inclusive).

endDatestring

ISO end date of the abandonment range (inclusive).

minAmountnumber

Minimum cart amount.

maxAmountnumber

Maximum cart amount.

hasBeenContactedboolean

Filters carts that have (or have not) already had a recovery attempt sent.

sortBystring

Sort field.

sortOrderstring

Sort direction (asc | desc).


Search abandoned carts

Free-term search over abandoned carts. Requires abandoned-carts:read.

200Search results (same double-nested envelope as the listing)
{
  "data": {
    "data": [
      {
        "_id": "65f3a1b2c4d5e6f7a8b9c0e1",
        "channelId": "chn_shopify_01",
        "origin": "shopify",
        "status": "open",
        "recoveryStatus": "none",
        "totalAmount": 1250.00,
        "currency": "MXN",
        "abandonedAt": "2026-04-10T09:15:00.000Z"
      }
    ],
    "pagination": {
      "page": 0,
      "limit": 20,
      "total": 3,
      "totalPages": 1,
      "hasMore": false
    }
  }
}

Returns the search results, with the same double-nested envelope as the listing (data.data, data.pagination). This is the same getAbandonedCheckouts internally (searchAbandonedCheckouts just adds searchTerm), so each element is the raw Mongo document — same _id/origin detail as the listing.

Required permission: abandoned-carts:read

Parameters

qstring

Search term.

pagenumber

Page number (0-based).

limitnumber

Items per page.


Count carts by status group

Count of abandoned carts grouped by visual status. Requires abandoned-carts:read.

200Count by status group
{
  "data": {
    "no_action": 42,
    "with_action": 18,
    "recovered": 15,
    "not_recovered": 12,
    "all": 87
  }
}

Returns the cart count grouped by the 5 fixed groups (no_action, with_action, recovered, not_recovered, all), wrapped in data.

Required permission: abandoned-carts:read

Real groups: no_action, with_action, recovered, not_recovered, all

no_action are the open carts with no recovery attempt at all; with_action are the contacted ones; not_recovered sums expired + closed; all is the total. These 5 names don't match the statusGroup you accept as a filter in the listing — they're the fixed grouping of this count endpoint.


Count abandoned carts

Returns the total count of abandoned carts matching the filters. Requires abandoned-carts:read.

200Total count matching the filters
{ "data": { "count": 87 } }

Returns the total count of carts matching the filters (count), wrapped in data.

Required permission: abandoned-carts:read

Parameters

statusstring

Filter by cart status.

statusGroupstring

Filter by visual status group.

recoveryStatusstring

Filter by recovery process status. Accepted values: none, pending, email_sent, sms_sent, whatsapp_sent, multiple.

channelIdstring

Filter by channel.

originstring

Filter by channel origin/type.

startDatestring

ISO start date (inclusive).

endDatestring

ISO end date (inclusive).

Tip

Unlike what you might expect from other simple count endpoints, this one accepts the same filters as the listing — use it to show a counter that exactly matches a filtered view, without fetching all the records.


Abandoned carts statistics

Aggregated statistics of abandoned carts within a range. Requires abandoned-carts:read.

200Aggregated statistics for the range
{
  "data": {
    "total": 87,
    "byStatus": {
      "open": 42,
      "contacted": 18,
      "recovered": 15,
      "expired": 7,
      "closed": 5
    },
    "byStatusGroup": {
      "no_action": 42,
      "with_action": 18,
      "recovered": 15,
      "not_recovered": 12,
      "all": 87
    },
    "totalValue": 128450.50,
    "averageValue": 1476.44,
    "recoveryRate": 0.18,
    "recoveredValue": 22450.75,
    "byOrigin": {
      "shopify": 60,
      "mercado-libre": 27
    }
  }
}
curl "https://api.fenicia.io/orders/abandoned-carts/stats?startDate=2026-04-01&endDate=2026-04-30" \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns the aggregated statistics for the range, wrapped in data: the total (total — not totalCarts, that field doesn't exist), the breakdown by status (byStatus) and by status group (byStatusGroup, the same 5 groups as the count endpoint), the total and average value (totalValue, averageValue), the recovery rate and recovered value (recoveryRate, recoveredValue), and the breakdown by origin/channel (byOrigin).

Required permission: abandoned-carts:read

Parameters

channelIdstring

Filter by channel.

originstring

Filter by channel origin/type.

startDatestring

ISO start date (inclusive).

endDatestring

ISO end date (inclusive).


Get an abandoned cart

Gets the full detail of an abandoned cart, including its HATEOAS links. Requires abandoned-carts:read.

200Full detail of the cart
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0e1",
    "channelId": "chn_shopify_01",
    "origin": "shopify",
    "status": "open",
    "recoveryStatus": "none",
    "totalAmount": 1250.00,
    "currency": "MXN",
    "abandonedAt": "2026-04-10T09:15:00.000Z",
    "_links": {
      "self": "/orders/abandoned-carts/65f3a1b2c4d5e6f7a8b9c0e1",
      "recover": "/orders/abandoned-carts/65f3a1b2c4d5e6f7a8b9c0e1/recover",
      "close": "/orders/abandoned-carts/65f3a1b2c4d5e6f7a8b9c0e1/close",
      "addRecoveryAction": "/orders/abandoned-carts/65f3a1b2c4d5e6f7a8b9c0e1/recovery-action"
    }
  }
}
404No abandoned cart with that ID exists in your tenant
{ "error": { "code": "abandoned_carts:not_found", "message": "Abandoned cart not found" } }

Returns the full detail of the cart, including its HATEOAS links (_links), wrapped in data. The identifier is _id (not id), and _links carries 4 routes: self, recover, close, and addRecoveryAction — not just recover/close.

Required permission: abandoned-carts:read

Parameters

idstringrequired

Abandoned cart ID.


Sync abandoned carts

Triggers a sync of abandoned carts from the connected channels. Requires abandoned-carts:sync.

{ "channelId": "chn_shopify_01" }
202Sync accepted (see warning: doesn't trigger real work yet)
{
  "data": {
    "message": "Abandoned carts sync initiated",
    "status": "processing",
    "channelId": "chn_shopify_01"
  }
}

Returns the confirmation that the sync was accepted (message, status, channelId), wrapped in data — see the warning below: it doesn't trigger real work yet.

Required permission: abandoned-carts:sync

Parameters

channelIdstring

Limits the sync to a single channel. If omitted, the handler reports it as general (see warning below).

Placeholder endpoint: it doesn't trigger a real sync yet

Unlike POST /orders/sync, this endpoint's handler is a placeholder: it accepts the request and responds 202, but the channel integrations aren't wired to this route yet — it doesn't trigger any real abandoned cart sync on the channel. channelId is optional; if you omit it, the channelId key simply doesn't appear in the response.


Recover a cart

Marks the cart as recovered or triggers the recovery action. Requires abandoned-carts:recover.

{ "orderId": "65f3a1b2c4d5e6f7a8b9c0d1", "externalOrderId": "SHOPIFY-10042" }
200Cart marked as recovered — returns the FULL updated document, not just id/status
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0e1",
    "channelId": "chn_shopify_01",
    "origin": "shopify",
    "status": "recovered",
    "recoveryStatus": "none",
    "totalAmount": 1250.00,
    "currency": "MXN",
    "orderId": "65f3a1b2c4d5e6f7a8b9c0d1",
    "externalOrderId": "SHOPIFY-10042",
    "recoveredAt": "2026-04-10T10:15:00.000Z",
    "updatedAt": "2026-04-10T10:15:00.000Z"
  }
}
409The cart has already been marked as recovered
{ "error": { "code": "abandoned_carts:already_recovered", "message": "Abandoned cart already recovered" } }
curl -X POST https://api.fenicia.io/orders/abandoned-carts/65f3a1b2c4d5e6f7a8b9c0e1/recover \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns the full updated abandoned cart (findOneAndUpdate with { new: true }), wrapped in data — not a reduced object with only id/status. It carries status: "recovered", recoveredAt, and orderId/externalOrderId if you sent them, alongside the rest of the cart's fields (_id, channelId, origin, totalAmount, etc.).

Required permission: abandoned-carts:recover

Parameters

idstringrequired

Abandoned cart ID.

orderIdstring

Internal ID of the order the cart converted into, if it already exists.

externalOrderIdstring

ID of the order on the source channel (Shopify, Amazon, etc.), if it already exists.


Close a cart

Closes the cart as unrecoverable. No body required. Requires abandoned-carts:update.

{}
200Cart closed — returns the FULL updated document, not just id/status
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0e1",
    "channelId": "chn_shopify_01",
    "origin": "shopify",
    "status": "closed",
    "recoveryStatus": "none",
    "totalAmount": 1250.00,
    "currency": "MXN",
    "updatedAt": "2026-04-10T10:15:00.000Z"
  }
}
409The cart has already been closed
{ "error": { "code": "abandoned_carts:already_closed", "message": "Abandoned cart already closed" } }
curl -X POST https://api.fenicia.io/orders/abandoned-carts/65f3a1b2c4d5e6f7a8b9c0e1/close \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns the full updated abandoned cart, wrapped in data — not a reduced object with only id/status. Internally closeAbandonedCheckout delegates to the same updateAbandonedCheckoutStatus used by PUT .../status, so the response shape is identical.

Required permission: abandoned-carts:update

Parameters

idstringrequired

Abandoned cart ID.


Record a recovery action

Records a recovery action on the cart (for example, a reminder sent). Requires abandoned-carts:send-reminder.

{
  "type": "whatsapp",
  "status": "sent",
  "templateId": "recordatorio-carrito-v1",
  "recoveryUrl": "https://tienda.example.com/cart/recover/65f3a1b2c4d5e6f7a8b9c0e1"
}
200Action recorded — returns the FULL updated document, including the new action in recoveryActions
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0e1",
    "channelId": "chn_shopify_01",
    "origin": "shopify",
    "status": "contacted",
    "recoveryStatus": "whatsapp_sent",
    "totalAmount": 1250.00,
    "currency": "MXN",
    "recoveryActions": [
      {
        "type": "whatsapp",
        "status": "sent",
        "templateId": "recordatorio-carrito-v1",
        "recoveryUrl": "https://tienda.example.com/cart/recover/65f3a1b2c4d5e6f7a8b9c0e1"
      }
    ],
    "lastContactedAt": "2026-04-10T10:00:00.000Z",
    "updatedAt": "2026-04-10T10:00:00.000Z"
  }
}
404No abandoned cart with that ID exists
{ "error": { "code": "abandoned_carts:not_found", "message": "Abandoned cart not found" } }

Returns the full updated abandoned cart, wrapped in data — not a reduced object with only id/status/recoveryStatus. The action you sent is appended to recoveryActions[] ($push), and it carries the status (contacted) and derived recoveryStatus alongside the rest of the cart's fields.

Required permission: abandoned-carts:send-reminder

Parameters

idstringrequired

Abandoned cart ID.

typestringrequired

Channel of the action: email | sms | whatsapp | notification | manual.

statusstringrequired

Result of the action: scheduled | sent | delivered | failed | clicked | converted.

timestampstring

ISO date of the action. Default: now.

templateIdstring

ID of the message template used.

recoveryUrlstring

Recovery URL sent to the customer (must be a valid URL).

messagestring

Content of the message sent.

userIdstring

ID of the team user who triggered the action.

recoveryStatus is derived from type + status

You don't send recoveryStatus yourself: the API computes it from your type/status. Only when status is sent or delivered does it become email_sent / sms_sent / whatsapp_sent according to type; in any other case it stays pending. The cart also moves to status: "contacted" as soon as you register the first action.


Update a cart's status

Directly updates the status of an abandoned cart. Requires abandoned-carts:update.

{ "status": "expired" }
200Status updated — returns the FULL updated document, not just id/status/updatedAt
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0e1",
    "channelId": "chn_shopify_01",
    "origin": "shopify",
    "status": "expired",
    "recoveryStatus": "none",
    "totalAmount": 1250.00,
    "currency": "MXN",
    "updatedAt": "2026-04-10T10:05:00.000Z"
  }
}
400status is not one of the allowed values
{ "error": { "code": "validation:invalid_input", "message": "Invalid status. Must be one of: open, contacted, recovered, expired, closed" } }
404No abandoned cart with that ID exists
{ "error": { "code": "abandoned_carts:not_found", "message": "Abandoned cart not found" } }

Returns the full updated abandoned cart, wrapped in data — not a reduced object with only id/status/updatedAt. If the new status is recovered, this endpoint also stamps recoveredAt (same logic as updateAbandonedCheckoutStatus in the library).

Required permission: abandoned-carts:update

Parameters

idstringrequired

Abandoned cart ID.

statusstringrequired

New status: open | contacted | recovered | expired | closed.

Use recover/close for transitions with business rules

This endpoint writes the status directly, without the rules applied by POST .../recover (records recoveredAt) or POST .../close. Prefer those dedicated endpoints when the use case matches; use this one only for cases they don't cover (for example, manually marking expired).


Tenant isolation

You can only query and operate abandoned carts belonging to your own tenant. Attempting to access a cart from another tenant returns 404, never cross-tenant information.

Next steps