Introduction
This document helps developers in integrating with P2Way.
Terminology:- 1. Payment Platform – P2Way system
- 2. Merchant – Site integrating with P2Way
- 3. API Key – Also called Secret Key provided to the Merchant after successful onboarding. This is to be used to generate the secure hash as part of the API requests
This Integration has two parts:
-
1. P2Way APIs to be invoked by Merchant site
- a. Create Order
- b. Create Payout Order
- c. Verify Order
-
2. Merchant’s API to be implemented as per P2Way specification.
- a. Callback
Before consuming API development, register with the Payment Platform (PP), complete onboarding and KYC, and update minimum/maximum payout limits. After completion, PP will provide a merchant ID and API key. Whitelist the Merchant’s IP to perform tests.
API calls are implemented as standard HTTPS POST (application/json)
Authentication
Every API call has a HmacSHA256 signature generated with your private key. Our server generates it's own HMAC signature and compares it with the API caller's. If they don't match the API call is discarded. The HMAC signature is sent as a HTTP header called signature.
example java program :POST create-order
{{payURL}}/pay/transaction/payer/create-order
This Endpoint create a basic payment from your domain in our system to redirect the user afterwards to the payment page After you redirect the user , when he/she finish or cancel the payment , we will redirect to your callback_url and then you can retrive payment information form get verify API.
payURL : Reach out PP for create-order URL
HEADERS
| signature | |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
Body raw (json)
| Parameter | Data Type | Description |
|---|---|---|
| fname | String | User First name |
| lname | String | User Last name |
| address | String | User Address |
| pin | String | Pincode |
| city | String | City |
| mobile | String | Mobile Number |
| state | String | State |
| String | User Email |
| Parameter | Data Type | Description |
|---|---|---|
| amount | decimal | requested amount for creating order |
| merchantId | String | MerchantId which is provided by the platform |
| orderId | String | A unique Id from merchant for any furthur information |
| paymentMethod | String | Requested Payment Method (UPI) and H2H for Self Hosted |
| currency | String | Requested Amount Currency (INR) |
| Parameter | Data Type | Description |
|---|---|---|
| service | String | Type of service being requested |
| bankType | String | Type of the bank |
Example Request
Example Response
POST create-payout-order
{{payURL}}/pay/transaction/payer/create-payout-order
This request generates a payout order on Payment Platform.
payURL : Reach out PP for create-payout-order URL
Note: Choose one of the following bank from the Available Banks list while creating Payout.
HEADERS
| signature | |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
Body raw (json)
| Parameter | Data Type | Description |
|---|---|---|
| accountNumber | String | User Account Number which the amount is to be credited |
| ifscCode | String | IFSC code of the corresponding Account |
| amount | decimal | Requested Amount |
| transactionType | String | PAY_OUT |
| bank | String | Bank Name of any one following Bank Accounts |
| bnfNickName | String | Benificiary Name |
| payeeName | String | Payee Name |
| orderId | String | A unique orderID created by merchant for furter information |
| phoneNumber | String | User Phone Number |
| pinCode | String | Pin Code |
| emailId | String | User Email ID |
| merchantId | String | Merchant ID which is provided by the Platform |
| paymentMethod | String | NEFT |
| currency | String | Requested Amount Currency |
Example Request
Example Response
POST verify-order
{{payURL}}/pay/transaction/payer/verify-order
This API is to reconfirm the successfully processed order and to obtain further details on the order placed.HEADERS
| signature | |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
Body raw (json)
| Parameter | Data Type | Description |
|---|---|---|
| merchantId | String | MerchantId provided by the platform |
| merchantOrderId | String | A unique orderId generated while creating order |
| orderId | String | A unique orderId by platform |
| transactionUserUtr | String | Unique Transaction Reference ID |
Example Request
Example Response
GET callbackrequest
{{URL}}/{{APIPath}}?orderId={{orderId}}&status={{status}}&tt={{transactionType}}
This API is to be implemented by the Merchant and will be called by PP to send response on an order placed. Order can be successful or failure. Upon success, Merchant site is required to call Verify Order API of PP to reconfirm and for further details on the order placed.The transaction is success, please send success is "true" or "false" as per the given response.PARAMS
| Parameter | Data Type | Description |
|---|---|---|
| orderId | String | OrderId of merchant payer |
| status | String | Transaction status updates sent to the merchant via callback request |
| tt (transactionType) | String | Transaction status updates sent to the merchant via callback request |
Example Request
Example Response
GET balance
{{payURL}}/pay/merchant/balance/{merchantId}/{currency}
This API verifies the available balance of a merchant prior to a payout request.HEADERS
| signature |
{generated Hash} (SECRETKEY + merchantId + currency) |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
| Parameter | Data Type | Description |
|---|---|---|
| merchantId | String | MerchantId provided by the platform |
| currency | String | Balance Amount Currency |
Example Request
Example Response
Error Codes
| Status Code | Error Message |
|---|---|
| 200 | Merchant Not Found |
| 200 | Merchant Wallet not created |
| 200 | Hash Mismatched. |
| 200 | Invalid Parameter |
Available Banks
- Canara Bank
- DCB Bank
- Federal Bank
- HDFC Bank
- Punjab National Bank
- Indian Bank
- ICICI Bank
- Syndicate Bank
- Karur Vysya Bank
- Union Bank of India
- Kotak Mahindra Bank
- IDFC First Bank
- Andhra Bank
- Karnataka Bank
- ICICI Corporate Bank
- Axis Bank
- UCO Bank
- South Indian Bank
- Yes Bank
- Standard Chartered Bank
- State Bank of India
- Indian Overseas Bank
- Bandhan Bank
- Central Bank of India
- Bank of Baroda
- UPI