diff --git a/integration-tests/modules/__tests__/order/workflows/create-fulfillment.spec.ts b/integration-tests/modules/__tests__/order/workflows/create-fulfillment.spec.ts index baa91169b3a53..0a94876ccfe13 100644 --- a/integration-tests/modules/__tests__/order/workflows/create-fulfillment.spec.ts +++ b/integration-tests/modules/__tests__/order/workflows/create-fulfillment.spec.ts @@ -372,6 +372,7 @@ medusaIntegrationTestRunner({ ], no_notification: false, location_id: undefined, + metadata: { meta_key: "meta_value" }, } await createOrderFulfillmentWorkflow(container).run({ @@ -406,6 +407,9 @@ medusaIntegrationTestRunner({ expect(orderFulfillItemWithInventory.detail.fulfilled_quantity).toEqual( 1 ) + expect(orderFulfill.fulfillments[0].metadata).toEqual({ + meta_key: "meta_value", + }) const reservation = await inventoryModule.listReservationItems({ line_item_id: itemWithInventory.id, diff --git a/packages/core/core-flows/src/order/workflows/create-fulfillment.ts b/packages/core/core-flows/src/order/workflows/create-fulfillment.ts index 1f81b18e7bfad..4f922dcbe9374 100644 --- a/packages/core/core-flows/src/order/workflows/create-fulfillment.ts +++ b/packages/core/core-flows/src/order/workflows/create-fulfillment.ts @@ -160,6 +160,7 @@ function prepareFulfillmentData({ labels: input.labels ?? [], delivery_address: shippingAddress as any, packed_at: new Date(), + metadata: input.metadata, }, } }