The difference is not price, it is who writes the storefront. On Shopify your agent works inside a theme system, an object model and an app permission scheme. With a headless backend it writes ordinary HTML and calls a JSON API, and nothing about your markup is decided in advance.
Shopify is a complete shop with a storefront attached. Headless commerce is the shop without the storefront: a backend holding products, stock, carts and orders, and an API your own frontend reads from. Codex is very good at writing that frontend, which is what makes the second shape practical for the first time.
Both take Stripe payments into your own account, and on neither does card data touch your storefront.
It can, and for a conventional store that is a perfectly reasonable answer. The constraint appears when you want a page Shopify's theme system does not model well — an unusual product configurator, a bespoke bundle, a landing page that is half editorial. Then you are writing around the platform.
This is Shopify's strongest card. A headless store has no app store, so anything you would have installed becomes something you or your agent build against an API. That is cheap when the feature is simple and expensive when it is not.
Shopify is a good product and this comparison is not an argument that it is obsolete. Choose it when you want a store running this afternoon without a developer, when you need a particular app from its ecosystem, or when POS and multi-channel selling matter more than controlling the markup.
When the storefront is the product — when the design, the copy and the page structure are things you actually care about — and when you have an agent that can write and maintain them. That combination is new, and it is the reason this is worth reconsidering now rather than three years ago.
The app ecosystem, built-in POS and shipping integrations, and round-the-clock support. If your store depends on a specific Shopify app, replacing it becomes your problem rather than an install. That is a real cost and it is worth counting before you move.
You do, on both. Payments run through Stripe into your own account, and CodexCMS takes no percentage of your sales — the platform charges £9.99 a month and nothing else, so a good month on the store costs the same as a quiet one.