You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I query an existing order or list the current customer's orders with metadata attached to it, it does not get included in the query response via HTTP or medusaJS client. All related model data does though, region, payment, variants, customer etc, include metadata except the Order object.
I have a custom API endpoint that creates orders from carts with orderService.createFromCart():
exportasyncfunctionPOST(req: MedusaRequest,res: MedusaResponse,): Promise<void>{// This is here to bypass the entire Medusa order process and create an order directly from a cart for PoC purposes.constorderService=req.scope.resolve('orderService')asOrderService;const{ cart_id }=req.bodyasApiNewOrderRequest;try{constnewOrder=awaitorderService.createFromCart(cart_id);res.status(200).json(newOrder);}catch(error){res.status(500).json({message: error.message});}}
metadata should be included with Order queries made via medusa-js client
Additional context
If I make my own endpoint with orderService.retrieve() then it returns the data with metadata attached:
exportasyncfunctionPOST(req: MedusaRequest,res: MedusaResponse,): Promise<void>{// This is here to update the order status manually for PoC purposes.\constorderService=req.scope.resolve('orderService')asOrderService;const{ order_id }=req.bodyasApiNewOrderUpdateRequest;try{constnewOrder=awaitorderService.retrieve(order_id);res.status(200).json(newOrder);}catch(error){res.status(500).json({message: error.message});}}
The text was updated successfully, but these errors were encountered:
Hi guys, it still exists, no metadata in medusa.customers.listOrders(); but as mentioned in your doc it's required, please add the missed property, thanks.
Bug report
Describe the bug
If I query an existing order or list the current customer's orders with metadata attached to it, it does not get included in the query response via HTTP or medusaJS client. All related model data does though, region, payment, variants, customer etc, include metadata except the Order object.
I have a custom API endpoint that creates orders from carts with
orderService.createFromCart()
:I then can update the metadata with:
The orders do show metadata in the admin panel but when querying with the medusa-js client:
or
the metadata is not included in the response.
System information
Medusa version (including plugins):
Node.js version: v20.12.0
Database: Postgres 16
Operating system: macos
Browser (if relevant): latest chrome
Steps to reproduce the behavior
medusa-no-metadata-on-orders.mp4
Expected behavior
metadata should be included with Order queries made via medusa-js client
Additional context
If I make my own endpoint with
orderService.retrieve()
then it returns the data with metadata attached:The text was updated successfully, but these errors were encountered: