@medusajs/cart
v2.22.4
Published
Medusa Cart module
Keywords
Readme
Cart Module for Medusa: manages carts, line items, shipping methods, addresses, credit lines, and the adjustments and tax lines applied to line items and shipping methods. Use it to build checkout flows; storefronts reach it through Medusa's Store API and cart workflows in @medusajs/medusa/core-flows. It ships with @medusajs/medusa and is registered by default, so you normally use it through the Medusa application rather than installing it directly.
At a glance
| | |
| --- | --- |
| Package | @medusajs/cart |
| Type | Commerce Module |
| Module key | Modules.CART ("cart") |
| Registered by default | Yes |
| Import from | @medusajs/medusa/cart |
Features
- Store line items, shipping methods, and shipping and billing addresses on a cart.
- Store promotion adjustments and tax lines on line items and shipping methods.
- Store credit lines applied to a cart.
Installation
No installation needed. The module ships with @medusajs/medusa and is registered by default.
Usage
Resolve the module's service from the container, for example in a workflow step:
import { Modules } from "@medusajs/framework/utils"
const cartModuleService = container.resolve(Modules.CART)