1Pay payment API is a software-to-software interface, not a user interface. With APIs, applications talk to each other without any user knowledge or intervention.
1Pay provides a simple http interface listing information of interest to perform transaction. This interface can be accessed on port 80/443. 1Pay payment gateway links merchants/sellers website to process online payments. Like most gateways, 1Pay Payment Gateway handles all major net banking, credit, debit and cash cards.
To initiate a transaction, the merchant generates a POST REQUEST (which is a particular mode of interaction on internet). The request must include mandatory and optional parameters. The mandatory fields include hash (checksum), transaction id (order reference number generated at merchant’s end), amount, email, phone number and other merchant specific data.
When the POST request reaches 1Pay PG the, customer would be re-directed to payment gateway’s payment page. Customer now selects the particular payment option on payment gateway’s page (Credit Card/Debit Card/Net Banking etc) and clicks on ‘Pay Now’. Now, payment gateway re-directs the customer to the chosen bank. The customer goes through the necessary authorization/authentication process at bank’s login page, and the bank gives the success/failure response back to payment gateway.
When the transaction POST request hits the payment gateway server, Payment gateway marks the transaction status on the basis of response received from Bank. Payment gateway provides the final transaction response to the merchant through a POST RESPONSE. In the POST RESPONSE sent by gateway, merchant would receive the status of the transaction. Merchant needs to call the verify transaction API after receiving the response from payment. This is done to strictly avoid any tampering attempt by the user.
For 16bit API key use below posting URL:-
1.TestURL:: https://hdfcprodsigning.in/onepayVAS/payprocessor
2.Live URL:: https://pay.1paypg.in/onepayVAS/payprocessor
For 32bit API key use below posting URL:-
3.Test:: https://hdfcprodsigning.in/onepayVAS/payprocessorV2
This section briefly details the overall transaction flow -
PostURL : https://hdfcprodsigning.in/onepayVAS/payprocessor
20 Parameters for auth request
ANAlphanumeric
Unique merchant id provided by 1Pay
Min Length: 5Max Length: 16
Sample value M00012
ANAlphanumeric
A unique key provided by 1Pay
Min Length: 8Max Length: 32
Sample value jpuT0821
ANAlphanumeric
A unique tracking id created by the merchant for each transaction
Min Length: 1Max Length: 32
Sample value 77983779999
Decimal (fixed 2 decimal points)
Amount of the transaction
Min Length: 1 (excluding decimal)Max Length: 8 (excluding decimal)
Sample value 100.00
Date Time (yyyy-MM-dd HH:mm:ss)Datetime
Date time of the originator
Min Length: 19Max Length: 19
Sample value 2018-08-01 13:20:33
NNumeric
Mobile number of the customer
Min Length: 10Max Length: 10
Sample value 9876588877
ANAlphanumeric
Email id of the customer
Min Length: 8Max Length: 50
Sample value abc@abc.com
NNumeric
Channels like Internet,IVR,etc
Min Length: 1Max Length: 1
Sample value 0 (For Internet)
AAlphabets
DIRECT: Capture Payment details on Aggregator’s page REDIRECT: Get Payment Details in Request from Merchant and redirect to Bank Page directly
Min Length: 6Max Length: 8
Sample value DIRECT/REDIRECT
AN(Special Characters Allowed are /?&=_:. )Alphanumeric
A Unique URL provided by merchant to post the response
Min Length: 10Max Length: 200
Sample value http://payone.tech/abc/
AN (Special Characters allowed are Tilde(~) and Pipe(|))Alphanumeric
IF Merchant wants Multipart Settlement for single Txn then he needs to pass different Product Ids along with the Amount ELSE value is ‘DEFAULT’.
Min Length:Max Length: Undefined
Sample value IF isMultiSettlement= 0 :- DEFAULT(Case-Sensitive) IF isMultiSettlement= 1 :- Product1~100|Product2~200|..|ProductN~AmountN Note :Sum of Amounts in Product Id field must be equal to Transaction Amount.
NNumeric
IF Merchant wants Settlement of single Txn in Multiple Accounts(Registered with 1pay) then he needs to pass value of this field as ‘1’(True)ELSE ‘0’(False).
Min Length: 1Max Length: 1
Sample value 0(False)/1(True)
ANAlphanumeric
Default value is “NA”. The user (merchant) defines these fields. The field data is passed along with a transaction request. These fields are for merchant to pass additional transaction related information like customer email id, contact number, Address etc..
Min Length: 2Max Length: 45
Sample value NA
ANAlphanumeric
Default value is “NA”. The user (merchant) defines these fields. The field data is passed along with a transaction request. These fields are for merchant to pass additional transaction related information like customer email id, contact number.
Min Length: 2Max Length: 45
Sample value NA
AN(Space allowed in Card Name Field)Alphanumeric
Default value is “NA”. The user (merchant) defines these fields. The field data is passed along with a transaction request. These fields are for merchant to pass additional transaction related information like customer email id, contact number.
Min Length: 2Max Length: 45
Sample value NA
ANAlphanumeric
Default value is “NA”. The user (merchant) defines these fields. The field data is passed along with a transaction request. These fields are for merchant to pass additional transaction related information like customer email id, contact number.
Min Length: 2Max Length: 250
Sample value NA
ANAlphanumeric
Default value is “NA”. The user (merchant) defines these fields. The field data is passed along with a transaction request. These fields are for merchant to pass additional transaction related information like customer email id, contact number.
Min Length: 2Max Length: 45
Sample value NA
AAlphabets
Payment Mode of the Transaction
Min Length: 2Max Length: 12
Sample value For txnType DIRECT :-NA For txnType REDIRECT :-NB/CC/DC/UPI
AN(Space allowed in Card Name Field)Alphanumeric
Default ‘NA’
Min Length: 2Max Length: 65
Sample value For txnType ‘DIRECT’ the default value -NA For txnType ‘REDIRECT’ – For CC/DC: "CARDNAME|CARDNO|CVV|EXPIRY|SAVECARDFLAG" For NB: Bank specific code provided by 1Pay For UPI: NA
AAlphabets
Type of Card used for Transaction
Min Length: 2Max Length: 20
Sample value For txnType DIRECT :-NA For txnType REDIRECT & instrumentId CC/DC :- Visa/Mastercard/Rupay etc For txnType REDIRECT & instrumentId NB :-NA For txnType REDIRECT & instrumentId UPI :-NA
The generated JSON data needs to be encrypted in AES-256 using a secret key provided by 1pay. After encryption the data will be posted on 1pay server over web browser.
ANAlphanumeric
A Unique merchant Id provided by 1Pay
Min Length: 5Max Length: 16
Sample value
ANAlphanumeric
Encrypted request parameters
Min Length:Max Length: -
Sample value KfpBKDDON6YiH4d5pfXZq6NVVvurTmiI/+jXy3Z s3atWH7XwXQGtBodk09+WWsjILjvWWRqA/SFj32 coE6e+6WzlXmrD7eBrRKxVGNl4Ye1AgsXrRruA3 uQEX/tWMNdFmIiNMCskyCP6KF/F4sUG3frbjhld VJmsj8E/1A1X60/F91L6khBOCdN4fzAJP6zYxws 2Zg5qXJATGI51LuaIGJBp4HLEj5G0oXq/JUvHmB 3Y1MACTlIbVn46RmiW8wHbkHeopIOVGZpJSkwBo tE1d0FxGYyxsGXEP4TAAKnJ/+ykg4dbngoy9LV/ QeBU9SPJSluFwg1F2X+5JNKkUwnE1YAvx5Fi+HgQ=
Request parameters need to be converted into json format as sample given below –
After receiving the encrypted response user needs to decrypt the data using the key shared by 1pay.
Json Data after decryption of the encrypted response -
ANAlphanumeric
Merchant Id Provided by 1Pay
Min Length: 5Max Length: 16
Sample value M00012
ANAlphanumeric
Merchant’s unique TxnReference Number received in Request
Min Length: 1Max Length: 32
Sample value 2018080112045
ANAlphanumeric
1Pay Unique Transaction Reference Number generated against Merchant’s Txn Id
Min Length: 19Max Length: 19
Sample value 100182141927437447
Date TimeDatetime
TxnDate and Time received in Request
Min Length: 19Max Length: 19
Sample value yyyy-MM-dd HH:mm:ss (2018-08-01 12:10:35)
AAlphabets
Transaction Status
Min Length: 1Max Length: 2
Sample value F(Fail)/To(Time Out)/Ok(Success)
NNumeric
Transaction Amount received in Request
Min Length: 2Max Length: 6
Sample value 100.00
ANAlphanumeric
1pay Response Code
Min Length: 5Max Length: 5
Sample value 00000
ANAlphanumeric
1pay Response Message based on the Response received from Service Provider/Bank
Min Length: 10Max Length: 200
Sample value Transaction Successful/No Error etc.
ANAlphanumeric
Transaction Reference Number received from Service Provider/Bank
Min Length: UndefinedMax Length: Undefined
Sample value BNK2018121
Date TimeDatetime
Date and Time when 1Pay sent the Response to Merchant
Min Length: 19Max Length: 19
Sample value Date and Time when 1Pay sent the Response to Merchant
ANAlphanumeric
Email id of the customer received in Request
Min Length: 8Max Length: 50
Sample value abc@abc.com
NNumeric
Mobile Number of the customer received in Request
Min Length: 10Max Length: 10
Sample value 9876588877
AAlphabets
Payment Mode of the Transaction
Min Length: 2Max Length: 2
Sample value NB/CC/DC/UPI
Post(Server to Server Call)URL : https://hdfcprodsigning.in/onepayVAS/getTxnDetails
ANAlphanumeric
Unique merchant id provided by 1Pay
Min Length: 5Max Length: 16
Sample value M00012
ANAlphanumeric
Merchant’s Unique Transaction Reference Number
Min Length: 1Max Length: 32
Sample value 77983779999
https://hdfcprodsigning.in/onepayVAS/getTxnDetails?merchantId =M00012&txnId=77983779999
ANAlphanumeric
Merchant Id Provided by 1Pay
Min Length: 5Max Length: 16
Sample value M00012
ANAlphanumeric
Merchant’s unique TxnReference Number received in Request
Min Length: 1Max Length: 32
Sample value 2018080112045
ANAlphanumeric
1Pay Unique Transaction Reference Number generated against Merchant’s Txn Id
Min Length: 19Max Length: 19
Sample value 2018111102102222
Date TimeDatetime
Transaction Date Time
Min Length: 19Max Length: 19
Sample value YYYY-MM-dd HH:mm:ss(2018-08-01 12:10:35)
AAlphabets
Transaction Status
Min Length: 1Max Length: 2
Sample value F(Fail)/To(Time Out)/Ok(Success)
NNumeric
Transaction amount
Min Length: 2Max Length: 6
Sample value 100.00
ANAlphanumeric
1pay Response Code
Min Length: 5Max Length: 5
Sample value 00000
ANAlphanumeric
1pay Response Message based on the Response received from Service Provider/Bank
Min Length: 10Max Length: 200
Sample value Transaction Successful/No Error etc.
ANAlphanumeric
Transaction Reference Number received from Service Provider/Bank
Min Length: UndefinedMax Length: Undefined
Sample value BNK2018121
Sample Response
Note: For timeout transactions, if transaction status query is done after 20 minutes, transaction status response will not be fetched. In this case, you have to consider this transaction as Failed. This is to say that when you get "trans_status":"NA" & "resp_code":"NA" in dual verification response please consider these transactions as failed transactions.
RefundRequest API
Post(Server to Server Call)URL : https://hdfcprodsigning.in/onepayVAS/refundRequest
ANAlphanumeric
Unique merchant id provided by 1Pay
Min Length: 5Max Length: 16
Sample value M00012
ANAlphanumeric
Merchant’s Unique Transaction Reference Number
Min Length: 1Max Length: 32
Sample value 77983779999
ANAlphanumeric
Unique number generated by merchant.
Min Length: 18Max Length: 18
Sample value 2018111102102222
NNumeric
Amount to be refunded
Min Length: 2Max Length: 6
Sample value 100.00
Min Length: Max Length:
Sample value Merchant
Request parameters need to be converted into json format as sample given below –
Refund request -
ANAlphanumeric
Merchant Id Provided by 1Pay
Min Length: 5Max Length: 16
Sample value M00012
ANAlphanumeric
Merchant’s unique Txn Reference Number received in Request
Min Length: 1Max Length: 32
Sample value 2018080112045
ANAlphanumeric
Unique number generated by merchant.
Min Length: 18Max Length: 18
Sample value 2018111102102222
NNumeric
Refund Amount received in Request
Min Length: 2Max Length: 6
Sample value 100.00
NNumeric
Transaction amount
Min Length: 2Max Length: 6
Sample value 100.00
AAlphabets
Partial Refund or Full Refund
Min Length: 2Max Length: 3
Sample value PR/FR
ANAlphanumeric
1pay Response Code
Min Length: 5Max Length: 5
Sample value RF000
ANAlphanumeric
Refund Response Message
Min Length: 10Max Length: 200
Sample value Refund Request Raised Successfully.
ANAlphanumeric
Refund Reference Number
Min Length: UndefinedMax Length: Undefined
Sample value BNK2018121
ANAlphanumeric
1Pay Unique Transaction Reference Number generated against Merchant’s Txn Id
Min Length: 19Max Length: 19
Sample value 100182141927437447
Min Length: Max Length:
Sample value Merchant
Below is the response code and response message for the same.
RF000 | Refund Request Raised Successfully |
RF001 | Transaction Id not found |
RF002 | Transaction is not in Success Status. |
RF003 | This Transaction is already full refunded |
RF004 | Transaction is Pending for Settlement. |
RF005 | Refund amount is greater than transaction amount. |
RF006 | Required parameter is missing or blank. |
RF007 | Refund RequestId is Already Exist it should be unique for every Refund Reques |
RF008 | No Default value for RequestRefundId. |
RF009 | Error Occurred while fetching Data. |
Post(Server to Server Call)URL : https://hdfcprodsigning.in/onepayVAS/refundStatus
Below is the response code and response message for Refund Status API:
RS000 | Refund Received successfully. |
RS000 | Refund Under Processed. |
RS000 | Refund Processed successfully. |
RS001 | Transaction Id does not exist. |
RS002 | RefundRequestId does not exist. |
RS003 | Required Parameters are Missing. |
RS004 | Error While Fetching Records. |
Request parameters need to be converted into json format as sample given below -
Refund Status API Request -
Refund Status API response -