Get a Specific Cart

GET /api/carts/{user_id}

This endpoint allows you to retrieve the full details of a specific shopping cart by the user ID.

Request Example

GET /api/carts/3

Response Format

Success Response
Error Response

When the cart exists, you'll receive HTTP/1.1 200 OK and JSON with the cart details:

{
  "user_id": "3",
  "firstname": "John",
  "lastname": "Doe",
  "date": "1466521318",
  "ip_address": "127.0.0.1",
  "company_id": "1",
  "cart_products": "1",
  "total": "30.00",
  "order_id": null,
  "user_data": {
    "user_id": "3",
    "status": "A",
    "user_type": "C",
    "user_login": "customer",
    "referer": "",
    "is_root": "N",
    "company_id": "1",
    "last_login": "1466521090",
    "timestamp": "1466408289",
    "firstname": "John",
    "lastname": "Doe",
    "company": "Simtech",
    "email": "customer@example.com",
    "phone": "77 77 777 7777",
    "fax": "",
    "url": "",
    "tax_exempt": "N",
    "lang_code": "en",
    "usergroups": [],
    "profile_id": "2",
    "profile_type": "P",
    "b_firstname": "John",
    "b_lastname": "Doe",
    "b_address": "44 Main street",
    "b_city": "Boston",
    "b_state": "MA",
    "b_country": "US",
    "b_zipcode": "02134",
    "s_firstname": "John",
    "s_lastname": "Doe",
    "s_address": "44 Main street",
    "s_city": "Boston",
    "s_state": "MA",
    "s_country": "US",
    "s_zipcode": "02134",
    "b_country_descr": "United States",
    "s_country_descr": "United States",
    "b_state_descr": "Massachusetts",
    "s_state_descr": "Massachusetts",
    "points": 0
  },
  "products": [
    {
      "item_id": "822274303",
      "item_type": "P",
      "product_id": "12",
      "amount": "1",
      "price": "30.00",
      "extra": {
        "product": "100g Pants",
        "product_options": {
          "3": "12",
          "4": "17"
        }
      },
      "product": "100g Pants"
    }
  ]
}

When the cart doesn't exist, you'll receive HTTP/1.1 404 Not Found.

Response Fields

Main Cart Fields

Field Type Description
user_id string The unique identifier of the user who owns the cart
firstname string Customer's first name
lastname string Customer's last name
date string UNIX timestamp when the cart was created
ip_address string Customer's IP address
company_id string The ID of the company/vendor
cart_products string Number of products in the cart
total string Total price of all products in the cart
order_id string/null Order ID if the cart has been converted to an order
user_data object Detailed information about the user
products array Array of products in the cart

Product Object Fields

Field Type Description
item_id string Unique identifier of the cart item
item_type string Type of item (P=Product)
product_id string ID of the product
amount string Quantity of the product in the cart
price string Unit price of the product
extra object Additional information about the product, including selected options
product string Name of the product
Tip: Cart data includes extensive user information which can be useful for personalization and analytics. The cart remains accessible even after being converted to an order until it's explicitly cleared.