TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Get a cart by ID

GEThttps://api.testingapis.com/api/Carts/{id}Sign in to see this endpoint's URL

Parameters 1

NameTypeDescription
idrequiredpath · integer (int32)Cart ID.

Responses

200
The cart.
404
The cart does not exist.
500
Unexpected server error.

Example

Request
curl -X GET "https://api.testingapis.com/api/Carts/1" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
{
  "id": 1,
  "userId": 101,
  "items": [
    {"productId": 3, "quantity": 2, "price": 89.99},
    {"productId": 7, "quantity": 1, "price": 49.99}
  ],
  "total": 229.97,
  "updatedAt": "2025-07-16T12:00:00Z"
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.