🛒 Checkout
Retrieve and Apply Shipping Methods
Shipping methods are required for merchants to determine how to deliver the order to the shopper. Shipping methods are chosen by the shopper.
Getting Shipping Methods from Cart
You can use the cart query to retrieve details about a specific cart, including available shipping methods for each bag in the cart.
Input Parameters for cart
id
: The ID of the cart you want to retrieve.
Example:
Apply Shipping Methods to Cart
You can use the cartApplyShippingMethods function to apply specific shipping methods to the bags in your cart. This function takes the desired shipping methods for each bag and updates the cart accordingly.
After applying the shipping methods, the function provides an updated Cart as the result.
Input Parameters for cartApplyShippingMethods
id
: The ID of the cart for which you want to apply the shipping methods.bags
: An array of objects of typeCartApplyShippingMethodInput
representing the desired shipping method for each bag.
CartApplyShippingMethodInput
bagId
: The ID of the bag for which you want to set the shipping method.shippingMethodId
: The ID of the desired shipping method for the bag.
Example: