Payment Gateway Transactions' Exploratory Data Analysis

The exercise

mCom is a fictitious eCommerce application. Like most eCommerce platforms, it has a catalog of products and a bunch of merchants. Buyers select products they wish to purchase and the sellers service those purchases.

mCom is integrated with multiple payment gateways. It uses a third party PG aggregator (like JusPay) to route each incoming transaction to one of the payment gateways. In order to make a payment, the user can select any of the available payment modes such as a credit card, netbanking, UPI etc.

The file below is a sample of 50,000 transactions over a period of time. The brief was to analyse it, pull out whatever insights were there, and make recommendations off the back of them.

Download the raw transactions data (CSV, 4.8 MB)

Download the cleaned workbook (XLSX, 4.1 MB)

Data cleanup and sanity checks

On doing a data cleanup and on conducting data sanity checks, we identify that the data is mostly clean and has no major anomaly outliers.

Trends and observations

Here is how transaction volume splits across payment modes and payment gateways. UPI is 62% of everything.

Transaction volume split by payment gateway and payment mode, with UPI at 62% of all transactions

Overall payment success rate stays flat at around 80% across the whole period.

Weekly overall payment success rate, flat around 81.5% from week 2023-30 to week 2024-27

The average hides the interesting part. Success rate by payment mode is not remotely even:

Mode of paymentStart of trendlineEnd of trendlineDifference
UPI96.195.9-0.2
Credit Card78.881.22.4
Wallet45.951.85.8
Debit Card47.947.2-0.7
Net Banking47.447.2-0.2

UPI clears 95% of the time. Debit cards and netbanking sit at 47%, and they are not improving. Credit cards and wallets are the only two modes trending up.

Within UPI, PhonePe and Razorpay are noticeably better than the rest:

Payment gatewayStart valueEnd valueDifference
Razorpay99.2799.580.30
PhonePe98.9799.220.26
Amazon Pay95.1995.220.03
Paytm95.4095.03-0.37
Google Pay95.5495.03-0.51

And within credit cards the ranking is different again, with Google Pay and Paytm improving fastest while Razorpay drops nearly five points:

Payment gatewayStart valueEnd valueDifference
Google Pay75.6880.474.79
Paytm75.1879.754.58
Amazon Pay77.0379.021.99
PhonePe90.6288.09-2.53
Razorpay93.5488.63-4.90

Recommendations

  1. Prioritise UPI as a payment mode over the others.
  2. Within UPI, push more load to PhonePe and Razorpay, because the success rate is better there.
  3. If the user is going to pay by credit card, route that transaction to Google Pay or PhonePe.

To actually achieve this:

  • Put UPI first in the payment journey rather than leaving it as one option among many.
  • If the user picks something else, either redirect them to UPI or at least tell them success rates are lower on that channel.
  • Gamify UPI with cashbacks.
  • For credit cards, pre-fill as much customer data as possible.

How Swiggy already does this

Swiggy follows almost exactly this set of guidelines in its own payment journey, so it is worth walking through.

Because the user has previously paid by UPI, Swiggy has already selected UPI as the default on the final pre-payment page.

Swiggy checkout with UPI preselected as the default payment option

On clicking Apply Coupons, Swiggy shows a long list of discounts and cashbacks for UPI as well as other modes, which gamifies the choice of payment mode.

Swiggy coupon list showing cashback offers tied to UPI payments

If the user does choose to change payment mode, the list that appears is ordered deliberately. Swiggy has its own UPI licence, so that goes on top to reduce reliance on other UPI apps. After that come specific UPI apps, Google Pay first and then Paytm UPI. This flow suits someone who has been paying by UPI all along.

Swiggy payment mode list with Swiggy's own UPI option placed first

Other UPI options are still highlighted before anything else appears. Only at the end do debit and credit cards, wallets and cash on delivery show up. For a new user with no payment history, putting Add New UPI ID at the top is the right default.

Swiggy payment screen showing cards, wallets and other options listed last

Two more rules fall out of this. If the user has consistently paid through some other mode, that mode should be their preferred option instead of UPI. And on a failed transaction, nudge the user towards an alternate mode rather than letting them retry into the same wall.

Dead ends I explored

Worth writing down the things that did not go anywhere, because I spent time on them:

  • No strong correlation between transaction amount and payment mode, or between transaction amount and success rate.
  • No strong correlation between location ID, user ID or merchant ID and either payment mode preference or success rate.
  • No real repeat purchase behaviour. Very few users place repeat orders, and the average order value of a repeat purchase is about the same as the first one.