This documentation provides a reference to the sdk.store.cart
set of methods used to send requests to Medusa's Store API routes.
Related guides: How to implement carts in the storefront.
This method creates a cart. It sends a request to the Create Cart API route.
Related guide: How to create a cart in the storefront.
body
StoreCreateCartPromise
Promise<StoreCartResponse>This method updates a cart. It sends a request to the Update Cart API route.
Related guide: How to update a cart in the storefront.
id
stringbody
StoreUpdateCartPromise
Promise<StoreCartResponse>This method retrieves a cart by its ID. It sends a request to the Get Cart API route.
Related guide: How to retrieve a cart in the storefront.
To retrieve a cart by its ID:
To specify the fields and relations to retrieve:
Learn more about the fields
property in the API reference.
id
stringPromise
Promise<StoreCartResponse>This methods adds a product variant to the cart as a line item. It sends a request to the Add Line Item API route.
Related guide: How to manage a cart's line items in the storefront.
cartId
stringPromise
Promise<StoreCartResponse>This method updates a line item in a cart. It sends a request to the Update Line Item API route.
Related guide: How to manage a cart's line items in the storefront.
cartId
stringlineItemId
stringPromise
Promise<StoreCartResponse>This method deletes a line item from a cart. It sends a request to the Remove Line Item API route.
Related guide: How to manage a cart's line items in the storefront.
cartId
stringlineItemId
stringPromise
Promise<StoreLineItemDeleteResponse>This method adds a shipping method to a cart. It sends a request to the Add Shipping Method API routes.
Related guide: Implement shipping step during checkout.
cartId
stringPromise
Promise<StoreCartResponse>This method completes a cart and places the order. It's the last step of the checkout flow. The method sends a request to the Complete Cart API route.
Related guide: Learn how to complete cart in checkout flow.
cartId
stringPromise
Promise<StoreCompleteCartResponse>This method updates the customer of a cart.
id
stringPromise
Promise<StoreCartResponse>