What an app can read
The carts API is a read-only view of a store’s customer carts. Use it to recover an abandoned cart, show a merchant what a shopper left behind, or re-fetch the cart a cart webhook pointed at. It is not the shopper-facing/cart endpoint. That one belongs to the storefront and acts on the
signed-in shopper’s own cart. This mount is for an installed app or a staff member and covers
every customer cart in the store.
Cart writes are shopper actions on the storefront, so there are no create, update or delete
routes here. An app reads a cart; it never edits one.
Authentication and scope
READ_CART_CONTENTS scope. A call without it is refused with
403 naming the missing scope.
READ_CART_CONTENTS unlocks the fetch API on its own. READ_CARTS is the separate scope that
makes the storefront send cart webhooks. An app can hold either without the other: with only
READ_CART_CONTENTS it can fetch carts but receives no cart events; with only READ_CARTS it
receives notify-only events and cannot fetch the cart.READ_CUSTOMERS if you need the customer’s profile.
Endpoints
All paths are underhttps://api.salesive.com/api/v1.
List carts
Cart fields
Item fields
name, image and price are the values recorded on the line itself. The populated
product, food or service object carries the current catalog values, so a later price change
shows up there while the line keeps the values the storefront recorded. A populated catalog object
is null if that record has since been deleted.
Get one customer’s cart
data is the same cart object shown above, not a list:
resourceId. A Customer _id is also accepted and is resolved to that customer’s user. The lookup
is scoped to your store, so an id from another store returns 404.
A customer with no cart returns 404 Cart not found.
When to call it
- After a cart webhook.
carts/item_added,carts/updated,carts/item_removed,carts/clearedandcarts/abandonedcarry the shopper’s user id asresourceId(and again ascustomerId). CallGET /carts/:customerIdto read the current line items and value. The event itself is notify-only: it may carry a smallcartaggregate (itemCountandtotalPrice) when your install holdsREAD_CART_CONTENTS, but never the line items. - To find carts to recover. List with
status=abandonedand work through the carts the abandonment job has flagged. - To show a merchant a shopper’s cart. Read one cart by customer id.
Abandonment
A cart isabandoned when both are true:
- it holds at least one item, and
- its last content change is at least
CART_ABANDON_IDLE_MINUTESold (30 minutes by default).
lastActivityAt, falling back to updatedAt for carts written before
that field existed. It deliberately does not use updatedAt alone, because the storefront bumps
updatedAt when it reads a cart. status=abandoned applies the same rule, so the list and the
carts/abandoned webhook agree.
Errors
Next steps
Webhooks
The cart topics and the per-topic payload additions.
Wishlists
Read the products a customer saved for later.
Customers
Resolve a
customerId to a customer profile with READ_CUSTOMERS.Money and units
How
totalPrice and every other amount is expressed.
