Send Callback (Sandbox)
Api Endpoint:
This API is used to simulate a transaction callback is a POST request. It is available on Sandbox only.
{BaseUrl}/callback/send
Description
The Send Callback API allows you to test how your system handles callbacks without performing an actual transaction. This ensures your integration processes callback data correctly.
Request
Request Header
The request must include the following headers for authentication:
{
"apiKey": "your api key",
"token": "your token",
"content-type": "application/json"
}
- apiKey: Your unique API key provided by PayHub.
- token: A token that validates your session or request.
- content-type: Specifies that the request body is in JSON format.
Request Body
The body of the request should include the following parameters:
{
"transaction_id":"5702623861",
"type":"payin",
"status":"failed"
}
- transaction_id: Unique ID of the simulated transaction.
- type: Type of transaction (allowed:
payin,payout). - status: Transaction status (allowed:
success,failed,pending).
Possible Responses:
Success Response
A response indicating that Callback Processed Successfully.
{
"responseCode": 200,
"responseMessage": "Success",
"responseData": "Callback Processed Successfully "
}
- responseCode: 200 - Indicates a successful request.
- responseMessage: Success - A message indicating the request was successful.
- responseData: Contains the Callback details.
Error Responses
Invalid Request Type:
A response indicating that the provided type is invalid.
{
"responseCode": 400,
"responseMessage": "Invalid request type. Allowed types [payin, payout]"
}
- responseCode: 400 - Indicates Bad Request due to an invalid request.
- responseMessage: Invalid request type. Allowed types [payin, payout] - A message indicating the provided Type is invalid.
Transaction Not Found
A response indicating that the provided Transaction ID not found.
{
"responseCode": 404,
"responseMessage": "Transaction not found"
}
- responseCode: 404 - Indicates Not Found due to item not found.
- responseMessage: Transaction not found - A message indicating that the provided Transaction ID not found.
Invalid Status:
A response indicating that the provided Status is invalid.
{
"responseCode": 400,
"responseMessage": "Invalid status. Allowed status [success, failed, pending]"
}
- responseCode: 404 - Indicates Bad Request due to an invalid request.
- responseMessage: Invalid status. Allowed status [success, failed, pending] - A message indicating the provided Status is invalid.
Invalid API Key
A response indicating that the provided API key is invalid.
{
"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.
Notes
- This endpoint is only available in the Sandbox environment.
- Use it to ensure your server is correctly handling different callback scenarios.
- Make sure to pass valid request parameters to avoid errors.
By following this documentation, you can integrate and use the Send Callback (Sandbox) API effectively in your payment gateway system.