Skip to main content

REST API

Overview​

Live Carts for WooCommerce registers a REST API namespace, live-carts/v1, under the standard WordPress REST API (/wp-json/live-carts/v1/...).

Requirements​

The REST API feature requires a recent version of Live Carts for WooCommerce (free). The Pro version adds some additional features to the REST API (as noted below), but is not required for the core functionality.

Authentication & permissions​

Every endpoint requires the requesting user to be logged in and have the manage_woocommerce capability (the same capability the Live Carts admin screens require). There is no separate API key — use one of WordPress's standard REST authentication methods:

  • Cookie + nonce — for requests made by logged-in WordPress users.
  • Application Passwords (built into WordPress core since 5.6) — the recommended method for external/server-to-server integrations. Create one under Users → Profile → Application Passwords and send it as HTTP Basic auth.

Requests without sufficient permissions receive a 401 or 403 HTTP response code.

Testing​

You can explore the REST API functionality and send test requests using the free REST API Explorer plugin, also from BerryPress.

Carts​

A "cart" object is a shopper's active, abandoned, or converted WooCommerce cart, as tracked by Live Carts.

GET /live-carts/v1/carts​

List carts.

Request​

ParamTypeDescription
pageintegerPage number (default 1).
per_pageintegerItems per page, 1–100 (default 20).
userinteger / arrayOnly carts belonging to this/these user ID(s).
statusstringactive, converted, abandoned, or trash. When omitted, trashed carts are excluded and all other statuses are included.
afterstring (ISO8601)Only carts created on/after this date.
beforestring (ISO8601)Only carts created on/before this date.
productinteger / arrayOnly carts that currently contain at least one of these product or variation IDs.
min_totalnumberOnly carts with a value (total) of at least this amount.
max_totalnumberOnly carts with a value (total) of at most this amount.

Response​

Example response
[
{
"id": "BCDDF9CE",
"admin_url": "https://example.com/wp-admin/admin.php?page=live-carts-for-woocommerce&cart_id=3168189774",
"status": "active",
"email": "john.doe@example.com",
"trashed": false,
"user_id": 5,
"order_id": null,
"created": "2026-09-19T10:00:00+00:00",
"last_seen": "2026-09-19T10:05:12+00:00",
"value": 49.99,
"coupons": ["SAVE10"],
"ip_address": "203.0.113.5",
"last_url": "https://example.com/cart/"
},
...
]

Pagination totals are returned as headers X-WP-Total and X-WP-TotalPages, matching core WP REST list endpoints.

GET /live-carts/v1/carts/{id}​

Returns a single cart object.

Request​

ParamTypeDescription
idintegerCart ID (e.g. BCDDF9CE)

Response​

Example response
{
"id": "BCDDF9CE",
"admin_url": "https://example.com/wp-admin/admin.php?page=live-carts-for-woocommerce&cart_id=3168189774",
"recovery_url": "https://example.com/cart/?recover_cart=9f2c...",
"status": "active",
"email": "john.doe@example.com",
"trashed": false,
"user_id": 5,
"order_id": null,
"created": "2026-09-19T10:00:00+00:00",
"last_seen": "2026-09-19T10:05:12+00:00",
"value": 49.99,
"coupons": ["SAVE10"],
"ip_address": "203.0.113.5",
"last_url": "https://example.com/cart/",
"items": [
{
"key": "b46e37e1...",
"quantity": 2,
"line_subtotal": 40,
"line_subtotal_tax": 0,
"line_total": 40,
"line_tax": 0,
"product": {
"product_id": 10,
"variation_id": 0,
"name": "Example Product",
"sku": "EX-10",
"url": "https://example.com/product/example-product/",
"price": "20.00",
"attributes": { "Color": "Blue" }
}
}
],
"revisions": [
{
"date": "2026-09-19T10:00:00+00:00",
"changes": [
{
"type": "item_added",
"item": {
"key": "b46e37e1...",
"quantity": 2,
"line_subtotal": 40,
"line_subtotal_tax": 0,
"line_total": 40,
"line_tax": 0,
"product": {
"product_id": 10,
"variation_id": 0,
"name": "Example Product",
"sku": "EX-10",
"url": "https://example.com/product/example-product/",
"price": "20.00",
"attributes": { "Color": "Blue" }
}
}
}
]
}
]
}

Each change inrevisions has a type of item_added, item_removed, or item_update. An item_update change also includes item_before, the item as it was immediately prior.

Returns a 404 HTTP response code if the cart ID doesn't exist.

PUT /live-carts/v1/carts/{id}/items Pro​

(POST is also accepted, for HTTP clients that can't send PUT.)

Adds items to a cart, removes items, or changes item quantities.

Request​

{id} is the cart's ID, same as GET /carts/{id}.

{
"items": [
{ "product_id": 10, "quantity": 3 },
{ "product_id": 25, "variation_id": 31, "quantity": 1 },
{ "product_id": 11, "quantity": 0 }
]
}

Each entry:

FieldRequiredMeaning
product_idyesProduct ID (or the parent product ID for a variation).
variation_idnoVariation ID, if the line is a variation. Omit or 0 for a simple product.
quantityyesNew quantity. 0 (or any value <= 0) removes the line item if present. A positive quantity either updates the existing line's quantity or adds it as a new line if it isn't already in the cart.

If a product_id/variation_id pair doesn't resolve to an existing product, that entry is skipped; the rest of the request is still applied.

Totals for lines this endpoint adds or changes are interim: unit price × quantity, with no tax, discounts, or user-specific pricing applied. WooCommerce recalculates them the next time the shopper's cart loads. Lines whose quantity didn't change are left exactly as they were.

Response​

Returns the updated cart, in the same format as GET /carts/{id}.

404 error if the ID isn't a cart. 409 error if the cart is trashed or already converted to an order. 400 error if items is missing/empty.

POST /live-carts/v1/carts/{id}/convert Pro​

Converts the cart's current contents into a new WooCommerce order (status pending), the same action as the "Create Order" button on the admin cart detail page.

Request​

{id} is the cart's formatted ID, same as GET /carts/{id}.

Response​

{
"order_id": 4821,
"order_status": "pending",
"order_total": "49.99",
"order_edit_url": "https://example.com/wp-admin/post.php?post=4821&action=edit"
}

404 error if the ID isn't a cart 409 error if the cart is trashed, already converted, or empty.

Shopper Lists​

A "shopper list" is a user's list from WooCommerce's built-in Shopper Lists feature (wishlist, "save for later").

type is list_wishlist or list_saved-for-later.

GET /live-carts/v1/shopper-lists​

List shopper lists.

Request​

ParamTypeDescription
pageintegerPage number (default 1).
per_pageintegerItems per page, 1–100 (default 20).
userinteger / arrayOnly carts belonging to this/these user ID(s).
statusstringactive, converted, abandoned, or trash. When omitted, trashed carts are excluded and all other statuses are included.
afterstring (ISO8601)Only carts created on/after this date.
beforestring (ISO8601)Only carts created on/before this date.

Response​

Example response
[
{
"id": "BCDDF9CE",
"type": "list_wishlist",
"admin_url": "https://example.com/wp-admin/admin.php?page=live-carts-for-woocommerce&cart_id=3168189774",
"status": "active",
"email": "john.doe@example.com",
"trashed": false,
"user_id": 5,
"order_id": null,
"created": "2026-09-19T10:00:00+00:00",
"last_seen": "2026-09-19T10:05:12+00:00",
"value": 49.99,
"coupons": ["SAVE10"],
"ip_address": "203.0.113.5",
"last_url": "https://example.com/cart/"
},
...
]

Pagination totals are returned as headers X-WP-Total and X-WP-TotalPages, matching core WP REST list endpoints.

GET /live-carts/v1/shopper-lists/{id}​

Returns a single shopper list object.

Request​

ParamTypeDescription
idintegerShopper List ID (e.g. BCDDF9CE)

Response​

Example response
{
"id": "BCDDF9CE",
"admin_url": "https://example.com/wp-admin/admin.php?page=live-carts-for-woocommerce&cart_id=3168189774",
"status": "active",
"email": "john.doe@example.com",
"trashed": false,
"user_id": 5,
"order_id": null,
"created": "2026-09-19T10:00:00+00:00",
"last_seen": "2026-09-19T10:05:12+00:00",
"value": 49.99,
"coupons": ["SAVE10"],
"ip_address": "203.0.113.5",
"last_url": "https://example.com/cart/",
"items": [
{
"key": "b46e37e1...",
"product": {
"product_id": 10,
"variation_id": 0,
"name": "Example Product",
"sku": "EX-10",
"url": "https://example.com/product/example-product/",
"price": "20.00",
"attributes": { "Color": "Blue" }
}
}
],
"revisions": [
{
"date": "2026-09-19T10:00:00+00:00",
"changes": [
{
"type": "item_added",
"item": {
"key": "b46e37e1...",
"product": {
"product_id": 10,
"variation_id": 0,
"name": "Example Product",
"sku": "EX-10",
"url": "https://example.com/product/example-product/",
"price": "20.00",
"attributes": { "Color": "Blue" }
}
}
}
]
}
]
}

Returns 404 if the ID isn't a shopper list.

  • Webhooks: get a signed JSON request at your own URL when a cart or shopper list changes.
  • Actions: PHP action hooks fired by Live Carts.
  • Filters: PHP filters for changing how Live Carts tracks, stores and emails carts.