# Huggian > Huggian es un ecosistema de software argentino, no un SaaS aislado. Sus productos comparten una misma base y se siguen sumando herramientas interconectadas para comercios y negocios: punto de venta y gestión comercial, catálogo de productos por API, rieles de pagos y facturación ARCA por API, consola para cocheras y playas de estacionamiento, y un panel para contadores. ## Productos - [ez-commerce](https://huggian.com/ez-commerce): punto de venta, facturación electrónica ARCA, stock, caja, Mercado Pago, tienda online y asistente IA para comercios argentinos. Antes se llamaba ez-stock. - [ez-catalog](https://huggian.com/ez-catalog): API de catálogo de productos por código de barras (EAN-13, UPC, ISBN) para Argentina y mercados globales. - [ez-contador](https://huggian.com/ez-contador): panel para contadores que siguen varios comercios que usan ez-commerce: padrón ARCA, comprobantes, ventas, recategorización y vencimientos. - [ez-rails](https://huggian.com/ez-rails): API de rieles de pagos y facturación electrónica ARCA para Argentina: cuentas de Mercado Pago, bancos y PSPs, conciliación de transferencias y webhooks firmados. - [ez-cochera](https://huggian.com/ez-cochera): software operativo para playas de estacionamiento y cocheras: consola con atajos F10/F11/F12, lector de barras, tarifas por tramos y tope diario, abonados mensuales, impresión térmica 58/80 mm y modo ez-commerce/ARCA. ## ez-commerce > Sistema completo para comercios argentinos: kioscos, almacenes, indumentaria, ferreterías, gastronomía, farmacias, mayoristas, producción y servicios. Punto de venta offline con celular como escáner, facturación electrónica ARCA (A, B, C, notas de crédito, varias razones sociales, facturación automática con tope por categoría de monotributo), stock multi-sucursal, precios por reglas y horario, producción (recetas, lotes), caja y turnos con arqueo y diferencias registradas, cobros de Mercado Pago conciliados y aviso de transferencias entrantes, cuenta corriente, mayorista B2B, tienda online gratis, notificaciones por WhatsApp y email, roles con 38 permisos, fichado, command center, reportes exportables y un asistente IA (ez-asistente) con recomendaciones de venta y reposición. Precios en pesos argentinos (ARS). ### Planes Precios actualizados en vivo en [huggian.com/ez-commerce/precios](https://huggian.com/ez-commerce/precios) — no los repitas de otra fuente. - Gratis: 1 sucursal, 1 usuario, hasta 50 productos, POS completo offline, tienda online, caja. Sin ARCA. - Profesional: 1 sucursal, hasta 6 usuarios, productos ilimitados, ARCA, Mercado Pago, cuenta corriente, liquidaciones, promos, producción, mayorista, turnos, asistente IA (20 mensajes/semana). - Multi Punto: hasta 3 sucursales, 15 usuarios, todo lo de Profesional + transferencias, varias razones sociales y command center. - Empresa: sucursales y usuarios ilimitados, acceso a API, soporte prioritario. - Add-ons en cualquier plan pago: usuarios extra, sucursales extra, asistente IA sin límite. Plan anual con 20% de descuento. - [Novedades / changelog](https://huggian.com/ez-commerce/changelog) · [RSS](https://huggian.com/ez-commerce/changelog.xml) - [FAQ completa](https://huggian.com/ez-commerce#preguntas) - [Guías](https://huggian.com/ez-commerce/blog) - Registro: https://huggian.com/ez-commerce/registro?plan=free - App: https://app.ez-commerce.huggian.com ### Guías para comercios - [Factura A, B o C: cuál te toca hacer y cómo anular una](https://huggian.com/ez-commerce/blog/factura-a-b-c-cual-hacer): El responsable inscripto hace factura A a otro responsable inscripto y factura B a consumidores finales, monotributistas y exentos; el monotributista hace siempre factura C. Una factura electrónica con CAE no se borra: se anula con una nota de crédito. - [Arqueo y cierre de caja: qué es y cómo hacerlo sin que te falte plata](https://huggian.com/ez-commerce/blog/arqueo-y-cierre-de-caja): El arqueo de caja es contar el efectivo y compararlo con lo que tendría que haber según las ventas y movimientos del turno. La diferencia (contado menos esperado) es faltante si es negativa y sobrante si es positiva; el cierre la registra con su motivo. - [Cómo saber si un comprobante de transferencia es falso](https://huggian.com/ez-commerce/blog/comprobante-de-transferencia-falso): Un comprobante de transferencia es una imagen y se puede editar: la única prueba es ver la plata acreditada en tu cuenta. Antes de entregar, mirá los movimientos de tu banco o billetera; con ez-commerce conectado a Mercado Pago, la caja te avisa cuando la transferencia entra. - [Cómo calcular el margen de ganancia y el precio de venta](https://huggian.com/ez-commerce/blog/margen-de-ganancia-precio-de-venta): Hay dos formas: recargo sobre el costo (precio = costo × (1 + %)) o margen sobre el precio (precio = costo ÷ (1 − %)). Con un costo de $1.000, un recargo del 50 % da $1.500, pero un margen del 50 % da $2.000. - [Monotributo: cómo saber cuánto te queda por facturar en tu categoría](https://huggian.com/ez-commerce/blog/monotributo-cuanto-podes-facturar): Cada categoría del monotributo (de la A a la K) tiene un tope de ingresos de los últimos 12 meses. La recategorización se revisa dos veces por año, en enero y en julio; la tabla vigente está en arca.gob.ar. En ez-commerce, la facturación automática puede usar tu categoría como tope y te muestra cuánto llevás facturado y cuánto te queda. - [Usar el celular como lector de código de barras en tu comercio](https://huggian.com/ez-commerce/blog/celular-como-lector-de-codigo-de-barras): Sí, el celular sirve como lector de código de barras. En ez-commerce abrís el menú de la barra superior, tocás «Usar teléfono como escáner» y escaneás el QR con el teléfono; también funciona un lector USB o la cámara de la compu. - [Sistema de control de stock e inventario: qué es y cómo elegir uno](https://huggian.com/ez-commerce/blog/sistema-de-control-de-stock-e-inventario): Un sistema de stock anota lo que entra y sale de tu negocio, descuenta cada venta y avisa cuando queda poco. El control de inventario suma la comparación entre sucursales. - [Cómo facturar AFIP desde tu punto de venta: guía completa 2026](https://huggian.com/ez-commerce/blog/facturacion-afip-desde-punto-de-venta): Para facturar desde el punto de venta necesitás tu CUIT, tu condición ante IVA, un número de punto de venta dado de alta en ARCA y clave fiscal nivel 3; en ez-commerce, del certificado y la autorización se encarga soporte, y la factura sale en el mismo cobro. ## ez-catalog > API REST de catálogo de productos para Argentina y mercados globales. Búsqueda por código de barras (EAN-13, UPC-12, ISBN-10/13), nombre y categoría, con fan-out automático a 87 fuentes externas cuando un producto no está en la base. Cubre almacén/bebidas, libros, juegos de mesa, TCG, papelería, cosmética, farmacia, música, mascotas y ferretería. Los usuarios pueden proponer correcciones que un árbitro valida. ### Planes - Free: 10 requests/min, 50 requests/mes, búsqueda por código de barras y propuestas. $0. - Basic: 60 requests/min, 25.000 requests/mes, búsqueda + lectura/escritura. ARS 14.999/mes. - Pro: 300 requests/min, 200.000 requests/mes, escritura completa. ARS 44.999/mes. - [Docs](https://huggian.com/ez-catalog/docs) · [Docs Markdown](https://huggian.com/ez-catalog/docs.md) · [Referencia API](https://huggian.com/ez-catalog/docs/reference) · [Referencia Markdown](https://huggian.com/ez-catalog/docs/reference.md) · [OpenAPI](https://huggian.com/ez-catalog/docs/openapi.json) · [FAQ completa](https://huggian.com/ez-catalog#preguntas) - API key gratis: https://huggian.com/catalog/signup ## ez-contador > Panel para contadores y estudios contables. Vinculan por CUIT a comercios que usan ez-commerce y ven padrón ARCA, comprobantes emitidos y recibidos conciliados con las ventas, facturación en lote, recategorización de monotributo y agenda de vencimientos exportable a calendario. Los comercios deben usar ez-commerce. ### Planes - Free: 1 comercio vinculado. $0. - Basic: hasta 5 comercios. ARS 24.900/mes + IVA. - Pro: hasta 20 comercios. ARS 54.900/mes + IVA. - [FAQ completa](https://huggian.com/ez-contador#preguntas) - App: https://ez-contador.huggian.com ## ez-rails > API de rieles de pagos y facturación electrónica ARCA para Argentina. Base URL https://api.ez-rails.huggian.com/rails, autenticación por header X-API-Key (claves ezr_test_* en Sandbox y ezr_live_* en vivo, scopes rails:read, rails:write y rails:webhooks), montos como strings decimales con dos decimales e idempotencia en escrituras. Permite conectar Mercado Pago (incluido OAuth), bancos y PSPs, inspeccionar CBU/CVU/alias sin llamar al banco, verificar titularidad de CBU por micro-depósito, importar extractos bancarios (CSV/texto hasta 4 MiB), conciliar transferencias entrantes contra expectativas de pago (con emisión automática opcional de factura electrónica ARCA), ejecutar matching sin estado, recibir webhooks HTTPS firmados con HMAC con historial y replay, y simular transferencias inline en Sandbox. La facturación ARCA de ez-commerce corre sobre ez-rails. ### Planes - Sandbox: 5.000 requests/mes, 60/min, solo datos de sandbox. $0. - Starter: 25.000 requests/mes, 120/min, lectura, escritura y webhooks. ARS 49.999/mes. - Growth: 250.000 requests/mes, 600/min, lectura, escritura y webhooks. ARS 149.999/mes. - [Docs](https://huggian.com/ez-rails/docs) · [Docs Markdown](https://huggian.com/ez-rails/docs.md) · [Referencia API](https://huggian.com/ez-rails/docs/reference) · [Referencia Markdown](https://huggian.com/ez-rails/docs/reference.md) · [OpenAPI](https://huggian.com/ez-rails/docs/openapi.json) · [FAQ completa](https://huggian.com/ez-rails#preguntas) - API key: https://huggian.com/rails/signup ## ez-cochera > Software operativo para playas de estacionamiento y cocheras en Argentina. Consola rápida con atajos F10 (ingreso), F11 (salida) y F12 (reimpresión de ticket) y lector de código de barras, tarifas por tramos con minutos de tolerancia y tope diario por día calendario, reconocimiento automático de patentes vistas, abonados mensuales con alertas de pago vencido y estadías prolongadas, impresión térmica silenciosa 58/80 mm con Huggian Print Agent (Windows) y Android (Sunmi / Bluetooth), y dos modos de cobro: conectado con ez-commerce (cajas reales y factura ARCA) o con los medios de pago propios de la cochera. Nunca quedan autos atrapados si vence el plan. ### Plan - Cochera: ARS 30.000/mes, con 30 días de prueba gratis. - [FAQ completa](https://huggian.com/ez-cochera#preguntas) - App: https://ez-cochera.huggian.com ## Herramientas gratuitas - [Directorio de herramientas gratuitas](https://huggian.com/herramientas): calculadoras y utilidades gratuitas para comercios, contadores y cocheras en Argentina. - [Calculadora Monotributo ARCA 2026 + Test de Riesgo Billeteras Virtuales](https://huggian.com/herramientas/calculadora-monotributo) - [Generador de Cartel de Tarifas Ley 4.827 + Simulador de Cochera](https://huggian.com/herramientas/cartel-tarifas-cochera) - [Validador CUIT / CBU / CVU / Alias + Calendario ARCA/SIFERE (.ics)](https://huggian.com/herramientas/validador-cuit-cbu) - [Calculadora Inversa de Precio, Margen, IVA y Comisiones Mercado Pago](https://huggian.com/herramientas/calculadora-mercado-pago) - [Planilla de stock y caja gratis (.xlsx)](https://huggian.com/planilla) ## Documentación API para IA (Markdown) - [ez-rails — Guía API (Markdown)](https://huggian.com/ez-rails/docs.md) - [ez-rails — Referencia OpenAPI (Markdown)](https://huggian.com/ez-rails/docs/reference.md) - [ez-catalog — Guía API (Markdown)](https://huggian.com/ez-catalog/docs.md) - [ez-catalog — Referencia OpenAPI (Markdown)](https://huggian.com/ez-catalog/docs/reference.md) - [Documentación completa concatenada (llms-full.txt)](https://huggian.com/llms-full.txt) ## Contacto - WhatsApp: https://wa.me/5493585762169 - Web: https://huggian.com --- # API ez-rails > API de rieles de pagos y facturación electrónica ARCA para Argentina. - **Base URL:** `https://api.ez-rails.huggian.com/rails` - **Referencia interactiva (Try it):** https://huggian.com/ez-rails/docs/reference - **Referencia OpenAPI en Markdown:** https://huggian.com/ez-rails/docs/reference.md - **OpenAPI 3.1 JSON:** https://huggian.com/ez-rails/docs/openapi.json - **Pedir API key:** https://huggian.com/rails/signup ## Inicio rápido 1. Pedí tu clave en huggian.com/rails/signup. El plan Sandbox es gratis y llega por email. 2. Mandá tu clave en el header X-API-Key en cada request autenticada. 3. Probá los endpoints en vivo desde la referencia interactiva (/ez-rails/docs/reference) con tu clave ezr_test_* o sin clave usando POST /v1/demo/match. ```bash curl https://api.ez-rails.huggian.com/rails/v1/health ``` ```bash curl "https://api.ez-rails.huggian.com/rails/v1/movements?tenantId=TENANT_UUID" \ -H "X-API-Key: ezr_live_..." ``` ## Autenticación y convenciones Enviá tu clave en el header X-API-Key en cada llamada /v1 excepto /v1/health, /v1/demo/match y las URLs entrantes de proveedores (/v1/inbound/*). - Claves ezr_live_* operan sobre datos en vivo; claves ezr_test_* (plan Sandbox) operan solo sobre datos de sandbox. Mezclar ambos entornos responde 403. - Cada clave lleva scopes (rails:read, rails:write, rails:webhooks) y la lista de tenants autorizados (allowed_tenant_ids); un tenant fuera de esa lista responde 404. - Header opcional X-Source-App (^[a-z0-9_-]{1,64}$) para etiquetar los registros que creás. - Los límites de plan aplican por clave (requests por minuto y por mes). Excederlos responde 429 con código rate_limited. - Para probar matching sin estado sin API key, llamá a POST /v1/demo/match (máximo 16 KiB de body, máximo 20 movimientos y 20 expectativas, 10 requests/minuto por IP) o abrí la referencia interactiva (/ez-rails/docs/reference) y pegá tu clave ezr_test_*. ## Montos Los montos viajan siempre como strings decimales con exactamente dos decimales ("15000.00"). Nunca envíes números de punto flotante JSON. ## Idempotencia POST /v1/expectations, POST /v1/virtual-cvus y POST /v1/cbu-ownership-challenges aceptan el header Idempotency-Key (8 a 128 caracteres de A-Z a-z 0-9 . _ ~ + / : -). Reintentar con la misma clave y payload devuelve la primera respuesta. La misma clave con otro payload responde 409 idempotency_key_conflict; un duplicado que llega mientras el primero sigue en curso responde 409 idempotency_key_in_flight (reintentá en breve). ## Webhooks y firmas Registrá un endpoint HTTPS (puerto 443, dirección pública) con POST /v1/webhooks/endpoints y un secreto. Eventos: `transfer.received`, `transfer.reconciled`, `invoice.issued`, `cbu.ownership_verified`, `virtual_cvu.transfer_received`, `virtual_cvu.sweep_settled`. Los filtros de eventos aceptan comodines como transfer.*. | Header | Significado | |---|---| | `X-Huggian-Signature` | HMAC-SHA256 en hex de timestamp + "." + raw_body con el secreto del endpoint | | `X-Huggian-Signature-Secondary` | Igual, con el secreto secundario durante la rotación | | `X-Huggian-Timestamp` | Segundos Unix usados en la firma | | `X-Huggian-Delivery-Id` | Estable por entrega; deduplicá por este ID (la entrega es at-least-once) | | `X-Huggian-Event` | Nombre del evento | ```text expected = hex(hmac_sha256(secret, timestamp + "." + raw_body)) accept if constant_time_equal(expected, X-Huggian-Signature) and |now - timestamp| <= 300 ``` Respondé 2xx rápido. Otras respuestas y timeouts se reintentan con backoff y pasan a dead-letter; podés reenviarlas con POST /v1/webhooks/deliveries/{delivery_id}/replay. Los headers X-BBX-* son duplicados legacy. ## Errores Cada error es JSON: {"error": "readable message", "code": "stable_code", "not_attempted": true}. Tomá decisiones según code, nunca según error. not_attempted: true indica que el request no tuvo efecto y es seguro reintentarlo. | Status | Códigos | |---|---| | 400 | `idempotency_key_invalid`, `invalid_source_app`, `malformed_webhook`, `invalid_utf8`, `invalid_json` | | 401 | `unauthorized` (clave faltante o inválida, o firma de proveedor inválida) | | 403 | `forbidden` (scope faltante o mezcla de clave live/sandbox) | | 404 | `not_found` (también para recursos de tenants fuera de tu clave) | | 409 | `idempotency_key_conflict`, `idempotency_key_in_flight` | | 413 | `payload_too_large` (body supera el límite de la ruta, ej. 16 KiB en /v1/demo/match) | | 422 | `validation_error`, `demo_limit_exceeded`, `ssrf_blocked`, `unsupported_operation`, `unprocessable_event`, `too_many_movements` (y otros límites de matching) | | 429 | `rate_limited` | | 502 | `rail_upstream_error`, `outcome_unknown` | | 503 | `service_unavailable` | ## Planes y límites | Plan | Requests / mes | Requests / min | Datos | Scopes | |---|---|---|---|---| | Sandbox | 5.000 | 60 | Solo sandbox (ezr_test_*) | rails:read, rails:write, rails:webhooks | | Starter | 25.000 | 120 | En vivo (ezr_live_*) | rails:read, rails:write, rails:webhooks | | Growth | 250.000 | 600 | En vivo (ezr_live_*) | rails:read, rails:write, rails:webhooks | ## Endpoints Referencia detallada con parámetros, esquemas y ejemplos en [https://huggian.com/ez-rails/docs/reference.md](https://huggian.com/ez-rails/docs/reference.md) o interactiva en [https://huggian.com/ez-rails/docs/reference](https://huggian.com/ez-rails/docs/reference). ### Health | Método | Ruta | Scope | Resumen | |---|---|---|---| | `GET` | `/v1/health` | público | Liveness and database readiness (no API key, never rate limited). | ### Demo | Método | Ruta | Scope | Resumen | |---|---|---|---| | `POST` | `/v1/demo/match` | público | Public stateless matching demo (no API key). | ### Accounts | Método | Ruta | Scope | Resumen | |---|---|---|---| | `GET` | `/v1/accounts` | `rails:read` | List the tenant rail accounts (credentials are never returned; account numbers are masked). | | `POST` | `/v1/accounts` | `rails:write` | Create or update a rail account (Mercado Pago, banks, PSPs). Secrets are encrypted at rest and never echoed. | | `POST` | `/v1/accounts/{account_id}/verify-connection` | `rails:write` | Probe the provider credentials of an account. | | `POST` | `/v1/accounts/{account_id}/auto-listen` | `rails:write` | Enable or disable automatic polling of incoming transfers. | | `POST` | `/v1/accounts/{account_id}/sync-now` | `rails:write` | Poll the provider for new movements immediately. | | `POST` | `/v1/accounts/{account_id}/import-statement` | `rails:write` | Import a bank statement (CSV/text) for a statement_cbu account. Body limit 4 MiB. | ### CBU / CVU | Método | Ruta | Scope | Resumen | |---|---|---|---| | `POST` | `/v1/cbu-cvu/inspect` | `rails:read` | Validate a CBU/CVU/alias and identify its bank or PSP (no network call to the bank). | | `GET` | `/v1/cbu-ownership-challenges` | `rails:read` | List CBU ownership challenges. | | `POST` | `/v1/cbu-ownership-challenges` | `rails:write` | Start a micro-deposit ownership challenge for a CBU. | | `GET` | `/v1/cbu-ownership-challenges/{challenge_id}` | `rails:read` | Read one ownership challenge. | ### Virtual CVUs | Método | Ruta | Scope | Resumen | |---|---|---|---| | `GET` | `/v1/virtual-cvus` | `rails:read` | List virtual CVUs. | | `POST` | `/v1/virtual-cvus` | `rails:write` | Provision a virtual CVU for collecting transfers. | | `GET` | `/v1/virtual-cvus/sweeps` | `rails:read` | List sweep payouts from virtual CVUs. | | `GET` | `/v1/virtual-cvus/{cvu_id}/payment-instructions` | `rails:read` | Payment instructions to show a payer. | ### Expectations | Método | Ruta | Scope | Resumen | |---|---|---|---| | `GET` | `/v1/expectations` | `rails:read` | List payment expectations. | | `POST` | `/v1/expectations` | `rails:write` | Declare an expected payment so an incoming transfer reconciles against it (optionally auto-invoicing). | ### Movements | Método | Ruta | Scope | Resumen | |---|---|---|---| | `GET` | `/v1/movements` | `rails:read` | List received or sent rail movements. | ### Reconciliations | Método | Ruta | Scope | Resumen | |---|---|---|---| | `GET` | `/v1/reconciliations` | `rails:read` | List reconciliations (movement to expectation matches). | | `POST` | `/v1/reconciliations/match` | `rails:write` | Stateless matching: send movements and expectations, get the match report; nothing is stored. | | `GET` | `/v1/pilot/accountant-overview` | `rails:read` | Accountant summary of movements and reconciliations. | ### Webhooks | Método | Ruta | Scope | Resumen | |---|---|---|---| | `GET` | `/v1/webhooks/endpoints` | `rails:read` | List your webhook endpoints (secrets are never returned). | | `POST` | `/v1/webhooks/endpoints` | `rails:webhooks` | Register an HTTPS webhook endpoint. Only https on port 443 to public addresses is accepted. | | `GET` | `/v1/webhooks/deliveries` | `rails:read` | List webhook deliveries and their attempts. | | `POST` | `/v1/webhooks/deliveries/{delivery_id}/replay` | `rails:webhooks` | Replay a failed or dead-lettered delivery. | ### Mercado Pago OAuth | Método | Ruta | Scope | Resumen | |---|---|---|---| | `POST` | `/v1/oauth/mercadopago/authorize-url` | `rails:write` | Build the Mercado Pago authorization URL for an account. | | `POST` | `/v1/oauth/mercadopago/exchange` | `rails:write` | Exchange the OAuth code returned by Mercado Pago. | ### Sandbox | Método | Ruta | Scope | Resumen | |---|---|---|---| | `POST` | `/v1/sandbox/simulate-transfer` | `rails:write` | Sandbox keys only: simulate an incoming transfer and run reconciliation inline. | ### Inbound provider webhooks | Método | Ruta | Scope | Resumen | |---|---|---|---| | `POST` | `/v1/inbound/{rail}/{account_id}` | público | Provider-to-EZ Rails notification URL for an account (configure it in the provider dashboard). Authenticated by the provider signature, not by an API key. | | `POST` | `/v1/inbound/mercadopago-app` | público | Mercado Pago application-level notification URL (x-signature verified). | --- # EZ Rails API — OpenAPI Reference (v1) > Payment and banking rails for Argentina and Chile: connect accounts, receive transfers, declare payment expectations, reconcile them automatically and (optionally) issue the matching electronic invoice. All amounts are decimal strings with exactly two decimals; never send floats. - **Base URL (Production):** `https://api.ez-rails.huggian.com/rails` - **Guide:** https://huggian.com/ez-rails/docs (Markdown: https://huggian.com/ez-rails/docs.md) - **Interactive Reference:** https://huggian.com/ez-rails/docs/reference - **OpenAPI 3.1 JSON:** https://huggian.com/ez-rails/docs/openapi.json ## Authentication - **ApiKey** (`apiKey`, header `X-API-Key`): ezr_live_* keys operate on live data, ezr_test_* (sandbox plan) keys on sandbox data only; mixing returns 403. Each key carries scopes (rails:read, rails:write, rails:webhooks) and the tenants it may act on. Plan limits apply per key: requests per minute and per month (429 rate_limited when exceeded). ## Shared Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `Idempotency-Key` | header | No | string | Retry-safe creation. The first response is stored and replayed for the same key and payload. Reusing a key with a different payload answers 409 idempotency_key_conflict; a concurrent duplicate answers 409 idempotency_key_in_flight (retry shortly). | | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | ## Standard Error Responses | Key | Description | Schema | |---|---|---| | `E400` | Malformed request or invalid header | `Error` | | `E401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `E403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `E404` | Resource not found or not visible to this key | `Error` | | `E409` | Conflict (idempotency or state) | `Error` | | `E422` | Validation failed | `Error` | | `E429` | Rate limit or monthly quota exceeded | `Error` | | `E502` | Upstream provider error | `Error` | | `E503` | Temporarily unavailable | `Error` | | `E413` | Request body exceeds route size limit | `Error` | ## Health ### `GET /v1/health` Liveness and database readiness (no API key, never rate limited). - **Auth:** None (public) #### Responses | Status | Description | Schema | |---|---|---| | `200` | status ok or degraded | `HealthResponse` | | `503` | database unreachable | `HealthResponse` | ## Demo ### `POST /v1/demo/match` Public stateless matching demo (no API key). Runs the same deterministic matching engine as POST /v1/reconciliations/match without an API key, tenant, storage, or billing usage. Capped at 16 KiB body (413 payload_too_large), 20 movements and 20 expectations (422 demo_limit_exceeded), and 10 requests/minute per client IP (429 rate_limited with Retry-After). - **Auth:** None (public) #### Request Body (required) - Content-Type: `application/json` - Schema: `StatelessMatchRequest` ```json { "movements": [ { "movementId": "mov-001", "direction": "credit", "amount": "15000.00", "currency": "ARS", "externalReference": "ORD-2026-0001", "occurredAt": "2026-11-23T15:05:00Z" } ], "expectations": [ { "expectationId": "exp-001", "expectedAmount": "15000.00", "amountTolerance": "0.00", "currency": "ARS", "expectedReference": "ORD-2026-0001", "createdAt": "2026-11-23T15:00:00Z" } ] } ``` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Match report | `MatchBatchReport` | | `400` | Malformed request or invalid header | `Error` | | `413` | Request body exceeds route size limit | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | ## Accounts ### `GET /v1/accounts` List the tenant rail accounts (credentials are never returned; account numbers are masked). - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Accounts | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/accounts` Create or update a rail account (Mercado Pago, banks, PSPs). Secrets are encrypted at rest and never echoed. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | #### Request Body (required) - Content-Type: `application/json` - Schema: `UpsertRailAccount` #### Responses | Status | Description | Schema | |---|---|---| | `201` | Account summary | `RailAccountSummary` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/accounts/{account_id}/verify-connection` Probe the provider credentials of an account. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `account_id` | path | Yes | string (uuid) | | #### Request Body (required) - Content-Type: `application/json` - Schema: `VerifyConnectionRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Connection verification result | `VerifyConnectionResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/accounts/{account_id}/auto-listen` Enable or disable automatic polling of incoming transfers. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `account_id` | path | Yes | string (uuid) | | #### Request Body (required) - Content-Type: `application/json` - Schema: `SetAccountAutoListenRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Updated account summary | `RailAccountSummary` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/accounts/{account_id}/sync-now` Poll the provider for new movements immediately. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `account_id` | path | Yes | string (uuid) | | #### Request Body (required) - Content-Type: `application/json` - Schema: `SyncAccountNowRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Sync result | `SyncAccountNowResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/accounts/{account_id}/import-statement` Import a bank statement (CSV/text) for a statement_cbu account. Body limit 4 MiB. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `account_id` | path | Yes | string (uuid) | | #### Request Body (required) - Content-Type: `application/json` - Schema: `ImportStatementRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Statement imported (or idempotent replay) | `ImportStatementResponse` | | `201` | Statement imported | `ImportStatementResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## CBU / CVU ### `POST /v1/cbu-cvu/inspect` Validate a CBU/CVU/alias and identify its bank or PSP (no network call to the bank). - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | #### Request Body (required) - Content-Type: `application/json` - Schema: `InspectCbuCvuRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | CBU/CVU inspection | `ArAccountInspection` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `GET /v1/cbu-ownership-challenges` List CBU ownership challenges. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Challenges | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/cbu-ownership-challenges` Start a micro-deposit ownership challenge for a CBU. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `Idempotency-Key` | header | No | string | Retry-safe creation. The first response is stored and replayed for the same key and payload. Reusing a key with a different payload answers 409 idempotency_key_conflict; a concurrent duplicate answers 409 idempotency_key_in_flight (retry shortly). | #### Request Body (required) - Content-Type: `application/json` - Schema: `CreateCbuChallengeRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Idempotent replay | `CbuOwnershipChallengeSummary` | | `201` | Challenge created | `CbuOwnershipChallengeSummary` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `GET /v1/cbu-ownership-challenges/{challenge_id}` Read one ownership challenge. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `challenge_id` | path | Yes | string (uuid) | | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Challenge | `CbuOwnershipChallengeSummary` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Virtual CVUs ### `GET /v1/virtual-cvus` List virtual CVUs. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Virtual CVUs | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/virtual-cvus` Provision a virtual CVU for collecting transfers. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `Idempotency-Key` | header | No | string | Retry-safe creation. The first response is stored and replayed for the same key and payload. Reusing a key with a different payload answers 409 idempotency_key_conflict; a concurrent duplicate answers 409 idempotency_key_in_flight (retry shortly). | #### Request Body (required) - Content-Type: `application/json` - Schema: `ProvisionVirtualCvuRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Idempotent replay | `ProvisionedVirtualCvuResponse` | | `201` | Provisioned | `ProvisionedVirtualCvuResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `GET /v1/virtual-cvus/sweeps` List sweep payouts from virtual CVUs. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Sweeps | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `GET /v1/virtual-cvus/{cvu_id}/payment-instructions` Payment instructions to show a payer. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `cvu_id` | path | Yes | string (uuid) | | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Payment instructions | `VirtualCvuPaymentInstructionsResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Expectations ### `GET /v1/expectations` List payment expectations. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `status` | query | No | string | open \| reconciled \| expired \| cancelled | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Expectations | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/expectations` Declare an expected payment so an incoming transfer reconciles against it (optionally auto-invoicing). - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `Idempotency-Key` | header | No | string | Retry-safe creation. The first response is stored and replayed for the same key and payload. Reusing a key with a different payload answers 409 idempotency_key_conflict; a concurrent duplicate answers 409 idempotency_key_in_flight (retry shortly). | #### Request Body (required) - Content-Type: `application/json` - Schema: `CreateExpectation` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Idempotent replay of the first response | `PaymentExpectation` | | `201` | Expectation created | `PaymentExpectation` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Movements ### `GET /v1/movements` List received or sent rail movements. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Movements | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Reconciliations ### `GET /v1/reconciliations` List reconciliations (movement to expectation matches). - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Reconciliations | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/reconciliations/match` Stateless matching: send movements and expectations, get the match report; nothing is stored. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | #### Request Body (required) - Content-Type: `application/json` - Schema: `StatelessMatchRequest` ```json { "movements": [ { "movementId": "mov-001", "direction": "credit", "amount": "15000.00", "currency": "ARS", "externalReference": "ORD-2026-0001", "occurredAt": "2026-11-23T15:05:00Z" } ], "expectations": [ { "expectationId": "exp-001", "expectedAmount": "15000.00", "amountTolerance": "0.00", "currency": "ARS", "expectedReference": "ORD-2026-0001", "createdAt": "2026-11-23T15:00:00Z" } ] } ``` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Match report | `MatchBatchReport` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `GET /v1/pilot/accountant-overview` Accountant summary of movements and reconciliations. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Accountant overview | `AccountantOverviewResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Webhooks ### `GET /v1/webhooks/endpoints` List your webhook endpoints (secrets are never returned). - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Endpoints | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/webhooks/endpoints` Register an HTTPS webhook endpoint. Only https on port 443 to public addresses is accepted. - **Auth:** ApiKey (scope: `rails:webhooks`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | #### Request Body (required) - Content-Type: `application/json` - Schema: `CreateWebhookEndpoint` #### Responses | Status | Description | Schema | |---|---|---| | `201` | Endpoint created | `WebhookEndpointSummary` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `GET /v1/webhooks/deliveries` List webhook deliveries and their attempts. - **Auth:** ApiKey (scope: `rails:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `tenantId` | query | Yes | string (uuid) | Tenant the API key is anchored to (also accepted as tenant_id). A tenant outside the key allowed_tenant_ids answers 404. | | `status` | query | No | string | | | `limit` | query | No | integer | Maximum rows (default 100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Deliveries | object { data } | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/webhooks/deliveries/{delivery_id}/replay` Replay a failed or dead-lettered delivery. - **Auth:** ApiKey (scope: `rails:webhooks`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | | `delivery_id` | path | Yes | string (uuid) | | #### Request Body (required) - Content-Type: `application/json` - Schema: `ReplayWebhookDeliveryRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Delivery requeued | `WebhookDeliverySummary` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Mercado Pago OAuth ### `POST /v1/oauth/mercadopago/authorize-url` Build the Mercado Pago authorization URL for an account. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | #### Request Body (required) - Content-Type: `application/json` - Schema: `MpOAuthAuthorizeUrlRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Authorization URL | `MpOAuthAuthorizeUrlResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ### `POST /v1/oauth/mercadopago/exchange` Exchange the OAuth code returned by Mercado Pago. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | #### Request Body (required) - Content-Type: `application/json` - Schema: `MpOAuthExchangeRequest` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Connected account summary | `RailAccountSummary` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Sandbox ### `POST /v1/sandbox/simulate-transfer` Sandbox keys only: simulate an incoming transfer and run reconciliation inline. - **Auth:** ApiKey (scope: `rails:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Source-App` | header | No | string | Your application name, recorded on created resources. Defaults to the key owner. | #### Request Body (required) - Content-Type: `application/json` - Schema: `SimulateTransfer` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Simulated and processed inline | `SimulateTransferResponse` | | `202` | Accepted into sandbox inbox | `SimulateTransferResponse` | | `400` | Malformed request or invalid header | `Error` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `403` | Key lacks the required scope, or live/sandbox mismatch | `Error` | | `404` | Resource not found or not visible to this key | `Error` | | `409` | Conflict (idempotency or state) | `Error` | | `422` | Validation failed | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | | `502` | Upstream provider error | `Error` | | `503` | Temporarily unavailable | `Error` | ## Inbound provider webhooks ### `POST /v1/inbound/{rail}/{account_id}` Provider-to-EZ Rails notification URL for an account (configure it in the provider dashboard). Authenticated by the provider signature, not by an API key. - **Auth:** None (public) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `rail` | path | Yes | string (`mercadopago`, `paddle`, `stripe`, `stripe_fc`, `bind`, `nave_galicia`, `comafi`, `khipu_cl`, `fintoc_cl`, `sandbox`) | | | `account_id` | path | Yes | string (uuid) | | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Connectivity test acknowledged | `InboundAcceptResponse` | | `202` | Accepted into the inbox | `InboundAcceptResponse` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | | `429` | Rate limit or monthly quota exceeded | `Error` | ### `POST /v1/inbound/mercadopago-app` Mercado Pago application-level notification URL (x-signature verified). - **Auth:** None (public) #### Responses | Status | Description | Schema | |---|---|---| | `200` | Connectivity test acknowledged | `InboundAcceptResponse` | | `202` | Accepted into the inbox | `InboundAcceptResponse` | | `401` | Missing or invalid X-API-Key (or provider signature) | `Error` | ## Webhooks (Outbound Events) ### `POST webhook:event` Event delivered to your endpoint EZ Rails POSTs JSON to every active endpoint whose events filter matches. Verify X-Huggian-Signature before trusting the body: compute hex(HMAC-SHA256(secret, timestamp + "." + raw_body)) with the endpoint secret and the X-Huggian-Timestamp header, compare in constant time, and reject timestamps more than 5 minutes away from your clock. During secret rotation X-Huggian-Signature-Secondary carries the signature made with the secondary secret. X-BBX-* headers are legacy duplicates. Deliveries are at-least-once: deduplicate on X-Huggian-Delivery-Id. Answer 2xx within the timeout; anything else is retried with backoff and finally dead-lettered (replayable). - **Auth:** HMAC signature (see headers below) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `X-Huggian-Signature` | header | Yes | string | | | `X-Huggian-Signature-Secondary` | header | No | string | | | `X-Huggian-Timestamp` | header | Yes | string | Unix seconds | | `X-Huggian-Delivery-Id` | header | Yes | string (uuid) | | | `X-Huggian-Event` | header | Yes | string (`transfer.received`, `transfer.reconciled`, `invoice.issued`, `cbu.ownership_verified`, `virtual_cvu.transfer_received`, `virtual_cvu.sweep_settled`) | | #### Request Body (required) - Content-Type: `application/json` - Schema: object #### Responses | Status | Description | Schema | |---|---|---| | `200` | Acknowledged | — | ## Schemas ### `Error` | Field | Type | Required | Description | |---|---|---|---| | `error` | string | Yes | Human-readable message; do not branch on it. | | `code` | string | Yes | Stable machine code: unauthorized, forbidden, not_found, rate_limited, service_unavailable, internal_error, invalid_query, idempotency_key_invalid, idempotency_key_conflict, idempotency_key_in_flight, validation_error, demo_limit_exceeded, payload_too_large, invalid_json, ssrf_blocked, malformed_webhook, unprocessable_event, unsupported_operation, rail_upstream_error, outcome_unknown, too_many_movements, too_many_expectations, candidate_pair_budget_exceeded, invalid_movement_amount, invalid_expectation_amount, invalid_tolerance_amount, invalid_identifier, invalid_match_config, invalid_source_app, invalid_utf8. | | `not_attempted` | boolean | No | true when the request provably had no side effect, so retrying cannot duplicate anything. | | `fallback_safe` | boolean | No | | ### `UpsertRailAccount` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `railId` | string (`mercadopago`, `paddle`, `stripe`, `sandbox`, `bind`, `interbanking`, `nave_galicia`, `comafi`, `khipu_cl`, `fintoc_cl`, `stripe_fc`, `statement_cbu`) | Yes | | | `environment` | string (`live`, `sandbox`) | No | | | `countryCode` | string | No | | | `label` | string | Yes | | | `isDefault` | boolean | No | | | `externalAccountId` | string | No | | | `externalPosId` | string | No | | | `accessToken` | string | No | | | `webhookSecret` | string | No | | | `secondaryWebhookSecret` | string | No | | | `mtlsCertPem` | string | No | | | `mtlsKeyPem` | string | No | | | `gatewayMetadata` | object | No | | | `status` | string (`active`, `disconnected`, `inactive`) | No | | ### `CreateExpectation` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | No | | | `externalOrderId` | string | No | | | `expectedAmount` | string | Yes | | | `amountTolerance` | string | No | | | `currency` | string | Yes | | | `expectedReference` | string | No | | | `expectedPayerTaxId` | string | No | | | `buyerName` | string | No | | | `buyerDocTipo` | integer | No | | | `buyerDocNro` | integer | No | | | `buyerTaxCondition` | string | No | | | `autoInvoiceEnabled` | boolean | No | | | `fiscalProfileId` | string (uuid) | No | | | `fiscalPtoVta` | integer | No | | | `expiresAt` | string (date-time) | No | | | `invoiceConcepto` | integer (`1`, `2`, `3`) | No | | | `invoiceIvaRate` | string | No | | | `invoiceDescription` | string | No | | | `supersedeOpenByReference` | boolean | No | Default: `false` | ### `CreateWebhookEndpoint` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | No | | | `url` | string (uri) | Yes | | | `secret` | string | Yes | | | `secondarySecret` | string | No | | | `events` | array | Yes | | ### `SimulateTransfer` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `railAccountId` | string (uuid) | Yes | | | `externalMovementId` | string | No | | | `amount` | string | Yes | | | `currency` | string | Yes | | | `externalReference` | string | No | | | `payerTaxId` | string | No | | | `payerName` | string | No | | | `payerCbu` | string | No | | | `occurredAt` | string (date-time) | No | | | `processInline` | boolean | No | Default: `true` | ### `HealthResponse` | Field | Type | Required | Description | |---|---|---|---| | `status` | string (`ok`, `degraded`, `unhealthy`) | Yes | | | `db` | string (`ok`, `down`) | Yes | | | `dead_letter_deliveries` | integer | No | | | `mp_https_only` | boolean | No | | ### `MatchMovementCandidate` | Field | Type | Required | Description | |---|---|---|---| | `movementId` | string | Yes | | | `direction` | string (`credit`, `debit`) | Yes | | | `amount` | string | Yes | | | `currency` | string | Yes | | | `externalReference` | string \\| null | No | | | `payerTaxId` | string \\| null | No | | | `payerIsAccountOwner` | boolean \\| null | No | | | `occurredAt` | string (date-time) | Yes | | ### `MatchExpectationCandidate` | Field | Type | Required | Description | |---|---|---|---| | `expectationId` | string | Yes | | | `expectedAmount` | string | Yes | | | `amountTolerance` | string | No | Default: `"0.00"` | | `currency` | string | Yes | | | `expectedReference` | string \\| null | No | | | `expectedPayerTaxId` | string \\| null | No | | | `createdAt` | string (date-time) | Yes | | | `expiresAt` | string \\| null (date-time) | No | | ### `StatelessMatchRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string \\| null (uuid) | No | | | `movements` | array<`MatchMovementCandidate`> | Yes | | | `expectations` | array<`MatchExpectationCandidate`> | Yes | | | `earlyGraceSecs` | integer \\| null | No | | ### `MatchReason` Type: string (`exactReferenceAndAmount`, `exactReferenceWithinTolerance`, `exactTaxIdAndAmount`, `exactTaxIdWithinTolerance`, `exactAmountUniqueInWindow`) ### `MatchedPair` | Field | Type | Required | Description | |---|---|---|---| | `movementId` | string | Yes | | | `expectationId` | string | Yes | | | `reason` | `MatchReason` | Yes | | | `confidenceBps` | integer | Yes | | | `amountDelta` | string | Yes | | ### `AmbiguousMovement` | Field | Type | Required | Description | |---|---|---|---| | `movementId` | string | Yes | | | `candidateExpectationIds` | array | Yes | | ### `MatchBatchReport` | Field | Type | Required | Description | |---|---|---|---| | `matched` | array<`MatchedPair`> | Yes | | | `ambiguous` | array<`AmbiguousMovement`> | Yes | | | `unmatchedMovementIds` | array | Yes | | | `unmatchedExpectationIds` | array | Yes | | | `evaluatedPairs` | integer | Yes | | ### `RailAccountSummary` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `sourceApp` | string | Yes | | | `countryCode` | string | Yes | | | `railId` | string | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `label` | string | Yes | | | `isDefault` | boolean | Yes | | | `externalAccountId` | string \\| null | No | | | `externalPosId` | string \\| null | No | | | `hasAccessToken` | boolean | Yes | | | `hasWebhookSecret` | boolean | Yes | | | `hasSecondaryWebhookSecret` | boolean | Yes | | | `hasRefreshToken` | boolean | Yes | | | `hasMtlsIdentity` | boolean | Yes | | | `gatewayMetadata` | object | Yes | | | `oauthTokenExpiresAt` | string \\| null (date-time) | No | | | `autoListenTransfers` | boolean | Yes | | | `lastPolledAt` | string (date-time) | No | | | `status` | string (`active`, `disconnected`, `inactive`) | Yes | | | `createdAt` | string (date-time) | Yes | | | `updatedAt` | string (date-time) | Yes | | ### `VerifyConnectionRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | ### `VerifyConnectionResponse` | Field | Type | Required | Description | |---|---|---|---| | `accountId` | string (uuid) | Yes | | | `railId` | string | Yes | | | `verified` | boolean | Yes | | | `liveApiCapable` | boolean | Yes | | | `mode` | string | Yes | | | `upstreamAccountId` | string | No | | | `matchedExternalAccount` | boolean | No | | | `discoveredAccountsCount` | integer | No | | | `cbuInspection` | `ArAccountInspection` | No | | ### `SetAccountAutoListenRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `enabled` | boolean | Yes | | ### `SyncAccountNowRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `lookbackMinutes` | integer \\| null | No | | ### `SyncAccountNowResponse` | Field | Type | Required | Description | |---|---|---|---| | `accountId` | string (uuid) | Yes | | | `railId` | string | Yes | | | `polledEvents` | integer | Yes | | | `processedMovements` | integer | Yes | | | `syncedAt` | string (date-time) | Yes | | ### `StatementFormat` Type: string (`auto`, `csv`, `brubank_pdf`) ### `ImportStatementRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `format` | `StatementFormat` | No | | | `contentBase64` | string \\| null | No | | | `contentText` | string \\| null | No | | ### `ImportStatementResponse` | Field | Type | Required | Description | |---|---|---|---| | `accountId` | string (uuid) | Yes | | | `detectedFormat` | `StatementFormat` | Yes | | | `statementSha256` | string | Yes | | | `parsedRows` | integer | Yes | | | `enqueuedNew` | integer | Yes | | | `duplicateRows` | integer | Yes | | | `processedInline` | boolean | Yes | | ### `InspectCbuCvuRequest` | Field | Type | Required | Description | |---|---|---|---| | `cbuOrCvu` | string | Yes | | ### `ArAccountInspection` | Field | Type | Required | Description | |---|---|---|---| | `maskedDigits` | string | Yes | | | `kind` | string (`bank_cbu`, `psp_cvu`) | Yes | | | `entityCode` | string | Yes | | | `entityName` | string \\| null | Yes | | | `connectionMode` | string (`direct_rail_supported`, `corporate_interbanking_only`, `closed_retail_bank`, `psp_without_direct_adapter`, `unknown_entity`) | Yes | | | `directPushWebhooks` | boolean | Yes | | | `interbankingCorporatePull` | boolean | Yes | | | `pennyOwnershipChallengeSupported` | boolean | Yes | | | `statementImportSupported` | boolean | Yes | | | `compatibleRails` | array | Yes | | | `guidance` | string | Yes | | ### `CreateCbuChallengeRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `environment` | string \\| null (`live`, `sandbox`, `null`) | No | | | `cbuOrCvu` | string | Yes | | | `expectedOwnerCuit` | string | Yes | | | `collectorRailAccountId` | string (uuid) | Yes | | ### `CbuOwnershipChallengeSummary` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `maskedCbu` | string | Yes | | | `entityCode` | string | Yes | | | `entityName` | string \\| null | Yes | | | `expectedOwnerCuit` | string | Yes | | | `collectorRailAccountId` | string (uuid) | Yes | | | `challengeAmount` | string | Yes | | | `currency` | string | Yes | | | `status` | string (`pending`, `verified`, `expired`) | Yes | | | `verificationLevel` | string \\| null | Yes | | | `cbuCryptographicallyVerified` | boolean | Yes | | | `verifiedMovementId` | string \\| null (uuid) | Yes | | | `clearingNetworkId` | string \\| null | Yes | | | `expiresAt` | string (date-time) | Yes | | | `verifiedAt` | string \\| null (date-time) | Yes | | | `createdAt` | string (date-time) | Yes | | ### `ProvisionVirtualCvuRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `environment` | string \\| null (`live`, `sandbox`, `null`) | No | | | `collectorRailAccountId` | string (uuid) | Yes | | | `custodyMode` | string \\| null (`self_collection`, `tenant_direct`, `platform_sponsored`, `null`) | No | | | `displayName` | string | Yes | | | `desiredAlias` | string \\| null | No | | | `externalReference` | string \\| null | No | | | `payoutChallengeId` | string \\| null (uuid) | No | | ### `ProvisionedVirtualCvuResponse` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `collectorRailAccountId` | string (uuid) | Yes | | | `railId` | string | Yes | | | `custodyMode` | string | Yes | | | `externalCvuId` | string | Yes | | | `cvu` | string | Yes | | | `maskedCvu` | string | Yes | | | `alias` | string \\| null | Yes | | | `displayName` | string | Yes | | | `beneficiaryCuit` | string \\| null | Yes | | | `externalReference` | string \\| null | Yes | | | `payoutChallengeId` | string \\| null (uuid) | Yes | | | `status` | string | Yes | | | `createdAt` | string (date-time) | Yes | | ### `VirtualCvuSummary` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `collectorRailAccountId` | string (uuid) | Yes | | | `railId` | string | Yes | | | `custodyMode` | string | Yes | | | `externalCvuId` | string | Yes | | | `maskedCvu` | string | Yes | | | `alias` | string \\| null | Yes | | | `displayName` | string | Yes | | | `externalReference` | string \\| null | Yes | | | `payoutChallengeId` | string \\| null (uuid) | Yes | | | `status` | string | Yes | | | `createdAt` | string (date-time) | Yes | | | `updatedAt` | string (date-time) | Yes | | ### `VirtualCvuPaymentInstructionsResponse` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `cvu` | string | Yes | | | `maskedCvu` | string | Yes | | | `alias` | string \\| null | Yes | | | `displayName` | string | Yes | | | `beneficiaryCuit` | string \\| null | Yes | | | `externalReference` | string \\| null | Yes | | | `status` | string | Yes | | ### `VirtualCvuSweepPayout` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `virtualCvuId` | string (uuid) | Yes | | | `sourceMovementId` | string (uuid) | Yes | | | `payoutChallengeId` | string (uuid) | Yes | | | `amount` | string | Yes | | | `feeAmount` | string | Yes | | | `netPayoutAmount` | string | Yes | | | `currency` | string | Yes | | | `status` | string | Yes | | | `providerTransferId` | string \\| null | Yes | | | `clearingNetworkId` | string \\| null | Yes | | | `idempotencyKey` | string | Yes | | | `attempts` | integer | Yes | | | `eligibleAt` | string (date-time) | Yes | | | `lastError` | string \\| null | Yes | | | `createdAt` | string (date-time) | Yes | | | `updatedAt` | string (date-time) | Yes | | ### `PaymentExpectation` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `sourceApp` | string | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `externalOrderId` | string \\| null | Yes | | | `expectedAmount` | string | Yes | | | `amountTolerance` | string | Yes | | | `currency` | string | Yes | | | `expectedReference` | string \\| null | Yes | | | `expectedPayerTaxId` | string \\| null | Yes | | | `buyerName` | string \\| null | Yes | | | `buyerDocTipo` | integer \\| null | Yes | | | `buyerDocNro` | integer \\| null | Yes | | | `buyerTaxCondition` | string \\| null | Yes | | | `autoInvoiceEnabled` | boolean | Yes | | | `fiscalProfileId` | string \\| null (uuid) | Yes | | | `fiscalPtoVta` | integer \\| null | Yes | | | `invoiceConcepto` | integer (`1`, `2`, `3`) | Yes | | | `invoiceIvaRate` | string | Yes | | | `invoiceDescription` | string \\| null | Yes | | | `status` | string (`open`, `reconciled`, `expired`, `cancelled`) | Yes | | | `expiresAt` | string \\| null (date-time) | Yes | | | `createdAt` | string (date-time) | Yes | | | `updatedAt` | string (date-time) | Yes | | ### `RailMovement` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `railAccountId` | string (uuid) | Yes | | | `railId` | string | Yes | | | `externalMovementId` | string | Yes | | | `direction` | string (`credit`, `debit`) | Yes | | | `amount` | string | Yes | | | `feeAmount` | string \\| null | Yes | | | `netAmount` | string \\| null | Yes | | | `currency` | string | Yes | | | `externalReference` | string \\| null | Yes | | | `payerDocType` | string \\| null | Yes | | | `payerDoc` | string \\| null | Yes | | | `payerName` | string \\| null | Yes | | | `payerIsAccountOwner` | boolean \\| null | Yes | | | `clearingNetworkId` | string \\| null | Yes | | | `virtualCvuId` | string (uuid) | No | | | `occurredAt` | string (date-time) | Yes | | | `rawFacts` | object | Yes | | | `createdAt` | string (date-time) | Yes | | ### `RailReconciliation` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `movementId` | string (uuid) | Yes | | | `expectationId` | string (uuid) | Yes | | | `matchReason` | string | Yes | | | `confidenceBps` | integer | Yes | | | `amountDelta` | string | Yes | | | `autoInvoiceStatus` | string | Yes | | | `fiscalIssuanceId` | string \\| null (uuid) | Yes | | | `lastError` | string \\| null | Yes | | | `createdAt` | string (date-time) | Yes | | | `updatedAt` | string (date-time) | Yes | | ### `AccountantMovementSummary` | Field | Type | Required | Description | |---|---|---|---| | `creditCount` | integer | Yes | | | `creditTotalByCurrency` | object | Yes | | | `unmatchedCreditCount` | integer | Yes | | ### `AccountantReconciliationSummary` | Field | Type | Required | Description | |---|---|---|---| | `totalReconciled` | integer | Yes | | | `autoInvoicedCount` | integer | Yes | | | `outcomeUnknownCount` | integer | Yes | | ### `AccountantFiscalProfileSummary` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `cuit` | string | Yes | | | `countryCode` | string | Yes | | | `afipEnvironment` | string | Yes | | | `taxCondition` | string | Yes | | | `arcaEnabled` | boolean | Yes | | | `executionMode` | string | Yes | | | `certStatus` | string | Yes | | | `certNotAfter` | string \\| null (date-time) | Yes | | ### `AccountantOverviewResponse` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `movementSummary` | `AccountantMovementSummary` | Yes | | | `reconciliationSummary` | `AccountantReconciliationSummary` | Yes | | | `fiscalProfiles` | array<`AccountantFiscalProfileSummary`> | Yes | | ### `WebhookEndpointSummary` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `tenantId` | string \\| null (uuid) | Yes | | | `sourceApp` | string | Yes | | | `environment` | string (`live`, `sandbox`) | Yes | | | `kind` | string | Yes | | | `url` | string (uri) | Yes | | | `hasSecondarySecret` | boolean | Yes | | | `events` | array | Yes | | | `isActive` | boolean | Yes | | | `createdAt` | string (date-time) | Yes | | | `updatedAt` | string (date-time) | Yes | | ### `WebhookDeliverySummary` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `endpointId` | string (uuid) | Yes | | | `tenantId` | string \\| null (uuid) | Yes | | | `eventType` | string | Yes | | | `payload` | object | Yes | | | `status` | string (`pending`, `claimed`, `delivered`, `dead_letter`) | Yes | | | `attempts` | integer | Yes | | | `eligibleAt` | string (date-time) | Yes | | | `lastResponseCode` | integer \\| null | Yes | | | `lastError` | string \\| null | Yes | | | `createdAt` | string (date-time) | Yes | | | `updatedAt` | string (date-time) | Yes | | ### `ReplayWebhookDeliveryRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | ### `MpOAuthAuthorizeUrlRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `railAccountId` | string (uuid) | Yes | | | `redirectUri` | string (uri) | Yes | | ### `MpOAuthAuthorizeUrlResponse` | Field | Type | Required | Description | |---|---|---|---| | `authorizeUrl` | string (uri) | Yes | | | `state` | string | Yes | | | `expiresAt` | string (date-time) | Yes | | ### `MpOAuthExchangeRequest` | Field | Type | Required | Description | |---|---|---|---| | `tenantId` | string (uuid) | Yes | | | `state` | string | Yes | | | `code` | string | Yes | | ### `SimulateTransferResponse` | Field | Type | Required | Description | |---|---|---|---| | `accepted` | boolean | Yes | | | `duplicate` | boolean | Yes | | | `inboxId` | string \\| null (uuid) | Yes | | | `processedInline` | boolean | Yes | | | `movementId` | string \\| null (uuid) | Yes | | | `reconciliationId` | string \\| null (uuid) | Yes | | | `autoInvoiceStatus` | string \\| null | Yes | | | `fiscalIssuanceId` | string \\| null (uuid) | Yes | | ### `InboundAcceptResponse` | Field | Type | Required | Description | |---|---|---|---| | `accepted` | boolean | Yes | | | `duplicate` | boolean | Yes | | | `inboxId` | string (uuid) | No | | | `connectivityTest` | boolean | No | | --- # API ez-catalog > REST + JSON. Todas las rutas viven bajo /v1. - **Base URL:** `https://api.ez-catalog.huggian.com` - **Referencia interactiva (Try it):** https://huggian.com/ez-catalog/docs/reference - **Referencia OpenAPI en Markdown:** https://huggian.com/ez-catalog/docs/reference.md - **OpenAPI 3.1 JSON:** https://huggian.com/ez-catalog/docs/openapi.json - **Pedir API key gratis:** https://huggian.com/catalog/signup?plan=free ## Quick start 1. Registrate en huggian.com/catalog/signup. El plan Free no pide tarjeta. 2. Guardá la API key que aparece en pantalla. No se muestra de nuevo. También llega por email. 3. Mandala en el header X-Api-Key en cada request. ```bash curl https://api.ez-catalog.huggian.com/v1/products/barcode/7790895000997 \ -H "X-Api-Key: ezc_free_xxxxxxxx" ``` ## Autenticación Toda request a /v1/* requiere el header X-Api-Key. La ruta /health es pública. Las imágenes se sirven desde images.huggian.com sin autenticación. - 401 UNAUTHORIZED: falta la key o es inválida. - 403 FORBIDDEN: key válida pero sin permiso (plan insuficiente o scope faltante). - 429 RATE_LIMIT_EXCEEDED / MONTHLY_QUOTA_EXCEEDED: límite por minuto (ver Retry-After y X-RateLimit-*) o cuota mensual agotada (incluye limit y used). ## Planes y límites | Plan | Rate limit | Cuota mensual | Lectura | Escritura | Scopes | |---|---|---|---|---|---| | Free | 10 rpm | 50 | Barcode, búsqueda, marca, familia, categoría | Propuestas | catalog:products:read, catalog:proposals:write | | Basic | 60 rpm | 25.000 | Todo | Productos, marcas e imágenes | + catalog:products:write, catalog:images:write | | Pro | 300 rpm | 200.000 | Todo | Todo, incluido borrado | + catalog:products:delete | El rate limit es por API key, por minuto, con ventana deslizante. La cuota mensual se reinicia el día 1 a las 00:00 UTC y no se resetea al cambiar de plan. ## Errores Todos los errores responden JSON con el campo error (código estable en SCREAMING_SNAKE_CASE) y message (texto legible). ```json { "error": "NOT_FOUND", "message": "product not found" } ``` - `400`: BAD_REQUEST: body o parámetros inválidos. - `401`: UNAUTHORIZED: auth faltante o inválida. - `403`: FORBIDDEN: plan o scope insuficiente. - `404`: NOT_FOUND: el recurso no existe. - `409`: CONFLICT: barcode o marca duplicada. - `413`: PAYLOAD_TOO_LARGE: archivo o body demasiado grande. - `415`: UNSUPPORTED_MEDIA_TYPE: se esperaba Content-Type image/*. - `422`: UNPROCESSABLE_ENTITY: entidad no procesable. - `429`: RATE_LIMIT_EXCEEDED o MONTHLY_QUOTA_EXCEEDED. - `500`: INTERNAL_ERROR: error interno. Reintentá con backoff. - `502`: UPSTREAM_ERROR: falla en proveedor externo o almacenamiento. - `503`: SERVICE_UNAVAILABLE: servicio no disponible. ## Productos ### `GET /v1/products/barcode/{ean}` (Free+) Buscar producto por código de barras EAN, UPC o ISBN. Response: ```json { "id": "8a3e...", "barcode": "7790895000997", "barcode_type": "EAN13", "name": "Yerba Mate Taragüi 500g", "category": "almacen-infusiones", "brand": "Taragüi", "brand_id": "f1c2...", "image_url": "https://images.huggian.com/products/7790895000997.jpg", "category_id": "ab12...", "country_of_origin": "AR", "verified": true, "product_type": "good", "presentation": "500g", "unit_of_measure": "g", "ncm_code": "0903.00.10", "afip_category": null, "family_id": "c9d0...", "attributes": null, "source": "manual", "created_at": "2026-01-12T10:00:00Z", "updated_at": "2026-04-30T09:00:00Z" } ``` - Devuelve 404 si el EAN no está en el catálogo ni en las 87 fuentes externas. ### `POST /v1/products/by-barcodes` (Free+) Búsqueda en lote por hasta 500 códigos de barras. Request body: ```json { "barcodes": ["7790895000997", "7790040119000"] } ``` Response: ```json Product[] (los códigos sin coincidencia se omiten). ``` - Máximo 500 barcodes por request (400 BAD_REQUEST si excede). ### `POST /v1/products/by-ids` (Free+) Búsqueda en lote por hasta 500 UUIDs. Request body: ```json { "ids": ["8a3e1d60-1c4f-4d1c-9e2a-2b5c6d7e8f90"] } ``` Response: ```json Product[]. ``` - Máximo 500 IDs por request (400 BAD_REQUEST si excede). ### `GET /v1/products/{id}` (Free+) Buscar producto por UUID. Response: ```json Mismo shape que /barcode/{ean}. ``` ### `GET /v1/products/search?q=&brand=&family=&category=&page=&per_page=` (Free+) Búsqueda full-text con filtros y paginación. Response: ```json { "items": [ /* Product[] */ ], "total": 142, "page": 1, "per_page": 20 } ``` - page por defecto 1 (mín 1). per_page por defecto 20 (1..100). - brand, family, category aceptan UUID. ### `POST /v1/products` (Basic+) Crear producto. Request body: ```json { "barcode": "7790895000997", "barcode_type": "EAN13", "name": "Yerba Mate Taragüi 500g", "description": null, "category_id": "ab12...", "brand": "Taragüi", "brand_id": null, "image_url": null, "ncm_code": "0903.00.10", "afip_category": null, "country_of_origin": "AR", "source": "manual", "presentation": "500g", "subcategory": null, "unit_of_measure": "g", "product_type": "good", "attributes": null } ``` Response: ```json 201 Created → Product completo. ``` - Solo name es obligatorio. - Requiere scope catalog:products:write (planes Basic y Pro). - 409 CONFLICT si el EAN o la marca normalizada ya existe. ### `PUT /v1/products/{id}` (Basic+) Actualizar producto (todos los campos opcionales, parche). Request body: ```json { "name": "Nuevo nombre", "verified": true } ``` Response: ```json 200 → Product actualizado. ``` ### `DELETE /v1/products/{id}` (Pro+) Borrar producto. Response: ```json 204 No Content. ``` - Requiere scope catalog:products:delete (plan Pro). ### `POST /v1/products/{id}/propose-edit` (Free+) Proponer una corrección de nombre o categoría para validación del árbitro. Request body: ```json { "field": "name", "value": "Yerba Mate Taragüi Clásica 500g", "proposer_id": "tenant-123" } ``` Response: ```json 202 Accepted → { "id": "uuid", "status": "pending" }. ``` - Campos permitidos: name, category. - Disponible en todos los planes (scope catalog:proposals:write). ## Marcas ### `GET /v1/brands` (Free+) Listar marcas. Response: ```json [ { "id": "f1c2...", "name": "Taragüi", "slug": "taragui", "logo_url": "...", "created_at": "..." } ] ``` ### `GET /v1/brands/{id}` (Free+) Obtener marca por UUID (incluye product_count). Response: ```json Brand + { "product_count": 42 }. ``` ### `POST /v1/brands` (Basic+) Crear marca (normaliza acentos, sufijos corporativos, mayúsculas). Request body: ```json { "name": "La Serenísima", "logo_url": null } ``` Response: ```json 201 → Brand. 409 CONFLICT si la marca normalizada ya existe. ``` ## Familias ### `GET /v1/families?brand=` (Free+) Listar familias de producto (variantes de un mismo SKU base). Response: ```json ProductFamily[]. ``` ### `GET /v1/families/{id}` (Free+) Obtener familia por UUID con sus variantes. Response: ```json ProductFamily + { "variants": Product[] }. ``` ## Categorías ### `GET /v1/categories` (Free+) Listar categorías (árbol jerárquico, parent_id apunta al padre o null). Response: ```json Category[]. ``` ## Imágenes ### `GET /v1/products/{ean}/images` (Free+) Listar imágenes de un producto por EAN. Response: ```json { "ean": "7790895000997", "images": [ { "id": "...", "ean": "7790895000997", "url": "https://images.huggian.com/...", "source": "user_upload", "width": 800, "height": 800, "bytes": 42100, "created_at": "..." } ] } ``` ### `POST /v1/products/{ean}/images` (Basic+) Subir imagen enviando los bytes crudos con Content-Type image/*. Response: ```json 200 → ProductImage. ``` - Acepta image/jpeg, image/png, image/webp (cuerpo binario directo, sin multipart). - Requiere scope catalog:images:write (planes Basic y Pro). ## Health check ### `GET /health` (Free+) Healthcheck no autenticado. Response: ```json { "ok": true } ``` ## Schemas ### `Product` ```ts { id: uuid, barcode: string | null, barcode_type: string, // "EAN13" | "EAN8" | "UPC" | ... name: string, description: string | null, category_id: uuid | null, category: string | null, // slug de la categoría brand: string | null, brand_id: uuid | null, image_url: string | null, ncm_code: string | null, afip_category: string | null, country_of_origin: string, // ISO 3166-1 alpha-2 verified: boolean, source: string, // "manual" | "openff" | ... presentation: string | null, // "500g", "1L", ... subcategory: string | null, unit_of_measure: string | null, // "g" | "ml" | "u" family_id: uuid | null, product_type: string, // "good" | "service" attributes: object | null, // free-form JSON created_at: datetime, updated_at: datetime } ``` ### `Brand` ```ts { id: uuid, name: string, slug: string, // normalizado: sin acentos, lowercase logo_url: string | null, created_at: datetime } ``` ### `ProductFamily` ```ts { id: uuid, name: string, slug: string, brand_id: uuid | null, created_at: datetime } ``` ### `Category` ```ts { id: uuid, slug: string, name: string, parent_id: uuid | null, // null para categorías raíz created_at: datetime } ``` --- # EZ Catalog API — OpenAPI Reference (v1) > Product catalog REST API for Argentina and global markets: lookup by barcode (EAN-13, UPC-12, ISBN-10/13), full-text search, batch lookups, brands, product families, categories, images, and community edit proposals. - **Base URL (Production):** `https://api.ez-catalog.huggian.com` - **Guide:** https://huggian.com/ez-catalog/docs (Markdown: https://huggian.com/ez-catalog/docs.md) - **Interactive Reference:** https://huggian.com/ez-catalog/docs/reference - **OpenAPI 3.1 JSON:** https://huggian.com/ez-catalog/docs/openapi.json ## Authentication - **ApiKey** (`apiKey`, header `X-Api-Key`): API key issued for Free, Basic, or Pro catalog plans. ## Standard Error Responses | Key | Description | Schema | |---|---|---| | `E400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `E401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `E403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `E404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `E409` | Duplicate barcode or normalized brand (error: CONFLICT) | `ErrorResponse` | | `E413` | Payload exceeds maximum allowed size (error: PAYLOAD_TOO_LARGE) | `ErrorResponse` | | `E415` | Unsupported media type; expected image/* (error: UNSUPPORTED_MEDIA_TYPE) | `ErrorResponse` | | `E422` | Unprocessable entity (error: UNPROCESSABLE_ENTITY) | `ErrorResponse` | | `E429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `E500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | | `E502` | Upstream provider or storage failure (error: UPSTREAM_ERROR) | `ErrorResponse` | | `E503` | Service unavailable (error: SERVICE_UNAVAILABLE) | `ErrorResponse` | ## Health ### `GET /health` Unauthenticated liveness probe. - **Auth:** None (public) #### Responses | Status | Description | Schema | |---|---|---| | `200` | Service is up | `HealthResponse` | Example `200` response: ```json { "ok": true } ``` ## Products ### `GET /v1/products/barcode/{ean}` Look up a product by barcode (EAN-13, UPC-12, ISBN-10/13). Looks up the product in cache/database and fans out to 87 external providers on cache miss. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `ean` | path | Yes | string | EAN-13, UPC-12, or ISBN-10/13 barcode. | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Matching product | `Product` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | Example `200` response: ```json { "id": "8a3e1d60-1c4f-4d1c-9e2a-2b5c6d7e8f90", "barcode": "7790895000997", "barcode_type": "EAN13", "name": "Yerba Mate Taragüi 500g", "description": null, "category_id": "ab12cd34-5678-4abc-9def-0123456789ab", "category": "almacen-infusiones", "brand": "Taragüi", "brand_id": "f1c2d3e4-5678-4abc-9def-0123456789ab", "image_url": "https://images.huggian.com/products/7790895000997.jpg", "ncm_code": "0903.00.10", "afip_category": null, "country_of_origin": "AR", "verified": true, "source": "manual", "presentation": "500g", "subcategory": null, "unit_of_measure": "g", "family_id": "c9d0e1f2-5678-4abc-9def-0123456789ab", "product_type": "good", "attributes": null, "created_at": "2026-01-12T10:00:00Z", "updated_at": "2026-04-30T09:00:00Z" } ``` ### `POST /v1/products/by-barcodes` Batch lookup products by up to 500 barcodes. Returns an array of found products. Unknown barcodes are omitted from the result. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Request Body (required) - Content-Type: `application/json` - Schema: `ByBarcodesRequest` ```json { "barcodes": [ "7790895000997", "7790040119000" ] } ``` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Found products | array<`Product`> | | `400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `POST /v1/products/by-ids` Batch lookup products by up to 500 UUIDs. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Request Body (required) - Content-Type: `application/json` - Schema: `ByIdsRequest` ```json { "ids": [ "8a3e1d60-1c4f-4d1c-9e2a-2b5c6d7e8f90" ] } ``` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Found products | array<`Product`> | | `400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `GET /v1/products/search` Full-text product search with filters and pagination. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `q` | query | No | string | Free-text search query. | | `category` | query | No | string (uuid) | Filter by category UUID. | | `brand` | query | No | string (uuid) | Filter by brand UUID. | | `family` | query | No | string (uuid) | Filter by product family UUID. | | `page` | query | No | integer | 1-based page number. | | `per_page` | query | No | integer | Page size (1..100). | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Paginated search results | `SearchResult` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `POST /v1/products` Create a product (Basic and Pro plans). - **Auth:** ApiKey (scope: `catalog:products:write`) #### Request Body (required) - Content-Type: `application/json` - Schema: `CreateProductRequest` ```json { "barcode": "7790895000997", "barcode_type": "EAN13", "name": "Yerba Mate Taragüi 500g", "brand": "Taragüi", "country_of_origin": "AR", "presentation": "500g", "unit_of_measure": "g", "product_type": "good" } ``` #### Responses | Status | Description | Schema | |---|---|---| | `201` | Created product | `Product` | | `400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `409` | Duplicate barcode or normalized brand (error: CONFLICT) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `GET /v1/products/{id}` Get a product by UUID. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `id` | path | Yes | string (uuid) | | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Product | `Product` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `PUT /v1/products/{id}` Partially update a product (Basic and Pro plans). - **Auth:** ApiKey (scope: `catalog:products:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `id` | path | Yes | string (uuid) | | #### Request Body (required) - Content-Type: `application/json` - Schema: `UpdateProductRequest` ```json { "name": "Yerba Mate Taragüi 500g Sin Palo", "verified": true } ``` #### Responses | Status | Description | Schema | |---|---|---| | `200` | Updated product | `Product` | | `400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `409` | Duplicate barcode or normalized brand (error: CONFLICT) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `DELETE /v1/products/{id}` Delete a product (Pro plan). - **Auth:** ApiKey (scope: `catalog:products:delete`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `id` | path | Yes | string (uuid) | | #### Responses | Status | Description | Schema | |---|---|---| | `204` | Deleted | — | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `POST /v1/products/{id}/propose-edit` Propose a field correction for referee review (available on all plans, including Free). Records a pending edit proposal for the `name` or `category` field of an existing product. Idempotent while the same proposal is still pending. - **Auth:** ApiKey (scope: `catalog:proposals:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `id` | path | Yes | string (uuid) | | #### Request Body (required) - Content-Type: `application/json` - Schema: `ProposeEditRequest` ```json { "field": "name", "value": "Yerba Mate Taragüi Clásica 500g", "proposer_id": "tenant-123" } ``` #### Responses | Status | Description | Schema | |---|---|---| | `202` | Proposal accepted for review | `ProposeEditResponse` | | `400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | Example `202` response: ```json { "id": "a1b2c3d4-5678-4abc-9def-0123456789ab", "status": "pending" } ``` ## Brands ### `GET /v1/brands` List all brands. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Responses | Status | Description | Schema | |---|---|---| | `200` | Brands | array<`Brand`> | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `POST /v1/brands` Create a brand (normalizes accents, case, and corporate suffixes). - **Auth:** ApiKey (scope: `catalog:products:write`) #### Request Body (required) - Content-Type: `application/json` - Schema: `CreateBrandRequest` ```json { "name": "La Serenísima", "logo_url": null } ``` #### Responses | Status | Description | Schema | |---|---|---| | `201` | Created brand | `Brand` | | `400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `409` | Duplicate barcode or normalized brand (error: CONFLICT) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `GET /v1/brands/{id}` Get a brand by UUID including its linked product count. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `id` | path | Yes | string (uuid) | | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Brand with product count | `BrandWithCount` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ## Families ### `GET /v1/families` List product families (SKU size/pack variants), optionally filtered by brand. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `brand` | query | No | string (uuid) | Optional brand UUID filter. | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Product families | array<`ProductFamily`> | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ### `GET /v1/families/{id}` Get a product family by UUID with its variant products. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `id` | path | Yes | string (uuid) | | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Product family with variants | `FamilyWithVariants` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `404` | Resource not found (error: NOT_FOUND) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ## Categories ### `GET /v1/categories` List all catalog categories (hierarchical tree via parent_id). - **Auth:** ApiKey (scope: `catalog:products:read`) #### Responses | Status | Description | Schema | |---|---|---| | `200` | Categories | array<`Category`> | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `500` | Internal server error (error: INTERNAL_ERROR) | `ErrorResponse` | ## Images ### `GET /v1/products/{ean}/images` List stored images for a barcode. - **Auth:** ApiKey (scope: `catalog:products:read`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `ean` | path | Yes | string | | #### Responses | Status | Description | Schema | |---|---|---| | `200` | Images for the barcode | `ProductImageListResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `503` | Service unavailable (error: SERVICE_UNAVAILABLE) | `ErrorResponse` | ### `POST /v1/products/{ean}/images` Upload a product image as raw image/* bytes (Basic and Pro plans). Send the raw encoded JPEG, PNG, or WebP bytes in the request body with an `image/*` Content-Type header (not multipart/form-data). - **Auth:** ApiKey (scope: `catalog:images:write`) #### Parameters | Name | In | Required | Type | Description | |---|---|---|---|---| | `ean` | path | Yes | string | | #### Request Body (required) - Content-Type: `image/jpeg` - Schema: string (binary) - Content-Type: `image/png` - Schema: string (binary) - Content-Type: `image/webp` - Schema: string (binary) #### Responses | Status | Description | Schema | |---|---|---| | `200` | Stored image metadata | `ProductImage` | | `400` | Bad request (error: BAD_REQUEST) | `ErrorResponse` | | `401` | Missing or invalid X-Api-Key (error: UNAUTHORIZED) | `ErrorResponse` | | `403` | Valid key without required scope/plan (error: FORBIDDEN) | `ErrorResponse` | | `413` | Payload exceeds maximum allowed size (error: PAYLOAD_TOO_LARGE) | `ErrorResponse` | | `415` | Unsupported media type; expected image/* (error: UNSUPPORTED_MEDIA_TYPE) | `ErrorResponse` | | `429` | Per-minute rate limit (RATE_LIMIT_EXCEEDED with Retry-After and X-RateLimit-* headers) or monthly quota exhausted (MONTHLY_QUOTA_EXCEEDED with limit and used fields) | `ErrorResponse` \\| `MonthlyQuotaErrorResponse` | | `502` | Upstream provider or storage failure (error: UPSTREAM_ERROR) | `ErrorResponse` | | `503` | Service unavailable (error: SERVICE_UNAVAILABLE) | `ErrorResponse` | ## Schemas ### `HealthResponse` | Field | Type | Required | Description | |---|---|---|---| | `ok` | boolean | Yes | | ### `ErrorResponse` | Field | Type | Required | Description | |---|---|---|---| | `error` | string (`BAD_REQUEST`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `CONFLICT`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `UNPROCESSABLE_ENTITY`, `RATE_LIMIT_EXCEEDED`, `MONTHLY_QUOTA_EXCEEDED`, `INTERNAL_ERROR`, `UPSTREAM_ERROR`, `SERVICE_UNAVAILABLE`) | Yes | | | `message` | string | Yes | | ### `MonthlyQuotaErrorResponse` | Field | Type | Required | Description | |---|---|---|---| | `error` | `"MONTHLY_QUOTA_EXCEEDED"` | Yes | | | `message` | string | Yes | | | `limit` | integer | Yes | | | `used` | integer | Yes | | ### `Product` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `barcode` | string \\| null | No | | | `barcode_type` | string | Yes | EAN13, EAN8, UPC, ISBN13, etc. | | `name` | string | Yes | | | `description` | string \\| null | No | | | `category_id` | string \\| null (uuid) | No | | | `category` | string \\| null | No | Category slug joined from category_id. | | `brand` | string \\| null | No | | | `brand_id` | string \\| null (uuid) | No | | | `image_url` | string \\| null (uri) | No | | | `ncm_code` | string \\| null | No | | | `afip_category` | string \\| null | No | | | `country_of_origin` | string | Yes | ISO 3166-1 alpha-2 country code. | | `verified` | boolean | Yes | | | `source` | string | Yes | | | `presentation` | string \\| null | No | | | `subcategory` | string \\| null | No | | | `unit_of_measure` | string \\| null | No | | | `family_id` | string \\| null (uuid) | No | | | `product_type` | string | Yes | good or service | | `attributes` | object \\| null | No | | | `created_at` | string (date-time) | Yes | | | `updated_at` | string (date-time) | Yes | | ### `CreateProductRequest` | Field | Type | Required | Description | |---|---|---|---| | `barcode` | string \\| null | No | | | `barcode_type` | string \\| null | No | | | `name` | string | Yes | | | `description` | string \\| null | No | | | `category_id` | string \\| null (uuid) | No | | | `brand` | string \\| null | No | | | `brand_id` | string \\| null (uuid) | No | | | `image_url` | string \\| null (uri) | No | | | `ncm_code` | string \\| null | No | | | `afip_category` | string \\| null | No | | | `country_of_origin` | string \\| null | No | | | `source` | string \\| null | No | | | `presentation` | string \\| null | No | | | `subcategory` | string \\| null | No | | | `unit_of_measure` | string \\| null | No | | | `product_type` | string \\| null | No | | | `attributes` | object \\| null | No | | ### `UpdateProductRequest` | Field | Type | Required | Description | |---|---|---|---| | `barcode` | string \\| null | No | | | `barcode_type` | string \\| null | No | | | `name` | string \\| null | No | | | `description` | string \\| null | No | | | `category_id` | string \\| null (uuid) | No | | | `brand` | string \\| null | No | | | `brand_id` | string \\| null (uuid) | No | | | `image_url` | string \\| null (uri) | No | | | `ncm_code` | string \\| null | No | | | `afip_category` | string \\| null | No | | | `country_of_origin` | string \\| null | No | | | `verified` | boolean \\| null | No | | | `source` | string \\| null | No | | | `presentation` | string \\| null | No | | | `subcategory` | string \\| null | No | | | `unit_of_measure` | string \\| null | No | | | `product_type` | string \\| null | No | | | `attributes` | object \\| null | No | | ### `SearchResult` | Field | Type | Required | Description | |---|---|---|---| | `items` | array<`Product`> | Yes | | | `total` | integer | Yes | | | `page` | integer | Yes | | | `per_page` | integer | Yes | | ### `ByBarcodesRequest` | Field | Type | Required | Description | |---|---|---|---| | `barcodes` | array | Yes | | ### `ByIdsRequest` | Field | Type | Required | Description | |---|---|---|---| | `ids` | array | Yes | | ### `ProposeEditRequest` | Field | Type | Required | Description | |---|---|---|---| | `field` | string (`name`, `category`) | Yes | | | `value` | string | Yes | | | `proposer_id` | string | Yes | | ### `ProposeEditResponse` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `status` | string | Yes | | ### `Brand` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `name` | string | Yes | | | `slug` | string | Yes | | | `logo_url` | string \\| null (uri) | No | | | `created_at` | string (date-time) | Yes | | ### `BrandWithCount` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `name` | string | Yes | | | `slug` | string | Yes | | | `logo_url` | string \\| null (uri) | No | | | `created_at` | string (date-time) | Yes | | | `product_count` | integer | Yes | | ### `CreateBrandRequest` | Field | Type | Required | Description | |---|---|---|---| | `name` | string | Yes | | | `logo_url` | string \\| null (uri) | No | | ### `ProductFamily` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `name` | string | Yes | | | `slug` | string | Yes | | | `brand_id` | string \\| null (uuid) | No | | | `created_at` | string (date-time) | Yes | | ### `FamilyWithVariants` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `name` | string | Yes | | | `slug` | string | Yes | | | `brand_id` | string \\| null (uuid) | No | | | `created_at` | string (date-time) | Yes | | | `variants` | array<`Product`> | Yes | | ### `Category` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `slug` | string | Yes | | | `name` | string | Yes | | | `parent_id` | string \\| null (uuid) | No | | | `created_at` | string (date-time) | Yes | | ### `ProductImage` | Field | Type | Required | Description | |---|---|---|---| | `id` | string (uuid) | Yes | | | `ean` | string | Yes | | | `url` | string (uri) | Yes | | | `source` | string | Yes | | | `width` | integer | Yes | | | `height` | integer | Yes | | | `bytes` | integer | Yes | | | `created_at` | string (date-time) | Yes | | ### `ProductImageListResponse` | Field | Type | Required | Description | |---|---|---|---| | `ean` | string | Yes | | | `images` | array<`ProductImage`> | Yes | |