curl --request GET \
--url https://api.timbrix.mx/invoices/report/export.csv \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.timbrix.mx/invoices/report/export.csv"
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/export.csv', 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/export.csv",
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/export.csv"
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/export.csv")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbrix.mx/invoices/report/export.csv")
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_bodyExport Invoices as CSV
Capped at 500 matching invoices per request — narrow the date range if you hit the limit.
curl --request GET \
--url https://api.timbrix.mx/invoices/report/export.csv \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.timbrix.mx/invoices/report/export.csv"
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/export.csv', 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/export.csv",
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/export.csv"
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/export.csv")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbrix.mx/invoices/report/export.csv")
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_bodyImpuesto="002", never derived by subtraction), so the columns reconcile: Subtotal + IVA - Retenciones = Total.
Note: The export is limited to 500 invoices per request. If the filter matches more than 500 invoices, the endpoint returns a 400 error. To export larger datasets, use multiple requests with narrower date ranges or other filters.
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/export.csv?dateFrom=2026-08-01&dateTo=2026-08-31" \
-H "Authorization: Bearer <your_token>" \
-H "X-Organization-Id: 550e8400-e29b-41d4-a716-446655440000" \
-o invoices.csv
const csvContent = await timbrix.invoices.exportCsv(
{ dateFrom: "2026-08-01", dateTo: "2026-08-31" },
"550e8400-e29b-41d4-a716-446655440000"
)
console.log(csvContent)
Example Response
CSV file with the following columns:Fecha,Serie,Folio,UUID,Tipo,RFC Receptor,Subtotal,IVA,Retenciones,Total,Estatus
2026-08-15,A,1,d3bfbc57-44af-4390-a064-f0afab85e5df,I,GODE561231GR8,100.00,16,0,116.00,vigente
2026-08-16,A,2,e4cfccd68-55bg-5401-b175-g1bgbc96f6eg,I,GODE561231GR8,250.00,40,0,290.00,vigente
Common Errors
400 Bad Request
The filter matches more than 500 invoices. Use narrower date ranges or additional filters to reduce the result set.401 Unauthorized
Missing or invalid Bearer token / API key.403 Forbidden
The authenticated user is not a member of the organization sent inX-Organization-Id, or the API key does not have the read:invoices scope.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
CSV de facturas