Get deposits made onto the prepay e-wallet. Works similarly to subscriptions
URL: https://www.trade-copier.com/webservice/v4/deposit/getEwalletDeposits.php
Response: JSON object list
| Field Name | Field Type | Field Description |
|---|---|---|
| order_status | string | Status of the deposit. 301=None, 303=active, 305=expired, 306=cancelled |
| total | string | Amount deposited |
| currency | string | Currency in which the deposit was made |
| modified_date | string | Last modified date of the deposit |
| cancel_date | string | Date at which the deposit was cancelled. Sends back date 0 if not cancelled |
| subscription_key | string | Unique identifier of the deposit |
| invoices | array | All invoices of the deposit |
| total | string | Amount paid |
| currency | string | Currency in which the invoice was made |
| invoice_status | string | Status of the invoice order. 401=pending, 402=paid, 403=refunded |
| paid_date | string | Date on which the invoice was made |
| coupon_code | string | Coupon code of the invoice |
| amount | string | Discount from coupon, can be a percentage or absolute value |
| percentage | string | Indicates whether amount is a percentage or not. 1=percentage, empty means absolute value |
PHP example
<?php
echo "<link rel='stylesheet' type='text/css' href='https://www.trade-copier.com/webservice/example.css'>";
$url="https://www.trade-copier.com/webservice/v4/deposit/getEWalletDeposits.php";
$headers = array(
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Bearer [[TOKEN]]',
);
// Open connection
$ch = curl_init();
// Setting the options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute request
$json = json_decode(curl_exec($ch));
// Close connection
curl_close($ch);
if(is_array($json) && array_key_exists('deposits', $json))
{
echo '<table id="api_data">';
foreach($json->subscriptions as $row) {
foreach($row as $key => $val) {
if($key != 'invoices')
echo '<th>'.$key.'</th>';
}
break;
}
foreach($json->subscriptions as $subscription)
{
echo '<tr>';
foreach($subscription as $key => $val)
{
if($key != 'invoices')
echo '<td>'.$val.'</td>';
}
echo '</tr>';
echo '<tr>';
foreach($subscription->invoices as $invoice)
{
echo '<th>Invoices</th>';
foreach($invoice as $key => $val)
{
echo '<th>'.$key.'</th>';
}
echo '<tr>';
echo '</tr>';
echo '<td></td>';
foreach($invoice as $key => $val)
{
echo '<td>'.$val.'</td>';
}
}
echo '</tr>';
echo '<tr><td></td></tr>';
}
echo '</table>';
}
else
{
//This is an error message that can be access like this:
//echo $json>code." ".$json>error;
echo json_encode($json);
}
?>