feat(dashboard, core-flows, js-sdk, types, medusa): listing order's shipping options (#13242)
* feat(dashboard, core-flows,js-sdk,types,medusa): listing order's shipping option * fix: typo * chore: migrate claim form * fix: cleanup rule logic * feat: add test case, rm params * fix: expand location name
This commit is contained in:
@@ -504,6 +504,36 @@ export class Order {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* This method retrieves a list of shipping options for an order based on the order's shipping address.
|
||||
*
|
||||
* This method sends a request to the [List Shipping Options](https://docs.medusajs.com/api/admin#orders_getordersidshipping-options)
|
||||
* API route.
|
||||
*
|
||||
* @param id - The order's ID.
|
||||
* @param queryParams - Configure the fields to retrieve in each shipping option.
|
||||
* @param headers - Headers to pass in the request
|
||||
* @returns The list of shipping options.
|
||||
*
|
||||
* @example
|
||||
* sdk.admin.order.listShippingOptions("order_123")
|
||||
* .then(({ shipping_options }) => {
|
||||
* console.log(shipping_options)
|
||||
* })
|
||||
*/
|
||||
async listShippingOptions(
|
||||
id: string,
|
||||
queryParams?: FindParams & HttpTypes.AdminGetOrderShippingOptionList,
|
||||
headers?: ClientHeaders
|
||||
) {
|
||||
return await this.client.fetch<{
|
||||
shipping_options: HttpTypes.AdminShippingOption[]
|
||||
}>(`/admin/orders/${id}/shipping-options`, {
|
||||
query: queryParams,
|
||||
headers,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* This method retrieves a list of changes made on an order, including returns, exchanges, etc...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user