> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced COD Workflows | Razorpay COD & Magic Checkout

> Learn how to create rule-based COD workflows to block risky orders, add COD fees, convert COD to prepaid and more at checkout on your Shopify store.

Available in
🇮🇳 India

Use **Advanced COD Workflows** to create rule-based workflows that control how COD behaves for specific customers, orders, products or locations. Each workflow applies a single action, such as blocking COD or adding a fee, when an order matches the conditions you define.

To get started, on the Dashboard, navigate to **Magic Checkout** → **Setup and Settings** → **Cash on Delivery** → **Advanced COD Workflows**.

## Create Advanced COD Settings

Under **Create Advanced COD Settings**, select the type of workflow you want to create. You can select only one action per workflow.

| Workflow | Description |
| - | - |
| Block Risky Orders | Limit COD for high-risk customers and certain pincodes. Hides COD at checkout for orders that match the conditions. |
| Add Extra Fees | Apply extra fees for certain zones, products or order values to recover COD handling costs. |
| Convert COD to Prepaid | Encourage COD customers to pay online after checkout with a WhatsApp discount message. |
| COD Transactions with OTP | Verify COD orders with a One-Time Password (OTP) to prevent fake orders. |
| Always Allow COD | Whitelist trusted customers or VIPs to skip risk checks and blocking rules. |

## Create a Workflow

When you select a workflow type, a three-step configuration opens:

> [accordion] Step 1: Select Criteria
>
> Choose one or more conditions that decide when the workflow applies. When you select multiple conditions, the workflow applies only if an order matches all of them.
>
> | Condition | Targets |
> | - | - |
> | Cart | The total cart value, such as orders above or below a defined amount. |
> | Location | Specific states, regions or pincodes. |
> | UTM | Marketing source, medium or campaign, such as `utm_source`, `utm_medium` or `utm_campaign`. |
> | SKU | Specific products or categories from your synced Shopify catalogue. |
> | Customer Attribute | Specific customer details, such as phone number, email or IP address. |
> | RTO Risk | The order's RTO risk level (Low, Medium or High) from RTO Intelligence. |
>
> > [!NOTE]
> >
> > **Handy Tips**
> >
> > Not all conditions are available for every workflow. For example, **RTO Risk** is available for **Block Risky Orders** and **Add Extra Fees**. You can add values to list-based conditions such as phone numbers, pincodes and SKUs manually or through a bulk CSV or Excel upload, and download an existing list.

> [accordion] Step 2: Define Logic
>
> Set the values for each condition you selected in the previous step and configure the action. For example:
>
> * For **Cart Range**, enter the minimum and maximum cart value.
> * For **Location**, **UTM**, **SKU** and **Customers**, select or add the values the workflow applies to.
> * For **Add Extra Fees**, enter the COD fee. You can create multiple cart value slabs, each with its own fee. Ranges cannot overlap.
> * For **Convert COD to Prepaid**, set the discount value, minimum order value and the WhatsApp message customers receive.

> [accordion] Step 3: Review
>
> Verify your settings, then enter a **Name of Workflow** and an optional **Description**. The **Criteria** and **Logic** summaries show the conditions and values you selected. Click **Save** to activate the workflow.
>
> > [!WARNING]
> >
> > **Watch Out!**
> >
> > Once activated, the workflow applies to all new orders immediately.

### Workflow Types

> [accordion] Block Risky Orders
>
> Hides COD at checkout for orders that match the conditions you set. Use it to restrict COD for high-risk customers, specific pincodes or products. Supported conditions: Cart, Location, UTM, SKU, Customer Attribute and RTO Risk.

> [accordion] Add Extra Fees
>
> Adds an extra COD fee to the order total to recover handling costs. You can configure multiple cart value slabs, each with its own fee. Supported conditions: Cart, Location, UTM, SKU, Customer Attribute and RTO Risk.

> [accordion] Convert COD to Prepaid
>
> Nudges the customer to pay online after placing a COD order, using a discount sent over WhatsApp. Configure the discount value (flat or percentage), the minimum order value and the payment validity window. A WhatsApp message preview updates as you edit the configuration.
>
> > [!WARNING]
> >
> > **Watch Out!**
> >
> > **Convert COD to Prepaid** and **Partial COD** cannot run at the same time. If Partial COD is enabled, you are prompted to disable it before you can activate this workflow.

> [accordion] COD Transactions with OTP
>
> Adds OTP verification to COD orders. Once enabled, every COD order requires the customer to enter an OTP to confirm the order, regardless of customer, cart value, product or location. This workflow applies store-wide and does not use conditions.

> [accordion] Always Allow COD
>
> Always shows COD for selected customers, even if other rules, RTO risk or zone and pincode restrictions would normally block it. Add customers by email or phone number. This workflow has the highest priority and overrides all blocking rules.

## Next Steps

* [COD and RTO Settings](https://razorpay.com/docs/payments/cod-magic-checkout/shopify/cod)
* [Partial COD](https://razorpay.com/docs/payments/cod-magic-checkout/shopify/cod/partial-cod.md)
