Simple Cart API Guide
The Simple Cart API provides streamlined checkout for standard shipping workflows. Perfect for merchants whose products don’t require special fulfillment, like scheduled delivery or installation.When to Use Simple Cart API
Choose Simple Cart API when your integration:- Works with merchants selling standard-shipped items only
- Doesn’t need split shipments for different fulfillment types
- Requires quick implementation with minimal complexity
- Doesn’t need addon services (warranties, protection plans)
Key Characteristics
What You Get:- Direct cart operations with flat response structure
- Single shipping method for entire order
- Straightforward checkout flow
- All standard cart features (coupons, shipping options, etc.)
- Split shipments (mixing standard shipping with scheduled delivery)
- Addon services (warranties, protection plans, installation)
- Multiple fulfillment types in one order
- Per-item shipping configuration
Prerequisites
Before starting, ensure you have:Firmly Application ID
Your Application ID from Firmly (contact support if you don’t have one)
Test Merchant Domain
Work with Firmly to enable your app ID for a specific test store
API Client
cURL, Postman, or your preferred HTTP client
Important: Before you can access a merchant’s store, Firmly must configure your app ID to work with that specific domain. Contact our team to set up access to your test merchant.
Quick Start Implementation
Build your first checkout with Simple Cart API in 30 minutes.Step 1: Authenticate
Get a device token to identify your user’s session:access_token from the response - you’ll use it as x-firmly-authorization in all subsequent requests.
Step 2: Add Items to Cart
Add a product using its SKU:Step 3: Set Shipping Information
Provide the shipping address to get available shipping methods:- Updated cart totals with tax
- Available shipping methods
- Auto-selected cheapest shipping option
Step 4: Select Shipping Method (Optional)
If you want a different shipping method than the auto-selected one:Step 5: Complete the Order
Use the Payment API to finalize the purchase:Complete Example Flow
API Structure
Simple Cart API uses a flat cart structure:Available Endpoints
Cart Operations
GET /api/v1/domains/{domain}/cart- Get current cartPOST /api/v1/domains/{domain}/cart/{product_id}- Add item to cartPUT /api/v1/domains/{domain}/cart/{line_item_id}- Update quantityDELETE /api/v1/domains/{domain}/cart- Clear cart
Checkout Flow
POST /api/v1/domains/{domain}/checkout/shipping-info- Set shipping addressGET /api/v1/domains/{domain}/checkout/shipping-rates- Get shipping optionsPOST /api/v1/domains/{domain}/checkout/shipping-method- Select shippingPOST /api/v3/payment/{domain}/complete-order- Complete purchase
Error Handling
Common errors and their meanings:ErrorCartNotFound- Cart session expiredErrorProductNotFound- Invalid product IDErrorNotEnoughStock- Item out of stockErrorCountryNotSupported- Shipping country not availableCreditCardDeclined- Payment failed
Perfect For
- Apparel & Accessories - Everything ships standard
- Books & Media - Uniform shipping methods
- Consumer Electronics - Small items, standard delivery
- Beauty Products - No special handling needed
- Digital Goods - With physical components
Next Steps
- Handle Errors - Learn about error codes and retry strategies
- Explore Cart Operations - Deep dive into cart management endpoints
- Payment Integration - Understand payment tokenization and processing