Checkpost

How to charge a cash on delivery fee on Shopify

Short answer: Add a shipping rate that includes your COD fee (for example "Standard (COD)"), then show Cash on Delivery only when the shopper picks that rate. In Checkpost, choose “COD fee: offer COD only with the COD rate” from Templates, adjust the values, test it, then save and enable the rule.

The problem

Couriers charge extra to collect cash, and refused COD parcels cost two shipping legs. Shopify has no COD surcharge, so stores either absorb the cost or lose it. Folding the fee into a dedicated shipping rate puts the charge in checkout's own totals, on every Shopify plan, without editing orders afterwards.

How to set it up

  1. Install Checkpost from the Shopify App Store.
  2. Open Templates and choose COD fee: offer COD only with the COD rate.
  3. First add a rate named with "COD" in Settings → Shipping and delivery, priced at your normal rate plus the fee. Use the same word here and the name your checkout shows for cash on delivery. Add the "COD fee: prepaid methods off with the COD rate" rule too.
  4. Use Try this rule to test a sample cart, then click Save rule.

The rule

Hide payment methods containing "Cash on Delivery" when all of these conditions is true:

Shoppers see no message: the methods are changed before checkout shows them.

Rule definition (JSON)
{
  "name": "COD only with the COD rate",
  "action": {
    "kind": "hide_payment",
    "methods": [
      "Cash on Delivery"
    ],
    "match": "contains"
  },
  "match": "all",
  "conditions": [
    {
      "kind": "text",
      "field": "delivery_method_title",
      "op": "not_contains_any",
      "values": [
        "COD"
      ]
    }
  ]
}

Examples with the default settings

These outcomes apply to this rule alone. Other enabled rules may also affect checkout.

Test cartExpected outcome
Shopper picked Standard (COD)Methods unchanged by this rule
Shopper picked StandardHide payment methods containing "Cash on Delivery"

Where this rule works

This changes matching payment methods that Shopify exposes to the customization. Payment rules do not have the same express-checkout coverage as cart validation. Shopify limits wallet customization and credit-card customization on non-Plus US/Canada stores. See Shopify's payment compatibility and verify your COD/manual method in a development store. Geographic payment rules currently use the first delivery group's address.

Tips

Can you do this without an app?

Shopify can't add a fee for a payment method. Without an app, the COD fee has to be added to every order or edited in afterwards.

FAQ

Can the fee be its own line on the order?

Not on every plan. Apps that show a separate fee line rely on theme code or Shopify Plus checkout extensions. A shipping rate works on all plans and needs no theme changes.

Can I charge a percentage fee?

Shipping rates are fixed or based on price or weight ranges. Use price-based rates if the fee should grow with the order.

Related rules

Add cod fee: offer cod only with the cod rate to your store