Carts API
Access abandoned cart data and send recovery emails for your store.
Scope Required
Cart endpoints require the carts:read scope for viewing carts and carts:write scope for sending recovery emails.
List Abandoned Carts
Retrieve a paginated list of abandoned shopping carts. Abandoned carts are carts that have items but have been inactive for more than 1 hour and have not been recovered (converted to orders).
GET /api/external/v1/cartsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per_page | integer | Items per page (default: 15, max: 100) |
from | string | Start date (YYYY-MM-DD) |
to | string | End date (YYYY-MM-DD) |
has_email | boolean | Filter to carts with customer email |
recovery_sent | boolean | Filter by whether recovery email was sent |
value_min | number | Minimum cart value |
value_max | number | Maximum cart value |
sort | string | Sort field: created_at, updated_at, value |
order | string | Sort order: asc, desc (default: desc) |
Example Request
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/carts?has_email=true&value_min=10" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"Response
{
"success": true,
"data": [
{
"id": 42,
"customer_email": "player@example.com",
"customer_id": 15,
"items_count": 2,
"total_quantity": 3,
"cart_value": "49.97",
"currency": "USD",
"items": [
{
"id": 101,
"product_id": 5,
"product_name": "VIP Rank",
"quantity": 1,
"unit_price": "29.99",
"total": "29.99"
},
{
"id": 102,
"product_id": 8,
"product_name": "Crate Key Bundle",
"quantity": 2,
"unit_price": "9.99",
"total": "19.98"
}
],
"is_guest": false,
"recovery_email_sent": false,
"recovery_email_sent_at": null,
"created_at": "2025-01-20T10:30:00Z",
"updated_at": "2025-01-20T10:45:00Z",
"abandoned_at": "2025-01-20T11:45:00Z"
}
],
"meta": {
"current_page": 1,
"last_page": 5,
"per_page": 15,
"total": 68
}
}Get Single Cart
Retrieve details for a specific abandoned cart.
GET /api/external/v1/carts/{id}Example Request
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/carts/42" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"Response
{
"success": true,
"data": {
"id": 42,
"customer_email": "player@example.com",
"customer_id": 15,
"customer": {
"id": 15,
"email": "player@example.com",
"username": "Player123",
"created_at": "2024-12-01T09:00:00Z"
},
"items_count": 2,
"total_quantity": 3,
"cart_value": "49.97",
"currency": "USD",
"items": [
{
"id": 101,
"product_id": 5,
"product_name": "VIP Rank",
"product_slug": "vip-rank",
"quantity": 1,
"unit_price": "29.99",
"total": "29.99",
"product": {
"id": 5,
"name": "VIP Rank",
"slug": "vip-rank",
"is_active": true,
"in_stock": true
}
},
{
"id": 102,
"product_id": 8,
"product_name": "Crate Key Bundle",
"product_slug": "crate-key-bundle",
"quantity": 2,
"unit_price": "9.99",
"total": "19.98",
"product": {
"id": 8,
"name": "Crate Key Bundle",
"slug": "crate-key-bundle",
"is_active": true,
"in_stock": true
}
}
],
"is_guest": false,
"recovery_email_sent": false,
"recovery_email_sent_at": null,
"expires_at": "2025-01-27T10:30:00Z",
"created_at": "2025-01-20T10:30:00Z",
"updated_at": "2025-01-20T10:45:00Z",
"abandoned_at": "2025-01-20T11:45:00Z"
}
}Get Cart Statistics
Retrieve aggregate statistics about abandoned and recovered carts.
GET /api/external/v1/carts/statsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
days | integer | Analysis period in days (default: 30, max: 365) |
Example Request
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/carts/stats?days=30" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"Response
{
"success": true,
"data": {
"period_days": 30,
"active_carts": 12,
"abandoned_today": 3,
"total_abandoned": 68,
"recovered_carts": 24,
"recovered_today": 2,
"abandonment_rate": 45.6,
"recovery_rate": 16.2,
"avg_cart_value": "34.50",
"abandoned_value": "2346.00",
"recovered_value": "828.00",
"recovered_value_today": "69.98",
"recovery_emails_sent": 52,
"currency": "USD"
}
}Send Recovery Email
Trigger a cart recovery email to be sent to the customer. This will queue the email for delivery using your store's configured email template.
POST /api/external/v1/carts/{id}/recoverPrerequisites
- The cart must have a customer email address
- Cart recovery must be enabled in your store settings
- A recovery email must not have already been sent for this cart
- The cart must not be already recovered
Example Request
curl -X POST "https://yourstore.pixlpay.net/api/external/v1/carts/42/recover" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"Response
{
"success": true,
"data": {
"id": 42,
"customer_email": "player@example.com",
"recovery_email_sent": true,
"recovery_email_sent_at": "2025-01-20T14:30:00Z"
},
"message": "Recovery email queued successfully"
}Cart Object
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
customer_email | string | Customer's email address (null for guest carts without email) |
customer_id | integer | Customer ID if logged in (null for guests) |
customer | object | Customer details (on single cart endpoint) |
items_count | integer | Number of unique products in cart |
total_quantity | integer | Total quantity of all items |
cart_value | string | Total cart value |
currency | string | Currency code (e.g., USD, EUR) |
items | array | Cart items with product details |
is_guest | boolean | Whether this is a guest cart |
recovery_email_sent | boolean | Whether a recovery email was sent |
recovery_email_sent_at | string | ISO 8601 timestamp of when recovery email was sent |
expires_at | string | ISO 8601 timestamp when cart expires (guest carts only) |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp of last activity |
abandoned_at | string | ISO 8601 timestamp (1 hour after last update) |
Cart Item Object
| Field | Type | Description |
|---|---|---|
id | integer | Cart item ID |
product_id | integer | Product ID |
product_name | string | Product name |
product_slug | string | Product URL slug |
quantity | integer | Quantity in cart |
unit_price | string | Price per unit |
total | string | Line total (quantity x unit_price) |
product | object | Product availability info (on single cart endpoint) |
Statistics Object
| Field | Type | Description |
|---|---|---|
period_days | integer | Analysis period in days |
active_carts | integer | Carts with items, not expired, not recovered |
abandoned_today | integer | Carts abandoned today |
total_abandoned | integer | Total abandoned carts in period |
recovered_carts | integer | Carts converted to orders |
recovered_today | integer | Carts recovered today |
abandonment_rate | number | Percentage of carts abandoned |
recovery_rate | number | Percentage of carts recovered |
avg_cart_value | string | Average cart value |
abandoned_value | string | Total value of abandoned carts |
recovered_value | string | Total value recovered |
recovered_value_today | string | Value recovered today |
recovery_emails_sent | integer | Number of recovery emails sent |
currency | string | Store's default currency |
Errors
| Status | Error | Description |
|---|---|---|
| 401 | Unauthorized | Invalid or missing token |
| 403 | Forbidden | Token lacks carts:read or carts:write scope |
| 404 | Not Found | Cart doesn't exist |
| 422 | Unprocessable Entity | Cart already recovered or missing email |
| 429 | Too Many Requests | Rate limit exceeded |
Error Response Example
{
"success": false,
"error": {
"code": "CART_ALREADY_RECOVERED",
"message": "This cart has already been recovered"
}
}Use Cases
Cart Recovery Automation
Build custom cart recovery workflows by fetching abandoned carts and triggering recovery emails based on your own logic:
# Get carts abandoned in last 2 hours with email and value > $20
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/carts?has_email=true&value_min=20&recovery_sent=false" \
-H "Authorization: Bearer YOUR_TOKEN"
# Send recovery email for high-value cart
curl -X POST "https://yourstore.pixlpay.net/api/external/v1/carts/42/recover" \
-H "Authorization: Bearer YOUR_TOKEN"Analytics Integration
Export cart data to your analytics platform for deeper insights:
# Get daily stats for dashboard
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/carts/stats?days=7" \
-H "Authorization: Bearer YOUR_TOKEN"Customer Support
Look up cart details when customers report checkout issues:
# Get specific cart details
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/carts/42" \
-H "Authorization: Bearer YOUR_TOKEN"