Overview
Step 1: Create a Cart
First, create an empty cart. You’ll get back acart_id that you’ll use for all subsequent operations.
Step 2: Add Items to Cart
Add products to the cart using a variant ID. You can get variant IDs from the product endpoints.Adding a bundle
A bundle (type: BUNDLE) has no variants of its own. To add it, pick one variant of every product in its offers and send them in a single request, all with the same quantity and with bundleId set to the bundle’s id:
400 CART_INCOMPLETE_BUNDLE_ERROR. In the cart response the bundle’s items carry groupedBy: { "type": "BUNDLE", "bundleId", "groupedId" } - items with the same groupedId form one bundle instance, so you can render them as a group and price them with the bundle’s price.
The same
items shape (including bundleId) is accepted when creating the cart in Step 1, so a bundle can be the first thing in a new cart.Step 3: View Cart Contents
Fetch the current cart to display items to the user:Step 4: Redirect to Checkout
When the customer is ready to purchase, redirect them to the Fourthwall checkout page using the cart ID:Alternative: Domain cart checkout URL
You can also use the domain cart-checkout entrypoint:Alternative: Direct product checkout URL
If you want to skip cart creation and redirect from variant IDs directly, use:quantity is optional and defaults to 1.
For full behavior details, see Cart Checkout Endpoint.
Complete Example
Here’s a complete implementation you can adapt:Next Steps
Style Your Checkout
Make your checkout page match your brand
Cart API Reference
See all cart operations