> For the complete documentation index, see [llms.txt](https://wiki.theshop.dev/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.theshop.dev/docs/frontstore/basic-selling-flow/product-detail/add-products-to-cart.md).

# Add products to cart

**Add to cart** functionality is a fundamental feature that allows customers to add a particular product to their Shopping cart.

When adding product to the shopping cart, always check if the selected product is available.

[This API call](https://demo.theshop.dev/api-documentation/v1#/products/ac0a9e535756249912ecc80a803f988c) checks if product is available.

## Types of products in the shopping cart

There are three types of products that can be added to the Shopping cart. You can combine all of them within the one cart call.

### Simple product

When adding a simple product, you should use `cart[]` array in endpoint to get correct results from the shopping cart.

### Product variant

When adding a variant of product to the shopping cart, use `variants[]` array in endpoint to get correct results from the shopping cart.

### Multipack product

If adding a multipack product, use `multipack[]` array in endpoint to get correct results from the shopping cart.

<figure><img src="/files/Dp4wmXmhfCN3jwtnX5vm" alt=""><figcaption><p><strong>Add to cart</strong> button located in the right side of the screen</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.theshop.dev/docs/frontstore/basic-selling-flow/product-detail/add-products-to-cart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
