GET
/
invoices
/
stats
curl -X GET https://api.contazen.ro/v1/invoices/stats \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -G -d "year=2024"
{
  "success": true,
  "data": {
    "overview": {
      "total_invoices": 245,
      "total_revenue": 458750.00,
      "average_invoice_value": 1872.45,
      "payment_rate": 87.5
    },
    "by_status": {
      "draft": 5,
      "sent": 25,
      "paid": 195,
      "overdue": 15,
      "cancelled": 5
    },
    "monthly_trend": [
      {
        "month": "January",
        "month_number": 1,
        "total": 35000.00,
        "count": 18,
        "growth": 0
      },
      {
        "month": "February",
        "month_number": 2,
        "total": 42000.00,
        "count": 22,
        "growth": 20.0
      }
    ],
    "top_clients": [
      {
        "client_id": "cli_abc123def",
        "client_name": "Tech Solutions SRL",
        "total_revenue": 85000.00,
        "invoice_count": 12,
        "percentage": 18.5
      }
    ],
    "by_currency": [
      {
        "currency": "RON",
        "total": 385000.00,
        "total_ron": 385000.00,
        "count": 210
      },
      {
        "currency": "EUR",
        "total": 15000.00,
        "total_ron": 73750.00,
        "count": 35
      }
    ],
    "payment_methods": {
      "bank_transfer": 165,
      "cash": 20,
      "card": 10,
      "other": 0
    }
  }
}

Overview

This endpoint provides detailed invoice statistics including counts by status, monthly trends, top clients, and revenue breakdown. Perfect for dashboards and analytics.

Query Parameters

year
integer
Year for statistics (defaults to current year)
month
integer
Specific month (1-12) for detailed monthly statistics
quarter
integer
Specific quarter (1-4) for quarterly statistics
currency
string
Filter statistics by specific currency

Response

success
boolean
Indicates if the request was successful
data
object
curl -X GET https://api.contazen.ro/v1/invoices/stats \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -G -d "year=2024"
{
  "success": true,
  "data": {
    "overview": {
      "total_invoices": 245,
      "total_revenue": 458750.00,
      "average_invoice_value": 1872.45,
      "payment_rate": 87.5
    },
    "by_status": {
      "draft": 5,
      "sent": 25,
      "paid": 195,
      "overdue": 15,
      "cancelled": 5
    },
    "monthly_trend": [
      {
        "month": "January",
        "month_number": 1,
        "total": 35000.00,
        "count": 18,
        "growth": 0
      },
      {
        "month": "February",
        "month_number": 2,
        "total": 42000.00,
        "count": 22,
        "growth": 20.0
      }
    ],
    "top_clients": [
      {
        "client_id": "cli_abc123def",
        "client_name": "Tech Solutions SRL",
        "total_revenue": 85000.00,
        "invoice_count": 12,
        "percentage": 18.5
      }
    ],
    "by_currency": [
      {
        "currency": "RON",
        "total": 385000.00,
        "total_ron": 385000.00,
        "count": 210
      },
      {
        "currency": "EUR",
        "total": 15000.00,
        "total_ron": 73750.00,
        "count": 35
      }
    ],
    "payment_methods": {
      "bank_transfer": 165,
      "cash": 20,
      "card": 10,
      "other": 0
    }
  }
}