Revenue: Tracking and Invoicing
Monitor your revenue, understand invoicing cycles, and track commission payments from your referral partnership.
Overview
Debitura provides comprehensive revenue tracking and transparent invoicing for all referral partner commissions. This guide covers how to monitor your earnings, understand invoice cycles, and manage payments.
Revenue Dashboard
Access Your Dashboard
View real-time revenue metrics:
GET /v1/referral-partners/revenue/dashboard
Response:
{
"summary": {
"current_month": {
"total_commission": { "value": 12500, "currency": "EUR" },
"cases_attributed": 42,
"average_commission_per_case": { "value": 298, "currency": "EUR" }
},
"last_month": {
"total_commission": { "value": 11200, "currency": "EUR" },
"cases_attributed": 38,
"paid": true
},
"year_to_date": {
"total_commission": { "value": 145000, "currency": "EUR" },
"cases_attributed": 487
},
"all_time": {
"total_commission": { "value": 423000, "currency": "EUR" },
"cases_attributed": 1423
}
},
"pending_payment": {
"amount": { "value": 11200, "currency": "EUR" },
"invoice_date": "2024-02-01",
"due_date": "2024-02-15"
}
}
Key Metrics
Commission Breakdown:
- Total commission earned (current period)
- Number of attributed cases
- Average commission per case
- Month-over-month growth
Payment Status:
- Pending payments
- Paid amounts
- Payment schedule
Revenue Tracking
Track Individual Cases
Monitor commission for specific cases:
GET /v1/referral-partners/revenue/cases
Query Parameters:
| Parameter | Description |
|---|---|
status | Filter by payment status: pending, paid, reversed |
month | Filter by month: 2024-01 |
limit | Results per page (max 100) |
Response:
{
"cases": [
{
"case_id": "case_abc123",
"client_id": "cli_xyz789",
"created_at": "2024-01-15T10:00:00Z",
"amount_collected": { "value": 10000, "currency": "EUR" },
"debitura_fee": { "value": 2500, "currency": "EUR" },
"commission": {
"rate": 0.20,
"amount": { "value": 500, "currency": "EUR" },
"status": "paid",
"paid_at": "2024-02-01T00:00:00Z",
"invoice_number": "INV-2024-02-001"
}
}
],
"summary": {
"total_cases": 42,
"total_commission": { "value": 12500, "currency": "EUR" }
}
}
Revenue by Period
Analyze revenue trends over time:
GET /v1/referral-partners/revenue/periods?start=2024-01&end=2024-12
Response:
{
"periods": [
{
"period": "2024-01",
"cases_created": 38,
"cases_collected": 35,
"total_collected": { "value": 350000, "currency": "EUR" },
"total_commission": { "value": 11200, "currency": "EUR" },
"payment_status": "paid",
"invoice_number": "INV-2024-02-001"
},
{
"period": "2024-02",
"cases_created": 42,
"cases_collected": 39,
"total_collected": { "value": 390000, "currency": "EUR" },
"total_commission": { "value": 12500, "currency": "EUR" },
"payment_status": "pending",
"invoice_number": "INV-2024-03-001"
}
]
}
Revenue by Client
See which clients generate most revenue:
GET /v1/referral-partners/revenue/by-client?period=2024-01
Response:
{
"clients": [
{
"client_id": "cli_abc123",
"external_id": "customer_001",
"company_name": "Acme Corporation",
"cases_count": 12,
"total_commission": { "value": 3600, "currency": "EUR" },
"average_commission": { "value": 300, "currency": "EUR" }
}
]
}
Invoicing
Invoice Cycle
Monthly Invoicing:
- Invoices generated: 1st of each month
- Period covered: Previous calendar month
- Payment due: 15 days from invoice date
- Payment method: Bank transfer
Timeline Example:
January 1-31: Cases collected, commission accrued
February 1: Invoice generated for January
February 15: Payment due
February 15-20: Payment processed
Invoice Structure
Invoice includes:
- Partner details
- Invoice period (e.g., January 2024)
- Line items for each case
- Subtotal by case status
- Adjustments (if any)
- Total commission due
- Payment terms
View Invoices
List all invoices:
GET /v1/referral-partners/invoices
Response:
{
"invoices": [
{
"invoice_number": "INV-2024-02-001",
"period": "2024-01",
"issued_date": "2024-02-01",
"due_date": "2024-02-15",
"amount": { "value": 11200, "currency": "EUR" },
"status": "paid",
"paid_date": "2024-02-14",
"payment_reference": "REF-2024-02-14-001",
"pdf_url": "https://api.debitura.com/invoices/INV-2024-02-001.pdf"
}
]
}
Download Invoice
Get invoice PDF:
GET /v1/referral-partners/invoices/{invoice_number}/pdf
Returns PDF file for download.
Invoice Details
Detailed breakdown of an invoice:
GET /v1/referral-partners/invoices/{invoice_number}
Response:
{
"invoice_number": "INV-2024-02-001",
"period": "2024-01",
"partner": {
"partner_id": "ref_partner_123",
"company_name": "Your Platform AB",
"vat_number": "SE123456789001",
"address": {
"street": "Kungsgatan 1",
"city": "Stockholm",
"postal_code": "111 43",
"country": "SE"
}
},
"line_items": [
{
"description": "Commission on 38 cases",
"quantity": 38,
"amount": { "value": 11200, "currency": "EUR" }
}
],
"adjustments": [
{
"description": "Previous period adjustment",
"amount": { "value": -150, "currency": "EUR" },
"reason": "Refunded case from Dec 2023"
}
],
"subtotal": { "value": 11200, "currency": "EUR" },
"adjustments_total": { "value": -150, "currency": "EUR" },
"total": { "value": 11050, "currency": "EUR" },
"vat_included": false
}
Payment Processing
Payment Methods
Bank Transfer (Default):
- Automatic bank transfer
- 1-3 business days processing
- No fees deducted
PayPal:
- Optional payment method
- Faster processing (1 day)
- May incur PayPal fees
Configure Payment Details
Set up or update payment information:
POST /v1/referral-partners/payment-details
Request:
{
"method": "bank_transfer",
"bank_account": {
"iban": "SE4550000000058398257466",
"swift": "ESSESESS",
"account_holder": "Your Platform AB",
"bank_name": "SEB"
},
"billing_address": {
"company_name": "Your Platform AB",
"vat_number": "SE123456789001",
"street": "Kungsgatan 1",
"city": "Stockholm",
"postal_code": "111 43",
"country": "SE"
}
}
Payment Notifications
Receive notification when payment is processed:
Webhook Event:
{
"event": "invoice.paid",
"data": {
"invoice_number": "INV-2024-02-001",
"amount": { "value": 11200, "currency": "EUR" },
"paid_date": "2024-02-14",
"payment_reference": "REF-2024-02-14-001",
"period": "2024-01"
}
}
Payment Status
Check payment status for an invoice:
GET /v1/referral-partners/invoices/{invoice_number}/payment-status
Response:
{
"invoice_number": "INV-2024-02-001",
"status": "paid",
"amount": { "value": 11200, "currency": "EUR" },
"paid_date": "2024-02-14T10:30:00Z",
"payment_method": "bank_transfer",
"reference": "REF-2024-02-14-001"
}
Reporting
Export Revenue Data
Export revenue data for your own reporting:
GET /v1/referral-partners/revenue/export?format=csv&period=2024-01
Formats:
csv- Comma-separated valuesxlsx- Excel spreadsheetjson- JSON format
CSV Example:
case_id,client_id,created_at,amount_collected,commission,status
case_abc123,cli_xyz789,2024-01-15,10000.00,500.00,paid
case_def456,cli_xyz789,2024-01-20,5000.00,250.00,paid
Custom Reports
Generate custom revenue reports:
POST /v1/referral-partners/reports/custom
Request:
{
"report_type": "revenue_summary",
"period": {
"start": "2024-01-01",
"end": "2024-12-31"
},
"group_by": "month",
"metrics": ["commission", "cases_count", "collection_rate"],
"format": "xlsx"
}
Response:
{
"report_id": "rpt_abc123",
"status": "generating",
"estimated_completion": "2024-01-15T10:05:00Z",
"download_url": null
}
Receive webhook when report is ready:
{
"event": "report.ready",
"data": {
"report_id": "rpt_abc123",
"download_url": "https://api.debitura.com/reports/rpt_abc123.xlsx",
"expires_at": "2024-01-22T10:00:00Z"
}
}
Analytics
Performance Metrics
Track key performance indicators:
GET /v1/referral-partners/analytics/performance
Response:
{
"period": "2024-01",
"kpis": {
"total_commission": { "value": 11200, "currency": "EUR" },
"cases_created": 42,
"cases_collected": 39,
"collection_rate": 0.929,
"average_days_to_collection": 28,
"commission_per_case": { "value": 287, "currency": "EUR" },
"growth": {
"commission_growth": 0.116,
"case_growth": 0.105
}
}
}
Trending Data
Identify trends in your revenue:
GET /v1/referral-partners/analytics/trends?period=last_6_months
Response:
{
"trends": {
"commission_trend": "increasing",
"average_commission_trend": "stable",
"case_volume_trend": "increasing",
"insights": [
"Commission increased 11.6% vs. previous month",
"Case volume growing at 10.5% monthly rate",
"Collection rate improved 2% vs. 6-month average"
]
}
}
Adjustments
Understanding Adjustments
Adjustments may appear on invoices for:
- Refunds: Customer refunded after payment
- Corrections: Calculation errors
- Disputed Cases: Attribution disputes resolved
- Currency Adjustments: Exchange rate corrections
Adjustment Notifications
Receive notification of adjustments:
Webhook Event:
{
"event": "revenue.adjustment",
"data": {
"adjustment_id": "adj_abc123",
"type": "refund",
"case_id": "case_xyz789",
"amount": { "value": -500, "currency": "EUR" },
"reason": "Customer refund processed",
"applied_to_invoice": "INV-2024-03-001"
}
}
View Adjustments
List all adjustments:
GET /v1/referral-partners/revenue/adjustments
Response:
{
"adjustments": [
{
"adjustment_id": "adj_abc123",
"type": "refund",
"case_id": "case_xyz789",
"amount": { "value": -500, "currency": "EUR" },
"reason": "Customer refund processed",
"created_at": "2024-02-10T14:30:00Z",
"applied_to_invoice": "INV-2024-03-001"
}
]
}
Tax and Compliance
VAT Handling
Reverse Charge Mechanism: For EU B2B partnerships, VAT is typically handled via reverse charge:
- Invoices issued without VAT
- You account for VAT in your country
- Requires valid VAT number
Configure VAT:
POST /v1/referral-partners/tax-settings
Request:
{
"vat_number": "SE123456789001",
"tax_country": "SE",
"reverse_charge_applicable": true
}
Tax Documentation
Download annual tax summary:
GET /v1/referral-partners/tax/annual-summary?year=2024
Provides summary for tax filing purposes.
Best Practices
Revenue Monitoring
- Check dashboard weekly for real-time tracking
- Review invoices promptly when issued
- Download PDFs for your records
- Export data monthly for your own reporting
Payment Management
- Keep payment details updated to avoid delays
- Monitor payment notifications via webhooks
- Reconcile payments with your accounting system
- Contact support immediately if payment issues
Record Keeping
- Save all invoices (PDF and data)
- Track adjustments and reasons
- Export monthly reports for analysis
- Archive annual summaries for tax purposes
Troubleshooting
Issue: Commission seems incorrect
Solution:
- Check case attribution
- Verify collection amounts
- Review commission rate in partnership agreement
- Check for adjustments
Issue: Payment not received
Solution:
- Verify payment details are correct
- Check invoice due date
- Review payment status via API
- Contact Debitura finance team
Issue: Missing cases in revenue report
Solution:
- Verify cases are attributed to your partnership
- Check if cases have been collected
- Review case creation timestamps
- Ensure bearer tokens were used
Next Steps
- Revenue Attribution - Understand attribution rules
- Integration Examples - Code samples
- Troubleshooting - Common issues