Skip to main content

Abandoned Carts

This section covers the API endpoints for managing abandoned carts. These endpoints allow administrators to view abandoned cart information and send messages to customers with abandoned carts.

List Abandoned Carts

Retrieve a paginated list of customers with abandoned carts.

GET /v1/admin/abandoned-carts

Query Parameters

ParameterTypeDescription
filter[email]stringFilter by customer email
filter[username]stringFilter by customer username
filter[date_range]stringFilter by cart date range
search_textstringSearch in username, email, country name, phone, or full name
per_pageintegerNumber of items per page (default: 10)

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=1",
"from": 1,
"last_page": 9,
"last_page_url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=9",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=1",
"label": "1",
"active": true
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=2",
"label": "2",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=3",
"label": "3",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=4",
"label": "4",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=5",
"label": "5",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=6",
"label": "6",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=7",
"label": "7",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=8",
"label": "8",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=9",
"label": "9",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts?page=2",
"path": "http://testing-api.sumaya369.net/v1/admin/abandoned-carts",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 89,
"abandoned_carts": [
{
"id": "997d3b30-bdff-11ef-a6e6-29b4ed422e74",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "مازن كامل",
"email": "mazenstag@yopmail.com",
"cart_count": 1,
"last_sent": null,
"status": null
},
{
"id": "8a11c760-1067-11ef-826e-d31875f62d1f",
"avatar": "https://i.ibb.co/g4BR50S/avatar.png",
"name": "محمد عبدالله",
"email": "msadoon47@gmail.com",
"cart_count": 3,
"last_sent": null,
"status": null
},
{
"id": "82ef9100-1666-11ef-b015-c9ca6af3c91b",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "Shahd Ali",
"email": "alattassshahed@gmail.com",
"cart_count": 2,
"last_sent": null,
"status": null
},
{
"id": "a42feadb-46aa-3cb7-8ca5-6584eab8e24b",
"avatar": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/23296/images.gif",
"name": "زين الشطناوىة",
"email": "customer@customer.com",
"cart_count": 2,
"last_sent": null,
"status": null
},
{
"id": "73ad9bb0-8bbf-11ef-bbb0-d533b41a0645",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "test10",
"email": "test10@test.com",
"cart_count": 1,
"last_sent": null,
"status": null
},
{
"id": "8ae56650-ce69-11ef-aa79-351f3d9724b0",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "tester",
"email": "omarsalem@test4.com",
"cart_count": 4,
"last_sent": null,
"status": null
},
{
"id": "aca71bd0-9c12-4279-9e9e-33e1b5bf00de",
"avatar": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/21936/scene06849.png",
"name": "Mohammed Bootfi",
"email": "moha2mmed@bootfi.com",
"cart_count": 4,
"last_sent": "2024-03-27, 16:28:08",
"status": "failed"
},
{
"id": "df5323f6-3891-4337-978a-94ef244c82c5",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "wewdw eewedw",
"email": "aalbaiti360@gmail.com",
"cart_count": 4,
"last_sent": null,
"status": null
},
{
"id": "632b99e0-d553-11ed-aa3a-3bbf028b61db",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "وضحى جميل",
"email": "jwadhaj222@gmail.com",
"cart_count": 1,
"last_sent": "2024-05-27, 11:49:19",
"status": "sent"
},
{
"id": "743f9060-c0f5-4f05-a819-43b1dcd950cc",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"name": "هدى الحاكمي",
"email": "houda.elhakmi@gmail.com",
"cart_count": 1,
"last_sent": "2024-05-27, 11:52:31",
"status": "sent"
}
]
},
"status_code": 200
}

Send Messages to Customers

Send templated messages to customers with abandoned carts.

POST /v1/admin/abandoned-carts/send-messages

Request Parameters

ParameterTypeDescriptionValidation Rules
linkstringMessage linkMin 3 characters
intentionstringMessage intentionMin 3 characters
customer_idsarrayArray of customer IDs to send messages toRequired

Response

{
"success": true,
"message": "تم إنشاء الرسائل",
"data": null,
"status_code": 200
}

Notes

  • Messages are sent using a predefined template with customer name and cart items
  • Messages are sent with a delay interval to avoid rate limiting
  • The template includes placeholders for customer name and cart items list