Order Concepts

In this document, you’ll learn about orders and related concepts

Order#

An order is a purchase made by a customer, either through the storefront or through the API. It is represented by the Order data model.

An order holds information about:

  • The purchased items.
  • The customer who made the order.
  • Payment and shipping information

Order Items#

The items purchased in an order are represented by the OrderItem data model. An order can have multiple items.

A diagram showcasing the relation between an order and its items.

Item’s Product Details#

The details of the purchased products are represented by the LineItem data model. Not only does a line item hold the details of the product, but also details related to its price, adjustments due to promotions, and taxes.


Order’s Shipping Method#

An order has one or more shipping methods used to handle item shipment.

Each shipping method is represented by the OrderShippingMethod data model that holds its details. The shipping method is linked to the order through the OrderShipping data model.

A diagram showcasing the relation between an order and its items.

data Property#

When fulfilling an order, you can use a third-party fulfillment provider that requires additional custom data to be passed along from the order creation process.

The OrderShippingMethod data model has a data property. It’s an object used to store custom data relevant later for fulfillment.

The Medusa application passes the data property to the Fulfillment Module when fulfilling items.


Order Totals#

An order’s total amounts (including tax total, total after an item is returned, etc…) are represented by the OrderSummary data model.

Refer to the Retrieve Order Totals guide to learn how to retrieve an order’s totals.


Order Payments#

Payments made on an order, whether they’re capture or refund payments, are recorded as transactions represented by the OrderTransaction data model.

An order can have multiple transactions. The sum of these transactions must be equal to the order summary’s total. Otherwise, there’s an outstanding amount.

Refer to the Transactions guide to learn more.

Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break