-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix(js-sdk): add missing admin order archive and complete methods #12944
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
fix(js-sdk): add missing admin order archive and complete methods #12944
Conversation
🦋 Changeset detectedLatest commit: b5e8298 The changes in this PR will be included in the next version bump. This PR includes changesets to release 69 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 |
@anteprimorac is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM <3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution, could you update the pr description please :)
@adrien2p, the PR description is updated. |
This PR adds two missing methods to the
admin.order
module of the JS SDK:archive
andcomplete
.The SDK previously lacked support for the
POST /admin/orders/{id}/archive
andPOST /admin/orders/{id}/complete
endpoints, even though these endpoints exist in the Medusa backend. Adding them fills this gap and ensures developers have access to the full order lifecycle directly from the SDK.The implementation introduces two new methods:
archive(id, queryParams?, headers?)
— sends aPOST
request to archive the order.complete(id, body, queryParams?, headers?)
— sends aPOST
request to complete the order, including optional additional data.Both methods follow the existing patterns used in the SDK for consistency, with full TypeScript support and inline documentation.
Since the SDK currently does not have automated tests, these methods have to be manually tested. You can do so by calling them from an initialized SDK instance:
These calls should correctly interact with the Medusa Admin API and return a typed
AdminOrderResponse
.