feat(core-flows, js-sdk, medusa): draft order shipping removal (#12124)

**What**
- allow removal of a shipping method

---

CLOSES CMRC-1013
This commit is contained in:
Frane Polić
2025-04-16 06:10:24 +00:00
committed by GitHub
parent a12b5f7456
commit 01542f6973
10 changed files with 382 additions and 11 deletions
+16 -2
View File
@@ -506,16 +506,30 @@ export class DraftOrder {
)
}
async removeShippingMethod(
id: string,
shippingMethodId: string,
headers?: ClientHeaders
) {
return await this.client.fetch<HttpTypes.AdminDraftOrderPreviewResponse>(
`/admin/draft-orders/${id}/edit/shipping-methods/method/${shippingMethodId}`,
{
method: "DELETE",
headers,
}
)
}
/**
* This method updates a shipping method in a draft order. It sends a request to the
* [Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders_postordereditsidshipping-methodsaction_id) API route.
*
*
* @param id - The draft order's ID.
* @param methodId - The shipping method's ID.
* @param body - The data to update the shipping method.
* @param headers - Headers to pass in the request.
* @returns The draft order preview's details.
*
*
* @example
* sdk.admin.draftOrder.updateShippingMethod("order_123", "sm_123", {
* shipping_option_id: "so_123",