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": "Cart data retrieved",
  "data": {
    "items": [
      {
        "product_key": "msfed12817960fa4b48dca19facff2b61b",
        "product_id": 123,
        "name": "…",
        "count": 1,
        "price": 1500,
        "cost": 1500,
        "weight": 0.5,
        "options": {},
        "old_price": 0,
        "discount_price": 0,
        "discount_cost": 0
      }
    ],
    "cart": {
      "msfed12817960fa4b48dca19facff2b61b": {}
    },
    "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

The line key is ms followed by 32 md5 hex characters. Which fields go into the key is set by ms3_cart_product_key_fields (id,options by default). Money and weight arrive as JSON numbers rounded to two and three decimals, so a round price reads 7451, not 7451.00. Empty options arrive as {}.

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.