ZeroRTO Docs v1.0.0
Main Website Pricing Plans Merchant Portal
India Payments • Instant UPI & Cards

Razorpay COD-to-Prepaid Setup Zero-Risk Delivery

Eliminate cash handling friction and convert risky Cash-on-Delivery (COD) orders into instant prepaid UPI transactions with automated discounts via Razorpay Payment Links API.

Razorpay Payment Links v1

Instant UPI, Google Pay, PhonePe, Paytm & Debit/Credit Cards

HMAC Verified payment_link.paid event

How COD-to-Prepaid Conversion Works

When a customer cannot pay in cash or requests re-delivery, ZeroRTO incentivizes instant digital payment:

1. Delivery Failed (COD) No cash / Door locked
2. Instant Discount Link Flat ₹50 OFF via UPI Link
3. Order Marked PREPAID Zero cash hassle / 100% Delivered

2. How to Retrieve Razorpay Key ID & Key Secret

You need your API Keys generated inside your Razorpay merchant dashboard:

1. Razorpay Key ID

Starts with rzp_live_... found under Account & Settings > API Keys.

2. Razorpay Key Secret

Your private API key secret generated alongside the Key ID to authenticate link creation requests.

  1. Log in to your Razorpay Dashboard.
  2. In the left sidebar, click Account & Settings > API Keys.
  3. Click Generate Key (or regenerate if you lost the secret).
  4. Copy both the Key ID and Key Secret.

3. Exactly Where to Paste in the ZeroRTO Plugin

Open your WordPress Admin > click ZeroRTO > open the COD to Prepaid tab:

WordPress Admin > ZeroRTO > COD to Prepaid Tab
Step 1: Enable Toggle
COD to Prepaid Conversion Engine
Step 2: Set Discount Value
50
Step 3: Select Razorpay
Razorpay (Selected) Active Gateway
Step 4: Paste Key ID
rzp_live_xxxxxxxxxxxxxxxx
Step 5: Paste Key Secret
••••••••••••••••
Step 6: Copy Webhook URL
Dedicated Razorpay Webhook Endpoint

Register this endpoint in Razorpay Dashboard > Settings > Webhooks:

https://yourstore.com/wp-json/rescuedrop/v1/payment-webhook/razorpay

4. Register Webhook in Razorpay Dashboard

Razorpay must notify your store immediately when a customer pays via UPI:

https://yourstore.com/wp-json/rescuedrop/v1/payment-webhook/razorpay
  1. In your Razorpay Dashboard, go to Account & Settings > Webhooks > Add New Webhook.
  2. In the Webhook URL field, paste your store's dedicated endpoint URL above.
  3. In the Secret field, enter your Razorpay Key Secret (or custom webhook secret).
  4. Under Active Events, check the box: payment_link.paid.
  5. Click Save Webhook.

5. Military-Grade HMAC-SHA256 Signature Verification

Financial Anti-Fraud Protection

ZeroRTO cryptographically verifies the X-Razorpay-Signature header on every incoming webhook using timing-attack-safe hash_equals(). No bad actor can fake a payment event to mark an order as paid without real funds entering your Razorpay bank account.