getCart( )


Retrieves a cart.

The getCart() function returns a Promise that resolves when the specified cart is retrieved.

Permissions
Manage eCommerce - all permissions
Read eCommerce - all read permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Read Orders
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function getCart(_id: string): Promise<Cart>;
Method Parameters
_idstringRequired

ID of the cart to retrieve.

Returns
Return Type:Promise<Cart>
JavaScript
import { cart } from "@wix/ecom"; async function getCart(id) { const response = await cart.getCart(id); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?