Gen-Endpoint
Back to API List

Shopping Cart API

E-commerce
7 Endpoints

Manage shopping cart operations with session handling, item management, and checkout preparation.

Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the Shopping Cart API. These API routes are live!
GET

/api/cart/{sessionId}

Get cart contents for session. Creates a new cart if sessionId is new or cart expired. Replace {sessionId} with an ID (e.g., sess_123).

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

POST

/api/cart/{sessionId}/items

Add an item to the cart. Replace {sessionId} with a session ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

GET

/api/cart/{sessionId}/items

List all items in the specified cart. Replace {sessionId} with a session ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

PUT

/api/cart/{sessionId}/items

Update quantity of an item in the cart. Expects itemId and new quantity. Replace {sessionId} with a session ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

DELETE

/api/cart/{sessionId}/items

Remove an item from the cart. Expects itemId. Replace {sessionId} with a session ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

PUT

/api/cart/{sessionId}

Update cart metadata, e.g., apply a coupon code. Replace {sessionId} with a session ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

DELETE

/api/cart/{sessionId}

Clear all items from the cart (cart session persists but is empty). Replace {sessionId} with a session ID.

Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

    Shopping Cart API - Free Public API | Gen-Endpoint