Skip to content

feat: add metadata to shipping options endpoints #12722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

bqst
Copy link
Contributor

@bqst bqst commented Jun 12, 2025

In Medusa v1, the /store/shipping-options endpoint exposed metadata for shipping options. This functionality was missing in v2, preventing developers from storing and retrieving custom key-value pairs on shipping options.

This PR restores metadata support for shipping options across both admin and store APIs.

Admin API:

  • ✅ POST /admin/shipping-options now accepts metadata
  • ✅ POST /admin/shipping-options/{id} now accepts metadata
  • ✅ GET /admin/shipping-options & GET /admin/shipping-options/{id} already exposed metadata (unchanged)

Store API:

  • ✅ GET /store/shipping-options now exposes metadata

Technical Updates:

  • Added metadata field to AdminCreateShippingOption and AdminUpdateShippingOption validators
  • Created missing AdminUpdateShippingOption.yaml schema
  • Updated TypeScript interfaces in packages/core/types
  • Updated store query config to include metadata by default
  • Enhanced code examples with metadata usage
@bqst bqst requested review from a team as code owners June 12, 2025 14:34
Copy link

changeset-bot bot commented Jun 12, 2025

⚠️ No Changeset found

Latest commit: 58b8255

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jun 12, 2025

@bqst is attempting to deploy a commit to the medusajs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, appreciate the contribution. I presume you tested this locally? Ideally, the PR includes a few integration tests.

As for the docs changes, I'll let @shahednasser decide what to do here. I believe these are usually added separately.

@bqst
Copy link
Contributor Author

bqst commented Jun 17, 2025

Thanks for the feedback! I've just added the corresponding integration tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants