Guide: build or buy

How to vibe code your own Shopify profit dashboard

AI coding tools have made a custom dashboard an afternoon's work. Here's how to build one properly with Claude Code, Lovable, Cursor or Codex, where profit numbers usually go wrong, how a home-built dashboard compares with MerchantFlow, and how to keep the flexibility without rebuilding the financial logic.

Part 1

The DIY approach with Claude Code, Lovable, Cursor and Codex

You can genuinely build this yourself. The tools are good, and the approach below holds up whichever one you choose. The dashboard is the quick part; most of the steps are about getting trustworthy data into it.

Pick your tool

Claude Code

Anthropic's coding agent, in your terminal or editor. It works across a whole project: reads and writes files, runs commands and tests, and can connect to MCP servers. A good fit if you want a codebase you own, such as a Next.js app with a Postgres database and a scheduled sync job.

Cursor

An AI-first code editor with an agent mode. You get a similar result to Claude Code inside an editor, seeing every change as it's made and steering as you go.

Codex

OpenAI's coding agent, available as a CLI, in editors and as cloud tasks you start from ChatGPT. Handy for handing off a well-specified piece, such as "write the Shopify bulk-export job and its tests", then reviewing what comes back.

Lovable

A browser-based app builder. You describe the dashboard in chat and it builds a React app with a backend, either Lovable Cloud or your own Supabase project, using Edge Functions for server-side work such as calling the Shopify API. The quickest route to a working interface.

The build, step by step

  1. Write down your profit formula first

    Before any code, decide exactly what profit means for your store: revenue after discounts and refunds, excluding tax, minus product cost, shipping and fulfilment, payment fees, ad spend and overheads. Put it in a short spec file (say, SPEC.md) and point your AI tool at it in every session. A vague formula produces confident-looking wrong numbers, however good the code is.

  2. Get API access to your store

    Since 1 January 2026 you can't create new custom apps in the Shopify admin. You create the app in Shopify's Dev Dashboard instead, which gives you a client ID and secret to exchange for short-lived access tokens, so your sync has to request fresh ones. Ask for read_orders, read_products and read_inventory (product cost lives on inventory items). By default an app only sees the last 60 days of orders; older history needs the read_all_orders scope, which Shopify has to approve.

  3. Connect your ad accounts

    Every ad platform has its own developer setup. Meta needs an app with ads_read and Ads Management Standard Access, and a system user token avoids tokens that expire. Google Ads needs a developer token, and Basic Access now requires brand verification of your Google Cloud project. TikTok needs a TikTok for Business developer app that passes review. Budget time for approvals, not just code.

  4. Prompt for a sync, not a page

    Ask the agent to build the data layer before the dashboard: tables for orders, line items, refunds, transactions, products, costs and daily ad spend, a backfill using Shopify's bulk operations, and an incremental sync of recently updated orders. Have it keep the raw API responses, so you can recalculate when you fix a rule.

    Example prompt
    Read SPEC.md. Create a Postgres schema for Shopify orders, line items, refunds, transactions and product costs. Write a backfill using GraphQL Admin API bulk operations, and an incremental sync that runs every 30 minutes for orders updated since the last run. Store the raw JSON for every order. Add tests with three sample orders: one partly refunded, one with a 100% discounted line, and one with tax-inclusive prices.
  5. Model your costs

    Shopify's API gives you each item's current cost, not what it cost when an order was placed, so record costs over time and join them to orders by date. Add tables for 3PL charges, fees from payment gateways Shopify can't see, and recurring expenses such as apps and wages.

  6. Build the dashboard, then reconcile it

    Now let the agent build the interface: profit by day, product and channel. Then check it against reality for the same dates and timezone: revenue and refunds against Shopify's reports, payouts against your bank, ad spend against each platform. Expect several rounds here.

  7. Host it and keep it running

    Deploy somewhere that runs scheduled jobs (a cron job on your host, Supabase scheduled functions or a small server), alert yourself when a sync fails, and plan for upkeep. Shopify releases a new API version every quarter and supports each for at least 12 months, and the ad platforms change their APIs on their own schedules.

Using Lovable? Ask it to keep every Shopify and ad-platform call in an Edge Function with tokens stored as secrets, never in the browser, and do the reconciliation step anyway. A polished interface makes wrong numbers more convincing, not less.

Part 2

Why Shopify profit dashboards get their numbers wrong

Whether you build it or buy it, a profit figure is only as good as the rules behind it. These six catch home-built and off-the-shelf dashboards alike.

Refunds

A refund can land weeks after the order. Book it on the refund date and the original month looks better than it was; skip partial refunds and returned items still look sold.

Example

A A$200 order on 28 October is partly refunded (A$80) on 6 November. On a sale-date basis October earned A$120. On a refund-date basis October shows A$200 and November takes an A$80 hit. Neither is wrong, but mixing them is.

How MerchantFlow handles it: Refunds are counted against the order they belong to, on the sale date, so each order's profit reflects what it actually earned.

Transaction fees

Shopify's API reports fees for Shopify Payments transactions, but PayPal, a Stripe account outside Shopify and most other gateways report fees elsewhere, if at all. Shopify's own third-party transaction fee can apply on top.

Example

If a third of your orders go through a gateway whose fees your dashboard can't see and you leave those fees at zero, every one of those orders looks more profitable by its whole processing cost.

How MerchantFlow handles it: Platform-reported fees are used where they exist; for other gateways you set a fee rule once, and those fees are labelled as estimates.

Advertising costs

Each platform reports spend by day in the ad account's own timezone and currency, and counts conversions its own way. Add up the purchases each platform claims and the same order gets counted more than once.

Example

Meta reports 40 purchases and Google 30 on a day your store took 55 orders. Add up the platforms and you get 70.

How MerchantFlow handles it: Revenue always comes from your store's orders and the platforms supply spend, so no order is counted twice. Spend is allocated across your orders and products.

3PL fees

Pick, pack, postage and storage are billed by your 3PL, often weekly or monthly, rather than sitting on each order in Shopify. A flat shipping estimate per order misses the gap, and storage often never gets counted.

Example

Estimating A$9 per order against actual charges averaging A$12.40 understates costs by A$3.40 an order. Across 2,000 orders a month that's A$6,800 of profit that isn't there.

How MerchantFlow handles it: Supported 3PLs' charges are pulled through their APIs and matched to each order, instead of a flat estimate.

Taxes

In Australia, the UK and the EU, prices usually include GST or VAT; in the US, sales tax is usually added at checkout. Treat a tax-inclusive total as revenue and you overstate revenue and profit by the tax.

Example

A A$110 order including 10% GST is A$100 of revenue, not A$110. Selling across borders, each country's rate differs again.

How MerchantFlow handles it: Per-country tax rules, set once and applied across your P&L, so tax is accounted for everywhere you sell.

COGS

Shopify's Admin API exposes the current cost of each item, not its cost when an order was placed. Update a cost and a naive dashboard rewrites the margin on every past order. A product with no cost at all looks like 100% margin.

Example

You paid A$8 a unit last year and pay A$11 now. Recalculating last year's sales at A$11 understates last year's margin by A$3 on every unit sold.

How MerchantFlow handles it: Product costs are effective-dated, so each sale uses the cost that applied when it sold, and coverage reporting shows products still missing a cost.

One more: time zones. Shopify's GraphQL Admin API returns timestamps in UTC, but your trading day starts at midnight where your store is. Filter by UTC dates and the first and last day of every report gain or lose hours of orders.

Part 3

Vibe-coded dashboard vs MerchantFlow

Both are reasonable choices. The difference is what you want to spend your time on.

Vibe-coded dashboard vs MerchantFlow
CustomisationVibe-coded dashboardUnlimited. Any metric, layout or workflow you can describe.MerchantFlowBroad but structured: P&L, products, orders, markets, cohorts and more, a custom report builder on Pro and Plus, and any question you like through Claude or ChatGPT.
Data accuracyVibe-coded dashboardAs good as the rules you write and test for refunds, fees, ad spend, tax, 3PL charges and cost history.MerchantFlowThose rules are built in and applied the same way to every order, with estimates labelled where a cost isn't reported.
API maintenanceVibe-coded dashboardYours: token refreshes, quarterly Shopify API versions, ad platform changes and syncs that silently stop.MerchantFlowOurs. Connections and syncs are maintained for you, and sync problems are flagged in the app.
SetupVibe-coded dashboardDeveloper apps and approvals from Shopify, Meta, Google and TikTok, then building and checking the sync.MerchantFlowConnect your store and ad accounts in a few minutes, with 1:1 help from our founder to set up your costs.
Ongoing costsVibe-coded dashboardHosting, a database and AI tool subscriptions, plus your time to monitor, fix and re-check it.MerchantFlowA monthly plan from $49 USD, with a 14-day free trial.
Best forVibe-coded dashboardYou enjoy building, have time to maintain it, or already run a data warehouse.MerchantFlowYou want numbers you can trust now, and would rather spend your time on the business.

Your numbers

What would maintaining it cost you?

Building it is a one-off. Keeping it right happens every month. Enter your order volume and what an hour of your time is worth, then adjust the effort to match your setup.

Your store

MerchantFlow billing

Your estimate for building it yourself

Upkeep, hours a month

Total upkeep8.5 h a month

The hours are starting assumptions for a Shopify store with a couple of ad platforms and a 3PL, not measurements. Change any of them.

Your comparison

Building it yourself

$465 a month in time and tools

$7,580 in the first year, including the build

About 142 hours of your time in the first year, roughly 17.8 eight-hour days

MerchantFlow Pro

$89 a month

$1,068 in the first year

Covers up to 5,000 orders a month, with 1:1 setup help from our founder.

On these numbers, building it yourself costs about $6,512 more in the first year.

MerchantFlow costs less whenever your upkeep takes more than 1 hour a month.

Start 14-Day Free Trial

Thinking of rebuilding a specific app?

What it would take to vibe code the profit apps merchants ask about most, part by part, with the costs at your order volume.

Triple Whale, Lifetimely and Polar Analytics and their logos are trademarks of their owners, shown only to identify the products. MerchantFlow is not affiliated with them.

Part 4

The best of both worlds: let your AI read MerchantFlow's numbers

If what you really want is to ask your own questions in Claude or ChatGPT, you don't need to rebuild the financial logic to get there. MerchantFlow already syncs your store, ad accounts and costs and does the calculations. Its MCP integration gives Claude, ChatGPT and other AI tools read-only access to the results, so your AI reads calculated profit instead of raw orders it has to interpret.

  • Calculated, not raw

    Your AI works from profit after COGS, fees, shipping and ad spend, the same figures as your dashboard, rather than re-deriving them from raw orders every time.

  • Ask anything

    Which products lost money last month? How did ROAS change after a price rise? Ask in plain words and get an answer from your own numbers.

  • Works where you work

    Claude, ChatGPT, Gemini, Cursor and other MCP clients. ChatGPT connects through MerchantFlow's listing in its directory; Claude takes a connector URL.

  • Read-only and revocable

    Access is read-only, granted with OAuth, and you can disconnect it at any time. Included on every plan, trials too; how far back your AI can see follows your plan.

Set it up in three steps

  1. 1Start a MerchantFlow trial and connect your store and ad accounts.
  2. 2In Claude, add MerchantFlow as a connector using https://merchantflow.ai/api/mcp, or open MerchantFlow's listing in ChatGPT.
  3. 3Approve read-only access, then ask your first question.

Questions to start with

  • What was my net profit last week after ad spend and fees?
  • Which five products have the lowest margin after COGS and fulfilment?
  • Which countries are losing money once shipping is included?

Still want a custom tool? Keep vibe coding the parts that are unique to your business, and let MerchantFlow own the financial logic underneath.

See the full setup guide

From the Shopify App Store

From merchants who tried the alternatives

I've tried quite a few of these profit tracker apps (even tried making one myself), but honestly, none of them offer what MerchantFlow does and the ones that come close cost 10x the monthly price. My favorite feature by far is the integration with my 3PL, so the data I'm seeing is the actual data not a guess.
Horizum

Netherlands

Shopify App Store
Its super important for me to know my numbers down the the exact percentage and I can trust Merchant Flow to get it right. I've used other softwares in the past but none of them have half of the features this does and always end up not being correct. Highly recommend using it if you're running an ecommerce store.
NomaDesk

Australia

Shopify App Store

FAQ

Questions about vibe coding a profit dashboard

Can I build a Shopify profit dashboard with Claude Code, Cursor, Codex or Lovable?

Yes. Any of them can build the app. The work is in the data: API access, a reliable sync, and rules for refunds, fees, ad spend, tax, 3PL charges and cost history. Part 1 of this guide walks through it step by step.

Why is my Shopify profit dashboard showing the wrong numbers?

Usually because of how it handles refunds, payment fees, ad platform conversions, 3PL charges, tax-inclusive prices or product cost history. Check those six first, then check that your date ranges use your store's timezone.

Can Shopify's API give me historical product costs?

Not directly. The Admin API exposes each item's current cost, so to know what a product cost when it sold, you have to record costs over time yourself and match them to orders by date.

Is it cheaper to vibe code my own dashboard?

The software can cost very little. The ongoing cost is your time: monitoring syncs, keeping up with API changes and re-checking the numbers. Use the calculator on this page with your own order volume and hourly value; MerchantFlow plans start from $49 USD a month with a 14-day free trial.

Can Claude or ChatGPT use my MerchantFlow data?

Yes. MerchantFlow's MCP integration gives Claude, ChatGPT and other MCP clients read-only access to your calculated profit data, on every plan including the trial.

Keep the AI. Skip rebuilding the finance.

Start a 14-day free trial, connect your store, and ask Claude or ChatGPT about your real profit, with 1:1 help from our founder on every plan.