chore(docs): Updated API Reference (automated) (#12268)

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2025-04-23 08:50:17 +00:00
committed by GitHub
parent cb53b8a529
commit c7065fcd2b
37 changed files with 392 additions and 156 deletions

View File

@@ -8,9 +8,6 @@ export const sdk = new Medusa({
},
})
To convert a draft order to an order:
```ts
sdk.admin.draftOrder.convertToOrder("order_123")
.then(({ order }) => {
console.log(order)

View File

@@ -0,0 +1,17 @@
import Medusa from "@medusajs/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.draftOrder.removeShippingMethod(
"order_123",
"shipping_method_123"
)
.then(({ draft_order_preview }) => {
console.log(draft_order_preview)
})

View File

@@ -0,0 +1,2 @@
curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}' \
-H 'Authorization: Bearer {access_token}'