Skip to main content
Retrieve a paginated list of expenses for the authenticated user. Supports filtering by profile, date range, category, tax regime, and text search.

Authentication

Requires a valid JWT token in the Authorization header.
Authorization: Bearer YOUR_JWT_TOKEN

Query Parameters

profileId
string
Filter expenses by profile UUID. If not provided, returns expenses from all profiles.
mes
number
Filter by month (1-12).
año
number
Filter by year.
tipo
string
Filter by payment type. Allowed values: “PUE”, “PPD”, “COMPLEMENTO_PAGO”.
categoria
string
Filter by category.
regimen_fiscal
string
Filter by tax regime of the receiver (3-digit SAT code).
Search across RFC (issuer/receiver), names, and concept. Uses case-insensitive partial matching.
page
number
default:"1"
Page number for pagination (starts at 1).
limit
number
default:"50"
Number of items per page (max 100).

Response

data
array
Array of expense objects.
id
string
UUID of the expense.
profile_id
string
UUID of the associated profile.
profile
object
Profile information.
id
string
Profile UUID.
nombre
string
Profile name.
rfc
string
Profile RFC.
tipo_origen
string
Origin type: “XML” (from CFDI) or “MANUAL” (manually created).
fecha
string
Date of the expense (ISO 8601).
mes
number
Month (1-12).
año
number
Year.
total
number
Total amount.
subtotal
number
Subtotal amount.
iva
number
IVA percentage.
iva_amount
number
IVA amount.
concepto
string
Expense description.
categoria
string
Expense category.
uuid
string
Fiscal folio UUID (for XML expenses).
tipo
string
Payment type: “PUE”, “PPD”, or “COMPLEMENTO_PAGO”.
rfc_emisor
string
Issuer RFC.
nombre_emisor
string
Issuer name.
rfc_receptor
string
Receiver RFC.
nombre_receptor
string
Receiver name.
estadoPago
object
Payment status information (only for XML expenses with tipo PUE/PPD).
estado
string
Payment status.
pagado
number
Amount paid.
pendiente
number
Amount pending.
pagination
object
Pagination information.
total
number
Total number of expenses matching the filters.
page
number
Current page number.
limit
number
Items per page.
totalPages
number
Total number of pages.

Example Request

cURL
curl -X GET "https://api.tresacontafy.com/api/expenses?profileId=123e4567-e89b-12d3-a456-426614174000&mes=3&año=2024&page=1&limit=50" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
cURL
curl -X GET "https://api.tresacontafy.com/api/expenses?search=amazon&page=1" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Error Responses

401
error
Unauthorized - Invalid or missing JWT token.
500
error
Internal server error.

Build docs developers (and LLMs) love