npm.io
2.22.7 • Published 4d ago

@medusajs/cart

Licence
MIT
Version
2.22.7
Deps
0
Size
446 kB
Vulns
0
Weekly
0
Stars
36.4K

Medusa logo

@medusajs/cart

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

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)

Resources