List the shipping options of a cart's order
const url = 'https://acme.mykreezalid.com/front_api/v1/carts/k3v9q2m8x1c7z5b4n6t0p2r8s1d3f7/orders/4242/available-shipping-methods';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://acme.mykreezalid.com/front_api/v1/carts/k3v9q2m8x1c7z5b4n6t0p2r8s1d3f7/orders/4242/available-shipping-methods \ --header 'Authorization: Bearer <token>'Returns the shipping options the buyer can choose for one order of the cart that is not checked out yet, with the amount each would cost for that order. When the order’s items belong to a logistic category, the options are the rates set for that category. Requires a token; a member’s cart only accepts that member’s token. When you send a token and the cart is a guest cart, the cart (and the guest’s other carts and orders) is attached to the signed-in member first.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The cart’s url_key, returned when the cart is created.
Example
k3v9q2m8x1c7z5b4n6t0p2r8s1d3f7Id of one of the cart’s orders (orders[].id in GET /carts/{url_key}).
Example
4242Responses
Section titled “Responses”The shipping options.
object
A shipping option the buyer can choose for one order of a cart, with what it costs for that order. When a custom shipping amount was forced on the order, every amount is null: the order keeps the forced amount whatever option is chosen.
object
For ShippingRate and CustomShippingRate, the id of the shipping method: send it as shipping_method_id to PATCH /carts/{url_key}/orders/{order_id}/shipping-method. For LogisticCategoriesShippingRate and CustomLogisticCategoriesShippingRate, the id of the rate of the order’s logistic category for that shipping method, which is not a shipping method id.
ShippingRate: the shipping method’s own price. LogisticCategoriesShippingRate: the price set for the order’s logistic category. The Custom variants are returned instead when a custom shipping amount was forced on the order.
Name of the shipping method.
Description of the shipping method.
Shipping amount for this order: the initial price, plus the additional-item price for each unit after the first. 0 when the order reaches the free-shipping threshold. null when a custom shipping amount was forced on the order.
Currency of the marketplace (ISO 4217 code).
Whether the order ships for free with this option. Only set for logistic-category rates; null otherwise.
How shipping_amount is computed. Every value is null when a custom shipping amount was forced on the order.
object
Price for the first unit.
Price added for each unit after the first (the field name is spelled this way).
Order amount from which shipping is free. Only set for logistic-category rates that have one; null otherwise.
Example
{ "shipping_rates": [ { "id": 12, "object": "ShippingRate", "title": "Standard delivery", "description": "Delivered in 3 to 5 working days", "shipping_amount": 6.9, "currency": "EUR", "free_shipping": false, "shipping_rate_attributes": { "initial_price": 4.9, "additionnal_item_step_price": 1, "free_shipping_threshold": 100 } } ]}No token or an invalid one, the order is not a pending order of this cart, or no shipping method is available for it (with code, status and message); or the cart belongs to another member (with success and error).
Error body returned by the Front API when it refuses a request.
object
HTTP status code, repeated in the body.
Human-readable reason.
Error body returned by several cart endpoints.
object
Error body of the cart endpoints that report success and error.
Human-readable reason.
Example
{ "code": 403, "status": "error", "message": "Token not found in request"}No open cart has this key: it does not exist or is closed.
Error body returned by several cart endpoints.
object
Error body of the cart endpoints that report success and error.
Human-readable reason.
Example
{ "success": false, "error": "Cart not found"}