Fetch Payin Status
Api Endpoint:
This API for Payin Status will be a POST request.
{BaseUrl}/user/getpayinstatus
Description
The Fetch Payin Status API allows a user to check the status of a specific payment transaction. This is typically used to verify whether a payment has been completed, is pending, has failed, or has expired.
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:
{
"transaction_id": "67264",
"date": "2023-09-20",
}
- transaction_id: The unique identifier of the transaction.
- date: The date of the transaction.
Possible Responses:
Payment Success Response
A response indicating that the payment has been completed successfully.
{
"responseCode": 200,
"responseMessage": "Success",
"responseData": {
"amount": 10,
"transaction_id": "286178304",
"status": "success",
"utr":"15667899",
"code": "00",
"description": "transaction success"
}
}
- responseCode: 200 - Indicates a successful request.
- responseMessage: Success - A message indicating the request was successful.
- responseData: Contains the transaction details.
- amount: 10 - The amount involved in the transaction.
- transaction_id: 286178304 - The unique identifier of the transaction.
- status: success - The status of the transaction.
- utr:15667899 - The unique identifier from bank.
- code: 00 - A code indicating the transaction was successful.
- description: transaction success - A description of the transaction status.
Payment Pending Response
A response indicating that the payment is pending.
{**
"responseCode": 200,
"responseMessage": "Success",
"responseData": {
"amount": 10,
"transaction_id": "284111275",
"status": "pending",
"code": "01",
"description": "transaction pending"
}
}
- responseCode: 200 - Indicates a successful request.
- responseMessage: Success - A message indicating the request was successful.
- responseData: Contains the transaction details.
- amount: 10 - The amount involved in the transaction.
- transaction_id: 284111275 - The unique identifier of the transaction.
- status: pending - The status of the transaction.
- code: 01 - A code indicating the transaction is pending.
- description: transaction pending - A description of the transaction status.
Payment Failed Response
A response indicating that the payment has failed.
{
"responseCode": 200,
"responseMessage": "Success",
"responseData": {
"amount": 10,
"transaction_id": "286623381",
"status": "failed",
"code": "02",
"description": "Customer failed to complete transaction"
}
}
- responseCode: 200 - Indicates a successful request.
- responseMessage: Success - A message indicating the request was successful.
- responseData: Contains the transaction details.
- amount: 10 - The amount involved in the transaction.
- transaction_id: 286623381 - The unique identifier of the transaction.
- status: failed - The status of the transaction.
- code: 02 - A code indicating the transaction failed.
- description: Customer failed to complete transaction - A description of the transaction status.
Expired Response
A response indicating that the payment request has expired.
{
"responseCode": 200,
"responseMessage": "Success",
"responseData": {
"amount": 10,
"transaction_id": "o_dd4jmJQErxxgEb41-240228174258",
"status": "expired",
"code": "U69",
"description": "Collect request expired"
}
}
- responseCode: 200 - Indicates a successful request.
- responseMessage: Success - A message indicating the request was successful.
- responseData: Contains the transaction details.
- amount: 10 - The amount involved in the transaction.
- transaction_id: o_dd4jmJQErxxgEb41-240228174258 - The unique identifier of the transaction.
- status: expired - The status of the transaction.
- code: U69 - A code indicating the request expired.
- description: Collect request expired - A description of the transaction status.
Invalid Tx Id
A response indicating that the provided transaction ID is invalid.
{
"responseCode": 400,
"responseMessage": "Please provide valid details.",
"responseData": "Please enter transaction id"
}
- responseCode: 400 - Indicates a bad request due to invalid transaction ID.
- responseMessage: Please provide valid details. - A message indicating the request contained invalid details.
- responseData: Please enter transaction id - A message specifying the missing or invalid transaction ID.
Invalid Tx Date
A response indicating that the provided transaction date is invalid.
{
"responseCode": 400,
"responseMessage": "Please provide valid details.",
"responseData": "Please enter transaction date"
}
- responseCode: 400 - Indicates a bad request due to invalid transaction date.
- responseMessage: Please provide valid details. - A message indicating the request contained invalid details.
- responseData: Please enter transaction date - A message specifying the missing or invalid transaction date.
Invalid API Key
A response indicating that the provided API key is invalid.
{
"responseCode": 403,
"responseMessage": "Invalid apiKey"
}
-
responseCode: 403 - 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.
Invalid Details
A response indicating that some of the details provided in the request are invalid.
{
"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 Fetch Payin Status API effectively in your payment gateway system.