curl --request GET \
--url https://api.timbrix.mx/invoices/report/summary \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.timbrix.mx/invoices/report/summary"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.timbrix.mx/invoices/report/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.timbrix.mx/invoices/report/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.timbrix.mx/invoices/report/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.timbrix.mx/invoices/report/summary")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbrix.mx/invoices/report/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"subtotal": 12500.5,
"total": 14500.58,
"iva": 2000.08,
"ivaCapped": false,
"retenciones": 350.5,
"ivaIncomplete": false,
"vigenteCount": 48,
"canceladoCount": 2,
"totalCount": 50
}Get Invoice Report Summary
Subtotal/total are summed via SQL (unbounded). IVA is computed by parsing each matching invoice’s stamped XML — capped at 2000 matching invoices per request; beyond that, iva is null and ivaCapped is true, and the caller should narrow the date range.
curl --request GET \
--url https://api.timbrix.mx/invoices/report/summary \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.timbrix.mx/invoices/report/summary"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.timbrix.mx/invoices/report/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.timbrix.mx/invoices/report/summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.timbrix.mx/invoices/report/summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.timbrix.mx/invoices/report/summary")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbrix.mx/invoices/report/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"subtotal": 12500.5,
"total": 14500.58,
"iva": 2000.08,
"ivaCapped": false,
"retenciones": 350.5,
"ivaIncomplete": false,
"vigenteCount": 48,
"canceladoCount": 2,
"totalCount": 50
}total - subtotal, since that breaks under retenciones or a non-16% rate.
Authentication
Accepts either:- A Supabase Bearer session (
Authorization: Bearer <token>) with theX-Organization-Id: <org-id>header. - An API key (
X-API-Key: sk_...) with theread:invoicesscope.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
dateFrom | string (ISO date) | Filtra por fecha de registro en Timbrix (createdAt), desde (inclusive). Un valor de solo fecha (YYYY-MM-DD) se ancla al inicio del día en America/Mexico_City. |
dateTo | string (ISO date) | Filtra por fecha de registro en Timbrix (createdAt), hasta (inclusive). Un valor de solo fecha (YYYY-MM-DD) se ancla al final del día (23:59:59.999) en America/Mexico_City. |
type | "I" | "E" | "T" | Filtra por tipo de comprobante |
status | "vigente" | "cancelado" | Filtra por estatus |
rfcReceptor | string | Filtra por RFC exacto del receptor |
environment | "sandbox" | "production" | Filtra por entorno. Ignorado con API key (siempre usa el entorno de la key). Con sesión de Supabase, por defecto es production — pasa environment=sandbox explícitamente para incluir CFDI de sandbox. |
Example Request
curl -X GET "https://api.timbrix.mx/invoices/report/summary?dateFrom=2026-08-01&dateTo=2026-08-31" \
-H "Authorization: Bearer <your_token>" \
-H "X-Organization-Id: 550e8400-e29b-41d4-a716-446655440000"
const summary = await timbrix.invoices.reportSummary(
{ dateFrom: "2026-08-01", dateTo: "2026-08-31" },
"550e8400-e29b-41d4-a716-446655440000"
)
console.log(summary.subtotal, summary.iva, summary.total)
Example Response
{
"subtotal": 12500.5,
"total": 14500.58,
"iva": 2000.08,
"ivaCapped": false,
"retenciones": 350.5,
"ivaIncomplete": false,
"vigenteCount": 48,
"canceladoCount": 2,
"totalCount": 50
}
| Field | Type | Description |
|---|---|---|
subtotal | number | Suma de subtotales de las facturas que coinciden con el filtro |
total | number | Suma de totales de las facturas que coinciden con el filtro |
iva | number | null | Suma de IVA trasladado (Impuesto="002" únicamente — nunca IEPS ni otro tipo) leído del XML de cada CFDI — null cuando ivaCapped es true |
ivaCapped | boolean | true cuando el filtro coincide con demasiadas facturas para calcular IVA en una solicitud |
retenciones | number | null | Suma de impuestos retenidos (ISR, IVA retenido, etc.) leído del XML de cada CFDI — null cuando ivaCapped es true, misma regla que iva |
ivaIncomplete | boolean | true cuando uno o más CFDI del rango filtrado no pudieron parsearse — iva/retenciones están subestimados para este reporte |
vigenteCount | integer | Facturas vigentes que coinciden con el filtro |
canceladoCount | integer | Facturas canceladas que coinciden con el filtro |
totalCount | integer | vigenteCount + canceladoCount |
Authorizations
API Key for authentication (format: sk_...)
Headers
Required for Supabase session auth. Ignored when authenticating with an API key (the organization resolves from the key).
Query Parameters
Filtra por fecha de registro en Timbrix (createdAt), desde (inclusive, ISO 8601). Un valor de solo fecha (YYYY-MM-DD) se ancla al inicio del día en America/Mexico_City.
"2026-08-01"
Filtra por fecha de registro en Timbrix (createdAt), hasta (inclusive, ISO 8601). Un valor de solo fecha (YYYY-MM-DD) se ancla al final del día (23:59:59.999) en America/Mexico_City, incluyendo el día completo.
"2026-08-31"
Filtra por tipo de comprobante
I, E, T Filtra por estatus
vigente, cancelado Filtra por RFC exacto del receptor
"XAXX010101000"
Filtra por entorno. Ignorado para peticiones autenticadas con API key (siempre se usa el entorno de la key). Para una sesión de Supabase, por defecto es 'production' — pasa este parámetro para incluir CFDI de sandbox.
sandbox, production Response
12500.5
14500.58
Suma de IVA trasladado leído del XML de cada CFDI — null cuando el rango filtrado excede el límite calculable (ver ivaCapped)
2000.08
true cuando el rango filtrado tiene demasiados CFDI para calcular IVA en esta solicitud — reduce el rango de fechas
false
Suma de impuestos retenidos (ISR, IVA retenido, etc.) leída del XML de cada CFDI — null cuando el rango filtrado excede el límite calculable (ver ivaCapped)
350.5
true cuando uno o más CFDI del rango filtrado no pudieron parsearse — iva/retenciones están incompletos (subestimados) para este reporte
false
48
2
50