---
title: "Get cart details (authenticated customer or guest)"
method: POST
path: "/cart"
tags: ["Cart"]
---

# Get cart details (authenticated customer or guest)

`POST /cart`

## Request

- Base URL: `http://localhost:8000/api/shop`
- URL: `http://localhost:8000/api/shop/cart`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-shop-api/docs/cart/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns the active cart with items, totals, coupons, shipping/payment method, and addresses. Works for both a logged-in customer and a guest; the cart is always identified by the Bearer token (the customer token, or the guest cart token from POST /api/shop/cart-token). A cart id in the body is ignored. It is a POST (not GET) because reading the cart recalculates totals; the GraphQL equivalent is the `createReadCart` mutation for the same reason. Body may be an empty `{}` for a logged-in customer.

## Headers

- `X-STOREFRONT-KEY` string, required
- `X-Locale` string
- `X-Channel` string
- `X-Currency` string

## Request body

- object

## Response `201`

The cart with items, totals, coupon, and selected shipping/payment.

## Other responses

- `400`: Invalid input
- `401`: No cart found for the given token, or not authenticated.
- `422`: Validation Error

---

[API](https://skmtc.dev/bagisto/apis/bagisto-shop-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-shop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-shop-api/revisions/f619df36bf29?raw)
