feat(core-flows,medusa,dashboard,js-sdk,types): add inventory item export - #16223
Merged
Conversation
…port Adds an export feature for inventory items, mirroring the existing product export. The exported CSV contains one row per inventory item with its total quantities plus stocked, reserved, and available quantities per stock location. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 24c5e81 The changes in this PR will be included in the next version bump. This PR includes changesets to release 79 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
… and drop incoming quantity Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Renames the barcode columns to Variant Barcode/Ean/Upc and creates one CSV row per variant-item connection. Items without a linked variant keep a single row with empty variant columns. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
medusa-docs-cloud | af75e00 | Commit Preview URL Branch Preview URL |
Jul 28 2026, 01:56 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
medusa-docs-book | af75e00 | Commit Preview URL Branch Preview URL |
Jul 28 2026, 01:57 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
medusa-docs-resources | af75e00 | Commit Preview URL Branch Preview URL |
Jul 28 2026, 01:59 PM |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
shahednasser
approved these changes
Jul 28, 2026
This was referenced Jul 28, 2026
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What — What changes are introduced in this PR?
Adds an export feature for inventory items:
view_configurationstable) that opens a drawer, shows the currently applied filters read-only, and kicks off the export.POST /admin/inventory-items/export— accepts the same query filters as the list endpoint, starts the workflow, and responds202with atransaction_id.exportInventoryItemsWorkflowin core-flows — runs the export step async in the background, streams the CSV to the File Module, and delivers the download link via afeednotification (failure notification via compensation).Location [European Warehouse] Stocked Quantity) — not just the aggregate.Variant Barcode/Variant Ean/Variant Upc, resolved through the variant-inventory module link). Items shared by multiple variants get one row per variant; items without a linked variant get a single row with empty variant columns.sdk.admin.inventoryItem.export()in the JS SDK and auseExportInventoryItemshook in the dashboard.Why — Why are these changes relevant or necessary?
Products already support CSV export, but there was no way to export inventory. Merchants managing stock across multiple locations need the per-location breakdown, which the list view only shows as an aggregate.
How — How have these changes been implemented?
The implementation mirrors the existing product export end-to-end (route drawer →
202+ long-running workflow → file upload → feed notification). The export step pages through Query in batches of 50 and streams to the file module with backpressure handling. Stock locations are fetched upfront and sorted by name so the per-location columns are stable across all rows and batches; items without a level at a location get empty cells (distinguishing "no level" from0). Level quantities are normalized through theBigNumberutility since Query can return raw big-number instances.Testing — How have these changes been tested, or how can the reviewer test the feature?
integration-tests/http/__tests__/inventory/admin/inventory-export.spec.tscovering: per-location columns for items stocked in multiple locations, export filtered by inventory item id, and export filtered by location.Examples
Resulting CSV columns:
Checklist
Additional Context
The export intentionally omits
incoming_quantityfrom the per-location columns.🤖 Generated with Claude Code