Payin Page
Api Endpoint:
This API for Payin Page will be a POST request.
{BaseUrl}/user/sendPayinPageRequest
Description
The Payin Page API allows a user to generate a payment page URL. This is typically used in scenarios where a customer is asked to pay a specified amount using their UPI ID through a web interface. Upon successful initiation, a URL is generated for the customer to complete the payment.
Request
Request Header
The request must include the following headers for authentication:
{
"apiKey": "your api key",
"token": "your token"
}
- apiKey: Your unique API key provided by PayHub.
- token: A token that validates your session or request.
Request Body
The body of the request should include the following parameters:
{
"amount":"100",
"username":"customer name",
"phone":"customer phone number",
"customer_email" : "customer email ",
"orderId":"Merchant's order id",
"label":"ACME CORP",'(optional)'
}
- upiId: The UPI ID of the customer to whom the payment request is being sent.
- amount: The amount to be paid by the customer.
- username: The name of the customer.
- phone: The phone number of the customer.
- customer_email: The email address of the customer.
- label: The business name on payment page that merchant wants to show.
Possible Responses:
Success Response
A successful response indicates that the payin page URL has been generated and includes the transaction details.
{
"responseCode": 200,
"responseMessage": "Success",
"responseData": {
"url": "https://payments.PayHub.link/?txid=54661&token=eyJhbGciOiJIUsInR5cCI6IkpXVCJ9.eyJlbWFpbElkIjoidGVzdEBwYXlodWIiLCJhcGlLZXkiOiJVMkZzZEdWa1gxOGg1RVBkZVRiNUFzbmloL2Ruby9Kakl3djJBVGQ5S21RPSIsImlhdCI6MTczMzcyMTM5NSwiZXhwIjoxNzMzNzIyMjk1fQ.XIMFL_7eSIKn70zUJTG97xCPBdgnB",
"transaction_id": "o_DPjeq6yX1hadsahgfhtkjklZ04cWs"
}
}
- responseCode: 200 - Indicates a successful request.
- responseMessage: Success - A message indicating the request was successful.
- responseData: Contains the payment page URL and transaction details.
- url: https://payments.PayHub.link/?txid=54661&token=eyJhbGciOiJIUsInR5cCI6IkpXVCJ9.eyJlbWFpbElkIjoidGVzdEBwYXlodWIiLCJhcGlLZXkiOiJVMkZzZEdWa1gxOGg1RVBkZVRiNUFzbmloL2Ruby9Kakl3djJBVGQ5S21RPSIsImlhdCI6MTczMzcyMTM5NSwiZXhwIjoxNzMzNzIyMjk1fQ.XIMFL_7eSIKn70zUJTG97xCPBdgnB - A URL that redirects the customer to the payment page to complete the payment.
- transaction_id: o_DPjeq6yX1hadsahgfhtkjklZ04cWs - A unique identifier for the transaction.
Error Responses
If there is an issue with the request, one of the following error responses will be returned:
Invalid API Key
{
"responseCode": 401,
"responseMessage": "Invalid apiKey"
}
-
responseCode: 401 - Indicates forbidden access due to an invalid API key.
-
responseMessage: Invalid apiKey - A message indicating the provided API key is invalid.
-
responseCode: 400 - Indicates a bad request due to a non-existent user.
-
responseMessage: User does not exist - A message indicating the user specified in the request does not exist.
{
"responseCode": 400,
"responseMessage": "Invalid details"
}
- responseCode: 400 - Indicates a bad request due to invalid details.
- responseMessage: Invalid details - A message indicating that some of the details provided in the request are invalid.
Notes
- Ensure that all required parameters are provided and valid.
- Check the response codes to handle different outcomes appropriately in your application.
- For security, keep your API key and token confidential.
By following this documentation, you can integrate and use the Payin Page API effectively in your payment gateway system.