Skip to content
  1. Extras
  2. MiniShop3
  3. Development
  4. Web API
  5. Cart

Cart

All /cart/* paths use TokenMiddleware (guest token auto-mint). Send cookie or Bearer; do not use query ms3_token.

Mutations

MethodPathBody (JSON)
POST/cart/addid, optional count, options, render
POST/cart/changeline key + count
POST/cart/change-optionkey + options
POST/cart/removeline key
POST/cart/clean
GET/cart/getquery: include_thumbs 0|1 (default 0)

Exact line field names: see cart/get response and CartController code. Optional render: snippet tokens for HTML SSR (not Nuxt SSR).

GET /cart/get

After the normalizer (CartResponseNormalizer):

json
{
  "success": true,
  "message": "",
  "data": {
    "items": [
      {
        "product_key": "123_…",
        "product_id": 123,
        "name": "…",
        "count": 1,
        "price": 1500,
        "cost": 1500,
        "weight": 0.5,
        "options": {},
        "old_price": 0,
        "discount_price": 0,
        "discount_cost": 0
      }
    ],
    "cart": {
      "123_…": {}
    },
    "status": {
      "total_positions": 1,
      "total_count": 1,
      "total_cost": 1500,
      "total_weight": 0.5,
      "total_discount": 0
    }
  }
}
FieldShapeFor
itemsalways arrayRead in new clients
cartmap by product_keyLegacy. Empty cart → {}, not []
statustotalsProducts only. Delivery / payment / total: GET /order/cost

Example

bash
curl -c jar.txt -b jar.txt -sS \
  'https://shop.example/assets/components/minishop3/api.php?route=/api/v1/customer/token/get'

curl -c jar.txt -b jar.txt -sS -X POST \
  'https://shop.example/assets/components/minishop3/api.php?route=/api/v1/cart/add' \
  -H 'Content-Type: application/json' \
  -d '{"id":123,"count":1}'

Full flow: Examples. Checkout: Checkout.