curl --request POST \ --url https://api.econpay.com.br/balance/list \ --header 'Authorization: Bearer SEU_TOKEN_JWT' \ --header 'Content-Type: application/json' \ --data '{ "companyIds": [1, 2, 3] }'
{ "available": 150000, "future": 250000, "retention": 50000 }
Consultar saldos de estabelecimentos
async function checkBalance(companyIds) { const response = await fetch('https://api.econpay.com.br/balance/list', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ companyIds }) }); const balances = await response.json(); return { available: balances.available / 100, future: balances.future / 100, retention: balances.retention / 100, total: (balances.available + balances.future) / 100 }; } const balance = await checkBalance([1]); console.log(`Disponível: R$ ${balance.available.toFixed(2)}`); console.log(`A receber: R$ ${balance.future.toFixed(2)}`); console.log(`Retido: R$ ${balance.retention.toFixed(2)}`); console.log(`Total: R$ ${balance.total.toFixed(2)}`);