July 30, 2025·Product
Add Custom Data to Cart and Order Line Items
Shahed Nasser

Shahed Nasser
Follow a step-by-step guide on how to add custom data to the cart and order line items in Medusa. The tutorial walks through a practical example of collecting custom gift messages.

Many businesses require customizing shopping cart fields to store additional information related to their specific use case. For example, you may collect during checkout:
- Gift messages for line items.
- Special order and delivery instructions.
- Scheduled pickup times.
Challenges of Adding Custom Fields in Ecommerce Platforms
Adding custom fields to cart and order line items can be difficult on commerce platforms that limit checkout customization. Developers may not be able to add custom fields in the storefront UI, or store custom fields in the cart and order data models.
These limitations often force developers to use hacky workarounds to collect and store custom input at checkout.
Why Use Medusa for Custom Cart Fields?
Medusa is a digital commerce platform with a built-in Framework for customization. With Medusa, developers have the flexibility to attach custom data to cart items and extend order line item fields to suit their business requirements. Medusa also supports a fully customizable checkout experience, enabling features like gift options, personalized messages, or custom delivery instructions without workarounds.
What You’ll Learn in This Cart Customization Tutorial
Add Gift Messages to Line Items
Follow this step-by-step custom cart fields tutorial
This ecommerce custom fields tutorial helps you add gift messages to order items in Medusa. By following this tutorial, you'll learn how to:
- Customize the Next.js Starter Storefront to add custom cart fields such as gift message inputs.
- Display gift message in the order summary of the storefront.
- Extend the Medusa Admin dashboard to include a new section that shows each order’s gift items and messages.