Skip to main content

Billing — Invoices (Read)

The Billing Invoices API lets you query invoices generated by the GeoTareas billing system, either created manually or through automation rules.

Prerequisites

All endpoints on this page require a valid JWT token, API key, and tenant header. See Authentication for details.

Pending Implementation

These endpoints are documented but not yet implemented in the public API (/apidev/v1/billing/*). The internal billing services exist in geotareas/facturacion/ but have not been wired to the API developers module. This documentation reflects the planned contract — DTOs, controller routes, permissions, and tests are still pending.


List Invoices

Retrieve a paginated list of invoices with optional filters.

GET/apidev/v1/billing/invoices
PermissionAPICLI_BILLING_READ
Rate Limit60 req/min (sliding window)
CacheNone (financial data)

Request Headers

Every request to a protected endpoint requires these headers:

HeaderRequiredDescription
AuthorizationYesBearer token obtained from the Login endpoint. Format: Bearer <token>
X-API-KeyYesCompany integration key provided during onboarding. Format: gtk_xxx...
tenantYesYour company hostname (e.g., yourcompany.geotareas.com)
Content-TypeConditionalapplication/json — required for POST and PUT requests

Query Parameters

ParameterTypeRequiredDefaultDescription
fromdate (YYYY-MM-DD)YesStart date filter
todate (YYYY-MM-DD)YesEnd date filter (max 90-day range)
statusstringNoStatus code: PENDIENTE, CONCILIADO, CERRADA, ANULADA
typestringNoInvoice type: PAGAR or COBRAR
provider_idstringNoFilter by provider ID
vehicle_idstringNoFilter by vehicle ID
account_idstringNoFilter by account ID
client_idstringNoFilter by client ID
service_idstringNoFilter by service/task ID
tariff_idstringNoFilter by tariff ID
pageintegerNo1Page number
page_sizeintegerNo50Records per page. Max: 200

Response Fields

FieldTypeDescription
idstringInvoice unique identifier
number_manualstring | nullManual invoice number
datestringInvoice date (ISO 8601)
typestringPAGAR or COBRAR
status.codestringStatus code
status.namestringStatus display name
status.behaviorintegerSystem behavior code (1=Pending, 2=Reconciled, 3=Closed, 9=Cancelled)
currency.idstringCurrency ID
currency.namestringCurrency name
currency.symbolstringCurrency symbol
service_idstringRelated service/task ID
assistance_numberstringAssistance number
provider.idstringProvider ID
provider.namestringProvider name
vehicle.idstringVehicle ID
vehicle.platestringVehicle plate
account.idstringAccount ID
account.namestringAccount name
origin.idstringOrigin/procedencia ID
origin.namestringOrigin/procedencia name
tariff.idstringApplied tariff ID
tariff.namestringApplied tariff name
subtotalnumberSubtotal without taxes
taxnumberTotal tax amount
totalnumberTotal with taxes
subtotal_estimatednumberEstimated subtotal
total_estimatednumberEstimated total
impute_toobjectImputation flags (client, account, provider, vehicle, personal, origin)
notesstringObservations
created_atstringCreation timestamp (ISO 8601)
updated_atstringLast update timestamp (ISO 8601)

Code Examples

curl -s -X GET "https://api.example.com/apidev/v1/billing/invoices?from=2026-04-01&to=2026-04-03&status=PENDIENTE" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT"

Response Example

{
"success": true,
"data": {
"items": [
{
"id": "7234567890123456789",
"number_manual": "001-0001",
"date": "2026-04-03T15:02:00",
"type": "PAGAR",
"status": { "code": "PENDIENTE", "name": "Pendiente", "behavior": 1 },
"currency": { "id": "1", "name": "Pesos Uy", "symbol": "$U" },
"service_id": "103878",
"assistance_number": "103490",
"provider": { "id": "5678", "name": "(CONT) Maldonado -San Carlos-Taller Sanca" },
"vehicle": { "id": "1013", "plate": "ABC 1234" },
"account": { "id": "41224", "name": "BRUNO MATIAS BARRETO PADILLA" },
"origin": { "id": "99", "name": "Servicios Sura" },
"tariff": { "id": "1", "name": "Tarifa General - Prestador" },
"subtotal": 900.00,
"tax": 198.00,
"total": 1098.00,
"subtotal_estimated": 900.00,
"total_estimated": 1098.00,
"impute_to": { "client": false, "account": false, "provider": true, "vehicle": false, "personal": false, "origin": true },
"notes": "Factura generada de forma automatica. (Externo)",
"created_at": "2026-04-03T15:02:00",
"updated_at": "2026-04-03T15:02:00"
}
],
"pagination": { "page": 1, "page_size": 50, "total": 1, "total_pages": 1 }
}
}

Errors

CodeHTTPDescription
BILLING_DATE_RANGE_TOO_WIDE400Date range exceeds 90 days
BILLING_INVALID_STATUS400Status code does not exist
CodeHTTP StatusDescriptionResolution
VALIDATION_ERROR400Request body or query parameters failed validationCheck the error.details field for specific validation failures
UNAUTHORIZED401Missing, expired, or invalid JWT token or API keyRe-authenticate via Login to get a fresh token
RATE_LIMITED429Too many requests — rate limit exceededWait until the Retry-After header time elapses. See Rate Limits
INTERNAL_ERROR500Unexpected server errorRetry after a brief delay. If persistent, contact support

Invoice Detail

Retrieve the full detail of a single invoice including all line items.

GET/apidev/v1/billing/invoices/{id}
PermissionAPICLI_BILLING_READ
Rate Limit60 req/min (sliding window)
CacheNone

Path Parameters

ParameterTypeRequiredDescription
idstringYesInvoice unique identifier

Response Fields

Includes all fields from the list endpoint, plus:

FieldTypeDescription
assistance_numberstringAssistance number
driver.idstringDriver/conductor ID
driver.namestringDriver/conductor name
client.idstringClient ID
client.namestring | nullClient name
user.idstringUser who created the invoice
user.namestringUser display name
impute_toobjectFull imputation flags
notesstringObservations
conceptsarrayInvoice line items (see below)
subtotal_estimatednumberEstimated subtotal
total_estimatednumberEstimated total

Concept fields:

FieldTypeDescription
concept_idstringConcept ID
concept_namestringConcept display name
typeintegerConcept type code
quantitynumberQuantity
unit_pricenumberUnit price
subtotalnumberLine subtotal
tax_percentnumberTax percentage
tax_amountnumberTax amount
totalnumberLine total

Response Example

{
"success": true,
"data": {
"id": "7234567890123456789",
"number_manual": "001-0001",
"date": "2026-04-03T15:02:00",
"type": "PAGAR",
"status": { "code": "PENDIENTE", "name": "Pendiente", "behavior": 1 },
"currency": { "id": "1", "name": "Pesos Uy", "symbol": "$U" },
"service_id": "103878",
"assistance_number": "103490",
"provider": { "id": "5678", "name": "(CONT) Maldonado..." },
"vehicle": { "id": "1013", "plate": "ABC 1234" },
"driver": { "id": "22", "name": "Juan Perez" },
"account": { "id": "41224", "name": "BRUNO MATIAS BARRETO PADILLA" },
"client": { "id": "0", "name": null },
"origin": { "id": "99", "name": "Servicios Sura" },
"tariff": { "id": "1", "name": "Tarifa General - Prestador" },
"user": { "id": "82", "name": "OB yuliana" },
"impute_to": {
"client": false,
"account": false,
"provider": true,
"vehicle": false,
"personal": false,
"origin": true
},
"notes": "Factura generada de forma automatica. (Externo)",
"concepts": [
{
"concept_id": "3",
"concept_name": "Movida",
"type": 1,
"quantity": 1.00,
"unit_price": 900.00,
"subtotal": 900.00,
"tax_percent": 22.00,
"tax_amount": 198.00,
"total": 1098.00
}
],
"subtotal": 900.00,
"tax": 198.00,
"total": 1098.00,
"subtotal_estimated": 900.00,
"total_estimated": 1098.00,
"created_at": "2026-04-03T15:02:00",
"updated_at": "2026-04-03T15:02:00"
}
}

Errors

CodeHTTPDescription
BILLING_INVOICE_NOT_FOUND404Invoice not found or does not belong to the tenant

Invoice Concepts

Retrieve only the line items of an invoice (useful when the full detail response is large).

GET/apidev/v1/billing/invoices/{id}/concepts
PermissionAPICLI_BILLING_READ
Rate Limit60 req/min

Response Example

{
"success": true,
"data": {
"invoice_id": "7234567890123456789",
"concepts": [
{
"concept_id": "3",
"concept_name": "Movida",
"concept_unit": "Unidades",
"type": 1,
"quantity": 1.00,
"unit_price": 900.00,
"subtotal": 900.00,
"tax_percent": 22.00,
"tax_amount": 198.00,
"total": 1098.00
}
],
"subtotal": 900.00,
"tax": 198.00,
"total": 1098.00
}
}

Export Invoices

Export invoices to CSV or XLSX. Accepts the same filters as the list endpoint. Limited to 10,000 records.

GET/apidev/v1/billing/invoices/export
PermissionAPICLI_BILLING_READ
Rate Limit5 req/5min (token bucket)
CacheNone

Additional Query Parameters

ParameterTypeDefaultDescription
formatstringcsvExport format: csv or xlsx
include_conceptsbooleanfalseInclude line item detail per invoice
(+ all filters from List Invoices)

Response

The response is a file download, not JSON:

  • CSV: Content-Type: text/csv; charset=utf-8
  • XLSX: Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
curl -s -X GET "https://api.example.com/apidev/v1/billing/invoices/export?from=2026-04-01&to=2026-04-03&format=csv" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT" \
--output invoices.csv

Errors

CodeHTTPDescription
BILLING_EXPORT_TOO_LARGE422Export exceeds 10,000 records