Request Payment APIs are used when the merchant wants to send a collect payment request to user's PhonePe app against an order.
Header Name | Header Value |
---|---|
| application/json |
| SHA256(base64 encoded payload + |
| Callback Url where a request will be made once user responds |
| Used for the cases where the merchant has multiple merchant IDs |
{
"merchantId":"MERCHANTUAT",
"transactionId":"TX123456789",
"merchantOrderId":"M123456789",
"amount":100,
"instrumentType":"MOBILE",
"instrumentReference":"9999999999",
"message":"collect for XXX order",
"email":"[email protected]",
"expiresIn":180,
"shortName":"DemoCustomer",
"storeId":"store1",
"terminalId":"terminal1"
}
{
"request": "eyAgCiAgICJtZXJjaGFudElkIjoiTUVSQ0hBTlRVQVQiLAogICAidHJhbnNhY3Rpb25JZCI6IlRYMTIzNDU2Nzg5IiwKICAgIm1lcmNoYW50T3JkZXJJZCI6Ik0xMjM0NTY3ODkiLAogICAiYW1vdW50IjoxMDAsCiAgICJpbnN0cnVtZW50VHlwZSI6Ik1PQklMRSIsCiAgICJpbnN0cnVtZW50UmVmZXJlbmNlIjoiOTk5OTk5OTk5OSIsCiAgICJtZXNzYWdlIjoiY29sbGVjdCBmb3IgWFhYIG9yZGVyIiwKICAgImVtYWlsIjoiYW1pdHh4eDc1QGdtYWlsLmNvbSIsCiAgICJleHBpcmVzSW4iOjE4MCwKICAgInNob3J0TmFtZSI6IkRlbW9DdXN0b21lciIsCiAgICJzdG9yZUlkIjoic3RvcmUxIiwKICAgInRlcm1pbmFsSWQiOiJ0ZXJtaW5hbDEiCn0="
}
Parameter Name | Type | Description | Mandatory |
---|---|---|---|
|
| Unique Merchant ID assigned to the merchant by PhonePe |
|
|
| Unique Transaction ID generated by the merchant to track this request to PhonePe |
|
|
| Unique Order ID generated by the merchant |
|
|
| Amount in Paisa |
|
|
| Has the value |
|
|
| Mobile number of the user |
|
|
| expire time of payment completion.Payment should be |
|
|
| Recommended to pass |
|
|
| Email Id of User |
|
|
| Customer Name |
|
|
| Sub-category of the merchant |
|
|
| Store Id of store. Should be |
|
|
| Terminal Id of store. Should be unique for a store. Special characters like " ", ",", "@" etc. are not allowed. Length should be lesser than |
|
{
"success": true,
"code": "SUCCESS",
"message": "Your request has been successfully completed.",
"data": {
"transactionId": "55fe801b-1092-461a-8480-c80d9781498a",
"amount": 300,
"merchantId": "MERCHANTUAT",
"providerReferenceId": "C2111161249027983263789"
}
}
Parameter Name | Type | Description |
---|---|---|
|
| Success status of the request |
|
| See below section for list of codes |
|
| Short message about status of request |
|
| Unique Transaction ID generated by the merchant to track this request to PhonePe |
|
| Unique Merchant ID assigned to the merchant by PhonePe |
|
| Transaction amount in paise |
|
| PhonePe transaction Id |
|
| Mobile Number |
The code in the above API response could be:
SUCCESS
: Collect was successfully sent to VPAINTERNAL_SERVER_ERROR
: Something went wrong. Need to validate through check transaction status API first to know the payment status.INVALID_TRANSACTION_ID
: TransactionId in request was duplicateBAD_REQUEST
: Some mandatory parameter was missingAUTHORIZATION_FAILED
: Checksum sent in header was not valid
When the user responds to the collect request sent by the merchant, a request is sent to either the URL provided in X-CALLBACK-URL or the merchant's registered callback URL. By default, this is a POST request.
Note:
- The callback would be sent only for success/Failed scenarios. For pending cases, there won't be any callback. For such transactions payment status should be checked with below API.
- If payment is in pending state, Merchant should display a message "Payment is in progress, please wait for sometime."
- The payment will always be closed within the expiry time passed in the collect request.