API Security for UPI, PSP and Payment Companies

API Security for UPI PSP and payment companies guide

Payment APIs connect customers, apps, PSPs, banks and payment networks in real time, making every integration a potential security boundary. This guide explains the API risks payment companies need to control, the safeguards RBI expects and how to test payment flows without overlooking authorisation, transaction logic or third-party exposure.

TL;DR

API security for UPI, PSP and payment companies protects the interfaces that initiate payments, authenticate participants, retrieve account information, process callbacks and reconcile transactions. Strong API security requires more than an API key: every request needs verified identity, precise authorisation, message integrity, encryption, replay protection, abuse controls and traceable logs.

The exact regulatory obligation depends on the organisation’s role. Banks and other covered regulated entities follow RBI’s Digital Payment Security Controls; authorised non-bank Payment System Operators follow RBI’s cyber-resilience directions; PSP banks and TPAPs also operate within NPCI’s UPI ecosystem requirements and contractual controls.

Why payment API security is different

A normal API may expose data or trigger a business action. A payment API can do both while moving money in seconds. In a UPI transaction, multiple systems may participate in initiation, authentication, routing, approval, settlement, notification and reconciliation. Security must survive every handoff.

The highest-risk failures are often not classic injection attacks. They are broken authorisation, replayed requests, modified amounts, forged callbacks, weak partner credentials, missing idempotency, excessive data exposure and business-logic gaps that let a technically valid request produce an unauthorised outcome.

Know which payment role you occupy

“UPI company,” “PSP” and “payment company” are not interchangeable legal categories. Security ownership depends on whether the organisation is a bank, PSP bank, Third-Party Application Provider (TPAP), authorised non-bank PSO, payment aggregator, gateway, merchant or technology vendor.

RoleSecurity responsibilityWhy the distinction matters
PSP bankConnects to UPI and provides payment services within the regulated banking environment.RBI banking and digital-payment security controls apply directly.
TPAPProvides the customer-facing UPI application through a PSP bank.Must meet applicable NPCI, PSP-bank and contractual security requirements; the partner bank retains oversight.
Non-bank PSOOperates an RBI-authorised payment system.RBI’s non-bank PSO cyber-resilience and payment-security directions apply directly.
Payment gateway or vendorProvides technology or processing connections without necessarily being the regulated operator.May be contractually required to meet the regulated entity’s controls even when not directly regulated under the same direction.
MerchantInitiates or receives payments through integrations.Must secure its credentials, callbacks, applications and customer-data handling.
Compliance starting point: document your role, authorisation status, partner relationships, data handled and exact API responsibility. Then map each applicable RBI, NPCI, CERT-In, privacy and contractual requirement to a named control owner.

The API risks that matter most in UPI and payments

RiskPayment impactSecurity test
Broken object authorisationOne user accesses another customer’s payment, VPA or account-linked information.Change resource identifiers across users, roles and partners.
Broken function authorisationA low-privilege client invokes administrative, refund or settlement functions.Call privileged endpoints using every lower-trust role.
Replay and duplicationA captured or retried request creates repeated financial effects.Resubmit requests, signatures and callbacks across time windows.
Message tamperingAmount, payee, status or reference data changes in transit or between services.Modify signed and unsigned fields and verify server-side validation.
Credential compromiseA leaked API key or certificate permits unauthorised partner activity.Review secret storage, rotation, scope, mTLS and revocation.
API abuseEnumeration, bot activity or transaction flooding causes fraud or service failure.Test rate limits by identity, endpoint, device, partner and transaction risk.
Forged callbackA merchant accepts a false success response or incorrect transaction state.Spoof callback origins, signatures, sequence and status transitions.

Essential controls for secure payment APIs

  • Strong workload identity: authenticate the calling application or partner using appropriately managed certificates, signed tokens or comparable cryptographic mechanisms.
  • Fine-grained authorisation: validate the actor, resource, action, transaction context and partner scope on the server for every request.
  • Confidentiality and integrity: use current TLS configurations and protect message integrity where the transaction design requires signed payloads.
  • Replay protection: enforce timestamps, nonces, short validity windows, unique transaction references and idempotency controls.
  • Strict input and schema validation: allow only expected fields, types, values and state transitions. Reject ambiguous, duplicate or out-of-sequence requests.
  • Abuse and availability controls: apply context-aware rate limiting, bot detection, WAF/API protection, DDoS controls and graceful resource limits.
  • Safe error handling: do not expose stack traces, credentials, internal routes, account details or security-decision logic.
  • Traceable logging: record the caller, action, transaction reference, outcome and relevant risk signals while masking PINs, credentials and sensitive payment data.
  • Inventory and lifecycle governance: maintain owners, versions, consumers and data classifications; retire shadow, stale and deprecated APIs.

What RBI expects from payment API security

For authorised non-bank PSOs, RBI’s Cyber Resilience and Digital Payment Security Controls directions expressly require API measures addressing authentication and authorisation, confidentiality, integrity, availability and threat protection. PSOs must also follow relevant standards and globally recognised API-security frameworks.

The same directions connect API security to secure development, annual authenticated security testing by qualified professionals, time-bound remediation, vendor risk, encryption, incident response, audit logging and real-time or near-real-time fraud monitoring. Implementation is phased by PSO size, so teams should verify the date applicable to their classification rather than presenting one deadline as universal.

For scheduled commercial banks, small finance banks, payments banks and credit-card issuing NBFCs, RBI’s Digital Payment Security Controls require secure-by-design application development, correct implementation of APIs for storage and communication, source-code review, vulnerability assessment and penetration testing, WAF and DDoS protection, logging, monitoring and strong authentication.

Third parties do not remove accountability: RBI expects regulated entities and PSOs to govern risks created by vendors, gateways and other ecosystem participants. Contracts should define control requirements, evidence, incident escalation, testing rights and remediation timelines.

How to test UPI and payment APIs

Start with authenticated, role-aware testing. Public unauthenticated scans cannot validate transaction authorisation, partner isolation, callbacks or business logic. Use dedicated test accounts and approved environments, with clear rules preventing real customer impact.

  1. Map the API estate: endpoints, versions, owners, partners, data and transaction functions.
  2. Model payment threats: trace initiation, authentication, approval, callback, reversal, refund and reconciliation paths.
  3. Review authentication: certificates, tokens, key rotation, expiry, revocation and partner onboarding.
  4. Test authorisation: cross-user, cross-merchant, cross-partner and privilege boundaries.
  5. Attack transaction logic safely: replay, duplication, altered amounts, invalid states and race conditions.
  6. Validate resilience: rate limits, resource exhaustion, fail-safe behaviour and dependency failures.
  7. Retest closure: verify fixes and record evidence tied to the affected endpoint and release.

See Osto’s guides to types of VAPT, the VAPT process and reading a pentest report for the testing workflow behind these controls.

Payment API security checklist

  • Maintain a complete API and partner inventory with owners and data classification.
  • Authenticate both users and communicating applications where applicable.
  • Enforce object-, function- and transaction-level authorisation server-side.
  • Protect transport, message integrity, credentials, keys and certificates.
  • Prevent replay, duplicate processing and out-of-order state changes.
  • Validate every request and callback against a strict schema and expected origin.
  • Apply WAF/API protection, rate limits, DDoS mitigation and anomaly detection.
  • Mask sensitive payment data in logs, errors and monitoring tools.
  • Test source code, APIs and infrastructure before release and after material changes.
  • Track findings to time-bound remediation, retesting and governance reporting.

How Osto helps payment companies secure APIs

Osto is a one-stop platform for cybersecurity and compliance. Its Web API Protection discovers and protects APIs, while continuous scanning, SAST, cloud posture monitoring and expert-led VAPT help payment teams find weaknesses across code, applications, APIs and infrastructure.

Security findings, remediation and compliance evidence stay connected instead of being split across separate vendors. For growing PSPs and payment companies, that unified operating model is why Osto is becoming the default for cybersecurity and compliance.

Protect every payment API.

Discover APIs, stop abuse, test business logic and track remediation with Osto’s unified security and compliance platform.

Book a Demo →

Frequently asked questions

What is API security for UPI?

It is the set of controls protecting the interfaces used across UPI apps and participants. It covers application identity, user and partner authorisation, encryption, message integrity, replay prevention, availability, logging, fraud signals and secure testing.

Are PSP banks and TPAPs the same?

No. A PSP bank connects to and participates in UPI as a regulated bank. A TPAP provides a UPI application through a PSP bank. Their direct regulatory position and contractual responsibilities differ, even though both contribute to the security of the same payment journey.

Which RBI rules cover payment API security?

Applicable rules depend on the entity. RBI’s Digital Payment Security Controls cover specified banks and credit-card issuing NBFCs. The Cyber Resilience and Digital Payment Security Controls directions cover authorised non-bank PSOs and include an express API-security section.

Is an API gateway enough to secure payment APIs?

No. A gateway can enforce authentication, traffic policies and some threat controls, but it cannot by itself fix broken business authorisation, unsafe transaction states, leaked secrets, insecure callbacks or weaknesses inside application code.

How often should payment APIs undergo security testing?

The applicable regulatory direction and entity classification determine the minimum. Testing should also occur before critical deployment, after material changes and after relevant incidents. Continuous scanning helps between formal expert-led assessments.

What is the biggest API risk for payment companies?

Broken authorisation and transaction-logic abuse are among the most consequential because a request may be technically valid but initiated by the wrong actor, against the wrong resource, or in an invalid transaction state.

Authoritative references