Retrieve aggregate statistics about your payment transactions
GET /payments/stats
Authorization: YOUR_API_KEY
Show Statistics Fields
curl -X GET "https://api.spendjuice.com/payments/stats" \ -H "Authorization: YOUR_API_KEY"
{ "data": { "captured": 2, "failed": 5, "pending": 2, "settled": 8, "total": 20 } }
const stats = await getPaymentStats(); const successRate = (stats.data.settled / stats.data.total) * 100; console.log(`Payment Success Rate: ${successRate}%`);
const stats = await getPaymentStats(); if (stats.data.failed > 0) { notifyTeam(`${stats.data.failed} failed payments require attention`); }