Comparisons

Payload ecommerce: the shipping, tax and discount code the plugin leaves to you

Payload's ecommerce plugin skips shipping, tax and discount codes. Here's the code you'd write for them and the Cmssy config that replaces it.

M
Maciej Bednarczyk
7 min read

Payload ecommerce: the shipping, tax and discount code the plugin leaves to you

Payload's ecommerce plugin skips shipping, tax and discount codes. Here's the code you'd write for them and the Cmssy config that replaces it.

Payload ecommerce, in its own docs: the plugin "does not handle shipping, taxes or subscriptions natively." You build them with the plugin's collections and hooks. Discount codes don't appear in the plugin's overview at all, and the plugin is still marked beta.

For many teams that's a fair trade; the next section says which. But it helps to see the trade in code. Take three tickets that show up early in most store builds:

  1. WELCOME10: 10% off a first order, one use per code, expires in 30 days.
  2. Free shipping over 60 EUR to Germany and Austria; flat 12.90 EUR everywhere else.
  3. 19% VAT, included in the prices, applied to shipping too.

Here's roughly what those three tickets look like on Payload, and what they look like on Cmssy.

Top: Payload ecommerce plugin docs listing core features, with the line that the plugin does not handle shipping, taxes or subscriptions natively highlighted. Bottom: Cmssy Region and tax settings with three tax rates and VAT rounding per line.
Payload leaves tax to your code; in Cmssy tax rates are workspace settings. Source: payloadcms.com.

Choose Payload if, choose Cmssy if

Stay on Payload if you want the store's data in your own database and repo, you're happy to own the pricing rules as code (some teams prefer that: it's reviewable and testable), you need deep admin customisation with your own React components, or the cost of a separate service matters more than the code. Payload is MIT, and you can run it free on your own hosting.

Choose Cmssy if you'd rather configure discounts, shipping and tax than write and maintain them, you want orders, refunds, returns and invoice numbers handled as a back office rather than collections you design, and you want an agent to run that back office over MCP.

The three tickets on Payload

This is a sketch, not a drop-in: the plugin's override options differ between versions, so we wrote it against Payload's general collection config and Local API, the pieces that are stable. It's 84 lines, it isn't typechecked against your generated types, and it isn't finished.

// collections/Discounts.ts
import type { CollectionConfig } from "payload";

export const Discounts: CollectionConfig = {
  slug: "discounts",
  admin: { useAsTitle: "code" },
  fields: [
    { name: "code", type: "text", required: true, unique: true },
    {
      name: "type",
      type: "select",
      required: true,
      options: ["percentage", "fixed", "free_shipping"],
    },
    { name: "value", type: "number", min: 0 },
    { name: "minSubtotal", type: "number", min: 0 },
    { name: "maxUses", type: "number", min: 1 },
    { name: "uses", type: "number", defaultValue: 0, admin: { readOnly: true } },
    { name: "startsAt", type: "date" },
    { name: "endsAt", type: "date" },
  ],
};

// lib/pricing.ts - called from your checkout endpoint or a cart hook
import type { Payload } from "payload";

const SHIPPING = [
  { id: "dhl-de-at", countries: ["DE", "AT"], price: 590, freeAbove: 6000 },
  { id: "dhl-eu", countries: [], price: 1290, freeAbove: null },
];
const VAT_RATE = 0.19; // goods and shipping

type Line = { unitPrice: number; quantity: number };

export async function priceCart(
  payload: Payload,
  lines: Line[],
  country: string,
  code?: string,
) {
  const subtotal = lines.reduce((s, l) => s + l.unitPrice * l.quantity, 0);

  let discount = 0;
  let freeShipping = false;
  if (code) {
    const { docs } = await payload.find({
      collection: "discounts",
      where: { code: { equals: code.toUpperCase() } },
      limit: 1,
    });
    const d = docs[0];
    const now = new Date();
    const valid =
      d &&
      (!d.startsAt || new Date(d.startsAt) <= now) &&
      (!d.endsAt || new Date(d.endsAt) > now) &&
      (!d.maxUses || (d.uses ?? 0) < d.maxUses) &&
      subtotal >= (d.minSubtotal ?? 0);
    if (!valid) throw new Error("DISCOUNT_NOT_APPLICABLE");
    if (d.type === "percentage") discount = Math.round(subtotal * ((d.value ?? 0) / 100));
    if (d.type === "fixed") discount = Math.min(d.value ?? 0, subtotal);
    if (d.type === "free_shipping") freeShipping = true;
  }

  const method =
    SHIPPING.find((m) => m.countries.includes(country)) ??
    SHIPPING.find((m) => m.countries.length === 0)!;
  const afterDiscount = subtotal - discount;
  const shipping =
    freeShipping || (method.freeAbove !== null && afterDiscount >= method.freeAbove)
      ? 0
      : method.price;

  // prices are gross: take the VAT out for the invoice lines
  const gross = afterDiscount + shipping;
  const tax = Math.round(gross - gross / (1 + VAT_RATE));

  return { subtotal, discount, shipping, tax, total: gross, methodId: method.id };
}

// Still yours to write: incrementing `uses` atomically when the order is
// placed (two checkouts can both see the last use), giving the use back on
// cancellation, re-pricing when the cart changes, per-line VAT rounding,
// and storing what was applied on the order so a later edit can't re-price it.

The code is the easy half. The comment at the end is the half that bites in production: a discount's last use claimed by two checkouts at once, a cancelled order that should give the use back, an order edited after checkout that mustn't be re-priced at today's rules, and VAT rounding that has to match what your accountant's software computes. None of that is hard to write. All of it is yours to test and keep correct.

The same three tickets on Cmssy

On Cmssy these are settings, not code. You can set them in the admin, or have an agent set them over MCP. These are the actual tool arguments.

Tax and shipping, in the workspace's commerce settings (update_cart_config):

{
  "workspace": "acme/shop",
  "pricesIncludeTax": true,
  "taxRates": [{ "id": "vat-19", "name": "VAT 19%", "rate": 19 }],
  "defaultTaxRateId": "vat-19",
  "shippingMethods": [
    {
      "id": "dhl-de-at",
      "label": "DHL Germany and Austria",
      "countries": ["DE", "AT"],
      "price": 590,
      "freeAbove": 6000,
      "taxRateId": "vat-19"
    },
    {
      "id": "dhl-eu",
      "label": "DHL Europe",
      "price": 1290,
      "taxRateId": "vat-19"
    }
  ]
}

The discount (create_discount):

{
  "workspace": "acme/shop",
  "code": "WELCOME10",
  "type": "percentage",
  "value": 10,
  "maxUses": 1,
  "endsAt": "2026-12-31T23:59:59Z"
}

Money is in minor units (590 is 5.90 EUR, 6000 is 60.00 EUR). A shipping method with no countries ships everywhere; each method can also have a subtotal window. Discount codes can be percentage, fixed-amount or free-shipping, with start and end dates, a minimum subtotal and a total usage cap. Cart totals, including tax, are computed on the server, so your storefront shows numbers rather than calculating them.

Cmssy Discounts list in the demo workspace with four percentage codes, their values, usage counts and enabled state.
Discount codes in Cmssy are records you configure, not code you write.

What you still write on Cmssy: the storefront itself, and the payment integration. Cmssy records payments and never moves money, so you connect Stripe (or another provider) in your app. Our next-storefront example does it with one Stripe webhook route: when Stripe confirms a checkout, the route records the payment on the Cmssy order with the PaymentIntent id as the reference. Shipping labels work the same way: Cmssy stores parcels and tracking, and next-storefront books the carrier (USPS, DHL Express or Deutsche Post through Shippo) from a Cmssy webhook. The full list of what the store side covers is in the Shopify comparison.

What the comparison looks like on one page

Payload ecommerce plugin Cmssy
Where it runs Inside your Next.js app, your database Hosted service your app calls
License MIT Closed service; SDKs, CLI, MCP server and examples are MIT
Products and variants Yes Yes
Discount codes Not in the plugin docs; build them Percentage, fixed, free shipping; dates, minimum, usage cap
Shipping "Not handled natively"; build it Methods with country rules, subtotal window, free-above threshold
Tax "Not handled natively"; build it Rates you set, gross or net prices, server-side totals
Payments Stripe adapter included You integrate the provider; Cmssy records payments
Multiple currencies Yes, a price field per currency Default plus up to 9 more; one per sales channel; prices set per currency, no exchange rates
Admin customisation Your own React components Fixed admin
Store back office Orders and transactions collections Manual orders, line edits, partial payments and refunds, shipments, returns, invoice numbers, a configurable pipeline
Agent over MCP Official plugin: find/create/update/delete per collection, plus your own tools Store tools such as refund_order, create_shipment, create_discount, edit_order
Cost to run Free on your own hosting Free Hobby plan up to 20 orders a month; Pro $29/month, no order cap

Payload wins real rows here: self-hosting, the license, the Stripe adapter and the admin. If those are your priorities, the code above is a reasonable price.

One thing to check if you picked Payload for Payload Cloud

Payload has joined Figma. According to Payload's announcement, new Payload Cloud deployments are paused, existing Cloud projects run as normal, no Cloud pricing changes are planned, and the open-source core continues. If you chose Payload because you wanted it hosted for you, that's worth re-reading before you start a new store on it. We compared the options for that situation in Payload CMS alternatives.

What Cmssy won't do for your store

  • Host or render the storefront. Cmssy stores products, carts and orders; your Next.js, Astro or React Router app renders and hosts the shop.
  • Take payments. You integrate the provider. Cmssy records what was paid and refunded.
  • Compute carrier rates or buy labels. You set shipping methods and prices; the carrier booking lives in your app, as above.
  • Calculate tax for you by jurisdiction. You set the rates. A verified EU VAT id on a company does drive reverse charge.
  • Run on your servers. There's no self-hosted Cmssy.

See it before you sign up

Every example in our repo reads a public demo workspace, so you can run next-storefront locally without an account (the Claude Code tutorial has the clone-and-run steps), or open the live storefronts at cmssy.com/demos. How the commerce settings work is in the commerce docs. If you'd rather see the agent side first, what an agent can run in a store walks through a refund and a wholesale order.

Sources

  • Payload ecommerce overview (beta notice; shipping, taxes and subscriptions not handled natively; no discount codes listed), checked 20 Nov 2026: https://payloadcms.com/docs/ecommerce/overview
  • Payload MCP plugin, checked 20 Nov 2026: https://payloadcms.com/docs/plugins/mcp
  • Payload has joined Figma, checked 20 Nov 2026: https://payloadcms.com/payload-has-joined-figma
  • Cmssy pricing, checked 20 Nov 2026: /pricing