Contextual Payments API specs
Written by: Avdhoot Kajarekar (UPI Product)
Version: V1.5
Date: 13th Aug 2024
Note: Changes from V1.4 are marked in yellow.
Table of Contents
Get Context API ....................................................................................................................... 2
1. Request Context API ..................................................................................................................... 2
2. Response Context API ................................................................................................................... 4
API changes ............................................................................................................................ 5
Request Pay API (Payer PSP to UPI Switch) ......................................................................................... 5
Request Auth Details – ReqAuthDetails (UPI Switch to Payee PSP) ...................................................... 6
Response Auth Details (Payee PSP to UPI Switch) .............................................................................. 6
Get Context API
These are the new set of APIs which shall get the respective context from acquirer (Phase 1) and pass
it to Payer PSP to display to the user.
1. Request Context API
<upi:ReqGetContext xmlns:upi="http://npci.org/upi/schema/">
<Head ver="1.0" contextVer=“” ts="" orgId="" msgId="" />
<Txn id=“AXB12345568643” note=“EMI” custRef=“” refId="" refUrl="" ts=“Timestamp” expiry=“”
refCategory=“” contextType=“USERINIT|MERCHANTINIT” subType=“ISSUER|ACQUIRER"
orgTxnDate=“” purpose=“” initiationMode=“00|01|02...” />
<Amount value=“” curr=“”>
<Context>
<Context ctxtCode=“” attribute= “” prodCode= “”/>
<Context ctxtCode=“” attribute= “” prodCode= “”/>
</Context>
<Payer addr=“” name =“” seqNum = “” type=“PERSON|ENTITY” code=“”>
<Indices>
<Index index = “01” participantName=“ICICI” IFSC = “ICI12345” accType = “CREDIT” bin =
“6543112000” accRefNum= “” />
<Index index = “02” participantName = “HDFC” IFSC = “HDFC12345” AccType = “SAVINGS” bin
= “” accRefNum= “” />
</Indices>
<Consent>
<Consent name=“mobNum” value=“+918149312774”>
<Consent name=“” value=“”>
</Consent>
<Scores>
<Scores provider= “” name = “” value = “”/>
<Scores provider= “” name = “” value = “”/>
</Scores>
<Biller billerId = "" custId = "" >
<Device>
<Tag name=“MOBILE” value=“”/>
<Tag name="GEOCODE" value=""/>
<Tag name="LOCATION" value="" />
<Tag name=“TIER” value=“”/>
<Tag name="IP" value=""/>
<Tag name="TYPE" value=""/>
<Tag name="ID" value=""/>
<Tag name="OS" value=""/>
<Tag name="APP" value=""/>
<Tag name="CAPABILITY" value=""/>
<Tag name="TELECOM" value="Airtel/Vodafone/..."/>
</Device>
</Payer>
<Ticket>
<Ticket category=“” start=“” end=“” startTime=“” endTime=”” tickType=“” tickId=“” tickNote=/>
<TicketRef tickId=”” tickRef=”” name=”” value=””/>
</Ticket>
<Payee addr=“” name =“” seqNum = “” type=“PERSON|ENTITY” code=“”>
<Merchant>
<Identifier subCode = “” mid=“” sid =“” tid=“” merchantType =“SMALL|LARGE”
merchantGenre=“OFFLINE|ONLINE” onBoardingType=“BANK|AGGREGATOR” Aggregator=“”
verified=“Y/N” />
<Name brand=“” legal=“” franchise=“”>
<Ownership type=“PROPRIETARY|PARTNERSHIP|PRIVATE|PUBLIC|OTHERS”/>
</Merchant>
</Payee>
</upi:ReqGetContext>
2. Response Context API
<upi:RespGetContext xmlns:upi="http://npci.org/upi/schema/">
<Head ver="1.0" contextVer=“” ts="" orgId="" msgId=""/>
<Txn id=“AXB12345568643” note=“EMI” custref=“” refId="" refUrl="" ts=“Timestamp” expiry=“”
refCategory=“” type=“USERINIT|MERCHANTINIT” subType=“ISSUER|ACQUIRER"
orgTxnDate=“” purpose=“” initmode=“00|01|02...” />
<Resp reqMsgId=“” result=“SUCCESS|FAILURE” errCode=“” respCode=“”/>
<Payee addr=“” name =“” seqNum = “” type=“PERSON|ENTITY” code=“”
accType=“CURRENT|SAVINGS…” IIN=“”>
<Merchant>
<Identifier subCode = “” mid=“” sid =“” tid=“” merchantType =“SMALL|LARGE”
merchantGenre=“OFFLINE|ONLINE” onBoardingType=“BANK|AGGREGATOR” Aggregator=“”
verified=“Y/N” />
<Name brand=“” legal=“” franchise=“”>
<Ownership type=“PROPRIETARY|PARTNERSHIP|PRIVATE|PUBLIC|OTHERS”/>
<Details name=”” value=””>
</Merchant>
<FeatureSupported value=”01|02|03|04|05|06|07|08|09” />
<Device>
<Tag name=“MOBILE” value=“”/>
<Tag name="GEOCODE" value=""/>
<Tag name="LOCATION" value="" />
<Tag name=“TIER” value=“”/>
<Tag name="IP" value=""/>
<Tag name="TYPE" value=""/>
<Tag name="ID" value=""/>
<Tag name="OS" value=""/>
<Tag name="APP" value=""/>
<Tag name="CAPABILITY" value=""/>
<Tag name="TELECOM" value="Airtel/Vodafone/..."/>
</Device>
</Payee>
<Index>
<Index index = “01” accAccp=“Y/N/P” conFee=“” pa= “”>
<Index index = “02” accAccp=“Y/N/P” conFee=“” pa= “”>
</Index>
<Context>
<EMIs>
<EMI index= “” name= “” tnC= “” prodName= “” prodCode= “” amount = “” note = “” pa = “” >
<EMIDetails seqNum = “” offerId = “” tenure = “” intRatePct = “” intRateAmt= “” procFee = “”
otherFee = “” totalAmt = “” discAmt = “” EMIAmt = “”/>
<EMIDetails seqNum = “” offerId = “” tenure = “” intRatePct = “” intRateAmt= “” procFee = “”
otherFee = “” totalAmt = “” discAmt = “” EMIAmt = “”/>
<EMIDetails seqNum = “” offerId = “” tenure = “” intRatePct = “” intRateAmt= “” procFee = “”
otherFee = “” totalAmt = “” discAmt = “” EMIAmt = “”/>
</EMI>
</EMIs>
<Offer>
<Offer index = “” offerId= “” name = “” category = “” desc = “” upAm = “” text=“” pa = “”/>
<Offer index = “” offerId= “” name = “” category = “” desc = “” upAm = “” text=“” pa= “” />
</Offer>
<Lounge>
<Lounge index = “” offerId= “” loungeNos = “” loungeAm = “” note = “” pa= “” />
<Lounge index = “” offerId= “” loungeNos = “” loungeAm = “” note = “” pa= “” />
</Lounge>
<Membership>
<Membership memNo = “” memId = “” memName = “” note=“” >
<Benefit offerId= “” type=“” value=“” upAm=“” note = “”>
</Membership>
<Ticket>
<TicketAmount offerId= “” start=“” end=“’ time=“” expiry=“” ticketId=“” am=“”>
</Ticket>
<Bill>
<Bill billerName=“” custId=“” am=“”>
</Bill>
</Context>
</upi:RespGetContext>
Note: if Index is populated as “00” means the respective context is applicable for all accounts
provided in ReqGetContext.
API changes
Changes in existing APIs to ensure affiliation in Contextual API and Financial APIs as below. The
changes in respective APIs are marked in Yellow.
We shall be using the <Meta> tag (ennumerable tag) to facilitate the affiliation.
Request Pay API (Payer PSP to UPI Switch)
<upi:ReqPay xmlns:upi="http://npci.org/upi/schema/">
<Head ver="1.0|2.0" ts="" orgId="" msgId=""/>
<Meta> //Meta Tag is already present in ReqPay API
<Tag name="ctxtCode" value=""/>
<Tag name="offerId" value=""/>
<Tag name="prodCode" value=""/>
</Meta>
…Remaining part same as existing ReqPay API.
Request Auth Details – ReqAuthDetails (UPI Switch to Payee PSP)
<upi:ReqAuthDetails xmlns:upi="http://npci.org/upi/schema/">
<Head ver="1.0|2.0" ts="" orgId="NPCI" msgId=""/>
<Meta> //Meta Tag shall be added in ReqAuthDetails API
<Tag name="ctxtCode" value=""/>
<Tag name="offerId" value=""/>
<Tag name="prodCode" value=""/>
</Meta>
…Remaining part same as existing ReqAuthDetails API.
Response Auth Details (Payee PSP to UPI Switch)
<upi:RespAuthDetails xmlns:upi="http://npci.org/upi/schema/">
<Head ver="1.0|2.0" ts="" orgId="" msgId=""/>
<Meta> //Meta Tag shall be added in RespAuthDetails API
<Tag name="ctxtCode" value=""/>
<Tag name="offerId" value=""/>
<Tag name="prodCode" value=""/>
</Meta>
…Remaining part same as existing RespAuthDetails API.
Note: Post Response Auth Details, UPI Switch will drop the following tags before sending it to
issuer to ensure no change at issuer end.