Differences Report
System vs provider amount comparison per invoice — highlights discrepancies with percentage and absolute differences.
GET
/apidev/v1/reports/portal/differencesPermissionAPICLI_RPTPORTAL_DIFERENCIAS
Rate Limit10 req/min (sliding window)
Cache300s (5 min)
Max Range93 days
Overview
Compares system-calculated amounts against provider-reported amounts for each invoice. Returns paginated rows with per-invoice differences and a summary with aggregate totals.
- Per-invoice detail — absolute and percentage difference for every invoice
- Provider filtering — restrict to specific providers (up to 100)
- State filtering — filter by invoice state codes (100–106)
- Summary aggregates — total system vs provider amounts, net difference, count of invoices with discrepancies
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
startdate | string | Yes | — | ISO 8601 start date |
enddate | string | Yes | — | ISO 8601 end date. Max range 93 days |
providers | string | No | All | Comma-separated provider IDs. Max 100 |
states | string | No | All | Comma-separated state codes (100–106) |
limit | integer | No | 25 | Records per page (1–100) |
offset | integer | No | 0 | Records to skip |
Code Examples
- cURL
- JavaScript
- Python
curl -s "https://$TENANT/apidev/v1/reports/portal/differences?startdate=2026-01-01&enddate=2026-03-31&limit=50" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT"
const response = await fetch(
`https://${TENANT}/apidev/v1/reports/portal/differences?startdate=2026-01-01&enddate=2026-03-31&limit=50`,
{ headers }
);
const { data, meta } = await response.json();
console.log(`Net difference: ${data.summary.net_difference}`);
response = requests.get(
f"https://{TENANT}/apidev/v1/reports/portal/differences",
headers=headers,
params={"startdate": "2026-01-01", "enddate": "2026-03-31", "limit": 50},
)
result = response.json()
rows = result["data"]["rows"]
Response Fields
Rows
| Field | Type | Description |
|---|---|---|
invoice_id | string | Invoice identifier |
provider_id | string | Provider identifier |
provider_name | string | Provider display name |
service_id | string | Associated service identifier |
service_number | string | Service number (human-readable) |
invoice_date | string | Invoice date |
system_amount | number | System-calculated amount |
provider_amount | number | null | Provider-reported amount. null if not submitted |
difference | number | Absolute difference (system − provider) |
difference_pct | number | Percentage difference |
state_code | string | null | Invoice state code |
state_name | string | null | Human-readable state name |
provider_invoice_number | string | null | Provider's own invoice number |
provider_invoice_date | string | null | Date on the provider's invoice |
Summary
| Field | Type | Description |
|---|---|---|
total_system | number | Sum of all system amounts |
total_provider | number | Sum of all provider amounts |
net_difference | number | Total system − total provider |
avg_variation_pct | number | Average variation percentage |
total_invoices | number | Total invoice count in range |
invoices_with_difference | number | Count of invoices where difference ≠ 0 |
Example Response
{
"success": true,
"data": {
"rows": [
{
"invoice_id": "710450328800",
"provider_id": "504210987600",
"provider_name": "Transporte Rápido S.A.",
"service_id": "820134567800",
"service_number": "SRV-2026-00142",
"invoice_date": "2026-02-15",
"system_amount": 12500.00,
"provider_amount": 13100.00,
"difference": -600.00,
"difference_pct": -4.80,
"state_code": "101",
"state_name": "In Review",
"provider_invoice_number": "FAC-2026-0087",
"provider_invoice_date": "2026-02-14"
},
{
"invoice_id": "710450328801",
"provider_id": "504210987601",
"provider_name": "Logística del Norte",
"service_id": "820134567801",
"service_number": "SRV-2026-00158",
"invoice_date": "2026-02-18",
"system_amount": 8700.00,
"provider_amount": 8700.00,
"difference": 0.00,
"difference_pct": 0.00,
"state_code": "102",
"state_name": "Approved",
"provider_invoice_number": "LN-0234",
"provider_invoice_date": "2026-02-17"
}
],
"summary": {
"total_system": 842300.00,
"total_provider": 856720.00,
"net_difference": -14420.00,
"avg_variation_pct": 1.71,
"total_invoices": 253,
"invoices_with_difference": 87
}
},
"meta": {
"total": 253,
"limit": 50,
"offset": 0
}
}
Errors
| Code | HTTP | Description |
|---|---|---|
BAD_REQUEST | 400 | Missing required headers or startdate/enddate |
VALIDATION_ERROR | 400 | Date range exceeds 93 days, invalid state codes, > 100 providers |
UNAUTHORIZED | 401 | Invalid or expired JWT / API Key |
FORBIDDEN | 403 | User lacks APICLI_RPTPORTAL_DIFERENCIAS permission |
RATE_LIMITED | 429 | Exceeded 10 req/min |
INTERNAL_ERROR | 500 | Unexpected server error |
Related
- Portal Dashboard — Executive KPIs and charts
- Tolerance Report — Tolerance rule analysis per invoice
- Portal Invoices — Invoice management endpoints
- Pagination — Standard pagination parameters