Parameters to be sent to the service are as follows:
Input Name | Type | Required | Description |
---|---|---|---|
public_key | String | Yes | your public key |
private_key | String | Yes | your private key |
Parameters to be returned from the service are as follows:
Input Name | Type | Description |
---|---|---|
status | String | success or error |
message | String | error message if status is error |
balance | numeric | withdrawable balance |
blocked_balance | numeric | blocked balance |
<?php
// API URL to send the request to
$url = 'https://payid19.com/api/v1/get_balance';
// Data to be sent in the POST request
$post = [
'public_key' => 'yourpublickey', // Your public key for API access
'private_key' => 'yourprivatekey', // Your private key for API access
];
// Initialize a cURL session
$ch = curl_init();
// Set the URL for the cURL request
curl_setopt($ch, CURLOPT_URL, $url);
// Enable SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
// Return the response instead of printing it directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Set the POST fields for the request
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
// Execute the cURL request and store the result
$result = curl_exec($ch);
// Close the cURL session
curl_close($ch);
// Decode the JSON response and check for errors
if (json_decode($result)->status == 'error') {
// If there's an error, display the error message
echo json_decode($result)->message;
} else {
// If the request is successful, display the balance
echo json_decode($result)->balance; // Current balance
// Uncomment to display blocked balance if needed
// echo json_decode($result)->blocked_balance; // Blocked balance
}
?>
const axios = require('axios');
// API URL to send the request to
const url = 'https://payid19.com/api/v1/get_balance';
// Data to be sent in the POST request
const postData = {
public_key: 'yourpublickey', // Your public key for API access
private_key: 'yourprivatekey', // Your private key for API access
};
// Function to make the API call
axios.post(url, postData)
.then(response => {
const result = response.data;
// Check if the response indicates an error
if (result.status === 'error') {
// If there's an error, log the error message
console.log(result.message);
} else {
// If the request is successful, display the balance
console.log(result.balance); // Current balance
// Uncomment to display blocked balance if needed
// console.log(result.blocked_balance); // Blocked balance
}
})
.catch(error => {
// Log any errors encountered during the request
console.error('Error:', error.message);
});
import requests
# API URL to send the request to
url = 'https://payid19.com/api/v1/get_balance'
# Data to be sent in the POST request
post_data = {
'public_key': 'yourpublickey', # Your public key for API access
'private_key': 'yourprivatekey', # Your private key for API access
}
# Make the POST request to the API
response = requests.post(url, data=post_data)
# Parse the JSON response
result = response.json()
# Check if the response indicates an error
if result.get('status') == 'error':
# If there's an error, print the error message
print(result.get('message'))
else:
# If the request is successful, display the balance
print(result.get('balance')) # Current balance
# Uncomment to display blocked balance if needed
# print(result.get('blocked_balance')) # Blocked balance