Logo: Medusa Cart Checkout

Medusa Cart Checkout

Organisatioun
OrcaQubits
medusa-cart-checkout

Implement Medusa v2 cart and checkout — cart lifecycle, line items, shipping and payment selection, sales channels, and checkout completion flow. Use when building cart and checkout features.

Iwwersiicht

EditeurOrcaQubits
Repositoryagentic-commerce-skills-plugins
Skill-Nummmedusa-cart-checkout
Stären
40
Forks
17
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    OrcaQubits huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Medusa Cart Checkout an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-cart-checkout
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins.git /tmp/agentic-commerce-skills-plugins
mkdir -p .claude/skills
cp -r /tmp/agentic-commerce-skills-plugins/medusa-commerce/skills/medusa-cart-checkout .claude/skills/medusa-cart-checkout
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Medusa Cart Checkout an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Medusa Cart Checkout automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Medusa Cart Checkout net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Medusa v2 Cart and Checkout

Before writing code

Fetch live docs:

  1. Web-search site:docs.medusajs.com cart module for cart data model and service methods
  2. Web-search site:docs.medusajs.com checkout flow for the end-to-end checkout process
  3. Web-search site:docs.medusajs.com sales channel for sales channel scoping
  4. Fetch https://docs.medusajs.com/resources/references/cart and review the ICartModuleService interface
  5. Web-search medusajs v2 cart workflow 2026 for latest cart-related workflow steps

Cart Lifecycle

Flow

Create Cart ──> Add Line Items ──> Set Address
  ──> Select Shipping ──> Init Payment ──> Complete

Cart States

StateDescription
ActiveCart is open, items can be added/removed
CompletingCheckout in progress, payment being processed
CompletedCart converted to order, no further modifications

Cart Data Model

EntityKey Fields
Cartregion_id, customer_id, sales_channel_id, email
LineItems[]variant_id, quantity, unit_price, Adjustments[]
ShippingMethods[]shipping_option_id, amount, data
Addressesshipping_address, billing_address
PaymentCollectionPaymentSessions[]

Module Architecture

Link TargetPurpose
Product ModuleVariant resolution
Region ModuleCurrency, tax rules
Sales Channel ModuleStorefront scoping
Promotion ModuleDiscount application
Payment ModulePayment sessions
Fulfillment ModuleShipping methods

Fetch live docs for cross-module link definitions and remoteQuery usage for cart enrichment.

Checkout Steps

Step 1: Create Cart

ts
// Skeleton: create cart in storefront
// Fetch live docs for createCartWorkflow input
const cart = await createCartWorkflow(container)
  .run({ input: { region_id, sales_channel_id } })
// Fetch live docs for required vs optional fields

Step 2: Add Line Items

WorkflowPurpose
addToCartWorkflowAdd variant + quantity to cart
updateLineItemInCartWorkflowUpdate quantity of existing item
deleteLineItemsWorkflowRemove items from cart

Step 3: Set Addresses

FieldRequiredNotes
first_name / last_nameYes
address_1YesStreet address
cityYes
country_codeYesISO 2-letter code
postal_codeConditionalRequired by region
provinceConditionalState/province

Step 4: Select Shipping Option

Available options determined by cart region, shipping address, and shipping profiles.

WorkflowPurpose
listShippingOptionsForCartWorkflowFetch available options
addShippingMethodToCartWorkflowApply selected shipping option

Step 5: Initialize Payment

WorkflowPurpose
createPaymentCollectionForCartWorkflowCreate payment collection
initializePaymentSessionWorkflowStart provider-specific session

Step 6: Complete Cart

WorkflowPurpose
completeCartWorkflowConvert cart to order

Completion validates: all items in stock, shipping selected, payment authorized, email set.

Fetch live docs for the exact validation checks performed during cart completion.

Sales Channels

ConceptDescription
Sales ChannelNamed storefront scope (e.g., "Web", "Mobile App", "B2B")
Publishable API KeyAssociates Store API requests with a sales channel
Product-Channel LinkProducts published to specific channels
  • Each cart belongs to one sales channel
  • Store API requests must include x-publishable-api-key header
  • Products not linked to the cart's channel are unavailable

Fetch live docs for publishable API key configuration and sales channel management.

Store API Routes

Route PatternMethodPurpose
/store/cartsPOSTCreate cart
/store/carts/:idGETRetrieve cart
/store/carts/:idPOSTUpdate cart (email, address)
/store/carts/:id/line-itemsPOSTAdd line item
/store/carts/:id/line-items/:item_idPOST/DELETEUpdate/remove line item
/store/carts/:id/shipping-methodsPOSTAdd shipping method
/store/carts/:id/payment-collectionsPOSTCreate payment collection
/store/carts/:id/completePOSTComplete checkout

Fetch live docs for request body shapes and response formats on each route.

Best Practices

Cart Management

  • Always create carts with a region_id -- it determines currency, tax rules, and shipping
  • Use sales_channel_id to scope product availability per storefront
  • Store custom checkout data in cart metadata (e.g., gift messages, notes)

Checkout Flow

  • Validate addresses before shipping option selection -- options depend on the destination
  • Re-fetch shipping options after address changes (available options may differ)
  • Initialize payment sessions only after shipping is selected (total must include shipping)
  • Handle cart completion errors gracefully -- display specific validation failures to the user

Performance

  • Use remoteQuery to enrich cart data (product details, images) in a single query
  • Cache shipping options per region + address combination to reduce API calls

Security

  • Never expose payment session secrets to the client
  • Validate cart ownership (customer or anonymous session) on every mutation
  • Use publishable API keys to enforce sales channel scoping

Fetch the Medusa v2 cart module documentation and checkout workflow references for exact service method signatures, workflow inputs, and validation rules before implementing.

Heefeg gestallte Froen

Wat mécht de KI-Skill Medusa Cart Checkout?

Implement Medusa v2 cart and checkout — cart lifecycle, line items, shipping and payment selection, sales channels, and checkout completion flow. Use when building cart and checkout features.

Firwat Medusa Cart Checkout op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Medusa Cart Checkout besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Medusa Cart Checkout an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-cart-checkout an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Medusa Cart Checkout benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Medusa Cart Checkout benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Medusa Cart Checkout domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Medusa Cart Checkout gratis?

Jo. OrcaQubits huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇