> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/commerce-api-references/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/mini-cart-widget.md).

# Mini cart widget

You can create a Mini Cart widget using JavaScript that runs on your website. The widget displays the contents of the cart to the shopper. You can implement the Mini Cart widget with a public API key or a confidential API key. The Mini Cart widget initiates the Shopper API requests directly from a web browser using JSONP as the cross-domain solution. The Shopper APIs also support CORS.

The Mini Cart widget uses the following common Shopper APIs:

* `GET /oauth20/token`
* `POST v1/shoppers/me/carts/active?productId={​pid}​&quantity={​qty}`​&#x20;
* `POST v1/shoppers/me/carts/active/line-items?productId={​pid}​&quantity={​qty}`
* `GET v1/shoppers/me/carts/active`
* `POST v1/shoppers/me/carts/active/web-checkout`


---

# 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:

```
GET https://docs.digitalriver.com/commerce-api-references/commerce-api-reference-guide/api-structure/mini-cart-widget.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
