Getting started
Make your first call to the Ecovoy API in a few minutes, using sandbox credentials. Nothing is charged in the sandbox.
1. Use your Ecovoy account
There is no separate developer signup. Log in with the same account you use on ecovoy.com. Your account acts as the organization that owns your applications, and its Ecovoy balance is the balance used in Production.
2. Create an application and sandbox credentials
- Open Dashboard → My applications → New application.
- On the application page, click Generate sandbox credentials.
- Copy the
client_secretimmediately and store it in a secret manager or environment variable. It is shown only once. If you lose it, generate a new one (the old one is revoked).
Sandbox credentials start with ecv_test_; Production credentials start with ecv_live_. A sandbox credential never works in Production, and vice versa.
3. Request an access token
Exchange the credentials for an access token on POST /oauth/token. Do this from your server only.
curl -X POST https://api.ecovoy.com/api/v2/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d grant_type=client_credentials \
-d client_id=ecv_test_xxxxxxxxxxxxxxxxxxxxxxxx \
-d client_secret=ecvs_test_xxxxxxxxxxxxxxxxxxxxxxxx
<?php
$ch = curl_init('https://api.ecovoy.com/api/v2/oauth/token');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'grant_type' => 'client_credentials',
'client_id' => getenv('ECOVOY_CLIENT_ID'),
'client_secret' => getenv('ECOVOY_CLIENT_SECRET'),
]),
]);
$token = json_decode(curl_exec($ch), true);
curl_close($ch);
echo $token['access_token'];
// Node.js 18+ (server side only — never expose your client_secret in a browser)
const res = await fetch('https://api.ecovoy.com/api/v2/oauth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: process.env.ECOVOY_CLIENT_ID,
client_secret: process.env.ECOVOY_CLIENT_SECRET,
}),
});
const token = await res.json();
console.log(token.access_token);
{
"access_token": "ecvat_test_9f2c...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "account:read balance:read transactions:read topup:read topup:write",
"environment": "sandbox"
}
4. Make your first API call
Send the token in the Authorization header. GET /me tells you which application, environment and scopes the token carries.
curl https://api.ecovoy.com/api/v2/me \
-H "Authorization: Bearer ecvat_test_9f2c..."
<?php
$ch = curl_init('https://api.ecovoy.com/api/v2/me');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $accessToken],
]);
$me = json_decode(curl_exec($ch), true);
const me = await fetch('https://api.ecovoy.com/api/v2/me', {
headers: { Authorization: `Bearer ${accessToken}` },
}).then(r => r.json());
Next, try a top-up lookup and a sandbox order.
5. Go to Production
When your integration works in the sandbox, click Request Production access on the application page. An Ecovoy administrator reviews every request manually. After approval you can generate Production (ecv_live_) credentials.
In Production, confirming a top-up order executes a real recharge and debits your Ecovoy balance. An order can be cancelled with /cancel-transaction only before it is confirmed. See Products and services.