Api Documentation
Currencies
Our Supported Currencies are listed below.
| Currency Name | Currency Symbol | Currency Code |
|---|---|---|
| Main Wallet |
Obtain API Key
Login to your merchant account.
Go to Merchant App -> API Access Key .
You can find your API keys Public Key and Secret Key in API Access Key menu from merchant dashboard. These keys are required to call API requests. If needed, you can generate a new API key anytime by clicking the Regenerate button. Make sure to keep these keys private and never share them with anyone.
Access Token POST
Access Token is required to make payment requests through the API. It serves as a secure key to authorize and validate your transactions. You can generate the Access Token using your API credentials Public Key and include it in the header of every payment request. Ensure the token is kept secure and updated regularly to maintain the security of your transactions.
- Live URL:https://qunzo-admin.tdevs.co/api/merchant/access-token
- Test URL:https://qunzo-admin.tdevs.co/api/merchant/sandbox/access-token
- Request Method:POST
Example PHP code
use Illuminate\Support\Facades\Http;
// Set up the API endpoint and your public key
$url = 'https://qunzo-admin.tdevs.co/api/merchant/access-token';
$publicKey = 'your_public_key';
// Make the POST request using Laravel's HTTP client
$response = Http::withHeaders([
'Content-Type' => 'application/json'
])->post($url, [
'public_key' => $publicKey,
]);
if ($response->successful()) {
return response()->json($response->json());
} else {
return response()->json($response->json());
}
Example Response Success 200
{
"status": "success",
"payment_url": "...."
}Example Response Error (400/401)
// Token invalid or expired (401)
{
"status": "error",
"message": "Token is invalid or expired"
}
// For validation rules error (400)
{
"status": "error",
"message": [
"The transaction id has already been taken."
]
}Make Payment POST
To get started with the payment process, simply follow the example code and ensure the parameters are set correctly. Be sure to use the provided API endpoints for your requests.
- Live URL:https://qunzo-admin.tdevs.co/api/merchant/make-payment
- Test URL:https://qunzo-admin.tdevs.co/api/sandbox/make-payment
- Request Method:POST
- UID:12344567890
- Password:12345678
Request to the endpoint with the following parameters:
| Param Name | Param Type | Description |
|---|---|---|
| amount | float|integerRequired | The amount to be charged for the transaction. |
| currency | string (4)Required | Currency Code (e.g., USD, EUR) |
| transaction_id | string (12)Required | A unique identifier for the transaction, consisting of 12 alphanumeric characters. |
| description | string (20)Required | A brief description of the transaction. |
| ipn_url | string (255)Optional | Send the notification URL where you want to receive the notification. |
| callback_url | string (255)Optional | Redirecting the user to the specified URL after the transaction is completed. |
| customer_name | string (50)Optional | Provide your customer name. |
| customer_email | string (50)Optional | Provide your customer email. |
Example PHP code
// API endpoint and sandbox credentials
$url = 'https://qunzo-admin.tdevs.co/api/merchant/make-payment';
$authToken = 'your_authorization_token_here'; // Replace with your actual token
// Request payload
$data = [
'amount' => 100.00, // Example amount
'currency' => 'USD', // Example currency
'transaction_id' => 'ABC123456789', // Unique transaction ID
'description' => 'Test payment', // Transaction description
'ipn_url' => 'https://yourdomain.com/ipn', // Notification URL (optional)
'callback_url' => 'https://yourdomain.com/callback', // Callback URL (optional)
'customer_name' => 'John Doe', // Customer name (optional)
'customer_email' => 'johndoe@example.com', // Customer email (optional)
];
// Initialize cURL
$ch = curl_init($url);
// Set up the request headers
$headers = [
'Content-Type: application/json',
'Authorization: Bearer ' . $authToken, // Add the authorization token
];
// Configure cURL options
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute the POST request
$response = curl_exec($ch);
// Handle errors
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
} else {
// Parse and display the response
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode === 200) {
$responseData = json_decode($response, true);
print_r($responseData); // Example output
} else {
echo 'Error: HTTP Code ' . $httpCode . PHP_EOL;
echo 'Message: ' . $response . PHP_EOL;
}
}
// Close cURL
curl_close($ch);Example Response Success 200
{
"status": "success",
"payment_url": "..."
}Example Response Error (400/401)
// Token invalid or expired (401)
{
"status": "error",
"message": "Token is invalid or expired"
}
// For validation rules error (400)
{
"status": "error",
"message": [
"The transaction id has already been taken."
]
}IPN POST
An IPN is a POST request sent to your business application URL to notify about a payment status update. It provides real-time data for identifying and verifying transactions. The key parameters include:
- URL:Your IPN URL.
- Method:GET
You will get following parameters below.
| Param Name | Description |
|---|---|
| status | Payment success status. |
| signature | At your end, a hash signature is used to verify the payment. |
| data | The data includes charges, amount, currency, payment transaction ID, and other relevant details. |
Example code
// Assuming the necessary data is available
$secretKey = ''; // Define your secret key here
$data = $_GET['data']; // Get the 'data' parameter from the request
$receivedSignature = $_GET['signature']; // Get the 'signature'
// Recreate the signature
$dataToHash = $data['transaction_id'] . $data['total_amount'];
$generatedSignature = hash_hmac('sha256', $dataToHash, $secretKey);
// Verify the signature
if ($generatedSignature === $receivedSignature) {
// Perform the task
// Your task execution code here
}