Skip to main content
Razorpay → AppsFlyerIntegration guide

Connecting Razorpay to AppsFlyer

Razorpay is Indian payments, where UPI dominates and the flow moves through a separate app on the customer's phone. AppsFlyer exists because mobile app attribution is a different problem from web attribution, and on iOS a large share of it is now aggregated and delayed by design rather than by accident. The join between them succeeds or fails on one thing: whether the AppsFlyer device identifier, appsflyer_id reaches the Razorpay payment before the conversion happens, because AppsFlyer can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Razorpay in-app payments to AppsFlyer without losing UPI purchases

Android can kill your app during a UPI handoff, so the AppsFlyer SDK af_purchase never fires. Write the device's appsflyer_id into the Razorpay order notes, and on payment.captured post the purchase to AppsFlyer's server-to-server events API with revenue converted from paise and currency INR. Pick one purchase source, SDK or server, to avoid double counting.

In an Android app, Razorpay's checkout hands UPI payments to the banking app through an intent and waits for the result. On low-memory phones the OS can kill your app while the customer is in PhonePe, so the success callback that would log af_purchase from the AppsFlyer SDK never runs. The payment is captured; AppsFlyer, and every ad network it postbacks to, sees nothing.

Send the purchase server-side instead. When your app asks your server to create the Razorpay order, include the device's appsflyer_id and write it into the order notes; when payment.captured arrives, post the purchase to AppsFlyer's server-to-server events API with that ID, revenue converted from paise to rupees and the currency set to INR. If you keep the SDK event as well, you will double-count, because AppsFlyer treats SDK and server events as separate unless you deduplicate them, so pick one source for purchase. Razorpay revenue also sits outside Google Play and App Store receipt validation, so AppsFlyer's purchase validation does not apply to it.

For refunds, check how your AppsFlyer setup handles negative revenue before sending refund.processed as a reversal. If most of your Razorpay sales happen on mobile web rather than in the app, this pair is the wrong place to send them.

Razorpay → AppsFlyer · what breaks

Why this join usually fails — Razorpay → AppsFlyer

  1. 01

    The AppsFlyer device identifier, appsflyer_id never reaches Razorpay

    UPI sends the customer into a banking app to approve, and on mobile that app switch frequently ends the browser session. The payment completes and the browser that started it may never come back to fire anything.

  2. 02

    UPI app switching ends the browser session

    The customer leaves the browser for a banking app to approve, and on many devices does not return. Payment succeeds, page never fires — and UPI is the majority method in this market.

  3. 03

    Web conversions sent to a mobile attribution platform

    This is the common error and it produces confident nonsense. A purchase made on your website has no device identifier and no install behind it. AppsFlyer will either discard it or attribute it to nothing, and the revenue disappears somewhere between the two systems without anyone noticing it went.

  4. 04

    Nothing reconciles afterwards

    AppsFlyer shows the event on the raw data export with its attributed media source. Check the raw export, not the aggregate dashboard, and confirm the event carries a device identifier rather than landing as organic.

Razorpay → AppsFlyer · the fix

What working looks like — Razorpay → AppsFlyer

  • The AppsFlyer device identifier, appsflyer_id on every payment

  • Conversions arriving in AppsFlyer

    The event is attributed to the install source, forwarded to whichever networks are configured, and appears in the cohort reporting.

  • Reconciled against the source

Razorpay → AppsFlyer · architecture

How Razorpay and AppsFlyer actually connect

  1. 1

    Razorpay holds the truth

    Razorpay separates authorised and captured. Auto-capture is common but not universal, and reporting on authorised inflates the figure by whatever fails to capture.

  2. 2

    AppsFlyer needs a click to match

    AppsFlyer needs the device identifier and an event name it recognizes, plus the revenue value for in-app purchases. A server event about a user with no linked device cannot be attributed to an install.

  3. 3

    The identifier is the bridge

    The AppsFlyer device identifier, appsflyer_id, captured at the visit and carried into the Razorpay payment.

  4. 4

    The event source decides reliability

    Fire on captured. The app-switch behaviour of UPI makes any browser-based trigger unreliable in a way that is much more pronounced here than on card markets.

  5. 5

    Deduplication at the destination

    AppsFlyer deduplicates in-app events by its own event identifier. Sending the same purchase from both the SDK and your server produces two events and double-counts revenue in every dashboard downstream, including the ad networks AppsFlyer forwards to.

Razorpay → AppsFlyer · normal or broken

Working vs. broken, side by side — Razorpay → AppsFlyer

Normal, not a fault

  • The AppsFlyer device identifier, appsflyer_id present on the payment

  • Sent from the Razorpay payment.captured webhook

  • Deduplicated correctly

    AppsFlyer deduplicates in-app events by its own event identifier. Sending the same purchase from both the SDK and your server produces two events and double-counts revenue in every dashboard downstream, including the ad networks AppsFlyer forwards to.

  • Reconciles with the source

Actually broken

  • The AppsFlyer device identifier, appsflyer_id missing on most records

    UPI sends the customer into a banking app to approve, and on mobile that app switch frequently ends the browser session. The payment completes and the browser that started it may never come back to fire anything.

  • Sent from the browser

    The customer leaves the browser for a banking app to approve, and on many devices does not return. Payment succeeds, page never fires — and UPI is the majority method in this market.

  • Counted twice, or not at all

    This is the common error and it produces confident nonsense. A purchase made on your website has no device identifier and no install behind it. AppsFlyer will either discard it or attribute it to nothing, and the revenue disappears somewhere between the two systems without anyone noticing it went.

  • Nobody has reconciled it

Razorpay → AppsFlyer · diagnose

Diagnostic order — Razorpay → AppsFlyer

  1. 01

    Count payments carrying the AppsFlyer device identifier, appsflyer_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Compare captured payments against confirmation-page loads on mobile

    Split by payment method. The UPI gap will be much larger than the card gap.

  4. 04

    Check what share of your revenue happens in the app at all

    If most purchases are on the web, AppsFlyer is not your conversion destination and the work belongs somewhere else entirely.

  5. 05

    Read the match rate, not the success message

    AppsFlyer shows the event on the raw data export with its attributed media source. Check the raw export, not the aggregate dashboard, and confirm the event carries a device identifier rather than landing as organic.

Razorpay → AppsFlyer · prove

How it gets proven — Razorpay → AppsFlyer

Source of truth

Razorpay's captured payments by date, net of refunds.

  • The AppsFlyer device identifier, appsflyer_id confirmed present on a live payment.
  • In-app revenue events reconciled per transaction against your billing system, with the organic share stated rather than assumed away.
  • A UPI payment approved in the banking app without returning to the site, confirmed to report.

Razorpay → AppsFlyer · free audit

What we check in the free audit

  • Count payments carrying the AppsFlyer device identifier, appsflyer_id
  • Follow one real conversion end to end
  • Compare captured payments against confirmation-page loads on mobile
  • Check what share of your revenue happens in the app at all
  • Read the match rate, not the success message

Checked against

Razorpay's captured payments by date, net of refunds.

Get my free conversion tracking audit

Free30 minutesNo obligation

Razorpay → AppsFlyer · when not to buy

When you don't need this — Razorpay → AppsFlyer

  • Measure identifier coverage yourself first — pull your last hundred payments and count how many carry the AppsFlyer device identifier, appsflyer_id.
  • If your Razorpay volume is card-only, the app-switch problem largely disappears.
  • If you have no mobile app, this is not a destination for you. If you have one but sell mostly on the web, send web conversions to your ad platforms directly and use AppsFlyer only for install and in-app events.

Razorpay → AppsFlyer · what we deliver

What gets built — Razorpay → AppsFlyer

  • Identifier capture into Razorpay

    Pass the click identifier into the Razorpay order's notes when your server creates the order. Notes survive to the payment and to the webhook regardless of what the browser did.

  • Event source: the Razorpay payment.captured webhook

    Fire on captured. The app-switch behaviour of UPI makes any browser-based trigger unreliable in a way that is much more pronounced here than on card markets.

  • Dispatch to AppsFlyer

    The AppsFlyer server-to-server events API, posted from your billing system with the device identifier and revenue.

  • Reversals where they exist

    Refunds are exposed and carry the original notes.

Written guarantee

95%+ tracking accuracy

Measured against Razorpay's captured payments by date, net of refunds.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Razorpay → AppsFlyer questions, answered

The app is often closed by the OS while the customer approves in the UPI app, so the SDK success callback never fires. Send the purchase from the payment.captured webhook with the appsflyer_id stored in the order notes.

Free · 30 min

Get Razorpay and AppsFlyer joined properly

Free30 minutesNo obligation