Apply Selected Shipping Methods

Once the desired shipping method(s) have been selected they can be applied to the cart.

📘

Each bag in a cart will require its own shipping method. For this reason data is passed in as a collection of shipping methods, one for each bag. If you only have one bag in your cart you will pass in a collection consisting of one shipping method.

Required Body Parameters (for each bag):

bag_id - the ID of the bag this shipping method applies to.
shipping_method_id - the ID of the selected shipping method.

curl -X POST https://sandbox-api.violet.io/v1/checkout/cart/{cart_id}/shipping \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '[{"bag_id": 1, "shipping_method_id": "usps-flatrate"}]'