Compras (Purchases)
Purchase vouchers from suppliers: what was bought, from whom, on which invoice and for how much. Useful for reconciling input VAT, building a supplier ranking, viewing spend by branch or category, or feeding a purchasing dashboard.
GET /v1/{cuenta}/compras is Cianbox's listing: headers from most
recent to oldest, with the same filters, amounts and states as the full
document, paginated by cursor (not
page/limit) — the same contract as
sales. The full content —line items, the
delivery notes that received the goods, the purchase orders it fulfills— is
fetched by id: GET /compras/{id} returns exactly the same as
GET /documentos/compra/{id}.
Example
curl -H "X-API-Key: YOUR_KEY" \
"https://api.cianbox.uno/v1/YOUR_ACCOUNT/compras?fecha_desde=2026-08-01&fecha_hasta=2026-08-31&limite=1"
{
"status": "ok", "module": "reporte:listado_compras", "count": 4, "units_charged": 4,
"body": {
"listado_compras": {
"parametros": {"fecha_desde": "2026-08-01", "fecha_hasta": "2026-08-31",
"tipo_fecha": "comprobante", "separar_por_moneda": false, "limite": 1},
"conversion": {"moneda": "ARS", "criterio": "cotizacion_de_cada_comprobante",
"comprobantes_convertidos": 0, "comprobantes_sin_cotizacion": 0},
"totales": [{"moneda": "ARS", "cantidad": 4, "total_neto": 138879.59}],
"compras": [
{
"id": 8046,
"comprobante": {"tipo": "Factura", "letra": "A", "punto_venta": 20, "numero": 45170,
"numero_completo": "Factura A 0020-00045170",
"contribuyente": {"id": 1, "razon_social": "Mi Empresa S.A.",
"cuit": "30-71234567-8", "condicion_iva": "Responsable Inscripto"}},
"fecha": "2026-08-14", "fecha_contabilizacion": "2026-08-31",
"proveedor": {"id": 334, "nombre": "Proveedor Ejemplo S.R.L.",
"cuit": "30-87654321-9", "condicion_iva": "Responsable Inscripto"},
"sucursal": {"id": 1, "nombre": "Casa Central"},
"usuario_carga": {"id": 5, "nombre": "Compras"},
"categoria": {"id": 8, "nombre": "SERVICIOS"},
"movimiento": {"id": 1, "nombre": "Compra de mercadería"},
"forma_pago": {"id": 1, "nombre": "Cuenta Corriente"},
"moneda": "ARS",
"neto_sin_iva": 28825.28, "total": 34879.59,
"saldo_pendiente": 34879.59, "saldo_vencido": 0.0,
"estado_pago": "pendiente"
}
],
"paginacion": {"limite": 1, "siguiente_cursor": "2026-08-14:8046", "hay_mas": true}
}
}
}
What each row brings
proveedor is the same object as in the document (id, name, tax id,
VAT category); sucursal, usuario_carga, categoria, movimiento and
forma_pago are {id, nombre} or null if the purchase has no such data.
forma_pago isn't stored on the purchase itself: it's derived from whether
it ended up on account or paid in cash, same as in the document.
| Field | What it is |
|---|---|
id |
The purchase's id, to request GET /compras/{id} |
comprobante |
The SUPPLIER's voucher type, letter and number, already assembled, plus the contribuyente that received it |
fecha |
The supplier's voucher date |
fecha_contabilizacion |
The date it was booked (can fall in a different period than fecha) |
proveedor |
{id, nombre, cuit, condicion_iva} |
sucursal, usuario_carga, categoria, movimiento, forma_pago |
{id, nombre} or null |
moneda |
The purchase's ISO code ("ARS", "USD"…) |
neto_sin_iva, total |
In the purchase's currency; a credit note shows positive |
saldo_pendiente, saldo_vencido |
What's still owed and, of that, how much is overdue — only with the accounts-payable permission (see below) |
estado_pago |
"pendiente", "vencida" or "saldada" — only with the accounts-payable permission |
plan_pago |
If the purchase is the invoice of a payment plan installment: {id, titulo, cuota: {numero, cantidad}} (the plan, at GET /documentos/plan_pago/{id}); null for a regular purchase |
Purchases have no voiding: if a row shows up, it's active (deleted ones are neither listed nor fetchable by id).
Cursor pagination
Same as sales: no page/limit. Always use paginacion.siguiente_cursor
from the previous response in ?cursor=. limite accepts up to 1000
(default 50).
.../compras?fecha_desde=2026-01-01&fecha_hasta=2026-09-30&limite=100
.../compras?fecha_desde=2026-01-01&fecha_hasta=2026-09-30&limite=100&cursor=2026-08-14:8046
Filters
| Filter | What it does |
|---|---|
fecha_desde, fecha_hasta |
YYYY-MM-DD. With neither: the current month |
tipo_fecha |
comprobante (default) or contabilizacion: chooses which date fecha_desde/fecha_hasta, ordering and the cursor use |
id_proveedor, id_sucursal, id_usuario, id_categoria, id_comprobante, id_movimiento, id_contribuyente, id_producto |
An id or a comma-separated list |
numero |
The supplier's voucher number, from any point of sale and type |
importe_desde, importe_hasta |
On the total as shown (credit note positive) |
moneda |
ISO code, as loaded |
letra |
The supplier's voucher letter: A, B, C, E, M, P, R, S, T or X, case insensitive. Any other letter returns 400 |
tipo |
factura, nota_credito and/or nota_debito, comma separated |
forma_pago |
cuenta_corriente (on account) or contado (cash) |
estado_pago |
pendiente (includes overdue), vencida or saldada — requires the ctacte_proveedores resource, otherwise 403 |
origen |
compras (default), cuotas_plan or todas (see below) |
separar_por_moneda |
true for totales per currency without converting, instead of unified into the main one |
Purchases don't accept incluir_anulados (there's no voiding). A filter not
on this list returns 400 filtro_invalido.
id_movimiento is this resource's most important filter.
tabla_compras records EVERY outflow — merchandise, expenses, payroll,
taxes, fixed assets — not just what you bought to resell. For "how much did
I buy from this merchandise supplier?" filter id_movimiento=1; without
it, a supplier ranking mixes tax authorities, your landlord and your actual
suppliers together.
Payment plan installment invoices (origen). When a supplier that
finances (a card, a bank) takes on a debt in a payment plan, each
installment later arrives as an invoice from it. That invoice repeats the
debt the plan already cancelled —the original purchase, which already
counts—, so by default it doesn't count as a purchase (origen=compras).
What's left out is reported in cuotas_plan_excluidas, by currency and with
the same filters: cantidad, total, capital, gastos (the financing
costs and interest) and sin_separar (invoices whose principal couldn't be
separated). origen=cuotas_plan brings only those invoices and
origen=todas, both; with those values cuotas_plan_excluidas is null.
The current account, due dates and payments don't change: the debt with the
financing supplier is real.
The date range
Up to 12 months per query — unless you filter by id_proveedor,
id_producto or numero, in which case, with no dates, it's the whole
history.
Everything in the main currency, unless you ask otherwise
Same as sales: totales comes back unified in the main currency,
converting each purchase at the exchange rate it had when it was recorded;
conversion tells you how many were converted or had no rate on file. Rows
always show in each purchase's own currency; ?separar_por_moneda=true
leaves totales per currency, unconverted.
Payment status requires accounts payable
estado_pago, saldo_pendiente and saldo_vencido on each row, and the
estado_pago filter, need the accounts-payable permission
(ctacte_proveedores). Without it, filtering by estado_pago returns
403 scope_ctacte_proveedores_requerido, and without that filter the rows
come back missing those three fields.
Typical cases
# everything bought from one supplier, no range limit
.../compras?id_proveedor=334
# merchandise purchases only (no expenses, payroll or taxes)
.../compras?id_movimiento=1
# overdue purchases with a supplier
.../compras?estado_pago=vencida
# expenses for one branch, by accounting period
.../compras?id_movimiento=20&id_sucursal=12&tipo_fecha=contabilizacion&fecha_desde=2026-08-01&fecha_hasta=2026-08-31
# whatever is on account with suppliers
.../compras?forma_pago=cuenta_corriente
# the full history for one voucher number
.../compras?numero=45170
Rankings and time series: don't add them up by hand
For "who do I buy the most from?", "how is spend trending month by month?" or "which category am I spending the most on?", use reportes/compras-agrupadas: the same calculation, server-side, far cheaper than pulling the whole listing.
How it's billed
By the purchases on the page it returns, plus the totales of the whole
filtered set. count in the response is that figure: what got billed,
weighted like the compras resource.
Full document
GET /compras/{id} returns the whole voucher in one call: assembled
number, the supplier with a formatted tax id, line items, the delivery
notes that received the goods, the purchase orders it fulfills, and payment
status.
.../compras/8046
Each line item brings precio_unitario, gravado, no_gravado, exento,
iva_monto, impuestos_internos and total only if your profile has
the costos permission (in tabla_detalles_compras the line amount is
the product's purchase cost); without it, the line comes back without
those fields — missing, not null. Payment status only shows up with the
accounts-payable permission (ctacte).
All document types, their permissions and how they're billed: Full documents.
Purchase items: one row per line, for exporting
GET /v1/{cuenta}/compras/items lists the lines of purchases, the
counterpart of sales items: each one with its purchase (id, date, number,
type, taxpayer), supplier, branch, purchase category, currency and exchange
rate, product (name, code and variant) with its brand and category, and the
line amounts (unit price, discount, taxed, untaxed, exempt, VAT, internal
taxes, total and neto_sin_iva). Credit notes in positive.
curl -H "X-API-Key: YOUR_KEY" \
"https://api.cianbox.uno/v1/YOUR_ACCOUNT/compras/items?fecha_desde=2026-08-01&fecha_hasta=2026-08-31&limite=1000"
- Filters: those of the purchases listing (with
tipo_fechaandorigen), plusid_categoria_compra(the purchase category; calledid_categoriain the purchases listing), the product'sid_marcaandid_categoria, andid_producto(the product or its variants). Noincluir_anulados. - Pagination: cursor
fecha:id_compra:id_item;limiteup to 1000 (200 by default).totalesandconversionon the first page only. - Permissions: requires
comprasandproductos. Line amounts and totals are the purchase cost: only with thecostospermission, as in the purchase document. Filtering byestado_pagorequiresctacte_proveedores. - Modified since a date:
modificado_desde/modificado_hastareturn the items of purchases modified or with a modified item, without the default range; each row withfecha_modificacion. To sync, replace all items of every purchase that shows up; deleted purchases have no items: see them in/compraswith the same filter.
Incremental sync
modificado_desde and modificado_hasta (YYYY-MM-DD or
YYYY-MM-DD HH:MM:SS) return only what changed in that range, without the
default date range and including deleted records: the purchase comes with
"estado": "eliminado" and amounts at 0 when deleted, so you can remove your
copy.
Every row carries fecha_modificacion; totales count only current
records. Step by step: Reports → incremental
sync.
.../compras?modificado_desde=2026-10-07%2009:15:00&limite=1000
Reference
Generated from the API's own schema, so it always reflects the real state.
Available fields
Can be filtered by
Can be sorted by
Use a hyphen and a direction: orden=fecha-desc, orden=id-asc. An orden the resource does not recognise — including the field:desc form, which belongs to raw tables — raises no error: you get the default order back. If the order matters, check the first row.
Text search looks at
Date field (for desde/hasta)
Limits
| Own rate limit | 300 req/min |
| Max range per query | 366 days |
| Max pagination depth | 50,000 skipped rows |
| Rows per page | up to 1000 |
Code examples
curl -H "X-API-Key: TU_KEY" \
"https://api.cianbox.uno/v1/TU_CUENTA/compras?limit=50"import requests
r = requests.get(
"https://api.cianbox.uno/v1/TU_CUENTA/compras",
headers={"X-API-Key": "TU_KEY"},
params={"limit": 50},
timeout=30,
)
r.raise_for_status()
for fila in r.json()["body"]:
print(fila)const r = await fetch(
"https://api.cianbox.uno/v1/TU_CUENTA/compras?limit=50",
{ headers: { "X-API-Key": "TU_KEY" } }
);
if (!r.ok) throw new Error(`HTTP ${r.status}`);
const { body } = await r.json();
console.log(body);