Medusa Carts API

A cart is a virtual shopping bag that customers can use to add items they want to purchase. A cart is then used to checkout and place an order. These API routes allow customers to create and manage their cart, and place an order.

GitHub OpenAPI
Business capability
Cart & Checkout AE-140.20

Operations 15

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /store/carts Create a cart · Create Cart #
Ask an LLM
“How do I start a new shopping cart for a guest?”
“Can I set a region and currency on a new cart?”
Tell an agent
Create a cart in region {region_id}.
Create a cart for {email} with items {items}.
GET /store/carts/{id} Get a cart · Get a Cart #
Ask an LLM
“What items and totals are in a cart?”
“Can I fetch a cart by its ID?”
Tell an agent
Get cart {id}.
Show the items and totals in cart {id}.
POST /store/carts/{id} Update a cart · Update a Cart #
Ask an LLM
“How do I change a cart's shipping address?”
“Does updating a cart reset its chosen payment method?”
Tell an agent
Update cart {id} to shipping address {shipping_address}.
Set the currency on cart {id} to {currency_code}.
POST /store/carts/{id}/complete Complete a cart and place an order · Complete Cart #
Ask an LLM
“How do I turn a cart into an order?”
“Can I complete a cart and place the order right away?”
Tell an agent
Complete cart {id} and place the order.
Place an order from cart {id}.
POST /store/carts/{id}/customer Log in a guest cart to a customer · Change Cart's Customer to Logged-in Customer #
Ask an LLM
“How do I attach a guest cart to a logged-in customer?”
“Can a logged-in user claim a guest cart?”
Tell an agent
Change cart {id} to the logged-in customer.
Log in the guest cart {id} to the customer.
POST /store/carts/{id}/gift-cards Add a gift card to a cart · Add Gift Card to Cart #
Ask an LLM
“How do I apply a gift card code to a cart?”
“Can I add a gift card to a cart?”
Tell an agent
Add gift card {code} to cart {id}.
Apply gift card code {code} to cart {id}.
DELETE /store/carts/{id}/gift-cards Remove a gift card from a cart · Remove Gift Card from Cart #
Ask an LLM
“How do I remove a gift card from a cart?”
“Can I take a gift card off a cart?”
Tell an agent destructive · confirm first
Remove gift card {code} from cart {id}.
Take gift card {code} off cart {id}.
POST /store/carts/{id}/line-items Add a product to a cart · Add Line Item to Cart #
Ask an LLM
“How do I add a product variant to a cart?”
“Can I add several units of an item to a cart?”
Tell an agent
Add {quantity} of variant {variant_id} to cart {id}.
Put {quantity} units of {variant_id} in cart {id}.
POST /store/carts/{id}/line-items/{line_id} Update a cart item · Update a Line Item in a Cart #
Ask an LLM
“How do I change the quantity of an item in a cart?”
“Can I edit a line item in a cart?”
Tell an agent
Set line item {line_id} in cart {id} to {quantity} units.
Change the quantity of item {line_id} in cart {id} to {quantity}.
DELETE /store/carts/{id}/line-items/{line_id} Remove an item from a cart · Remove Line Item from Cart #
Ask an LLM
“How do I remove an item from a cart?”
“Can I delete a line item from a cart?”
Tell an agent destructive · confirm first
Remove line item {line_id} from cart {id}.
Delete item {line_id} from cart {id}.
POST /store/carts/{id}/promotions Add promotions to a cart · Add Promotions to Cart #
Ask an LLM
“How do I apply a promo code to a cart?”
“Can I add several promotions to a cart at once?”
Tell an agent
Add promo codes {promo_codes} to cart {id}.
Apply promotions {promo_codes} to cart {id}.
DELETE /store/carts/{id}/promotions Remove promotions from a cart · Remove Promotions from Cart #
Ask an LLM
“How do I remove a promo code from a cart?”
“Can I take a promotion off a cart?”
Tell an agent destructive · confirm first
Remove promo code {promo_codes} from cart {id}.
Take promotion {promo_codes} off cart {id}.
POST /store/carts/{id}/shipping-methods Add a shipping method to a cart · Add Shipping Method to Cart #
Ask an LLM
“How do I choose a shipping option for a cart?”
“Can I add a calculated shipping price to a cart?”
Tell an agent
Add a shipping method to cart {id}.
Set the shipping option on cart {id}.
POST /store/carts/{id}/store-credits Add store credit to a cart · Add Store Credit to Cart #
Ask an LLM
“How do I apply store credit to a cart?”
“Can I add a specific amount of store credit to a cart?”
Tell an agent
Add {amount} store credit to cart {id}.
Apply {amount} store credit to cart {id}.
POST /store/carts/{id}/taxes Recalculate a cart's taxes · Calculate Cart Taxes #
Ask an LLM
“How do I force a cart to recalculate its taxes?”
“Does a cart recalculate taxes automatically?”
Tell an agent
Recalculate the taxes on cart {id}.
Force a fresh tax calculation for cart {id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/medusa:medusa-carts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

medusa-carts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 2.19.0
  title: Medusa Storefront Carts API
  license:
    name: MIT
    url: https://github.com/medusajs/medusa/blob/master/LICENSE
  description: 'A cart is a virtual shopping bag that customers can use to add items they want to purchase.


    A cart is then used to checkout and place an order.


    These API routes allow customers to create and manage their cart, and place an order.'
servers:
- url: http://localhost:9000
- url: https://api.medusajs.com
tags:


# --- truncated at 32 KB (241 KB total) ---
# Full source: https://artifacts.apis.io/medusa/openapi/medusa-carts-api-openapi.yml