Alokai

getApplicableShippingMethods

Method fetching the applicable shipping methods for a certain shipment of a basket.

This method communicates with the getApplicableShippingMethods endpoint of the Vue Storefront API Middleware. In turn, it receives data from the getShippingMethodsForShipment or the Get applicable shipping methods for certain shipment of basket endpoints exposed by SCAPI / OCAPI depending on the middleware configuration.

Signature

export declare function getApplicableShippingMethods(
	props: ShipmentGetApplicableShippingMethodsParams & {
    basketId?: string;
}
): Promise<import("commerce-sdk/dist/checkout/checkout").ShopperBaskets.ShippingMethodResult>;

Parameters

NameRequiredTypeDescription
propsRequiredShipmentGetApplicableShippingMethodsParams & { basketId?: string; }Parameter object which can be used with this method. Refer to its type definition to learn about possible properties.

Returns

Returns a representation of a Basket object.

Referenced Types

  • ShipmentGetApplicableShippingMethodsParams
  • ShopperBaskets.ShippingMethodResult

Examples

Fetching the applicable shipping methods for a certain shipment of a basket by shipmentId.

import { sdk } from '~/sdk.config.ts';

const basketId = (await sdk.commerce.getBasket()).basketId;

const updatedBasket = await sdk.commerce.getApplicableShippingMethods({ shipmentId: 'me', basketId });

On this page