Zoho CRM + Instamojo: Payment Tracking for Indian D2C Brands

Amit Prabhu Amit Prabhu · Jun 12, 2026 · 11 min read #D2C #E-commerce #India
Zoho CRM + Instamojo: Payment Tracking for Indian D2C Brands

For Indian D2C brands selling directly to consumers, Zoho CRM + Instamojo integration closes the gap between payment collection and customer relationship management. When a buyer completes a payment on an Instamojo payment link, that transaction data should immediately update the corresponding CRM deal, trigger a fulfillment workflow, and fire a GST invoice — without manual intervention. This guide walks through the complete Zoho CRM Instamojo integration: webhook configuration, Deluge functions for deal updates, payment link generation from CRM, and post-payment automation.

payment gateway mobile india

How the Zoho CRM and Instamojo Integration Works

The integration connects two systems through Instamojo’s webhook notifications and the Zoho CRM REST API. The data flow operates in two directions:

Neither direction requires a third-party middleware tool. Both use native Zoho CRM functions and Instamojo’s REST API (version 2.0, available on Business accounts and above).

Prerequisites Before You Begin

Confirm the following before starting the configuration:

Step 1: Configure the Instamojo Webhook

Instamojo sends a POST request to your webhook URL whenever a payment request changes status. Here is how to set it up:

  1. Log in to your Instamojo dashboard and go to Settings > API & Plugins > Webhooks.
  2. Enter your webhook URL. This will be a Zoho CRM webhook listener URL. For now, use a temporary URL from a service like webhook.site to capture the payload structure first.
  3. Save and trigger a test payment (Instamojo provides a test mode). The captured payload will look like this:
{
  "payment_id": "MOJO2503005J01234567",
  "payment_request_id": "a1b2c3d4e5f6789012345678",
  "status": "Credit",
  "amount": "2999.00",
  "buyer": "rahul.sharma@example.com",
  "buyer_name": "Rahul Sharma",
  "buyer_phone": "+919876543210",
  "currency": "INR",
  "mac": "abc123def456..."
}

Note the mac field — this is an HMAC-SHA1 signature that you must verify before processing any webhook to prevent spoofed requests.

d2c ecommerce india brand

Step 2: Create the Webhook Receiver Function in Zoho CRM

In Zoho CRM, go to Setup > Developer Space > Functions and create a new standalone function. This function will receive Instamojo webhook calls.

First, expose it as a REST API endpoint via Setup > Developer Space > Rest API, then use that URL as your Instamojo webhook target.

Here is the Deluge function that processes the webhook, verifies the signature, and updates the matching Deal:

// Instamojo Webhook Receiver - Deluge Function
// Receives POST from Instamojo, verifies MAC, updates CRM Deal

payment_id = input.get("payment_id");
payment_request_id = input.get("payment_request_id");
status = input.get("status");
amount = input.get("amount");
buyer_email = input.get("buyer");
buyer_phone = input.get("buyer_phone");
received_mac = input.get("mac");

// Verify MAC signature (HMAC-SHA1 of pipe-separated values using private salt)
// Note: Deluge does not have native HMAC, so validate on a trusted server or skip in test mode
// In production, verify via a Zoho Creator intermediate function with Python support

if (status == "Credit")
{
  // Find matching Deal by email or phone
  deals = zoho.crm.searchRecords("Deals", "Email_Address:equals:" + buyer_email);

  if (deals.size() == 0)
  {
    // Try searching Contacts linked to Deals
    contacts = zoho.crm.searchRecords("Contacts", "Email:equals:" + buyer_email);
    if (contacts.size() > 0)
    {
      contact_id = contacts.get(0).get("id");
      deals = zoho.crm.searchRecords("Deals", "Contact_Name.id:equals:" + contact_id);
    }
  }

  if (deals.size() > 0)
  {
    deal = deals.get(0);
    deal_id = deal.get("id");

    update_map = map();
    update_map.put("Instamojo_Payment_ID", payment_id);
    update_map.put("Payment_Status", "Paid");
    update_map.put("Payment_Amount_INR", amount.toDecimal());
    update_map.put("Payment_Date", zoho.currentdate);
    update_map.put("Stage", "Closed Won");

    update_response = zoho.crm.updateRecord("Deals", deal_id, update_map);
    info "Deal updated: " + deal_id;

    // Trigger Zoho Books invoice creation (optional)
    // books_response = invokeurl [...];
  }
  else
  {
    info "No matching Deal found for email: " + buyer_email;
    // Optionally create a new Contact + Deal here
  }
}
return "OK";

Step 3: Generate Instamojo Payment Links from Zoho CRM

Add a custom button on the Deals detail view that generates a payment link and stores it on the record. Go to Setup > Customization > Modules > Deals > Links and Buttons and create a new button that calls the following function:

// Generate Instamojo Payment Link - Deluge Function
// Called from Deal record button

deal_id = input.Deal.ID;
deal = zoho.crm.getRecordById("Deals", deal_id);

deal_name = deal.get("Deal_Name");
amount = deal.get("Amount");
contact_name = deal.get("Contact_Name").get("name");

// Fetch Contact email
contact_id = deal.get("Contact_Name").get("id");
contact = zoho.crm.getRecordById("Contacts", contact_id);
buyer_email = contact.get("Email");
buyer_phone = contact.get("Mobile");

// Call Instamojo API to create payment request
api_key = "your_instamojo_api_key";
auth_token = "your_instamojo_auth_token";

payload = map();
payload.put("purpose", deal_name);
payload.put("amount", amount.toString());
payload.put("buyer_name", contact_name);
payload.put("email", buyer_email);
payload.put("phone", buyer_phone);
payload.put("send_email", "True");
payload.put("send_sms", "True");
payload.put("redirect_url", "https://yoursite.com/payment-success/");
payload.put("allow_repeated_payments", "False");

headers = map();
headers.put("X-Api-Key", api_key);
headers.put("X-Auth-Token", auth_token);

response = invokeurl
[
  url: "https://www.instamojo.com/api/1.1/payment-requests/"
  type: POST
  parameters: payload
  headers: headers
];

if (response.get("success") == true)
{
  payment_link = response.get("payment_request").get("longurl");
  payment_request_id = response.get("payment_request").get("id");

  update_map = map();
  update_map.put("Instamojo_Payment_Link", payment_link);
  update_map.put("Payment_Status", "Pending");
  zoho.crm.updateRecord("Deals", deal_id, update_map);

  return "Payment link created: " + payment_link;
}
else
{
  return "Error creating payment link: " + response.toString();
}

Step 4: Field Mapping Between Instamojo and Zoho CRM

Use this reference table when mapping Instamojo webhook fields to your Zoho CRM Deal and Contact fields:

Instamojo Webhook FieldZoho CRM TargetModuleNotes
payment_idInstamojo_Payment_IDDealsStore for reconciliation
payment_request_idCustom field (optional)DealsLinks back to payment request
status = “Credit”Stage = “Closed Won”DealsOnly on Credit status
amountPayment_Amount_INRDealsConvert string to decimal
buyerEmailContactsUsed to find matching record
buyer_phoneMobileContactsFallback match field
created_atPayment_DateDealsUse webhook timestamp

Step 5: Automate Post-Payment Workflows

Once the Deal updates to “Closed Won” via the webhook, configure these follow-on automations in Zoho CRM workflow rules:

Trigger a GST Invoice in Zoho Books

Add a workflow rule: when Deal Stage changes to “Closed Won” and Payment Status is “Paid”, call a Deluge function that creates a Zoho Books invoice via the Books API. Pull the line items from a custom Products subform on the Deal. The Books API endpoint is https://www.zohoapis.in/books/v3/invoices?organization_id={org_id}.

Send a Payment Confirmation via WhatsApp

Use Zoho CRM’s WhatsApp integration (or a Zoho Flow connector to a WhatsApp Business API provider) to send a confirmation message to the buyer’s mobile number stored in the Contact record. Include the payment amount and an order ID generated from the Deal ID.

Create a Fulfillment Task

Add a workflow action to create a Task assigned to the fulfillment team with subject “Fulfill order for [Deal Name]” and due date of the next business day. Tag it with the payment ID for tracking.

Handling Failed and Refunded Payments

Instamojo sends webhook events for failed payment attempts and refunds. Extend your receiver function to handle these cases:

if (status == "Failed")
{
  // Update Deal payment status
  update_map = map();
  update_map.put("Payment_Status", "Failed");
  zoho.crm.updateRecord("Deals", deal_id, update_map);

  // Create follow-up task
  task_map = map();
  task_map.put("Subject", "Follow up: failed payment for " + deal.get("Deal_Name"));
  task_map.put("Due_Date", zoho.currentdate.addBusinessDay(1));
  task_map.put("Status", "Not Started");
  task_map.put("What_Id", deal_id);
  zoho.crm.createRecord("Tasks", task_map);
}

if (status == "Refunded")
{
  update_map = map();
  update_map.put("Payment_Status", "Refunded");
  update_map.put("Stage", "Closed Lost");
  zoho.crm.updateRecord("Deals", deal_id, update_map);
}

Testing the Integration End to End

Before going live, run through this testing checklist:

  1. Test mode payments: Enable Instamojo test mode and complete a payment using test card details. Verify the webhook fires and your CRM Deal updates correctly.
  2. Email match test: Ensure the buyer email in the test payment matches a Contact email in your CRM. If no match is found, check your search logic and field names.
  3. Payment link generation: Click the custom button on a test Deal. Confirm the link appears in the CRM field. Open the link and verify it pre-fills the buyer details and amount correctly.
  4. Duplicate protection: Pay the same link twice (if repeated payments are enabled). Confirm your function handles duplicate payment_ids without creating duplicate records.
  5. Refund test: Initiate a refund from the Instamojo dashboard and verify the CRM Deal status updates to Refunded.

For a full overview of all available options, explore our complete guide to Zoho integrations.

Frequently Asked Questions

Can Zoho CRM receive Instamojo payment notifications automatically?

Yes. Instamojo supports webhook notifications for payment events. You configure a webhook URL in your Instamojo dashboard pointing to a Zoho CRM REST API function endpoint. When a payment completes, Instamojo sends a POST request with transaction details, which your Deluge function processes to update the relevant CRM Deal or Contact record automatically.

How do I generate Instamojo payment links from Zoho CRM?

Use a Zoho CRM custom button on the Deal detail view that calls a Deluge function. The function uses invokeurl to call the Instamojo API’s /payment-requests/ endpoint with the deal amount, buyer name, email, and redirect URL. The generated payment link is stored in a custom URL field on the Deal record and can be shared with the customer via email or WhatsApp from within CRM.

Does Instamojo support recurring or subscription payments?

Instamojo does not natively support recurring billing or subscription management. For recurring payments from Indian customers, consider Razorpay Subscriptions or Cashfree Subscriptions instead. Instamojo is best suited for one-time payment links and D2C checkout flows where a sales rep or automated workflow sends a payment request per order.

How do I handle GST invoicing after an Instamojo payment?

Configure a Zoho CRM workflow that triggers when a Deal stage changes to Closed Won and Payment Status is Paid. The workflow calls a Deluge function that creates a Zoho Books invoice via the Books API, pulling product details and buyer information from the CRM Deal. Zoho Books then generates a GST-compliant invoice with the correct HSN/SAC codes and tax rates, and emails it to the buyer automatically.

What Instamojo plan is needed for API access?

API access is available on Instamojo’s Business plan and above. The free Starter plan does not include API access or webhooks. Business plan pricing starts at approximately INR 499 per month plus transaction fees of 2% plus INR 3 per transaction for domestic payments. UPI payments attract a lower fee of 1.8% with no fixed charge.

Need help connecting Instamojo to Zoho CRM for your D2C brand? Aaxonix builds and maintains payment integrations for Indian businesses.

Talk to Our Team
Share this article LinkedIn Twitter / X
# D2C # E-commerce # India # Instamojo # Payment Gateway # Zoho CRM

Thinking about Zoho or NetSuite?

Our team builds systems that actually work. No fluff, just honest architecture and clean implementation.