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
- Install Checkpost from the Shopify App Store.
- Open Templates and choose COD fee: offer COD only with the COD rate.
- 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.
- 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:
- Delivery method name contains none of COD
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 cart | Expected outcome |
|---|---|
| Shopper picked Standard (COD) | Methods unchanged by this rule |
| Shopper picked Standard | Hide 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
- In Settings → Shipping and delivery, add a rate next to your normal one with COD in its name, for example "Standard (COD)", priced at the normal rate plus your fee.
- Use this rule with "COD fee: prepaid methods off with the COD rate". Together, Cash on Delivery appears only with the COD rate and prepaid orders never pay the fee.
- The fee shows as part of the shipping line, not as its own line. Say so in the rate name or description so shoppers know why it costs more.
- Before a rate is chosen, Cash on Delivery stays visible. Shopify asks for the shipping rate before payment, so shoppers reach payment with a rate selected.
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
Hide cash on delivery over $500
Hide the Cash on Delivery payment method when the cart subtotal is over 500, so big orders are paid upfront.
Hide cash on delivery for first orders
Only returning customers can pay cash on delivery: hide it for guests and customers without a previous order.
Hide pay-later methods for pre-orders
Hide buy-now-pay-later and cash on delivery when the cart contains pre-order products.
Show bank transfer first for wholesale
Move the bank transfer payment method to the top of the list for customers tagged wholesale.