keepcalculator

06 Numbers and Powers

Thor Commerce Storefront: Catalog, Cart & Checkout

Card No. 06·63074 · Updated · Standard formula, shown below

Thor Commerce is a headless commerce platform that provides the core storefront functions—catalog, cart, and checkout—as separate, API-driven services. You connect these services to your own frontend (website, app, or custom interface) using its REST and GraphQL APIs, giving you full control over the customer experience while Thor handles the transactional backend.

Background: What Thor Commerce Is

Thor Commerce is a relatively new, open-source commerce platform designed for developers who want flexibility without building everything from scratch. Unlike monolithic platforms (like Shopify or BigCommerce) that provide a complete, hosted storefront, Thor is headless: it offers the backend logic (products, orders, customers) and lets you build or choose the frontend. This approach is popular among brands that need custom shopping experiences, such as multi-brand marketplaces, subscription services, or apps with embedded purchasing.

Thor is built on modern web technologies (Node.js, GraphQL) and is designed to be self-hosted, meaning you run it on your own server or cloud infrastructure. It’s not a SaaS—you’re responsible for installation, maintenance, and scaling. This makes it a fit for teams with development resources who want control over their commerce stack.

How Catalog, Cart, and Checkout Work

Thor separates the three main storefront functions into distinct modules, each with its own API. Here’s what each does:

  • Catalog: Manages products, variants, categories, and inventory. You can create products with attributes (size, color, material), set pricing, and organize them into collections. The API lets you query products, filter by attributes, and retrieve product details for display.
  • Cart: Tracks the customer’s selected items before checkout. Thor’s cart API allows you to create a cart, add items, update quantities, and apply promotions or discounts. The cart is stored server-side, so it persists across devices if the customer is logged in.
  • Checkout: Handles the order placement process. This includes collecting customer information (shipping/billing addresses), calculating shipping and taxes, processing payment (via integrated payment gateways like Stripe or PayPal), and creating the order. Thor provides a checkout API that you can integrate with your own checkout UI.

These modules communicate via REST or GraphQL. For example, when a customer adds an item to the cart, your frontend sends a POST request to the cart endpoint. When they proceed to checkout, you send the cart ID to the checkout endpoint, which returns an order confirmation.

Connecting Thor to Your Storefront

To connect Thor to your storefront, you need to build a custom integration layer. Here’s a typical flow:

  1. Set up Thor: Install Thor on your server, configure the database, and run the setup script.
  2. Create API credentials: Generate an API key and secret from the Thor admin panel.
  3. Build the frontend: Use a framework like React, Vue, or plain HTML/JavaScript to create your storefront pages.
  4. Make API calls: Use the Thor SDK or direct HTTP requests to fetch products, manage the cart, and process checkout.
  5. Handle webhooks: Set up webhooks to receive notifications for events like order creation or payment failure, so your system can react.

Thor also provides a JavaScript SDK that simplifies API calls. For example, to fetch a product, you’d call thor.products.get('product-id'). The SDK handles authentication and error handling.

Choosing Thor vs. Other Platforms

Deciding whether Thor is right for your project depends on your needs. Here’s a comparison:

  • Thor vs. Shopify: Shopify is a hosted, all-in-one platform that’s easier to set up but less customizable. Thor gives you full control over the frontend and backend, but requires more development effort.
  • Thor vs. Magento: Magento (now Adobe Commerce) is a powerful open-source platform with a large ecosystem. Thor is lighter and more modern, but has a smaller community and fewer extensions.
  • Thor vs. Custom-built: Building your own commerce backend from scratch is time-consuming and error-prone. Thor provides the essential components, saving you from reinventing the wheel.

If you need a quick, hosted solution with minimal coding, Thor might not be the best fit. But if you have a development team and need a customizable, self-hosted platform, Thor is a strong contender.

Common Problems and How to Solve Them

Developers often run into a few issues when using Thor:

  • Authentication errors: Ensure your API key and secret are correct and that your server’s time is synchronized (JWT tokens expire).
  • Cart persistence: If you want carts to survive page refreshes, store the cart ID in a cookie or localStorage, and pass it to the API on each request.
  • Checkout failures: Check that your payment gateway is configured correctly and that your webhook endpoints are accessible from the internet.
  • Performance: If your catalog is large, use pagination and caching (e.g., Redis) to speed up API responses.

The Thor documentation and community forums are good resources for troubleshooting specific errors.

Costs and Hosting Considerations

Thor is free to use (open-source), but you’ll incur costs for hosting, domain, SSL certificate, and any third-party services like payment gateways. You can run Thor on a VPS (e.g., DigitalOcean, Linode) or a cloud provider (AWS, Google Cloud). For a small store, a $10-20/month VPS is usually sufficient. As traffic grows, you may need to scale up resources or use a managed database service.

There are no licensing fees, but you should budget for development time. If you’re not familiar with Node.js and APIs, you may need to hire a developer, which can be a significant cost.

Security and Compliance

Since Thor handles customer data and payments, security is critical. Here are key considerations:

  • SSL/TLS: Always serve your storefront over HTTPS to encrypt data in transit.
  • Payment data: Use a PCI-compliant payment gateway like Stripe or PayPal, which handles card data directly, so you don’t store sensitive information.
  • Data protection: Implement GDPR or CCPA compliance if you serve customers in those regions. This includes obtaining consent for cookies and providing data deletion options.
  • Regular updates: Keep Thor and its dependencies updated to patch security vulnerabilities.

Thor’s documentation includes security best practices, and you should conduct regular security audits.

Alternatives to Thor Commerce

If Thor doesn’t meet your needs, consider these alternatives:

  • Medusa.js: A popular open-source headless commerce platform with a similar philosophy to Thor, but with a larger community and more built-in features.
  • Saleor: Another open-source headless platform, written in Python, with a GraphQL API and a modern admin panel.
  • Shopify Hydrogen: A headless option from Shopify, but it requires a Shopify subscription.
  • Swell: A hosted headless commerce platform with a free tier, but less customizable than Thor.

Each has its own strengths, so evaluate based on your technical stack and feature requirements.

Frequently Asked Questions

Do I need to be a developer to use Thor Commerce?

Yes, Thor is developer-focused. You need to know JavaScript/Node.js and have experience with APIs to set it up and integrate it with your frontend. There’s no drag-and-drop store builder.

Can I use Thor with WordPress or other CMS?

Yes, you can connect Thor to any frontend via its API. You could use WordPress as a CMS and fetch product data from Thor via JavaScript, though it’s not a typical setup.

Does Thor support multiple currencies and languages?

Yes, Thor supports multi-currency and multi-language out of the box. You can configure these in the admin panel and pass the appropriate locale in API requests.

How do I handle taxes and shipping?

Thor has built-in tax and shipping calculation logic, but you may need to configure tax rates and shipping methods based on your business. You can also integrate third-party services like Avalara or Shippo.

Is Thor PCI compliant?

Thor itself is not PCI certified, but it’s designed to work with PCI-compliant payment gateways. As long as you use a gateway that handles card data (like Stripe), your store can be PCI compliant.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →