Setup steps

  1. In Cashfree, open Developers → API Keys and copy the Payment Gateway client id and secret.
  2. In ProductLense, open Settings → Billing connections → Cashfree, paste them and set the mode.
  3. In Cashfree Merchant Dashboard → Developers → Webhooks, add a webhook endpoint with the URL ProductLense shows after you save the connection (pattern https://api.productlense.app/api/webhooks/{provider}/{connection_id}).
  4. Subscribe to the payment, refund and subscription events listed below, including Success Payment TDR so fees arrive the next day.
  5. ProductLense backfills 12 months from the reconciliation ledger. INR amounts are converted to USD at the ECB daily rate and kept in INR too.

Credentials and permissions

Credentials ProductLense asks for
FieldSecretWhere to find it
Client IDNoCashfree Merchant Dashboard → Developers → API Keys (Payment Gateway).
Client secretYes, encrypted at restThe secret paired with the client id. Cashfree also signs webhooks with it, so there is no separate webhook secret.
ModeNoproduction or sandbox.

Webhook

URL pattern, shown with your connection id after you save:

text
https://api.productlense.app/api/webhooks/cashfree/{connection_id}

Events: PAYMENT_SUCCESS_WEBHOOK, PAYMENT_FAILED_WEBHOOK, PAYMENT_USER_DROPPED_WEBHOOK, PAYMENT_CHARGES_WEBHOOK, REFUND_STATUS_WEBHOOK, SUBSCRIPTION_STATUS_CHANGED, SUBSCRIPTION_PAYMENT_SUCCESS, SUBSCRIPTION_PAYMENT_FAILED, SUBSCRIPTION_REFUND_STATUS

Verification: x-webhook-signature header: base64 HMAC-SHA256 of x-webhook-timestamp plus the raw body under your client secret; deliveries older than five minutes are refused.

What ProductLense reads

Customers
The customer on each order: your customer_id, else email, else phone.
Subscriptions
Subscriptions from subscription webhooks, with plan amount and interval. Cashfree has no API that lists them, so they start with the first event after you connect.
Payments
Successful payments as revenue; failed and dropped attempts are kept as failed.
Refunds
Refunds and chargebacks.
Fees
Exact: the service charge (TDR) plus GST on each payment, from the reconciliation ledger and the charges webhook.

What ProductLense never touches

  • Never creates, changes, refunds or cancels anything: read-only API calls and incoming webhooks only.
  • Never moves money, issues payouts, or reads bank account details.
  • Never sees full card numbers; providers do not expose them.
  • Never sends your customer data to the AI model: Ask and the daily insight see aggregates only.

Match payments to your users

Put pl_user_id or pl_visitor_id in order_tags when you create the order so revenue matches the visitor by id rather than email.

server: create the Cashfree order
await fetch('https://api.cashfree.com/pg/orders', {
  method: 'POST',
  headers: {
    'x-client-id': process.env.CASHFREE_CLIENT_ID ?? '',
    'x-client-secret': process.env.CASHFREE_CLIENT_SECRET ?? '',
    'x-api-version': '2025-01-01',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    order_amount: 2499,
    order_currency: 'INR',
    customer_details: { customer_id: user.id, customer_email: user.email, customer_phone: user.phone },
    order_tags: { pl_user_id: user.id, pl_visitor_id: visitorId },
  }),
});

Cashfree and ProductLense: questions

Does ProductLense work with Cashfree?
Yes. ProductLense connects to Cashfree with client ID, client secret, mode, backfills 12 months of history, and stays current through signed webhooks plus a nightly reconcile. One connection is included on Starter; Growth and Scale allow every provider at once on the same site.
What data does ProductLense read from Cashfree?
Customers, subscriptions, payments, refunds and fees, read-only. Payments: successful payments as revenue; failed and dropped attempts are kept as failed. Refunds: refunds and chargebacks. Fees: exact: the service charge (TDR) plus GST on each payment, from the reconciliation ledger and the charges webhook.
Can ProductLense change anything in my Cashfree account?
No. ProductLense only makes read calls and receives webhooks. It never creates, changes, refunds or cancels anything, never moves money, and never sees card numbers. Credentials are encrypted at rest, and the AI features only ever see aggregated numbers, never your customers’ data.
How does ProductLense match Cashfree payments to visitors?
Put pl_user_id or pl_visitor_id in order_tags when you create the order so revenue matches the visitor by id rather than email. Your site calls identify with the same user id after signup, and ProductLense follows the payment to that visitor’s first touch: source, medium, campaign and landing page.
Are Cashfree fees subtracted from revenue?
Exact: the service charge (TDR) plus GST on each payment, from the reconciliation ledger and the charges webhook. Net revenue is the charge minus the fee; refunds subtract the refunded amount and its fee. Profit per channel then subtracts ad spend.

Connect Cashfree and see revenue by channel today.

Add the script, connect Stripe or any of 14 other billing providers, and see revenue by channel the same day.