GestionCervecera API beta

REST API for server-to-server integrations. JSON over HTTPS, JWT authentication.

API REST para integraciones servidor a servidor. JSON sobre HTTPS, autenticación JWT.

This API is in beta. It works and it is documented, but it has not yet been used by an integration in production. Expect rough edges, and tell us when you hit one: at this stage a report changes the API, which is the point of a beta.

What beta does not mean: it does not mean the contract moves under your feet. Within /api/v1 we only add — new endpoints and new fields. Anything that would break a working integration goes in a new version, with at least 90 days' notice. Build against it as you would against any other version.

So give us a technical contact. Notice we cannot deliver is not notice: send the email address of whoever maintains the integration to desarrollo@gestioncervecera.com when you start. It is not the same address as your brewery's commercial contact, and it is the only way we can warn you before something changes.

Esta API está en beta. Funciona y está documentada, pero todavía ningún sistema la usó en producción. Es esperable que aparezcan asperezas: si encuentra una, avísenos. En esta etapa un reporte cambia la API, que es justamente para lo que sirve una beta.

Lo que beta no significa: no significa que el contrato se le mueva abajo de los pies. Dentro de /api/v1 sólo agregamos — endpoints nuevos y campos nuevos. Todo lo que rompa una integración que ya funciona va en una versión nueva, con un preaviso mínimo de 90 días. Constrúyala con la misma confianza que cualquier otra versión.

Por eso, dénos un contacto técnico. Un preaviso que no se puede entregar no es un preaviso: mandános el mail de quien mantiene la integración a desarrollo@gestioncervecera.com cuando arranque. No es el mismo que el contacto comercial de la fábrica, y es la única forma que tenemos de avisarle antes de que algo cambie.

OverviewIntroducción

This API lets an external system read and maintain your account's master data: customers with their points of sale and contacts, suppliers, products and price lists, recipes, supplies and their warehouses, production batches and tasks, and purchases — plus your catalogs and reports.

Base URL/api/v1
AuthenticationJWT bearer token
FormatJSON, UTF-8
DatesISO 8601

Your token is bound to a single account, and that binding is signed into the token: it always resolves to your own data, whatever parameters you send.

Esta API le permite a un sistema externo leer y mantener los datos maestros de su cuenta: clientes con sus puntos de venta y contactos, proveedores, productos y listas de precios, recetas, insumos y sus depósitos, lotes y tareas de producción, y compras — más sus catálogos y sus informes.

URL base/api/v1
AutenticaciónToken JWT
FormatoJSON, UTF-8
FechasISO 8601

Su token está atado a una sola cuenta, y esa relación va firmada dentro del token: siempre resuelve a sus propios datos, sin importar qué parámetros envíe.

What this API does not do. This version is built for master data: the records your systems need to stay in sync. The following operations are not available, and there is no endpoint for them — they are done in the application:

  • Creating orders and invoicing. No orders, invoices or credit notes are created, edited, approved, delivered or invoiced through the API. Orders can be read — see Orders — but invoices and credit notes are not read back.
  • Point of sale. The counter-sale flow — open register, combos, payment and receipt in one step — is not exposed. This is unrelated to /customers/{id}/points-of-sale, which is available and means your customer's branches.
  • Packaging runs. Turning beer into packaged product is not exposed. Recipes, supplies and packagings are.
  • Electronic documents in collections. Electronic receipts and electronic delivery guides are not issued through the API.
  • Delivery routes. Route sheets and their assignment are not exposed.
  • Operations that continue into a second step. Where the application asks you something after an action and then does more work — yeast reuse when a batch changes stage is the clearest case — the API exposes only the part that completes on its own, and says so in that section. It never leaves an operation half done.

Each of these is a decision about this version, not a permanent one. If your integration needs one, tell us: it helps us prioritise.

Qué no hace esta API. Esta versión está hecha para datos maestros: los registros que sus sistemas necesitan para mantenerse sincronizados. Las siguientes operaciones no están disponibles, y no hay endpoint para ellas — se hacen desde la aplicación:

  • Crear pedidos y facturar. Por la API no se crean, editan, aprueban, entregan ni facturan pedidos, y no se emiten facturas ni notas de crédito. Los pedidos sí se pueden leer — ver Pedidos —; las facturas y notas de crédito no.
  • Punto de venta. El flujo de venta en mostrador —caja abierta, combos, cobro y comprobante en un solo paso— no está expuesto. No tiene relación con /customers/{id}/points-of-sale, que sí está disponible y son las sucursales de su cliente.
  • Envasado. Pasar cerveza a producto envasado no está expuesto. Recetas, insumos y envases sí.
  • Documentos electrónicos en cobranzas. Los recibos electrónicos y las guías electrónicas no se emiten por la API.
  • Hoja de ruta. Las hojas de reparto y su asignación no están expuestas.
  • Operaciones que siguen en un segundo paso. Donde la aplicación le pregunta algo después de una acción y entonces hace más trabajo —la reutilización de levaduras al cambiar la etapa de un lote es el caso más claro— la API expone solo la parte que se completa sola, y lo aclara en esa sección. Nunca deja una operación a medias.

Cada una de estas es una decisión sobre esta versión, no algo definitivo. Si su integración necesita alguna, avísenos: nos ayuda a priorizar.

EnvironmentsEntornos

EnvironmentBase URLUse it for
QAhttps://apiqa.gestioncervecera.com/api/v1Integrating and testing. Test data.
Productionhttps://api.gestioncervecera.com/api/v1Only after validating in QA.
EntornoURL basePara qué
QAhttps://apiqa.gestioncervecera.com/api/v1Integrar y probar. Datos de prueba.
Producciónhttps://api.gestioncervecera.com/api/v1Solo después de validar en QA.

Both hosts serve this same documentation at their root, so https://apiqa.gestioncervecera.com is a valid bookmark. Start with GET /api/v1/health: it needs no token and answers {"status":"ok"}, so you can tell "the API is unavailable" from "my token is wrong" before opening a ticket.

Los dos hosts sirven esta misma documentación en su raíz, así que https://apiqa.gestioncervecera.com sirve como marcador. Empiece por GET /api/v1/health: no necesita token y responde {"status":"ok"}, así puede distinguir "la API no está disponible" de "mi token está mal" antes de abrir un ticket.

CredentialsCredenciales

There is one credential: your account's API key. No user name, no password. The account owner finds it in Settings and hands it to you.

A person's login never works here, and that is deliberate. If your integration authenticated as an employee, the day that person leaves or changes their password your integration would stop without warning — and every record it wrote would look as if that person had written it. The API key belongs to the account, not to anyone.

Treat it like a password: it is the whole credential. Keep it out of source control, out of URLs and out of logs. If it leaks, ask the account owner to have it replaced.

You do not request permissions. The key grants exactly what this API's endpoints need and nothing else — there is no request that reaches anything outside what is documented here.

Hay una sola credencial: la API key de su cuenta. Sin usuario y sin contraseña. El dueño de la cuenta la encuentra en Configuración y se la entrega.

El login de una persona nunca funciona acá, y es deliberado. Si su integración se autenticara como un empleado, el día que esa persona se va o cambia su contraseña la integración se detendría sin aviso — y cada registro que escribió figuraría como hecho por esa persona. La API key es de la cuenta, no de nadie en particular.

Trátela como una contraseña: es toda la credencial. Fuera del control de versiones, fuera de las URLs y fuera de los logs. Si se filtra, pídale al dueño de la cuenta que la reemplace.

No hay permisos que pedir. La clave habilita exactamente lo que necesitan los endpoints de esta API y nada más: no existe ningún pedido que llegue a algo que no esté documentado acá.

Postman and toolsPostman y herramientas

The full machine-readable contract is published as OpenAPI 3:

/api/v1/openapi.json

Every tool in the ecosystem reads it directly, so there is no separate collection to keep in sync:

  • Postman — Import → Link, paste the URL above. You get every endpoint, its parameters and its schemas as a ready-to-run collection.
  • Insomnia, Bruno, Hoppscotch — same import-from-URL flow.
  • Client generators — openapi-generator, NSwag or Kiota will produce a typed client in your language from the same file.
  • API reference — browse and try every endpoint in the browser, with request snippets in cURL, C#, JavaScript, Python and others.

The specification is generated from the running server, so it always matches the deployed version. Re-import it after an upgrade instead of editing your collection by hand.

El contrato completo, legible por máquina, se publica como OpenAPI 3:

/api/v1/openapi.json

Todas las herramientas del ecosistema lo leen directo, así que no hay una colección aparte que mantener sincronizada:

  • Postman — Import → Link y pegue la URL de arriba. Obtiene todos los endpoints, sus parámetros y sus schemas como una colección lista para ejecutar.
  • Insomnia, Bruno, Hoppscotch — el mismo flujo de importar desde URL.
  • Generadores de clientes — openapi-generator, NSwag o Kiota generan un cliente tipado en su lenguaje a partir del mismo archivo.
  • Referencia de la API — recorra y pruebe cada endpoint desde el navegador, con snippets en cURL, C#, JavaScript, Python y otros.

La especificación se genera desde el servidor en ejecución, así que siempre coincide con la versión desplegada. Vuelva a importarla después de una actualización en lugar de editar su colección a mano.

AuthenticationAutenticación

Log in once and reuse the access token. Do not log in on every request.

Autentique una vez y reutilice el token de acceso. No se autentique en cada request.

# 1) Login — ONCE, not on every request
curl -X POST https://api.gestioncervecera.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
        "apiKey": "<your account's API key>",
        "deviceName": "<a label for this client>"
      }'
# 1) Login — UNA VEZ, no en cada request
curl -X POST https://api.gestioncervecera.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
        "apiKey": "<la API key de su cuenta>",
        "deviceName": "<una etiqueta para este cliente>"
      }'

The response carries accessToken, expiresIn and an account object. There is no refresh token — see below. Exact fields are in the API reference.

La respuesta trae accessToken, expiresIn y un objeto account. No hay refresh token — vea más abajo. Los campos exactos están en la referencia de la API.

deviceName is a free-form label for your client, used for auditing: it is how support tells your staging environment apart from your production one when reading the logs. Send it.

deviceName es una etiqueta libre para identificar su cliente, y se usa para auditoría: es lo que permite distinguir en los registros su entorno de pruebas del productivo. Envíelo.

# 2) Use the accessToken on every call
curl "https://api.gestioncervecera.com/api/v1/customers?page=1&pageSize=50" \
  -H "Authorization: Bearer <accessToken>"

# 3) On 401, log in again (step 1) and retry the call once
# 2) Use el accessToken en cada llamada
curl "https://api.gestioncervecera.com/api/v1/customers?page=1&pageSize=50" \
  -H "Authorization: Bearer <accessToken>"

# 3) Ante un 401, autentique de nuevo (paso 1) y reintente la llamada una vez

The accessToken lasts 8 hours. When it expires, log in again with your API key. That is the whole renewal flow: one call, no stored state, and safe to run from several processes at the same time.

Do not treat 8 hours as a guarantee: read expiresIn from the login response instead of hard-coding it, and handle a 401 anyway. A token can stop being accepted before it expires — for instance if the integration user is deactivated.

El accessToken dura 8 horas. Cuando vence, autentique de nuevo con su API key. Ese es todo el flujo de renovación: una llamada, sin estado que guardar, y se puede ejecutar desde varios procesos a la vez sin problema.

No tome las 8 horas como garantía: lea expiresIn de la respuesta del login en vez de fijarlo en el código, y maneje igual el 401. Un token puede dejar de ser aceptado antes de vencer — por ejemplo si se inactiva el usuario de integración.

Implement it exactly like this:

Implémentelo exactamente así:

call(request):
    response = send(request, accessToken)
    if response.status == 401:
        accessToken = login(apiKey)             # step 1, again
        response = send(request, accessToken)   # ONE single retry
    return response
llamar(request):
    respuesta = enviar(request, accessToken)
    if respuesta.status == 401:
        accessToken = login(apiKey)             # paso 1, otra vez
        respuesta = enviar(request, accessToken)   # UN solo reintento
    return respuesta

One single retry. A retry loop on 401 produces a login storm and ends in a block. Login attempts are rate limited per API key and IP.

Un solo reintento. Un bucle de reintentos ante un 401 genera una tormenta de logins y termina en un bloqueo. Los intentos de login están limitados por API key y por IP.

There is no refresh token, and no logout

No hay refresh token ni logout

/auth/login is the only authentication endpoint. There is no /auth/refresh and no /auth/logout, and the login response contains no refreshToken. This is deliberate, and it is the design that suits automated clients.

/auth/login es el único endpoint de autenticación. No existe /auth/refresh ni /auth/logout, y la respuesta del login no trae ningún refreshToken. Es deliberado, y es el diseño que le conviene a un cliente automatizado.

A rotating refresh token has to be stored, kept current, and renewed exactly once at a time. Clients that run several requests in parallel — agents especially — hit the same expiry from several places at once, and one of those renewals loses. Logging in again has none of that: it is idempotent, holds no state, and is safe to call from as many processes as you like. You already store the API key, so there is no second secret to look after.

Un refresh token que rota hay que guardarlo, mantenerlo al día y renovarlo exactamente de a uno por vez. Los clientes que corren varios requests en paralelo —los agentes sobre todo— chocan con el mismo vencimiento desde varios lados a la vez, y una de esas renovaciones pierde. Volver a autenticarse no tiene nada de eso: es idempotente, no guarda estado y se puede llamar desde tantos procesos como quiera. La API key ya la guarda igual, así que no hay un segundo secreto que cuidar.

To cut access immediately, the account owner deactivates the integration user from the Users screen. That takes effect on the very next request, without waiting for any token to expire.

Para cortar el acceso de inmediato, el dueño de la cuenta inactiva el usuario de integración desde la pantalla de Usuarios. Tiene efecto en el request siguiente, sin esperar a que venza ningún token.

PermissionsPermisos

The API key grants a fixed set of permissions: exactly what the endpoints below need. You cannot ask for more, and there is nothing to configure. Anything not listed in this documentation has no endpoint, so no key can reach it.

La API key habilita un conjunto fijo de permisos: exactamente lo que necesitan los endpoints de abajo. No se puede pedir más y no hay nada que configurar. Todo lo que no esté en esta documentación no tiene endpoint, así que ninguna clave llega.

EndpointsPermission it needs
/auth/*, /healthNone. /health needs no token at all
GET /customers, GET /customers/{id} and its sub-resourcesCliente
Every write on /customers, its points of sale and its contactsCrearEditarCliente
GET /customers/{id}/balanceCtaCteCliente
Country reference catalogs: /tax-conditions, /provinces, /payment-terms, and the fiscal onesNone
Account catalogs: /price-lists, /customer-types, /currencies, /sales-reps, /logistics-providers, /customer-categoriesCliente
GET /brands, GET /brands/{id}Marcas
POST/PUT on /brandsCrearEditarMarcas
/brands/{id}/deactivateEliminarMarcas
GET /promotions, GET /promotions/{id}Promociones
POST/PUT on /promotionsCrearEditarPromocion
/promotions/{id}/deactivateEliminarPromocion
GET /suppliers, GET /suppliers/{id}, /supplier-categories, /expense-accountsProveedor
POST and PUT on /suppliersCrearEditarProveedor
/suppliers/{id}/deactivate and /activateEliminarProveedor
Everything under /purchases except /cancel, plus the purchase catalogs: /voucher-types, /payment-types, /supplies, /complementary-products, /purchasable-services, /spare-parts, /supply-warehousesCompras
everything on /purchase-ordersOrdenDeCompra
everything on /keg-purchase-orders and on /distributor-purchasesCompraDistribuidora
everything on /distributor-services — and the Duenio role on top, same as the web application's own service screensDistribuidora
/purchases/{id}/cancelEliminarCompra
GET /services, GET /services/{id}Servicio
POST and PUT on /servicesCrearEditarServicio
/services/{id}/deactivate and /activateEliminarServicio
GET /products, GET /products/{id}, /products/{id}/categories, /product-categories, /containers, /casesProductos
POST and PUT on /productsCrearEditarProducto
/products/{id}/deactivate and /activateEliminarProducto
Everything under /products/{id}/stock, including /pack and /unpackStock
GET on /batches, and /batches/{id}/extended-notes (both verbs)Lote
POST and PUT on /batchesCrearEditarLote
/batches/{id}/stageCambiarEtapaDeUnLote
/batches/{id}/deactivate and /activateEliminarLote
/batches/{id}/tasks/{taskId}/complete and /reopenProduccionCompletarTarea
GET on /batches/{id}/measurementsMediciones
everything on /batches/{id}/wasteProduccion
everything on /tanks — which is also the catalog of tankIdTanque
everything on /tasks and /task-definitionsTareas
everything on /price-listsListaDePrecio
everything on /costingsCosteo
everything on /waste-groupsProyectarVentas
/keg-volumes — the only catalog that reads your configurationBarril
GET on /kegsBarril
POST on /kegsCrearEditarBarril
PUT on /kegsEditarBarril
/kegs/{id}/deactivate and /activateEliminarBarril
POST /kegs/transfersTrasladoBarrilesEntreClientes
POST /kegs/{id}/release-reservationStock or LiberarBarril
POST /kegs/{id}/emptyIngresoDisminucionStock
POST /kegs/{id}/discardBarril
POST /kegs/{id}/returnDevolucionBarriles
POST /kegs/returns-to-supplierDevolucionBarrilesProveedor
POST /kegs/clean and /undo-cleanBarrilLimpieza
GET /kegs/{id}/movementsSeguimientoBarril or Barril
everything on /tap-systemsChoperasABM
POST /tap-systems/deliveriesEntregaDevolucionChoperas
everything on /supplies, and /ila-typesInsumos
/supplies/{id}/stock and /supplies/{id}/batchesStockInsumos
/supplies/{id}/stock/adjustments and /countsStockInsumos or Stock
/supplies/projectionProyeccionInsumos
GET on /warehouses — which is also the catalog of warehouseIdDepositos
POST and PUT on /warehousesCrearEditarDepositos
/warehouses/{id}/deactivate and /activateEliminarDepositos
GET on /supply-warehousesDepositoInsumo
POST and PUT on /supply-warehousesDepositoInsumoCrearEditar
/supply-warehouses/{id}/deactivate and /activateDepositoInsumoEliminar
GET and POST on /stock-movements, plus /supply-warehouses/{id}/transfersMovimientosDepositos
GET on /stock-valuation and /stock-valuation-costInformesStock
GET on /raw-material-valuationInformesProductos
everything on /mix-packsEnvasado
GET on /recipesReceta
POST on /recipesCrearEditarReceta
PUT on /recipesEditarReceta
/recipes/{id}/deactivate and /activateEliminarReceta
Fixed reference catalogs: /supplier-types, /purchase-types, /units, /product-typesNone
GET on /notificationsNone — same as the fixed catalogs above; the web application itself gates this with nothing more than being logged in
everything on /leadsLeads
GET on /auditInformes or Administracion — same gate as the web application's own audit report
everything on /files (published so far: POST, GET, GET .../content, .../deactivate)None — same as the web application itself
everything on /invitationsInvitarCliente module and the Administracion role — both required, same as the web application's own invitation action
everything on /external-users except .../activateDuenio role, no module — same as the web application itself
POST on /external-users/{id}/activateAdministracion role, no module — a laxer requirement than the rest of this resource, same asymmetry the web application itself has
/external-user-productsProducts and Customers modules, no role — same as the web application itself. Also needs portal product assignment enabled for your account, otherwise every action answers 404
/distributor-purchasesDistributor purchases module, no role — the same module /keg-purchase-orders already uses
GET on /checks, and the treasury catalogs: /banks, /check-statuses, /check-kindsCheques
POST/PUT on /checks, and /checks/{id}/collectIngresoEgresoCheques
/checks/{id}/deactivateEliminarCheques
/withholdingsInformes — same permission that already gates seeing this data through the Withholdings report screen
GET on /bank-accountsCuentasBancarias
POST/PUT on /bank-accountsCrearEditarCuentasBancarias
/bank-accounts/{id}/deactivate and /activateEliminarCuentasBancarias
GET and POST on /bank-accounts/{id}/movementsMovimientosCuentasBancarias
everything on /chart-of-accounts, and /account-categoriesCuenta
GET on /cash-registersCajasUsuario
POST/PUT on /cash-registersCrearEditarCajaUsuario
/cash-registers/{id}/deactivate and /activateEliminarCajaUsuario
GET on /cash-registers/{id}/movements, and /open and /closeCajas
GET on /ordersPedidos
GET on /delivery-notesEntregasVerRemito
GET on /collectionsCobranzas
POST on /collectionsCrearEditarCobranza
GET/POST/PUT on /returnable-packagingProduccion
everything on /accountConfiguraciones
GET on /maintenances, and /maintenances/{id}/deactivate//activateMantenimiento
POST on /maintenances, /maintenances/{id}/start and /maintenances/{id}/recurMantenimiento and IniciarMantenimiento
POST on /maintenances/{id}/finishMantenimiento and FinalizarMantenimiento
POST on /maintenances/{id}/rescheduleMantenimiento
GET on /spare-partsRepuesto
POST on /spare-partsCrearRepuesto
PUT on /spare-parts, and /spare-parts/{id}/deactivate//activateEditarRepuesto
GET on /event-categoriesEventoAgenda
POST on /event-categories, and /event-categories/{id}/activateCrearEditarCategoriaEvento
PUT on /event-categoriesCrearEditarCategoriaEvento
/event-categories/{id}/deactivateEliminarCategoriaEvento
GET on /calendar-eventsEventoAgenda
POST on /calendar-events, and /calendar-events/{id}/activateCrearEditarEventoAgenda
PUT on /calendar-eventsCrearEditarEventoAgenda
/calendar-events/{id}/deactivateEliminarEventoAgenda
EndpointsPermiso que necesita
/auth/*, /healthNinguno. /health no necesita ni token
GET /customers, GET /customers/{id} y sus sub-recursosCliente
Toda escritura sobre /customers, sus puntos de venta y sus contactosCrearEditarCliente
GET /customers/{id}/balanceCtaCteCliente
Catálogos de referencia del país: /tax-conditions, /provinces, /payment-terms y los fiscalesNinguno
Catálogos de la cuenta: /price-lists, /customer-types, /currencies, /sales-reps, /logistics-providers, /customer-categoriesCliente
GET /brands, GET /brands/{id}Marcas
POST/PUT sobre /brandsCrearEditarMarcas
/brands/{id}/deactivateEliminarMarcas
GET /promotions, GET /promotions/{id}Promociones
POST/PUT sobre /promotionsCrearEditarPromocion
/promotions/{id}/deactivateEliminarPromocion
GET /suppliers, GET /suppliers/{id}, /supplier-categories, /expense-accountsProveedor
POST y PUT sobre /suppliersCrearEditarProveedor
/suppliers/{id}/deactivate y /activateEliminarProveedor
Todo lo que cuelga de /purchases menos /cancel, más los catálogos de compras: /voucher-types, /payment-types, /supplies, /complementary-products, /purchasable-services, /spare-parts, /supply-warehousesCompras
todo /purchase-ordersOrdenDeCompra
todo /keg-purchase-orders y todo /distributor-purchasesCompraDistribuidora
todo /distributor-services — y además el rol Duenio, igual que las pantallas de servicios de la propia aplicación webDistribuidora
/purchases/{id}/cancelEliminarCompra
GET /services, GET /services/{id}Servicio
POST and PUT on /servicesCrearEditarServicio
/services/{id}/deactivate and /activateEliminarServicio
GET /products, GET /products/{id}, /products/{id}/categories, /product-categories, /containers, /casesProductos
POST y PUT sobre /productsCrearEditarProducto
/products/{id}/deactivate y /activateEliminarProducto
Todo lo que cuelga de /products/{id}/stock, incluidos /pack y /unpackStock
GET sobre /batches, y /batches/{id}/extended-notes (los dos verbos)Lote
POST y PUT sobre /batchesCrearEditarLote
/batches/{id}/stageCambiarEtapaDeUnLote
/batches/{id}/deactivate y /activateEliminarLote
/batches/{id}/tasks/{taskId}/complete y /reopenProduccionCompletarTarea
GET sobre /batches/{id}/measurementsMediciones
todo /batches/{id}/wasteProduccion
todo /tanks — que es además el catálogo de tankIdTanque
todo /tasks y /task-definitionsTareas
todo /price-listsListaDePrecio
todo /costingsCosteo
todo /waste-groupsProyectarVentas
/keg-volumes — el único catálogo que lee su configuraciónBarril
GET sobre /kegsBarril
POST sobre /kegsCrearEditarBarril
PUT sobre /kegsEditarBarril
/kegs/{id}/deactivate y /activateEliminarBarril
POST /kegs/transfersTrasladoBarrilesEntreClientes
POST /kegs/{id}/release-reservationStock o LiberarBarril
POST /kegs/{id}/emptyIngresoDisminucionStock
POST /kegs/{id}/discardBarril
POST /kegs/{id}/returnDevolucionBarriles
POST /kegs/returns-to-supplierDevolucionBarrilesProveedor
POST /kegs/clean y /undo-cleanBarrilLimpieza
GET /kegs/{id}/movementsSeguimientoBarril o Barril
todo /tap-systemsChoperasABM
POST /tap-systems/deliveriesEntregaDevolucionChoperas
todo /supplies, y /ila-typesInsumos
/supplies/{id}/stock y /supplies/{id}/batchesStockInsumos
/supplies/{id}/stock/adjustments y /countsStockInsumos o Stock
/supplies/projectionProyeccionInsumos
GET sobre /warehouses — que es además el catálogo de warehouseIdDepositos
POST y PUT sobre /warehousesCrearEditarDepositos
/warehouses/{id}/deactivate y /activateEliminarDepositos
GET sobre /supply-warehousesDepositoInsumo
POST y PUT sobre /supply-warehousesDepositoInsumoCrearEditar
/supply-warehouses/{id}/deactivate y /activateDepositoInsumoEliminar
GET y POST sobre /stock-movements, más /supply-warehouses/{id}/transfersMovimientosDepositos
GET sobre /stock-valuation y /stock-valuation-costInformesStock
GET sobre /raw-material-valuationInformesProductos
todo /mix-packsEnvasado
GET sobre /recipesReceta
POST sobre /recipesCrearEditarReceta
PUT sobre /recipesEditarReceta
/recipes/{id}/deactivate y /activateEliminarReceta
Catálogos de referencia fijos: /supplier-types, /purchase-types, /units, /product-typesNinguno
GET sobre /notificationsNinguno — igual que los catálogos fijos de arriba; la aplicación web misma no gatea esto con nada más que estar logueado
todo /leadsLeads
GET sobre /auditInformes o Administracion — mismo gate que el propio informe de auditoría de la web
todo /files (publicado hasta ahora: POST, GET, GET .../content, .../deactivate)Ninguno — igual que la propia aplicación web
todo /invitationsMódulo InvitarCliente y rol Administracion — los dos obligatorios, igual que la propia acción de invitar de la web
todo /external-users salvo .../activateRol Duenio, sin módulo — igual que la propia aplicación web
POST sobre /external-users/{id}/activateRol Administracion, sin módulo — menos exigente que el resto de este recurso, misma asimetría que ya tiene la propia aplicación web
/external-user-productsMódulos Productos y Clientes, sin rol — igual que la propia aplicación web. Además necesita la asignación de productos al portal habilitada en su cuenta; si no, todas las acciones responden 404
/distributor-purchasesMódulo Compras de distribuidora, sin rol — el mismo módulo que ya usa /keg-purchase-orders
GET sobre /checks, y los catálogos de tesorería: /banks, /check-statuses, /check-kindsCheques
POST/PUT sobre /checks, y /checks/{id}/collectIngresoEgresoCheques
/checks/{id}/deactivateEliminarCheques
/withholdingsInformes — el mismo permiso que ya habilita ver este dato desde la pantalla de informe de retenciones
GET sobre /bank-accountsCuentasBancarias
POST/PUT sobre /bank-accountsCrearEditarCuentasBancarias
/bank-accounts/{id}/deactivate y /activateEliminarCuentasBancarias
GET y POST sobre /bank-accounts/{id}/movementsMovimientosCuentasBancarias
todo sobre /chart-of-accounts, y /account-categoriesCuenta
GET sobre /cash-registersCajasUsuario
POST/PUT sobre /cash-registersCrearEditarCajaUsuario
/cash-registers/{id}/deactivate y /activateEliminarCajaUsuario
GET sobre /cash-registers/{id}/movements, y /open y /closeCajas
GET sobre /ordersPedidos
GET sobre /delivery-notesEntregasVerRemito
GET sobre /collectionsCobranzas
POST sobre /collectionsCrearEditarCobranza
GET/POST/PUT sobre /returnable-packagingProduccion
todo /accountConfiguraciones
GET sobre /maintenances, y /maintenances/{id}/deactivate//activateMantenimiento
POST sobre /maintenances, /maintenances/{id}/start y /maintenances/{id}/recurMantenimiento e IniciarMantenimiento
POST sobre /maintenances/{id}/finishMantenimiento y FinalizarMantenimiento
POST sobre /maintenances/{id}/rescheduleMantenimiento
GET sobre /spare-partsRepuesto
POST sobre /spare-partsCrearRepuesto
PUT sobre /spare-parts, y /spare-parts/{id}/deactivate//activateEditarRepuesto
GET sobre /event-categoriesEventoAgenda
POST sobre /event-categories, y /event-categories/{id}/activateCrearEditarCategoriaEvento
PUT sobre /event-categoriesCrearEditarCategoriaEvento
/event-categories/{id}/deactivateEliminarCategoriaEvento
GET sobre /calendar-eventsEventoAgenda
POST sobre /calendar-events, y /calendar-events/{id}/activateCrearEditarEventoAgenda
PUT sobre /calendar-eventsCrearEditarEventoAgenda
/calendar-events/{id}/deactivateEliminarEventoAgenda

A 403 names the permission that was missing, in message. You should not see one in normal use — if you do, it means an endpoint was added and your account has not picked up the new permission yet. Log in again: the token is reissued with the current set. If it persists, that is a bug on our side, not something for you to configure.

Un 403 indica en el message qué permiso faltaba. No debería ver ninguno en uso normal — si aparece, significa que se agregó un endpoint y su cuenta todavía no tomó el permiso nuevo. Autentique de nuevo: el token se emite con el conjunto actual. Si persiste, es un error nuestro y no algo que usted deba configurar.

ConventionsConvenciones

PagingPaginación

List endpoints take page (1-based, default 1) and pageSize (default 50, maximum 200), and answer with items, page, pageSize and total. total is the number of records matching your filter, not the number in this page.

Los endpoints de listado aceptan page (base 1, por defecto 1) y pageSize (por defecto 50, máximo 200), y responden con items, page, pageSize y total. total es la cantidad de registros que coinciden con su filtro, no la cantidad que trae esta página.

DatesFechas

Always ISO 8601 — 2026-08-12 or 2026-08-12T14:30:00. Any other format is rejected with a 400. Do not send 12/08/2026: it is ambiguous and it is not accepted.

Siempre ISO 8601 — 2026-08-12 o 2026-08-12T14:30:00. Cualquier otro formato se rechaza con un 400. No envíe 12/08/2026: es ambiguo y no se acepta.

Field namesNombres de campo

Request and response fields are English camelCase. Relation identifiers end in Id — priceListId, parentCustomerId. There is no exception: every field the API returns follows this rule.

Los campos de request y respuesta son camelCase en inglés. Los identificadores de relación terminan en Id: priceListId, parentCustomerId. No hay excepciones: todo campo que devuelve la API sigue esta regla.

ErrorsErrores

Every error, for every status code, has the same shape:

Todos los errores, para cualquier código de estado, tienen la misma forma:

{
  "error": {
    "code": "business_rule",
    "message": "...",
    "traceId": "..."
  }
}

Match on code, never on message: code is a stable identifier, message is human-readable text whose wording can change. The message comes back in the language configured for your integration user.

Discrimine por code, nunca por message: code es un identificador estable y message es texto legible cuya redacción puede cambiar. El message vuelve en el idioma configurado para su usuario de integración.

HTTPWhen
200OK
201Resource created
400Invalid body, or a business rule rejected the operation
401Token missing, invalid, expired, or user inactive
403Your integration user lacks the required permission
404The resource does not exist or is not yours
413Body larger than the 1 MB maximum
429Rate limit or concurrency limit exceeded — see Retry-After
500Unexpected error, with a reference id in the message
503The API is not enabled in this environment
HTTPCuándo
200OK
201Recurso creado
400Cuerpo inválido, o una regla de negocio rechazó la operación
401Token ausente, inválido, expirado, o usuario inactivo
403A su usuario de integración le falta el permiso necesario
404El recurso no existe o no es suyo
413Cuerpo mayor al máximo de 1 MB
429Límite de uso o de concurrencia excedido — ver Retry-After
500Error inesperado, con un id de referencia en el mensaje
503La API no está habilitada en este entorno

What to do with each code:

Qué hacer con cada code:

codeHTTPWhat to do
token_expired401Log in again and retry once.
token_missing401The header is missing. It must be Authorization: Bearer <token>.
token_invalid401Log in again. Check the header format.
missing_credentials400The login body needs apiKey.
invalid_credentials401Unknown API key, or the account is not active.
user_inactive401The integration user was deactivated. Contact your account administrator.
session_unavailable401Retry once; if it persists, contact us with the traceId.
too_many_login_attempts429Wait 60 seconds. You are almost certainly retrying in a loop.
not_authenticated401Log in again.
module_forbidden / role_forbidden / no_modules403Your user lacks the permission. Ask your account administrator. Do not retry.
plan_forbidden403This endpoint is not available on your account's plan. It is not a permission your administrator can grant — it is what the plan includes. Do not retry.
addon_not_contracted403This endpoint belongs to an add-on your account has not contracted. The message names it. Do not retry.
enterprise_required403API access is not enabled for this account. It applies to the whole API, not to one endpoint, and you will also get it on POST /auth/login. Contact your account manager. Do not retry.
forbidden403The operation is not allowed for this user. Do not retry.
business_rule400Read message: it names the rule that blocked the operation. Do not retry.
invalid_body400Malformed JSON, a field with the wrong type, or a text longer than its maximum. message names the field.
invalid_reference400A field ending in Id holds a value that is not available to your account. message names the field and the catalog that lists the valid ones. Do not retry.
missing_body400The endpoint needs a JSON body and none arrived.
invalid_date_range400dateFrom / dateTo missing, not ISO 8601, or inverted.
date_range_too_wide400Split the range into several calls. message states the maximum.
not_found404The resource does not exist or is not yours. Do not retry.
rate_limit_exceeded429Wait Retry-After and retry with exponential backoff.
too_many_concurrent_requests429Too many requests in flight at once. Serialize your calls.
request_in_progress409An identical Request-Id is still being processed. Retry in a few seconds to get its result.
request_id_reused400That Request-Id was already used for a different operation. Use one UUID per operation. Do not retry.
internal_error500Retry with exponential backoff. If it persists, contact us quoting the traceId.
api_disabled503The API is not enabled in this environment.
codeHTTPQué hacer
token_expired401Autentique de nuevo y reintente una vez.
token_missing401Falta el header. Tiene que ser Authorization: Bearer <token>.
token_invalid401Autentique de nuevo. Revise el formato del header.
missing_credentials400El cuerpo del login necesita apiKey.
invalid_credentials401API key desconocida, o la cuenta no está activa.
user_inactive401El usuario de integración fue dado de baja. Contacte al administrador de su cuenta.
session_unavailable401Reintente una vez; si persiste, contáctenos con el traceId.
too_many_login_attempts429Espere 60 segundos. Casi seguro está reintentando en un bucle.
not_authenticated401Autentique de nuevo.
module_forbidden / role_forbidden / no_modules403A su usuario le falta el permiso. Pídalo al administrador de su cuenta. No reintente.
plan_forbidden403Este endpoint no está disponible en el plan de su cuenta. No es un permiso que el administrador pueda otorgar — es lo que incluye el plan. No reintente.
addon_not_contracted403Este endpoint pertenece a un addon que su cuenta no contrató. El mensaje lo nombra. No reintente.
enterprise_required403El acceso a la API no está habilitado para esta cuenta. Aplica a la API entera, no a un endpoint, y también lo va a recibir en POST /auth/login. Contacte a su ejecutivo de cuenta. No reintente.
forbidden403La operación no está permitida para este usuario. No reintente.
business_rule400Lea el message: nombra la regla que bloqueó la operación. No reintente.
invalid_body400JSON mal formado, un campo con el tipo equivocado, o un texto más largo que su máximo. El message nombra el campo.
invalid_reference400Un campo terminado en Id tiene un valor que su cuenta no puede usar. El message nombra el campo y el catálogo que lista los válidos. No reintente.
missing_body400El endpoint necesita un cuerpo JSON y no llegó ninguno.
invalid_date_range400Falta dateFrom o dateTo, no están en ISO 8601, o están invertidos.
date_range_too_wide400Divida el rango en varias llamadas. El message indica el máximo.
not_found404El recurso no existe o no es suyo. No reintente.
rate_limit_exceeded429Espere el Retry-After y reintente con backoff exponencial.
too_many_concurrent_requests429Demasiados requests en vuelo a la vez. Serialice sus llamadas.
request_in_progress409Un Request-Id idéntico todavía se está procesando. Reintente en unos segundos para obtener su resultado.
request_id_reused400Ese Request-Id ya se usó para otra operación. Use un UUID por operación. No reintente.
internal_error500Reintente con backoff exponencial. Si persiste, contáctenos citando el traceId.
api_disabled503La API no está habilitada en este entorno.

The traceId identifies the exact request on our side. Always include it when reporting a problem.

El traceId identifica el request exacto de nuestro lado. Inclúyalo siempre al reportar un problema.

Rate limitsLímites de uso

Two independent limits keep response times predictable. Both apply to your account and both answer 429.

Dos límites independientes mantienen predecibles los tiempos de respuesta. Los dos aplican a su cuenta y los dos responden 429.

LimitDefaultError code
Requests per second1/s, with a small burst allowancerate_limit_exceeded
Requests in flight at once2too_many_concurrent_requests
LímitePor defectoCódigo de error
Requests por segundo1/s, con una pequeña tolerancia de ráfagarate_limit_exceeded
Requests en vuelo a la vez2too_many_concurrent_requests

Limits are configured per account — if you need more, ask. Expensive endpoints cost more than one unit of your per-second budget; each operation states its cost in the API reference. A change to your limits can take up to 5 minutes to take effect.

Los límites se configuran por cuenta: si necesita más, pídalo. Los endpoints costosos consumen más de una unidad de su presupuesto por segundo; cada operación declara su costo en la referencia de la API. Un cambio de límites puede tardar hasta 5 minutos en tomar efecto.

Every response carries your current budget in X-RateLimit-Limit and X-RateLimit-Remaining. When you exceed it you get a 429 with Retry-After in seconds.

Cada respuesta lleva su presupuesto actual en X-RateLimit-Limit y X-RateLimit-Remaining. Cuando lo excede recibe un 429 con Retry-After en segundos.

delay = max(Retry-After, 1)
for attempt in 1..6:
    response = send(request)
    if response.status != 429:
        return response
    wait(delay + random(0, delay * 0.3))    # jitter
    delay = min(delay * 2, 60)              # exponential, capped at 60s
fail("persistent rate limit")
espera = max(Retry-After, 1)
for intento in 1..6:
    respuesta = enviar(request)
    if respuesta.status != 429:
        return respuesta
    esperar(espera + aleatorio(0, espera * 0.3))   # jitter
    espera = min(espera * 2, 60)                   # exponencial, tope 60s
fallar("limite de uso persistente")

1. Respect Retry-After. It is the floor, not a suggestion. Retrying sooner only burns your own budget.

2. Double the wait on every attempt (1s, 2s, 4s, 8s…). Retrying at a fixed interval sustains the saturation instead of relieving it.

3. Add random jitter. If you run several processes, without jitter they all retry at the same instant and collide again.

1. Respete el Retry-After. Es el piso, no una sugerencia. Reintentar antes solo consume su propio presupuesto.

2. Duplique la espera en cada intento (1s, 2s, 4s, 8s…). Reintentar a intervalo fijo sostiene la saturación en lugar de aliviarla.

3. Agregue jitter aleatorio. Si corre varios procesos, sin jitter todos reintentan en el mismo instante y vuelven a chocar.

If you have many records to process, serialize your calls and space them out according to your limit, instead of firing them in parallel and absorbing the 429s. Watch X-RateLimit-Remaining to self-regulate before you hit the wall.

Si tiene muchos registros para procesar, serialice sus llamadas y espacielas según su límite, en lugar de dispararlas en paralelo y absorber los 429. Mire X-RateLimit-Remaining para autorregularse antes de chocar contra el tope.

IdempotencyIdempotencia

curl -X POST https://api.gestioncervecera.com/api/v1/customers \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -H "Request-Id: <one UUID per operation - reuse it on every retry>" \
  -d '<customer body — see the API reference for the fields>'
curl -X POST https://api.gestioncervecera.com/api/v1/customers \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -H "Request-Id: <un UUID por operación - repita el mismo en cada reintento>" \
  -d '<cuerpo del cliente — los campos estan en la referencia>'

Generate one UUID per operation and send it as Request-Id. On a retry, send the same one. That is the whole point: if your request dies on a network timeout, retrying with the same Request-Id gives you back the original response — same status, same body — instead of creating the record twice. The window is 5 minutes.

Genere un UUID por operación y mándelo como Request-Id. En un reintento, mande el mismo. Ahí está todo el sentido: si su request muere por un timeout de red, reintentar con el mismo Request-Id le devuelve la respuesta original —mismo status, mismo cuerpo— en vez de crear el registro dos veces. La ventana es de 5 minutos.

A replayed response carries the header Idempotent-Replayed: true, so you can tell it apart from a fresh one. You never have to guess whether the first attempt went through.

Una respuesta repetida trae el header Idempotent-Replayed: true, así que puede distinguirla de una nueva. Nunca tiene que adivinar si el primer intento pasó.

SituationYou get
First attemptThe normal response.
Retry, after the first one finishedThe original response, with Idempotent-Replayed: true.
Retry while the first one is still running409 request_in_progress. Wait a couple of seconds and retry: there is no response yet to give you.
Same Request-Id on a different operation400 request_id_reused. Use a new UUID per operation.
Attempt that failed (4xx/5xx)Nothing is stored. Retrying with the same Request-Id really runs again.
SituaciónQué recibe
Primer intentoLa respuesta normal.
Reintento, ya terminado el primeroLa respuesta original, con Idempotent-Replayed: true.
Reintento mientras el primero sigue corriendo409 request_in_progress. Espere un par de segundos y reintente: todavía no hay respuesta que darle.
Mismo Request-Id en otra operación400 request_id_reused. Use un UUID por operación.
Intento que falló (4xx/5xx)No se guarda nada. Reintentar con el mismo Request-Id ejecuta de verdad.

CustomersClientes

EndpointWhat it does
GET /customersPaged listing. search, page, pageSize, includeInactive.
GET /customers/{id}One customer, active or not.
POST /customersCreates a customer. Answers 201. tradeName and taxConditionId are required — there is no default for the tax condition, since it decides how the customer is invoiced.
PUT /customers/{id}Partial update.
POST /customers/{id}/deactivateDeactivation. Idempotent.
POST /customers/{id}/activateReactivation. Idempotent.
GET /customers/{id}/points-of-salePoints of sale of the customer.
POST /customers/{id}/points-of-saleAdds one point of sale. Answers 201.
PUT /customers/{id}/points-of-sale/{posId}Partial update of one point of sale.
POST /customers/{id}/points-of-sale/{posId}/deactivateDeactivation. Idempotent.
GET /customers/{id}/contactsContact people of the customer.
POST /customers/{id}/contactsAdds one contact. Answers 201.
PUT /customers/{id}/contacts/{contactId}Partial update of one contact.
POST /customers/{id}/contacts/{contactId}/deactivateDeactivation. Idempotent.
GET /customers/{id}/categoriesCategories assigned to the customer.
POST /customers/{id}/categoriesAssigns one category. Idempotent if already assigned.
POST /customers/{id}/categories/{categoryId}/deactivateRemoves one category. Idempotent.
GET /customers/{id}/balanceCurrent-account balance.
GET /customers/{id}/ledgerCurrent-account movements, newest first. from, to (YYYY-MM-DD), unreconciledOnly, page, pageSize.
EndpointQué hace
GET /customersListado paginado. search, page, pageSize, includeInactive.
GET /customers/{id}Un cliente, activo o no.
POST /customersCrea un cliente. Responde 201. tradeName y taxConditionId son obligatorios: la condición fiscal no tiene default porque decide cómo se le factura al cliente.
PUT /customers/{id}Actualización parcial.
POST /customers/{id}/deactivateBaja. Idempotente.
POST /customers/{id}/activateReactivación. Idempotente.
GET /customers/{id}/points-of-salePuntos de venta del cliente.
POST /customers/{id}/points-of-saleAgrega un punto de venta. Responde 201.
PUT /customers/{id}/points-of-sale/{posId}Actualización parcial de un punto de venta.
POST /customers/{id}/points-of-sale/{posId}/deactivateBaja. Idempotente.
GET /customers/{id}/contactsContactos del cliente.
POST /customers/{id}/contactsAgrega un contacto. Responde 201.
PUT /customers/{id}/contacts/{contactId}Actualización parcial de un contacto.
POST /customers/{id}/contacts/{contactId}/deactivateBaja. Idempotente.
GET /customers/{id}/categoriesCategorías asignadas al cliente.
POST /customers/{id}/categoriesAsigna una categoría. Idempotente si ya estaba asignada.
POST /customers/{id}/categories/{categoryId}/deactivateQuita una categoría. Idempotente.
GET /customers/{id}/balanceSaldo de cuenta corriente.
GET /customers/{id}/ledgerMovimientos de cuenta corriente, del más nuevo al más viejo. from, to (YYYY-MM-DD), unreconciledOnly, page, pageSize.

Current accountCuenta corriente

Read-only. Movements are generated by the system: an order adds to what the customer owes, a payment reduces it. Reconciling a movement — imputing a payment against an invoice — is a treasury operation that touches several entities at once (the movement, the order, the reconciliation record), and has its own resource, which this version does not publish. That is why reconciled is read-only here: you can read the state, not change it.

Solo lectura. Los movimientos los genera el sistema: un pedido suma a lo que debe el cliente, un pago lo resta. Conciliar un movimiento —imputar un pago contra una factura— es una operación de tesorería que toca varias entidades a la vez (el movimiento, el pedido, el registro de conciliación), y tiene su propio recurso, que esta versión no publica. Por eso reconciled es de solo lectura acá: se puede leer el estado, no cambiarlo.

A positive amount increases what the customer owes; a payment is negative. The balance is cumulative and depends on the order of the movements, so each entry reports the balance it left behind and the previousBalance it started from. For the current balance alone, read /balance: it is one call instead of paging to the end. If the customer belongs to a group and does not keep its own current account, this lists the group parent's movements — the same account /balance resolves to.

Un amount positivo aumenta lo que debe el cliente; un pago es negativo. El saldo es acumulado y depende del orden de los movimientos, así que cada entrada informa el balance que dejó y el previousBalance del que partió. Si solo necesita el saldo actual, lea /balance: es una llamada en vez de paginar hasta el final. Si el cliente pertenece a un grupo y no tiene cuenta corriente propia, esto lista los movimientos del padre del grupo — la misma cuenta que resuelve /balance.

orderNumber, invoiceNumber and deliveryNoteNumber are text, not ids. To read the order behind a movement, look it up in GET /orders by date and match its number; delivery notes are listed by GET /delivery-notes the same way.

orderNumber, invoiceNumber y deliveryNoteNumber son texto, no ids. Para leer el pedido de un movimiento, búsquelo en GET /orders por fecha y compare su number; los remitos se listan con GET /delivery-notes de la misma forma.

Every field, its type and its maximum length are in the API reference. Exceeding a maximum answers 400 with invalid_body naming the field.

Cada campo, su tipo y su longitud máxima están en la referencia de la API. Exceder un máximo responde 400 con invalid_body nombrando el campo.

Server-controlled fieldsCampos que controla el servidor

  • id — assigned by the server. Ignored if you send it, on create and on update.
  • active — read-only. Change it with /deactivate and /activate.
  • id — lo asigna el servidor. Se ignora si lo envía, tanto al crear como al actualizar.
  • active — solo lectura. Se cambia con /deactivate y /activate.

Validation rulesReglas de validación

A violation answers 400 with business_rule and a message naming the rule. The same rules apply in the application, so they cannot be waived per integration. Do not retry — retrying cannot succeed.

Una violación responde 400 con business_rule y un message que nombra la regla. Las mismas reglas rigen en la aplicación, así que no se pueden levantar por integración. No reintente: reintentar no puede funcionar.

  • tradeName is required.
  • taxConditionId is required on create, and has no default: it decides how the customer is invoiced and its values differ by country. Read them from GET /api/v1/tax-conditions.
  • tradeName must not match another active customer. A name freed by a deactivated customer can be reused.
  • In Chile, taxId (RUT) must not contain spaces.
  • A customer that does not belong to a group must have its own current account. Create it without parentCustomerId and it gets one; send parentCustomerId to attach it to a group instead.
  • Once a customer has current-account movements, its currency can no longer be changed.
  • customerTypeId must be an active type.
  • Every field ending in Id must hold a value from its catalog. Otherwise: 400 invalid_reference, naming the field and the catalog to read.
  • tradeName es obligatorio.
  • taxConditionId es obligatorio al crear y no tiene default: decide cómo se le factura al cliente y sus valores varían por país. Léalos de GET /api/v1/tax-conditions.
  • tradeName no puede coincidir con el de otro cliente activo. Un nombre que liberó un cliente dado de baja se puede reutilizar.
  • En Chile, el taxId (RUT) no puede contener espacios.
  • Un cliente que no pertenece a un grupo debe tener cuenta corriente propia. Creélo sin parentCustomerId y se le asigna una; envíe parentCustomerId para adjuntarlo a un grupo.
  • Una vez que un cliente tiene movimientos de cuenta corriente, ya no se puede cambiar su moneda.
  • customerTypeId debe ser un tipo activo.
  • Todo campo terminado en Id debe contener un valor de su catálogo. Si no: 400 invalid_reference, indicando el campo y el catálogo que hay que leer.

Listing and searchingListado y búsqueda

search matches trade name, legal name or tax id, accent- and case-insensitive. By default the listing returns only active customers; pass includeInactive=true to include deactivated ones — that is what you want when reconciling a full catalogue and you need to tell "deactivated" apart from "never existed". GET /customers/{id} always returns the customer, active or not.

search busca en nombre de fantasía, razón social o identificación fiscal, sin distinguir mayúsculas ni acentos. Por defecto el listado devuelve solo clientes activos; pase includeInactive=true para incluir los dados de baja: es lo que necesita al reconciliar un catálogo completo y tiene que distinguir "dado de baja" de "nunca existió". GET /customers/{id} devuelve siempre el cliente, esté activo o no.

Partial updatesActualizaciones parciales

PUT is a partial update: it changes only the fields you send. Fields you leave out keep their current value, so you never need to send the whole object to change one field. To clear a text field, send it as an explicit empty string or null.

To clear a reference field, send null — not 0. A 0 in any …Id field is read as "not set" and ignored, because no catalog has an entry with id 0. This matters if your client serializes uninitialized integers: those fields are skipped rather than written, so the stored value survives. When the field cannot be empty at all (currencyId, purchaseTypeId, taxConditionId), a 0 likewise leaves the current value untouched.

The update is idempotent — repeating the same request leaves the customer in the same state, so it is safe to retry after a network timeout.

PUT es una actualización parcial: cambia solo los campos que envía. Los que omite conservan su valor actual, así que nunca necesita mandar el objeto completo para cambiar un campo. Para vaciar un campo de texto, envíelo explícitamente como cadena vacía o null.

Para vaciar un campo de referencia mande null, no 0. Un 0 en cualquier campo …Id se lee como "sin asignar" y se ignora, porque ningún catálogo tiene una entrada con id 0. Esto importa si su cliente serializa enteros sin inicializar: esos campos se saltean en vez de escribirse, así que el valor guardado se conserva. Cuando el campo no puede quedar vacío (currencyId, purchaseTypeId, taxConditionId), un 0 también deja intacto el valor actual.

La actualización es idempotente: repetir el mismo request deja al cliente en el mismo estado, así que es seguro reintentarla después de un timeout de red.

The update validates the whole record, not just the fields you sent. If the customer already breaks one of the rules above — typically an older record — you get 400 even when the field you are changing is unrelated. The message names the rule. The record needs to be corrected in the application before it can be updated here.

La actualización valida el registro entero, no solo los campos que envió. Si el cliente ya viola alguna de las reglas de arriba —típicamente un registro antiguo— recibe 400 aunque el campo que está cambiando no tenga relación. El message nombra la regla. El registro tiene que corregirse en la aplicación antes de poder actualizarlo por acá.

Deactivation instead of deletionBaja en lugar de borrado

There is no delete. POST /customers/{id}/deactivate marks the record inactive; its history is kept and the resource stays reachable through GET /{id}. That is why this API has no DELETE verb. The operation is idempotent: deactivating something already inactive returns 200 with "alreadyInactive": true. A business rule can refuse the deactivation, in which case you get a 400 explaining why.

No hay borrado. POST /customers/{id}/deactivate marca el registro como inactivo; conserva su historia y el recurso sigue accesible por GET /{id}. Por eso esta API no tiene verbo DELETE. La operación es idempotente: dar de baja algo que ya está inactivo devuelve 200 con "alreadyInactive": true. Una regla de negocio puede rechazar la baja, y en ese caso recibe un 400 que explica por qué.

Points of sale, contacts, categories and balancePuntos de venta, contactos, categorías y saldo

Points of sale and contacts are managed one at a time, with their own endpoints. Each call touches a single one and leaves the rest untouched — there is no request that replaces the whole collection, deliberately: it would make "add one" and "delete every other one" the same call, and a partial payload would silently wipe what it omitted.

Los puntos de venta y los contactos se manejan de a uno, con sus propios endpoints. Cada llamada toca uno solo y deja el resto intacto — no existe una llamada que reemplace la colección entera, y es a propósito: haría que "agregar uno" y "borrar todos los demás" fueran el mismo pedido, y un cuerpo parcial borraría en silencio lo que omitió.

Deactivating one never deletes it: orders and deliveries point at a point of sale, so removing it would leave them dangling. It stops being listed and can no longer be selected. Its name is required, and provinceId and priceListId come from the same catalogs as the customer's.

Darlos de baja nunca los borra: los pedidos y los remitos apuntan al punto de venta, y eliminarlo los dejaría colgados. Deja de listarse y no se puede volver a elegir. El name es obligatorio, y provinceId y priceListId salen de los mismos catálogos que los del cliente.

The balance is a separate endpoint rather than a field of the customer. If the customer belongs to a group and does not keep its own current account, the balance returned is the group parent's, and accountCustomerId tells you whose it is.

El saldo es un endpoint aparte y no un campo del cliente. Si el cliente pertenece a un grupo y no lleva cuenta corriente propia, el saldo que se devuelve es el del padre del grupo, y accountCustomerId indica de quién es.

A customer can hold several categories at once, assigned and removed one at a time — same "one endpoint per item" criterion as points of sale and contacts, and for the same reason: CategoriaClienteService.SyncCategoriasCliente (used by the web application's customer form) replaces the whole set at once, which would make a partial update race with a concurrent write. categoryId is checked against GET /api/v1/customer-categories, and a system-defined category can be assigned like any other — the restriction on system-defined categories is only about editing or deactivating the category itself, not about using it.

Un cliente puede tener varias categorías a la vez, asignadas y quitadas de a una — mismo criterio de "un endpoint por ítem" que puntos de venta y contactos, y por el mismo motivo: CategoriaClienteService.SyncCategoriasCliente (la que usa el formulario de cliente de la web) reemplaza el conjunto entero de una vez, lo que haría que una actualización parcial compita con una escritura concurrente. categoryId se valida contra GET /api/v1/customer-categories, y una categoría de sistema se puede asignar como cualquier otra — la restricción sobre las categorías de sistema es solo para editar o desactivar la categoría en sí, no para usarla.

Customer typesTipos de cliente

The classification a customer's customerTypeId points at — Bar, Distributor, Online, and whatever your account added. A handful of ids are system-defined (present in every account) and cannot be edited, deactivated or reactivated through this resource: a PUT//deactivate//activate on one of them answers 404, the same way the web application's own edit screen never reaches them either.

La clasificación a la que apunta el customerTypeId de un cliente — Bar, Distribuidora, OnLine, y lo que haya agregado su cuenta. Un puñado de ids son de sistema (existen en todas las cuentas) y no se pueden editar, desactivar ni reactivar por este recurso: un PUT//deactivate//activate sobre uno de ellos responde 404, igual que la propia pantalla de edición de la web tampoco los alcanza.

EndpointWhat it does
GET /customer-typesPaged listing, including system-defined types. search (name), page, pageSize, includeInactive. This is also the catalog of a customer's customerTypeId.
GET /customer-types/{id}One type, active or not, system-defined or not.
POST /customer-typesCreates a type. Answers 201. name is required.
PUT /customer-types/{id}Partial update. 404 for a system-defined or deactivated id.
POST /customer-types/{id}/deactivateDeactivation. Idempotent. 400 for a system-defined type, or one used by an active customer.
POST /customer-types/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /customer-typesListado paginado, incluidos los tipos de sistema. search (nombre), page, pageSize, includeInactive. Es además el catálogo de customerTypeId de un cliente.
GET /customer-types/{id}Un tipo, activo o no, de sistema o no.
POST /customer-typesCrea un tipo. Responde 201. name es obligatorio.
PUT /customer-types/{id}Actualización parcial. 404 para un id de sistema o desactivado.
POST /customer-types/{id}/deactivateBaja. Idempotente. 400 para un tipo de sistema, o usado por un cliente activo.
POST /customer-types/{id}/activateReactivación. Idempotente.

Validation rulesReglas de validación

  • name is required, and must be unique among both your active and inactive types.
  • Deactivation is rejected when the type is system-defined, or when an active customer still uses it — both are real rules the web application already enforces.
  • Reactivation is rejected under the same name-uniqueness rule as creation: it fails if another active type already took the name while this one was deactivated.
  • name es obligatorio, y único entre sus tipos activos e inactivos.
  • La baja se rechaza si el tipo es de sistema, o si un cliente activo todavía lo usa — las dos son reglas reales que ya aplica la aplicación web.
  • La reactivación se rechaza con la misma regla de unicidad de nombre que el alta: falla si otro tipo activo ya tomó el nombre mientras este estaba desactivado.

Customer categoriesCategorías de cliente

This resource is only the category definition: create, rename, deactivate. A customer can hold several categories at once — reading which ones a given customer has, and assigning or removing them, is GET/POST /customers/{customerId}/categories, not here. A handful of ids may be system-defined (present in every account) and cannot be edited, deactivated or reactivated through this resource — same restriction as customer types.

Este recurso es solo la definición de la categoría: crear, renombrar, dar de baja. Un cliente puede tener varias categorías a la vez — leer cuáles tiene un cliente, y asignarlas o quitarlas, es GET/POST /customers/{customerId}/categories, no acá. Un puñado de ids pueden ser de sistema (existen en todas las cuentas) y no se pueden editar, desactivar ni reactivar por este recurso — misma restricción que tipos de cliente.

EndpointWhat it does
GET /customer-categoriesPaged listing, including system-defined categories. search (name), page, pageSize, includeInactive. This is also the catalog used to assign a category to a customer.
GET /customer-categories/{id}One category, active or not, system-defined or not.
POST /customer-categoriesCreates a category. Answers 201. name is required.
PUT /customer-categories/{id}Partial update. 404 for a system-defined or deactivated id.
POST /customer-categories/{id}/deactivateDeactivation. Idempotent. 400 for a system-defined category.
POST /customer-categories/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /customer-categoriesListado paginado, incluidas las categorías de sistema. search (nombre), page, pageSize, includeInactive. Es además el catálogo que se usa para asignar una categoría a un cliente.
GET /customer-categories/{id}Una categoría, activa o no, de sistema o no.
POST /customer-categoriesCrea una categoría. Responde 201. name es obligatorio.
PUT /customer-categories/{id}Actualización parcial. 404 para un id de sistema o desactivado.
POST /customer-categories/{id}/deactivateBaja. Idempotente. 400 para una categoría de sistema.
POST /customer-categories/{id}/activateReactivación. Idempotente.

Validation rulesReglas de validación

  • name is required, and must be unique among both your active and inactive categories, system-defined ones included.
  • Deactivation is rejected only when the category is system-defined. Unlike customer types, there is no check for customers currently holding the category — that guard does not exist in the web application either, so it is not invented here.
  • Reactivation is rejected under the same name-uniqueness rule as creation.
  • name es obligatorio, y único entre sus categorías activas e inactivas, incluidas las de sistema.
  • La baja se rechaza solo si la categoría es de sistema. A diferencia de los tipos de cliente, no hay chequeo de clientes que la estén usando — esa guarda tampoco existe en la aplicación web, así que no se inventa acá.
  • La reactivación se rechaza con la misma regla de unicidad de nombre que el alta.

BrandsMarcas

Brands of your brewery — the entity a customer's brandId points at. Full CRUD except reactivation: there is no /activate, because the web application itself has no way to reactivate a deactivated brand either (same situation already documented for mix-packs). Fiscal e-invoicing credentials that some accounts auto-fill on a brand are never exposed, and uploading a logo stays a web-only operation — logoUrl is read-only here.

Marcas de su cervecería — la entidad a la que apunta el brandId de un cliente. CRUD completo salvo reactivación: no hay /activate, porque la propia aplicación web tampoco tiene forma de reactivar una marca dada de baja (misma situación ya documentada para mix-packs). Las credenciales de facturación electrónica que algunas cuentas completan automáticamente en una marca nunca se exponen, y subir un logo sigue siendo una operación solo de la web — logoUrl es de solo lectura acá.

EndpointWhat it does
GET /brandsPaged listing of active brands. search (name), page, pageSize. This is also the catalog of a customer's brandId and of a chart-of-accounts entry's brandId.
GET /brands/{id}One brand, active or not.
POST /brandsCreates a brand. Answers 201. name is required.
PUT /brands/{id}Partial update. logoUrl and active are read-only.
POST /brands/{id}/deactivateDeactivation. Idempotent. No /activate — see above.
EndpointQué hace
GET /brandsListado paginado de marcas activas. search (nombre), page, pageSize. Es además el catálogo de brandId de un cliente y de una cuenta del plan de cuentas.
GET /brands/{id}Una marca, activa o no.
POST /brandsCrea una marca. Responde 201. name es obligatorio.
PUT /brands/{id}Actualización parcial. logoUrl y active son de solo lectura.
POST /brands/{id}/deactivateBaja. Idempotente. Sin /activate — ver arriba.

Validation rulesReglas de validación

  • name is required. There is no uniqueness rule — none exists today, not even in the web application.
  • Creating your third active brand automatically sends an internal notification email — same behavior the web application always had, inherited as-is.
  • There is no way to assign a brand to a product through this API — that feature is unused in the web application itself today (its only write path is commented out).
  • name es obligatorio. No hay regla de unicidad — no existe ninguna hoy, ni siquiera en la aplicación web.
  • Crear la tercera marca activa dispara automáticamente un mail interno de aviso — mismo comportamiento que siempre tuvo la aplicación web, heredado tal cual.
  • No hay forma de asignar una marca a un producto por esta API — esa funcionalidad no se usa hoy ni en la propia aplicación web (su única vía de escritura está comentada).

PromotionsPromociones

This is the promotion's definition only: how it gets applied to an order is the responsibility of the order engine, not this resource.

Esta es solo la definición de la promoción: cómo se aplica a un pedido es responsabilidad del motor de reglas, no de este recurso.

EndpointWhat it does
GET /promotionsPaged listing of active promotions. page, pageSize.
GET /promotions/{id}One promotion, active or not.
POST /promotionsCreates a promotion. Answers 201. description, scope and calculationType are required, plus whatever each combination needs — see the rules below.
PUT /promotions/{id}Partial update. active is read-only. 404 for a deactivated id — see below.
POST /promotions/{id}/deactivateDeactivates the promotion. Not physically deleted: still reachable through GET. Idempotent.
EndpointQué hace
GET /promotionsListado paginado de promociones activas. page, pageSize.
GET /promotions/{id}Una promoción, activa o no.
POST /promotionsCrea una promoción. Responde 201. description, scope y calculationType son obligatorios, más lo que pida cada combinación — ver las reglas abajo.
PUT /promotions/{id}Actualización parcial. active es de solo lectura. 404 para un id dado de baja — ver abajo.
POST /promotions/{id}/deactivateDa de baja la promoción. No se elimina físicamente: sigue accesible por GET. Idempotente.

Validation rulesReglas de validación

  • scope is either cart (applies to the whole order) or per-product.
  • cart: discountPercentage (0–100) is required. cartThreshold defaults to 0.
  • per-product: at least one of productIds is required. formatType (barril/envase_suelto/pack) drives which of liters/containerId/caseId applies.
  • calculationType=percentage: discountPercentage (0–100) is required.
  • calculationType=quantity (an MxN deal): buyQuantity and payQuantity are required, and payQuantity must be less than buyQuantity.
  • When restrictToPriceLists is true, at least one of priceListIds is required, and each must be one of your active price lists.
  • There is no /activate: the web application itself has no reactivation for a promotion either. A PUT on a deactivated promotion answers 404 for the same reason — the underlying save always reactivates on update, so this prevents reactivating one as a side effect of an edit.
  • scope es cart (aplica a todo el pedido) o per-product.
  • cart: discountPercentage (0–100) es obligatorio. cartThreshold default 0.
  • per-product: se requiere al menos un valor en productIds. formatType (barril/envase_suelto/pack) determina cuál de liters/containerId/caseId aplica.
  • calculationType=percentage: discountPercentage (0–100) es obligatorio.
  • calculationType=quantity (un MxN): buyQuantity y payQuantity son obligatorios, y payQuantity debe ser menor que buyQuantity.
  • Cuando restrictToPriceLists es true, se requiere al menos un valor en priceListIds, y cada uno debe ser una lista de precios activa suya.
  • No hay /activate: la aplicación web tampoco tiene reactivación para una promoción. Un PUT sobre una promoción dada de baja responde 404 por el mismo motivo — el guardado subyacente siempre reactiva al actualizar, y esto evita reactivarla como efecto colateral de una edición.

SuppliersProveedores

EndpointWhat it does
GET /suppliersPaged listing. search (trade name, legal name, tax id, e-mails), page, pageSize, includeInactive.
GET /suppliers/{id}One supplier, active or not.
POST /suppliersCreates a supplier. Answers 201. tradeName and taxConditionId are required — there is no default for the tax condition, since it decides how the supplier invoices you. Omitting currencyId uses your account's currency.
PUT /suppliers/{id}Partial update.
POST /suppliers/{id}/deactivateDeactivation. Idempotent.
POST /suppliers/{id}/activateReactivation. Idempotent.
GET /suppliers/{id}/productsPaged listing of the products this supplier provides. page, pageSize.
PUT /suppliers/{id}/productsReplaces that whole set. The body is an array of product ids. An empty array clears it.
GET /suppliers/{id}/ledgerCurrent-account movements, newest first. from, to (YYYY-MM-DD), unreconciledOnly, page, pageSize.
GET /suppliers/{id}/balanceWhat you owe the supplier right now, and in which currency.
EndpointQué hace
GET /suppliersListado paginado. search (nombre de fantasía, razón social, CUIT, emails), page, pageSize, includeInactive.
GET /suppliers/{id}Un proveedor, activo o no.
POST /suppliersCrea un proveedor. Responde 201. tradeName y taxConditionId son obligatorios: la condición fiscal no tiene default porque decide cómo le factura el proveedor. Si omite currencyId se usa la moneda de su cuenta.
PUT /suppliers/{id}Actualización parcial.
POST /suppliers/{id}/deactivateBaja. Idempotente.
POST /suppliers/{id}/activateReactivación. Idempotente.
GET /suppliers/{id}/productsListado paginado de los productos que provee este proveedor. page, pageSize.
PUT /suppliers/{id}/productsReemplaza ese conjunto entero. El body es un arreglo de ids de producto. Un arreglo vacío lo deja sin ninguno.
GET /suppliers/{id}/ledgerMovimientos de cuenta corriente, del más nuevo al más viejo. from, to (YYYY-MM-DD), unreconciledOnly, page, pageSize.
GET /suppliers/{id}/balanceCuánto le debe al proveedor ahora mismo, y en qué moneda.

Validation rulesReglas de validación

  • tradeName is required.
  • taxConditionId is required when creating. It is rejected with invalid_reference, naming /tax-conditions, rather than defaulted: the tax condition varies by country and decides how the supplier invoices you.
  • taxId must not match another active supplier that uses the same currency. Two suppliers with the same tax id in different currencies are allowed on purpose: it is how an account bills the same company in two currencies.
  • legalName follows the same rule as taxId.
  • Once a supplier has current-account movements, its currencyId can no longer be changed: the balance would end up mixing two currencies in one account.
  • Reactivation is rejected when another active supplier already uses the same legalName.
  • latitude and longitude are the one exception to "null clears it": they are stored as numbers with 0 meaning "not set", so sending null resets them to 0.
  • tradeName es obligatorio.
  • taxConditionId es obligatorio en el alta. Se rechaza con invalid_reference, nombrando /tax-conditions, en vez de tomar un default: la condición fiscal varía por país y decide cómo le factura el proveedor.
  • taxId no puede coincidir con el de otro proveedor activo que use la misma moneda. Dos proveedores con el mismo CUIT en monedas distintas sí se permiten, a propósito: es cómo una cuenta le factura a la misma empresa en dos monedas.
  • legalName sigue la misma regla que taxId.
  • Una vez que un proveedor tiene movimientos de cuenta corriente, ya no se puede cambiar su currencyId: el saldo terminaría mezclando dos monedas en una sola cuenta.
  • La reactivación se rechaza si ya hay otro proveedor activo con la misma legalName.
  • latitude y longitude son la única excepción a "null lo vacía": se guardan como números donde 0 significa "sin asignar", así que mandarlas en null las vuelve a 0.

The products a supplier providesLos productos que provee un proveedor

This is a many-to-many relation, and it is a different thing from the single supplierId written on a product. A product has one supplier on it — the one you usually buy it from — and may additionally be provided by several others. Both exist and neither replaces the other.

Es una relación muchos a muchos, y es otra cosa que el supplierId que lleva escrito un producto. Un producto tiene un proveedor propio — al que se lo compra habitualmente— y además puede ser provisto por varios. Las dos cosas existen y ninguna reemplaza a la otra.

PUT /api/v1/suppliers/22/products
[ 88, 91, 104 ]

Every id is checked against GET /api/v1/products; one outside it answers 400 invalid_reference naming productIds and that route. The links are deactivated rather than deleted: the relation records when it was created and is part of the history of who supplied what.

Cada id se valida contra GET /api/v1/products; uno que no esté ahí responde 400 invalid_reference nombrando productIds y esa ruta. Los vínculos se dan de baja, no se borran: la relación guarda cuándo se creó y es parte de la historia de quién proveyó qué.

Current accountCuenta corriente

Read-only. Movements are generated by the system: a purchase adds to what you owe, a payment reduces it, a credit note offsets it. Registering a payment is a treasury operation with its own resource, which this version does not publish — so there is no POST here.

Solo lectura. Los movimientos los genera el sistema: una compra suma a lo que usted debe, un pago lo resta, una nota de crédito lo compensa. Registrar un pago es una operación de tesorería con su propio recurso, que esta versión no publica: por eso acá no hay POST.

A positive amount increases what you owe; a payment is negative. The balance is cumulative and depends on the order of the movements, so each entry reports the balance it left behind and the previousBalance it started from. For the current balance alone, read /balance: it is one call instead of paging to the end.

Un amount positivo aumenta lo que usted debe; un pago es negativo. El saldo es acumulado y depende del orden de los movimientos, así que cada entrada informa el balance que dejó y el previousBalance del que partió. Si solo necesita el saldo actual, lea /balance: es una llamada en vez de paginar hasta el final.

The balance comes with its currencyId, because a number without a unit is not a balance. A supplier cannot change currency once it has movements, precisely so this number never mixes two.

El saldo viene con su currencyId, porque un número sin unidad no es un saldo. Un proveedor no puede cambiar de moneda una vez que tiene movimientos, justamente para que este número nunca mezcle dos.

ContactsContactos

A supplier has one contact, a free-text field already published as contactName. There is no list of contacts per supplier in the application, so there is no sub-resource for it.

Un proveedor tiene un contacto, un campo de texto libre que ya se publica como contactName. La aplicación no maneja una lista de contactos por proveedor, así que no hay sub-recurso para eso.

Supplier categoriesCategorías de proveedor

EndpointWhat it does
GET /supplier-categoriesPaged listing. page, pageSize, includeInactive. This is also the catalog of categoryId.
GET /supplier-categories/{id}One category, active or not.
POST /supplier-categoriesCreates a category. Answers 201. name is required.
PUT /supplier-categories/{id}Partial update.
POST /supplier-categories/{id}/deactivateDeactivation. Idempotent.
POST /supplier-categories/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /supplier-categoriesListado paginado. page, pageSize, includeInactive. Es además el catálogo de categoryId.
GET /supplier-categories/{id}Una categoría, activa o no.
POST /supplier-categoriesCrea una categoría. Responde 201. name es obligatorio.
PUT /supplier-categories/{id}Actualización parcial.
POST /supplier-categories/{id}/deactivateBaja. Idempotente.
POST /supplier-categories/{id}/activateReactivación. Idempotente.

Validation rulesReglas de validación

  • name is required, and must be unique among both your active and inactive categories — a deactivated category still blocks its name, the same rule the web application enforces.
  • Reactivation is rejected under the same rule: it fails if another active category already took the name while this one was deactivated.
  • Deactivating a category does not check whether a supplier currently uses it: the application does not enforce that either, so a supplier can be left pointing at an inactive category.
  • name es obligatorio, y único entre sus categorías activas e inactivas: una categoría desactivada igual bloquea su nombre, la misma regla que aplica la aplicación web.
  • La reactivación se rechaza con la misma regla: falla si otra categoría activa ya tomó el nombre mientras esta estaba desactivada.
  • Desactivar una categoría no revisa si algún proveedor la usa: la aplicación tampoco lo hace, así que un proveedor puede quedar apuntando a una categoría inactiva.

Supplier item mappingsMapeos de ítem de proveedor

Saved mappings from an invoice line description to a system item, used by the application's AI-assisted invoice load to skip lines it already learned to classify. A mapping points to a supply, a service, a complementary product or a spare part — at least one of the four is required.

Mapeos guardados de una descripción de línea de factura a un ítem del sistema, que usa la carga de facturas asistida por IA de la aplicación para saltear líneas que ya aprendió a clasificar. Un mapeo apunta a un insumo, un servicio, un producto complementario o un repuesto — se requiere al menos uno de los cuatro.

EndpointWhat it does
GET /supplier-item-mappingsPaged listing. page, pageSize, includeInactive.
GET /supplier-item-mappings/{id}One mapping, active or not.
POST /supplier-item-mappingsCreates a mapping. Answers 201. invoiceDescription and at least one of supplyId, serviceId, complementaryProductId, sparePartId are required.
PUT /supplier-item-mappings/{id}Partial update. invoiceDescription is ignored — see below.
POST /supplier-item-mappings/{id}/deactivateDeactivation. Idempotent.
POST /supplier-item-mappings/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /supplier-item-mappingsListado paginado. page, pageSize, includeInactive.
GET /supplier-item-mappings/{id}Un mapeo, activo o no.
POST /supplier-item-mappingsCrea un mapeo. Responde 201. invoiceDescription y al menos uno de supplyId, serviceId, complementaryProductId, sparePartId son obligatorios.
PUT /supplier-item-mappings/{id}Actualización parcial. invoiceDescription se ignora — ver abajo.
POST /supplier-item-mappings/{id}/deactivateBaja. Idempotente.
POST /supplier-item-mappings/{id}/activateReactivación. Idempotente.

Validation rulesReglas de validación

  • invoiceDescription is required on create, and is normalized before being stored (lowercased, accents stripped, whitespace collapsed) so it compares consistently against future invoice lines.
  • invoiceDescription is read-only after creation: it is the lookup key, and the application itself never lets it change once a mapping exists — its own edit screen shows it as plain text, not an input, once the row exists. Sending a different value on a PUT has no effect.
  • At least one of supplyId, serviceId, complementaryProductId, sparePartId is required.
  • supplierId is optional. Null means the mapping applies to every supplier; a specific supplier's mapping is preferred over a generic one when both would match the same text.
  • Accounts on the Homebrewer, FREE or Production plan cannot write to this resource — the same restriction the web screen enforces.
  • invoiceDescription es obligatoria en el alta, y se normaliza antes de guardarse (minúsculas, sin acentos, espacios colapsados) para que compare de forma consistente contra futuras líneas de factura.
  • invoiceDescription es de solo lectura después de crear: es la clave de búsqueda, y la aplicación misma no la deja cambiar una vez que el mapeo existe — su propia pantalla de edición la muestra como texto plano, no como un campo editable, fuera del alta. Mandar un valor distinto en un PUT no tiene efecto.
  • Se requiere al menos uno de supplyId, serviceId, complementaryProductId, sparePartId.
  • supplierId es opcional. Nulo significa que el mapeo aplica a todos los proveedores; el mapeo específico de un proveedor tiene prioridad sobre uno genérico cuando los dos coinciden con el mismo texto.
  • Las cuentas en plan Homebrewer, FREE o Producción no pueden escribir en este recurso — la misma restricción que aplica la pantalla web.

ServicesServicios

Not available on the Homebrewer, FREE or Production plans. Calls from an account on one of those answer 403 plan_forbidden. It is not a permission an administrator can grant — it is what the plan includes.

No disponible en los planes Homebrewer, FREE ni Producción. Las llamadas desde una cuenta en alguno de esos responden 403 plan_forbidden. No es un permiso que el administrador pueda otorgar — es lo que incluye el plan.

A service your account can be billed for by a supplier — an item a purchase can pay without moving stock, alongside supplies, complementary products and spare parts. This resource is only the service definition (create/rename/deactivate). Which suppliers offer a given service is not exposed here: the application only uses that relation to narrow a dropdown, and it is not data an integrator needs to write — the full catalog already gives you everything needed to validate serviceId.

Un servicio que su cuenta puede pagarle a un proveedor — un ítem que una compra puede pagar sin mover stock, junto a insumos, productos complementarios y repuestos. Este recurso es solo la definición del servicio (crear/renombrar/dar de baja). Qué proveedores ofrecen un servicio no se expone acá: la aplicación solo usa esa relación para angostar un combo, y no es un dato que un integrador necesite escribir — el catálogo completo ya le da todo lo necesario para validar serviceId.

GET /api/v1/purchasable-services already existed before this resource and is not replaced by it — it keeps being the route validated by serviceId in supplier item mappings, purchases and purchase orders. The two paths are deliberately different: GET /services would read as "the API's own services", which is exactly why the existing catalog was never named that.

GET /api/v1/purchasable-services ya existía antes que este recurso y no se reemplaza por él — sigue siendo la ruta que valida serviceId en mapeos de ítem de proveedor, compras y órdenes de compra. Las dos rutas son distintas a propósito: GET /services leería como "los servicios de la propia API", que es exactamente por lo que el catálogo existente nunca se llamó así.

EndpointWhat it does
GET /servicesPaged listing. search (name), page, pageSize, includeInactive.
GET /services/{id}One service, active or not.
POST /servicesCreates a service. Answers 201. name is required.
PUT /services/{id}Partial update. 404 for a deactivated id.
POST /services/{id}/deactivateDeactivation. Idempotent.
POST /services/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /servicesListado paginado. search (nombre), page, pageSize, includeInactive.
GET /services/{id}Un servicio, activo o no.
POST /servicesCrea un servicio. Responde 201. name es obligatorio.
PUT /services/{id}Actualización parcial. 404 para un id desactivado.
POST /services/{id}/deactivateBaja. Idempotente.
POST /services/{id}/activateReactivación. Idempotente.

Validation rulesReglas de validación

  • name is required, at most 100 characters, and must be unique among both your active and inactive services.
  • Deactivation does not check for purchases currently referencing the service — same as the web application, which allows it too (same criterion already applied to product-categories/customer-categories).
  • Reactivation is rejected under the same name-uniqueness rule as creation.
  • There is no way to assign or read which suppliers offer a service through this endpoint — see above.
  • name es obligatorio, hasta 100 caracteres, y único entre sus servicios activos e inactivos.
  • La baja no revisa si alguna compra referencia el servicio — igual que la aplicación web, que también lo permite (mismo criterio ya aplicado a product-categories/customer-categories).
  • La reactivación se rechaza con la misma regla de unicidad de nombre que el alta.
  • No hay forma de asignar ni leer qué proveedores ofrecen un servicio por este endpoint — ver arriba.

ChecksCheques

Checks received from customers or delivered to suppliers. Full read, edit, registration, collection and deactivation.

A check registered through POST /checks is a RECORD, not money anywhere yet. In the web application a check is never created on its own: it is always the side effect of recording a cash or bank-account movement, so it arrives already tied to one. This endpoint is the one way to register a check that is tied to no movement — the physical cheque you were handed, before you decide where to deposit it. Such a check will not appear in any cash-register or bank-account report and will not affect any balance. What turns it into money is POST /checks/{id}/collect.

Cheques recibidos de clientes o entregados a proveedores. Lectura, edición, registro, cobro y baja completos.

Un cheque registrado por POST /checks es un REGISTRO, todavía no es plata en ningún lado. En la aplicación web un cheque nunca se crea solo: siempre es el efecto de registrar un movimiento de caja o de cuenta bancaria, así que nace ya ligado a uno. Este endpoint es la única vía para registrar un cheque que no está ligado a ningún movimiento — el cheque físico que le entregaron, antes de decidir dónde depositarlo. Un cheque así no aparece en ningún reporte de caja ni de cuenta bancaria y no afecta ningún saldo. Lo que lo convierte en plata es POST /checks/{id}/collect.

EndpointWhat it does
GET /checksPaged listing. from, to (YYYY-MM-DD, match issue, due or collection date), statusId, page, pageSize.
GET /checks/{id}One check, active or not.
POST /checksRegisters a check. number, amount, issuer, issueDate, dueDate, bankId and kindId are required. Answers 201. Created in portfolio and never collected.
PUT /checks/{id}Partial update. statusId and collectionDate are read-only.
POST /checks/{id}/collectCollects the check into a cash register or a bank account. Send exactly one of cashRegisterId / bankAccountId, plus collectionDate. Writes one movement on the destination and marks the check collected.
POST /checks/{id}/deactivateDeactivates a check with no cash/bank movement linked to it. Not physically deleted: still reachable through GET.
EndpointQué hace
GET /checksListado paginado. from, to (YYYY-MM-DD, compara fecha de emisión, vencimiento o cobro), statusId, page, pageSize.
GET /checks/{id}Un cheque, activo o no.
POST /checksRegistra un cheque. number, amount, issuer, issueDate, dueDate, bankId y kindId son obligatorios. Responde 201. Nace en cartera y sin cobrar.
PUT /checks/{id}Actualización parcial. statusId y collectionDate son de solo lectura.
POST /checks/{id}/collectCobra el cheque a una caja o a una cuenta bancaria. Mande exactamente uno de cashRegisterId / bankAccountId, más collectionDate. Escribe un movimiento en el destino y marca el cheque como cobrado.
POST /checks/{id}/deactivateDa de baja un cheque sin movimiento de caja/banco asociado. No se elimina físicamente: sigue accesible por GET.

Validation rulesReglas de validación

  • dueDate must not be earlier than issueDate.
  • supplierId is read-only: the application itself never lets it change once the check exists (only customerId is editable).
  • customerId: on a check linked to a cash or bank-account movement (which is how almost every check enters the system), sending an explicit null is silently ignored rather than clearing it — the application only allows clearing it on a check with no such link.
  • /deactivate rejects a check linked to any cash or bank-account movement (issued through one, or already collected/delivered through one), an already inactive check, or one loaded by a different user (unless you can see everything). Same six rules the web application itself applies on delete, now shared code.
  • POST /checks cannot create a check that is already collected: collectionDate and statusId are read-only, and the four movement ids are not part of the contract at all.
  • /collect takes exactly one destination. An own check (kindId = own) can only be collected into a bank account, and is recorded there as an EXPENSE — collecting your own cheque is money leaving, not arriving.
  • /collect on a check that was deposited rejects a collectionDate earlier than the deposit date.
  • /collect into a cash register requires that register's shift to be open, but only if your account works with cash shifts. The main cash register is exempt.
  • A check can only be collected once.
  • dueDate no puede ser anterior a issueDate.
  • supplierId es de solo lectura: la aplicación misma no lo deja cambiar una vez que el cheque existe (solo customerId es editable).
  • customerId: en un cheque ligado a un movimiento de caja o cuenta bancaria (así entra casi todo cheque al sistema), mandar un null explícito se ignora en vez de vaciarlo — la aplicación solo permite vaciarlo en un cheque sin ese vínculo.
  • /deactivate rechaza un cheque ligado a cualquier movimiento de caja o cuenta bancaria (emitido a través de uno, o ya cobrado/entregado a través de uno), uno ya inactivo, o uno cargado por otro usuario (salvo que pueda ver todo). Las mismas seis reglas que la aplicación web aplica hoy al eliminar, ahora en código compartido.
  • POST /checks no puede crear un cheque ya cobrado: collectionDate y statusId son de solo lectura, y los cuatro ids de movimiento no forman parte del contrato.
  • /collect recibe exactamente un destino. Un cheque propio (kindId = propio) solo se puede cobrar a una cuenta bancaria, y ahí se registra como EGRESO — cobrar un cheque propio es plata que sale, no que entra.
  • /collect sobre un cheque depositado rechaza una collectionDate anterior a la fecha de depósito.
  • /collect a una caja exige que el turno de esa caja esté abierto, pero solo si su cuenta trabaja con turnos de caja. La caja grande está exenta.
  • Un cheque se puede cobrar una sola vez.

WithholdingsRetenciones

Withholdings applied on a payment to your account or to a supplier. Read-only in this version — no POST or PUT. This is not a scope cut: the application itself has no operation to create, edit or delete a single withholding — it is always the side effect of recording a bank-account movement (or, transitively, a collection), and its only state change is a whole-batch reversal triggered by cancelling that parent movement. Recording a bank movement IS published now, but deliberately only on its plain path: that endpoint does not accept withholdings, precisely because a movement that carries them also writes the orders and purchases being settled.

Retenciones aplicadas sobre un pago a su cuenta o a un proveedor. Solo lectura en esta versión — no hay POST ni PUT. No es un recorte de alcance: la aplicación misma no tiene ninguna operación para crear, editar o eliminar una retención individual — siempre es el efecto colateral de registrar un movimiento de cuenta bancaria (o, transitivamente, una cobranza), y su único cambio de estado es una reversa en lote que dispara al cancelar ese movimiento padre. Registrar un movimiento bancario SÍ está publicado ahora, pero a propósito solo en su camino simple: ese endpoint no acepta retenciones, justamente porque un movimiento que las lleva también escribe los pedidos y las compras que cancela.

EndpointWhat it does
GET /withholdingsPaged listing. from, to (YYYY-MM-DD, match when it was recorded), active, purchaseId, page, pageSize.
GET /withholdings/{id}One withholding, active or not.
EndpointQué hace
GET /withholdingsListado paginado. from, to (YYYY-MM-DD, compara la fecha de alta), active, purchaseId, page, pageSize.
GET /withholdings/{id}Una retención, activa o no.

Which origin field is populatedQué campo de origen viene poblado

  • Exactly one of purchaseId, orderNumber, or the two kegPurchase* fields is populated, depending on which side originated the withholding — customer/order, supplier/purchase, or supplier/keg purchase.
  • orderNumber and the kegPurchase* fields are text, not ids: to read the order, look it up in GET /orders by date and match its number; keg purchases (CompraBarril, distinct from the purchase orders in keg-purchase-orders) are not published either.
  • purchaseId is a real id because /purchases already exists — resolve it there for the purchase's own detail.
  • percentage is informational only: the application never reconciles it against amount.
  • Exactamente uno de purchaseId, orderNumber, o los dos campos kegPurchase* viene poblado, según de qué lado nació la retención — cliente/pedido, proveedor/compra, o proveedor/compra de barriles.
  • orderNumber y los campos kegPurchase* son texto, no ids: para leer el pedido, búsquelo en GET /orders por fecha y compare su number; las compras de barriles (CompraBarril, distinta de las órdenes de compra de keg-purchase-orders) tampoco lo están.
  • purchaseId es un id real porque /purchases ya existe — resuélvalo ahí para el detalle de la compra.
  • percentage es solo informativo: la aplicación nunca lo concilia contra amount.

Bank accountsCuentas bancarias

Bank accounts of your brewery. Full CRUD. Its movements (the transactions on an account) can be listed and recorded. Recording is deliberately narrow: a movement created through this API is a plain one — money in or out, optionally against a customer's or a supplier's current account — and never settles orders or purchases, never carries withholdings, cheques or agenda events. Those paths write orders, purchases and their payment status in the same database transaction, the same territory already kept out of checks and customers/{id}/ledger. A movement cannot be edited or cancelled through this API.

Cuentas bancarias de su cervecería. CRUD completo. Sus movimientos (las transacciones de una cuenta) se pueden listar y registrar. El registro es deliberadamente angosto: un movimiento creado por esta API es un movimiento simple — dinero que entra o sale, opcionalmente contra la cuenta corriente de un cliente o de un proveedor — y nunca cancela pedidos ni compras, nunca lleva retenciones, cheques ni eventos de agenda. Esos caminos escriben pedidos, compras y su estado de pago en la misma transacción de base de datos, el mismo territorio que ya quedó afuera de cheques y de customers/{id}/ledger. Un movimiento no se puede editar ni cancelar por esta API.

EndpointWhat it does
GET /bank-accountsPaged listing. search (cbu, alias or number), includeInactive, page, pageSize.
GET /bank-accounts/{id}One bank account, active or not.
POST /bank-accountsCreates a bank account. bankId, accountTypeId and currencyId are required. Answers 201.
PUT /bank-accounts/{id}Partial update. currencyId cannot change once the account has movements. active is read-only.
POST /bank-accounts/{id}/deactivateDeactivates the account. Not physically deleted: still reachable through GET. Idempotent.
POST /bank-accounts/{id}/activateReactivates a previously deactivated account. Idempotent.
GET /bank-accounts/{id}/movementsPaged listing of the account's movements, most recent first. from, to (YYYY-MM-DD, match the movement date), page, pageSize.
POST /bank-accounts/{id}/movementsRecords a movement on the account. typeId, chartOfAccountId, bankPaymentTypeId, amount and date are required. Optionally customerId (income) or supplierId (expense) to post it to their current account. Answers 201. Does NOT accept vouchers, withholdings, cheques or events.
EndpointQué hace
GET /bank-accountsListado paginado. search (cbu, alias o número), includeInactive, page, pageSize.
GET /bank-accounts/{id}Una cuenta bancaria, activa o no.
POST /bank-accountsCrea una cuenta bancaria. bankId, accountTypeId y currencyId son obligatorios. Responde 201.
PUT /bank-accounts/{id}Actualización parcial. currencyId no se puede cambiar una vez que la cuenta tiene movimientos. active es de solo lectura.
POST /bank-accounts/{id}/deactivateDa de baja la cuenta. No se elimina físicamente: sigue accesible por GET. Idempotente.
POST /bank-accounts/{id}/activateReactiva una cuenta previamente dada de baja. Idempotente.
GET /bank-accounts/{id}/movementsListado paginado de los movimientos de la cuenta, más recientes primero. from, to (YYYY-MM-DD, compara la fecha del movimiento), page, pageSize.
POST /bank-accounts/{id}/movementsRegistra un movimiento en la cuenta. typeId, chartOfAccountId, bankPaymentTypeId, amount y date son obligatorios. Opcionalmente customerId (ingreso) o supplierId (egreso) para impactarlo en su cuenta corriente. Responde 201. NO acepta comprobantes, retenciones, cheques ni eventos.

Validation rulesReglas de validación

  • cbu and number must each be unique among your account's bank accounts, active or not.
  • currencyId cannot change once the account has any bank movement.
  • /deactivate has no check for existing movements or a non-zero balance — the web application itself has none either. This is replicated as-is, not a gap introduced by the API.
  • A movement's typeId decides whether amount increases or decreases the balance. amount is SIGNED when you read it back: positive on an income, negative on an expense. When you SEND it on a POST it is always positive — typeId decides the direction.
  • On a POST, chartOfAccountId must match the movement direction: an income account on an income, an expense account on an expense. GET /chart-of-accounts exposes the income flag so you can filter.
  • On a POST, exchangeRate is required when the customer's or supplier's currency differs from the bank account's: without it the amount posted to their current account would be in the wrong currency. It is always the value of 1 unit of the foreign currency in your local currency (e.g. 1450 for USD 1 = ARS 1450), whichever side holds the foreign currency.
  • A movement's date cannot be in the future.
  • On a POST, generateVoucher issues the movement's voucher: a RECEIPT on an income with a customerId, a PAYMENT ORDER on an expense with a supplierId. The new document's id comes back as receiptId or paymentOrderId, resolvable at /receipts and /payment-orders. It needs a counterparty: asking for a voucher without one is rejected, because an income with no customer would issue a payment order for money that came IN.
  • The voucher is issued once, with the movement. There is no way to issue one for a movement recorded earlier.
  • Exactly one of a movement's customerId/supplierId is populated, matching which side it belongs to.
  • cbu y number deben ser únicos entre las cuentas bancarias de su cuenta, activas o no.
  • currencyId no se puede cambiar una vez que la cuenta tiene algún movimiento bancario.
  • /deactivate no chequea movimientos existentes ni saldo distinto de cero — la aplicación web tampoco lo hace. Se replica tal cual, no es un hueco que introduce la API.
  • El typeId de un movimiento decide si amount aumenta o disminuye el saldo. amount viene CON SIGNO al leerlo: positivo en un ingreso, negativo en un egreso. Cuando lo MANDA en un POST es siempre positivo — el typeId decide la dirección.
  • En un POST, chartOfAccountId tiene que coincidir con la dirección del movimiento: una cuenta de ingreso en un ingreso, una de egreso en un egreso. GET /chart-of-accounts expone el flag income para poder filtrar.
  • En un POST, exchangeRate es obligatorio cuando la moneda del cliente o del proveedor difiere de la de la cuenta bancaria: sin él, el importe que impacta en su cuenta corriente quedaría en la moneda equivocada. Es siempre el valor de 1 unidad de la moneda extranjera en tu moneda local (por ejemplo, 1450 para USD 1 = ARS 1450), esté la moneda extranjera del lado de la cuenta o del cliente o proveedor.
  • La date de un movimiento no puede ser futura.
  • En un POST, generateVoucher emite el comprobante del movimiento: un RECIBO en un ingreso con customerId, una ORDEN DE PAGO en un egreso con supplierId. El id del documento nuevo vuelve como receiptId o paymentOrderId, y se resuelve en /receipts y /payment-orders. Exige contraparte: pedir el comprobante sin ella se rechaza, porque un ingreso sin cliente emitiría una orden de pago por un dinero que ENTRÓ.
  • El comprobante se emite una sola vez, con el movimiento. No hay forma de emitirlo para un movimiento registrado antes.
  • Exactamente uno de customerId/supplierId de un movimiento viene poblado, según de qué lado sea.

Chart of accountsPlan de cuentas

Entries of your chart of accounts. Full CRUD. Some entries are system-defined (fixed, present on every account) and some are your own — name already resolves to the right label for either kind, and only your own entries can be created, edited or deactivated: a system-defined id always answers 404 on write, the same way the web application's own edit screen can never reach one. There is no way to reassign which supplies post their cost to an account through this endpoint; that stays a web-only operation.

Cuentas del plan de cuentas. CRUD completo. Algunas cuentas son de sistema (fijas, presentes en toda cuenta) y otras son propias — name ya resuelve la etiqueta correcta para cualquiera de los dos casos, y solo las propias se pueden crear, editar o dar de baja: un id de sistema siempre responde 404 al escribir, igual que la propia pantalla de edición de la web nunca puede alcanzarlo. No hay forma de reasignar qué insumos postean su costo a una cuenta desde este endpoint; eso sigue siendo una operación solo de la web.

EndpointWhat it does
GET /chart-of-accountsPaged listing, including system-defined entries. search (name), includeInactive, page, pageSize.
GET /chart-of-accounts/{id}One entry, active or not.
POST /chart-of-accountsCreates an entry. name is required. Answers 201.
PUT /chart-of-accounts/{id}Partial update. active is read-only. 404 for a system-defined id. brandId (catalog /brands) assigns the account to a brand, so reports classify its purchases and cash/bank movements by brand: assigning, changing or removing it (null) requires the multi-brand feature on your account, otherwise 400. Sending the brand the account already has, or omitting the field, keeps it.
POST /chart-of-accounts/{id}/deactivateDeactivates the entry. Not physically deleted: still reachable through GET. Idempotent.
POST /chart-of-accounts/{id}/activateReactivates a previously deactivated entry. Idempotent.
EndpointQué hace
GET /chart-of-accountsListado paginado, incluidas las cuentas de sistema. search (nombre), includeInactive, page, pageSize.
GET /chart-of-accounts/{id}Una cuenta, activa o no.
POST /chart-of-accountsCrea una cuenta. name es obligatorio. Responde 201.
PUT /chart-of-accounts/{id}Actualización parcial. active es de solo lectura. 404 para un id de sistema. brandId (catálogo /brands) asocia la cuenta a una marca, y los informes clasifican por esa marca sus compras y movimientos de caja y banco: asignarla, cambiarla o quitarla (null) exige tener Multimarca activa en la cuenta, si no responde 400. Mandar la marca que la cuenta ya tiene, u omitir el campo, la conserva.
POST /chart-of-accounts/{id}/deactivateDa de baja la cuenta. No se elimina físicamente: sigue accesible por GET. Idempotente.
POST /chart-of-accounts/{id}/activateReactiva una cuenta previamente dada de baja. Idempotente.

Validation rulesReglas de validación

  • name is required and must be unique among your account's entries, active or not.
  • income: true for income-only, false for expense-only, null for both. Sending an explicit null clears it to "both" — a real business state, not ignored.
  • /deactivate has no check for existing movements — the web application itself has none either. It also deactivates any supply that was posting its cost to this account, the same cascade the web application performs.
  • name es obligatorio y debe ser único entre las cuentas de su cuenta, activas o no.
  • income: true para solo ingreso, false para solo egreso, null para ambos. Mandar un null explícito lo limpia a "ambos" — un estado de negocio real, no se ignora.
  • /deactivate no chequea movimientos existentes — la aplicación web tampoco lo hace. También desactiva cualquier insumo que posteaba su costo a esta cuenta, la misma cascada que hace la aplicación web.

Cash registersCajas

Cash registers of your brewery (not to be confused with bank accounts). Full CRUD. Two registers are system-defined and shared by every account ("petty cash" and "main cash register") alongside your own — only your own can be created, edited or deactivated: a system-defined id always answers 404 on write, the same way the web application's own edit screen can never reach one. currencyId is always read-only: the application itself overwrites it with your account's default currency on every save, regardless of what is sent. Its movements can be listed, and a shift can be opened and closed. Every other movement — collections, payments, transfers between registers, cashing a cheque, cancellations — is NOT exposed: those either cross into orders, purchases and their current accounts, or reverse a batch of entries at once, the same territory already kept out of bank-movements and checks. Opening and closing is the one write that touches none of it.

Cajas de su cervecería (no confundir con las cuentas bancarias). CRUD completo. Dos cajas son de sistema y compartidas por toda cuenta ("caja chica" y "caja grande") junto a las propias — solo las propias se pueden crear, editar o dar de baja: un id de sistema siempre responde 404 al escribir, igual que la propia pantalla de edición de la web nunca puede alcanzarlo. currencyId es siempre de solo lectura: la aplicación misma la pisa con la moneda default de su cuenta en cada guardado, sin importar qué se mande. Sus movimientos se pueden listar, y se puede abrir y cerrar un turno. Todo otro movimiento — cobranzas, pagos, transferencias entre cajas, cobro de cheque, cancelaciones — NO se expone: esos cruzan pedidos, compras y sus cuentas corrientes, o revierten un lote de asientos de una, el mismo territorio que ya quedó afuera de bank-movements y cheques. La apertura y el cierre son la única escritura que no toca nada de eso.

EndpointWhat it does
GET /cash-registersPaged listing, including system-defined registers. search (name), includeInactive, page, pageSize.
GET /cash-registers/{id}One register, active or not.
POST /cash-registersCreates a register. name is required. Answers 201.
PUT /cash-registers/{id}Partial update. currencyId, balance and active are read-only. 404 for a system-defined id.
POST /cash-registers/{id}/deactivateDeactivates the register. Not physically deleted: still reachable through GET. Idempotent.
POST /cash-registers/{id}/activateReactivates a previously deactivated register. Idempotent.
GET /cash-registers/{id}/movementsPaged listing of the register's movements, most recent first. from, to (YYYY-MM-DD, match the movement date), page, pageSize (capped at 100, lower than the usual 200). Read-only.
POST /cash-registers/{id}/openOpens the register's shift with amount in cash. Writes two movements in one transaction: the opening here, and its mirror expense on the main cash register. 400 if the shift is already open. Returns the register with its new balance.
POST /cash-registers/{id}/closeCloses the register's shift with amount in cash. Mirror income on the main cash register. 400 if the shift is not open. Returns the register with its new balance.
EndpointQué hace
GET /cash-registersListado paginado, incluidas las cajas de sistema. search (nombre), includeInactive, page, pageSize.
GET /cash-registers/{id}Una caja, activa o no.
POST /cash-registersCrea una caja. name es obligatorio. Responde 201.
PUT /cash-registers/{id}Actualización parcial. currencyId, balance y active son de solo lectura. 404 para un id de sistema.
POST /cash-registers/{id}/deactivateDa de baja la caja. No se elimina físicamente: sigue accesible por GET. Idempotente.
POST /cash-registers/{id}/activateReactiva una caja previamente dada de baja. Idempotente.
GET /cash-registers/{id}/movementsListado paginado de los movimientos de la caja, más recientes primero. from, to (YYYY-MM-DD, compara la fecha del movimiento), page, pageSize (tope 100, más bajo que el habitual de 200). Solo lectura.
POST /cash-registers/{id}/openAbre el turno de la caja con amount en efectivo. Escribe dos movimientos en una transacción: la apertura acá y su egreso espejo en la caja grande. 400 si el turno ya está abierto. Devuelve la caja con su saldo nuevo.
POST /cash-registers/{id}/closeCierra el turno de la caja con amount en efectivo. Ingreso espejo en la caja grande. 400 si el turno no está abierto. Devuelve la caja con su saldo nuevo.

Validation rulesReglas de validación

  • name is required. There is no uniqueness rule — none exists today, not even in the web application.
  • currencyId cannot be set through this endpoint: the application always overwrites it with your account's default currency on every save.
  • assignedUserId is not published: there is no catalog of users yet. assignedUserName is exposed instead, read-only, already resolved to text.
  • /deactivate has no check for existing movements — the web application itself has none either. Replicated as-is, not a gap introduced by the API.
  • Movements: pageSize caps at 100 for this sub-resource, not the usual 200 — the underlying query's own limit, already tuned and verified against real data.
  • Movements: a shift can be opened and closed, but there is no other POST, no cancellation and no transfer — see the remarks on CashMovementDto.
  • /open and /close take an amount that must be zero or positive. Zero is valid: that is how a shift opens with no float.
  • The main cash register has no shift of its own to open or close: it is the register every other one mirrors into. Asking for it answers 400.
  • name es obligatorio. No hay regla de unicidad — no existe ninguna hoy, ni siquiera en la aplicación web.
  • currencyId no se puede fijar desde este endpoint: la aplicación siempre la pisa con la moneda default de su cuenta en cada guardado.
  • assignedUserId no está publicado: todavía no hay catálogo de usuarios. En su lugar se expone assignedUserName, de solo lectura, ya resuelto a texto.
  • /deactivate no chequea movimientos existentes — la aplicación web tampoco lo hace. Se replica tal cual, no es un hueco que introduce la API.
  • Movimientos: pageSize tiene tope de 100 para este sub-recurso, no el habitual de 200 — el límite propio de la query subyacente, ya ajustado y verificado contra datos reales.
  • Movimientos: se puede abrir y cerrar un turno, pero no hay ningún otro POST, ni cancelación ni transferencia — ver las notas de CashMovementDto.
  • /open y /close reciben un amount que tiene que ser cero o positivo. Cero es válido: así se abre un turno sin fondo fijo.
  • La caja grande no tiene turno propio para abrir ni cerrar: es la caja contra la que se espeja cada apertura y cierre. Pedirlo responde 400.

PurchasesCompras

These endpoints move stock and money. Every line that points at a supply, a complementary product or a spare part changes the stock on hand, and the purchase is posted to the supplier's current account. That makes them the endpoints where a blind retry costs the most: send an idempotency key on every write.

Estos endpoints mueven stock y dinero. Cada línea que apunta a un insumo, a un producto complementario o a un repuesto cambia el stock disponible, y la compra se imputa a la cuenta corriente del proveedor. Eso los vuelve los endpoints donde un reintento a ciegas sale más caro: mande una clave de idempotencia en toda escritura.

EndpointWhat it does
GET /purchasesPaged listing, most recent first, without lines. dateFrom, dateTo, supplierId, purchaseTypeId, search (voucher numbers), page, pageSize, includeCancelled.
GET /purchases/{id}One purchase with its lines.
POST /purchasesRecords a purchase or a credit note, with its lines. Answers 201.
PUT /purchases/{id}Partial update. What you may change depends on how much has been paid.
POST /purchases/{id}/cancelVoids it, reversing the stock and current-account movements. Idempotent.
EndpointQué hace
GET /purchasesListado paginado, más recientes primero, sin las líneas. dateFrom, dateTo, supplierId, purchaseTypeId, search (números de comprobante), page, pageSize, includeCancelled.
GET /purchases/{id}Una compra con sus líneas.
POST /purchasesRegistra una compra o una nota de crédito, con sus líneas. Responde 201.
PUT /purchases/{id}Actualización parcial. Qué se puede cambiar depende de cuánto se pagó.
POST /purchases/{id}/cancelLa anula, revirtiendo los movimientos de stock y de cuenta corriente. Idempotente.

LinesLíneas

A line points at exactly one destination, and the destination decides what moves: supplyId stocks a raw material, complementaryProductId a complementary product, sparePartId a spare part, serviceId pays for a service and moves no stock. A line with none of the four is valid too — it is an expense described in text.

Una línea apunta a exactamente un destino, y el destino decide qué se mueve: supplyId ingresa un insumo, complementaryProductId un producto complementario, sparePartId un repuesto, serviceId paga un servicio y no mueve stock. Una línea sin ninguno de los cuatro también es válida: es un gasto descripto en texto.

Sending lines replaces the whole collection; omitting it keeps the current lines untouched. There is no per-line merge on purpose: with one, "remove a line" and "do not mention a line" would be the same request.

Mandar lines reemplaza la colección entera; omitirla conserva las líneas actuales. No hay fusión línea por línea a propósito: con una, "borrar una línea" y "no mencionar una línea" serían el mismo request.

Validation rulesReglas de validación

  • supplierId is required.
  • Either invoiceNumber or deliveryNoteNumber is required. And invoiceNumber specifically becomes required as soon as the purchase carries any amount: without an invoice there is no voucher to charge the expense to.
  • The same invoiceNumber cannot be recorded twice for the same supplier.
  • Every line needs a description and a quantity greater than zero.
  • When a line stocks a supply, its unitId must be convertible to that supply's own base unit. Kilograms into a supply measured in litres does not convert, and is rejected.
  • Each number in externalLots is limited to 50 characters.
  • A credit note (purchaseTypeId = 2) needs creditNoteNumber instead of an invoice number.
  • purchaseTypeId cannot be changed after creation: a purchase and a credit note move stock in opposite directions, and the movement has already been applied.
  • Voiding is rejected when the purchase has payments applied, or credit notes against it. Void those first — the message names them.
  • A credit note, and voiding a purchase, take stock out. On an account that blocks negative stock (of supplies or of spare parts), they are rejected if they would leave a supply or a spare part below zero in its warehouse. Nothing is recorded.
  • purchaseOrderId is optional. Allowed values: GET /api/v1/purchase-orders. Recording a purchase with it set is what advances that order's applied/completed state.
  • supplierId es obligatorio.
  • Hace falta invoiceNumber o deliveryNoteNumber. Y invoiceNumber en particular pasa a ser obligatorio en cuanto la compra tiene algún importe: sin factura no hay comprobante contra el que imputar el gasto.
  • El mismo invoiceNumber no se puede registrar dos veces para el mismo proveedor.
  • Cada línea necesita description y una quantity mayor que cero.
  • Cuando una línea ingresa un insumo, su unitId tiene que ser convertible a la unidad base de ese insumo. Kilos a un insumo medido en litros no convierte, y se rechaza.
  • Cada número de externalLots admite hasta 50 caracteres.
  • Una nota de crédito (purchaseTypeId = 2) necesita creditNoteNumber en lugar de número de factura.
  • purchaseTypeId no se puede cambiar después del alta: una compra y una nota de crédito mueven el stock en sentidos opuestos, y el movimiento ya se aplicó.
  • La anulación se rechaza si la compra tiene pagos aplicados o notas de crédito asociadas. Anule primero esas: el mensaje las nombra.
  • Una nota de crédito, y la anulación de una compra, sacan stock. En una cuenta que bloquea el stock negativo (de insumos o de repuestos), se rechazan si dejarían un insumo o un repuesto por debajo de cero en su depósito. No se graba nada.
  • purchaseOrderId es opcional. Valores permitidos: GET /api/v1/purchase-orders. Registrar una compra con este campo es lo que avanza el applied/completed de esa orden.

Header and lines must agreeLa cabecera y las líneas tienen que coincidir

If the subtotal of the header does not match the sum of the line costs, the request is rejected with 400 header_detail_mismatch and the message states both amounts and the difference. This is not a formatting complaint: the mismatch is almost always a data entry error, and once the purchase is paid it can no longer be corrected. Fix the amounts, or re-send the same request with "confirmDiscrepancy": true to record it as is. A tolerance of the larger of 1 or 0.5% is allowed before the guard fires.

Si el subtotal de la cabecera no coincide con la suma de los costos de las líneas, el request se rechaza con 400 header_detail_mismatch y el mensaje indica los dos importes y la diferencia. No es una queja de formato: la discrepancia casi siempre es un error de carga, y una vez que la compra está pagada ya no se puede corregir. Corrija los importes, o reenvíe el mismo request con "confirmDiscrepancy": true para registrarla tal cual. Se tolera hasta el mayor entre 1 y el 0,5% antes de que la guarda salte.

What you may change, and whenQué se puede cambiar, y cuándo

State of the purchaseWhat PUT accepts
Nothing paidAmounts, lines, voucher numbers, dates and the expense account. The supplier only while the purchase has no lines. Spare-part lines can only be added to a purchase that has no lines yet, and the lines of a purchase that already has a spare part cannot change.
Partially paidOnly the dates.
Fully paid, or already voidedNothing. Void it and record it again.
Estado de la compraQué acepta el PUT
Sin pagosImportes, líneas, números de comprobante, fechas y cuenta contable. El proveedor solo mientras la compra no tenga líneas. Las líneas de repuesto solo se pueden agregar a una compra que todavía no tiene líneas, y las líneas de una compra que ya tiene un repuesto no se pueden cambiar.
Con pago parcialSolo las fechas.
Totalmente pagada, o ya anuladaNada. Anúlela y regiéstrela de nuevo.

A change the current state does not allow answers 400 business_rule; it is never silently ignored. Changing amounts or lines reverses the movements of the previous version and applies the new ones.

Un cambio que el estado actual no permite responde 400 business_rule; nunca se ignora en silencio. Cambiar importes o líneas revierte los movimientos de la versión anterior y aplica los nuevos.

Not in v1Fuera de v1

The Argentine perceptions detail, registering payments, and file attachments. The first needs its own resource with its own catalog; the second is a multipart upload, which this API does not accept. Neither is required to record a purchase.

El detalle de percepciones de Argentina, registrar pagos, y los archivos adjuntos. El primero necesita su propio recurso con su catálogo; el segundo es una subida multipart, que esta API no acepta. Ninguno hace falta para registrar una compra.

Purchase ordersÓrdenes de compra

An intent to buy from a supplier, before any stock or money moves — not to be confused with purchases (which does). Registering a purchase that references this order is what advances applied/completed; nothing here moves stock or your supplier's current account by itself.

Una intención de compra a un proveedor, antes de que se mueva stock o dinero — no confundir con purchases (que sí lo hace). Registrar una compra que referencia esta orden es lo que avanza applied/completed; nada de esto mueve stock ni la cuenta corriente del proveedor por sí solo.

EndpointWhat it does
GET /purchase-ordersPaged listing, most recent first, without detail lines. search (order number, supplier name), page, pageSize, includeInactive.
GET /purchase-orders/{id}One order, active or not, with its detail lines.
POST /purchase-ordersCreates an order. Answers 201. supplierId and detailLines are required — at least one line.
PUT /purchase-orders/{id}Partial update. detailLines absent leaves the lines untouched; present (even empty) replaces every line — but empty is rejected, same rule as create.
POST /purchase-orders/{id}/deactivateDeactivation. Idempotent.
POST /purchase-orders/{id}/activateReactivation. Idempotent.
POST /purchase-orders/{id}/completeManual closing. Independent of whether any purchase has been applied against it. Idempotent.
EndpointQué hace
GET /purchase-ordersListado paginado, del más reciente al más viejo, sin las líneas de detalle. search (número de orden, nombre del proveedor), page, pageSize, includeInactive.
GET /purchase-orders/{id}Una orden, activa o no, con sus líneas de detalle.
POST /purchase-ordersCrea una orden. Responde 201. supplierId y detailLines son obligatorios — al menos una línea.
PUT /purchase-orders/{id}Actualización parcial. detailLines ausente conserva las líneas; presente (incluso vacío) reemplaza todas — pero vacío se rechaza, misma regla que al crear.
POST /purchase-orders/{id}/deactivateBaja. Idempotente.
POST /purchase-orders/{id}/activateReactivación. Idempotente.
POST /purchase-orders/{id}/completeCierre manual. Independiente de si se aplicó una compra contra ella. Idempotente.

LinesLíneas

Same shape as a purchase's lines: a line points at exactly one of supplyId, complementaryProductId, sparePartId or serviceId — no warehouseId here, an order does not stock anything yet. deliveredQuantity/remainingQuantity are read-only: only registering a purchase against this order moves them.

Misma forma que las líneas de una compra: una línea apunta a exactamente uno de supplyId, complementaryProductId, sparePartId o serviceId — sin warehouseId acá, una orden todavía no ingresa nada a stock. deliveredQuantity/ remainingQuantity son de solo lectura: solo registrar una compra contra esta orden las mueve.

Validation rulesReglas de validación

  • supplierId is required.
  • detailLines must have at least one entry.
  • notes is limited to 500 characters.
  • supplierId es obligatorio.
  • detailLines tiene que tener al menos un elemento.
  • notes admite hasta 500 caracteres.

Not in v1Fuera de v1

Emailing the order to the supplier (same optional-follow-up pattern already excluded elsewhere in this API — the order is complete and valid without the email), the calendar entries linked to an order (different save semantics, a sub-model shared with other entities), and keg-purchase-orders (a fully separate entity with no code in common with this one, despite the similar name).

Enviar la orden por mail al proveedor (mismo patrón de acción opcional encadenada ya excluido en el resto de esta API — la orden queda completa y válida sin el mail), la agenda de fechas ligada a una orden (semántica de guardado distinta, un sub-modelo compartido con otras entidades), y keg-purchase-orders (una entidad completamente aparte, sin código en común con esta, pese al nombre parecido).

Keg purchase ordersÓrdenes de compra de barriles

An intent to buy kegged product from a distributor's supplier, before any stock moves — a fully separate resource from purchase-orders, despite the similar name: no code in common, own model, own module (CompraDistribuidora). Registering a delivery against this order is what advances applied/completed, but that side is not published in v1 yet; nothing here moves stock by itself.

Una intención de compra de producto embarrilado a un proveedor de la distribuidora, antes de que se mueva stock — un recurso completamente aparte de purchase-orders, pese al nombre parecido: sin código en común, modelo propio, módulo propio (CompraDistribuidora). Registrar una entrega contra esta orden es lo que avanza applied/completed, pero ese lado todavía no está publicado en v1; nada de esto mueve stock por sí solo.

EndpointWhat it does
GET /keg-purchase-ordersPaged listing, most recent first, without detail lines. search (order number, supplier name), page, pageSize, includeInactive.
GET /keg-purchase-orders/{id}One order, active or not, with its detail lines.
POST /keg-purchase-ordersCreates an order. Answers 201. supplierId and detailLines are required — at least one line, and every line needs a productId.
PUT /keg-purchase-orders/{id}Partial update. detailLines absent leaves the lines untouched; present (even empty) replaces every line — but empty is rejected, same rule as create.
POST /keg-purchase-orders/{id}/deactivateDeactivation. Idempotent.
POST /keg-purchase-orders/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /keg-purchase-ordersListado paginado, del más reciente al más viejo, sin las líneas de detalle. search (número de orden, nombre del proveedor), page, pageSize, includeInactive.
GET /keg-purchase-orders/{id}Una orden, activa o no, con sus líneas de detalle.
POST /keg-purchase-ordersCrea una orden. Responde 201. supplierId y detailLines son obligatorios — al menos una línea, y cada línea necesita un productId.
PUT /keg-purchase-orders/{id}Actualización parcial. detailLines ausente conserva las líneas; presente (incluso vacío) reemplaza todas — pero vacío se rechaza, misma regla que al crear.
POST /keg-purchase-orders/{id}/deactivateBaja. Idempotente.
POST /keg-purchase-orders/{id}/activateReactivación. Idempotente.

LinesLíneas

containerId and caseId are mutually exclusive with a "loose" keg (free liters) — same criterion as a product's sales formats. deliveredQuantity/remainingQuantity and costPerLiter are read-only: only a delivery registered against this order moves the first two, and the product's cost at save time fills the last one.

containerId y caseId son mutuamente excluyentes con un barril "suelto" (liters libre) — mismo criterio que un formato de venta de un producto. deliveredQuantity/remainingQuantity y costPerLiter son de solo lectura: solo una entrega registrada contra esta orden mueve las dos primeras, y el costo del producto al momento de guardar completa la última.

Validation rulesReglas de validación

  • supplierId is required.
  • detailLines must have at least one entry, and every line requires productId.
  • supplierId es obligatorio.
  • detailLines tiene que tener al menos un elemento, y cada línea requiere productId.

Not in v1Fuera de v1

Emailing the order to the supplier (same optional-follow-up pattern already excluded elsewhere in this API — the order is complete and valid without the email), the calendar entries linked to an order (different save semantics, a sub-model shared with other entities), and registering a delivery against the order — that is distributor-purchases, a separate resource not published yet, so applied/completed/deliveredQuantity only change once it is.

Enviar la orden por mail al proveedor (mismo patrón de acción opcional encadenada ya excluido en el resto de esta API — la orden queda completa y válida sin el mail), la agenda de fechas ligada a una orden (semántica de guardado distinta, un sub-modelo compartido con otras entidades), y registrar una entrega contra la orden — eso es distributor-purchases, un recurso aparte todavía no publicado, así que applied/completed/deliveredQuantity solo cambian cuando lo esté.

ProductsProductos

EndpointWhat it does
GET /productsPaged listing, without sales formats. search (name, style, code), complementaryOnly, page, pageSize, includeInactive.
GET /products/{id}One product with its containers and cases.
POST /productsCreates a product, optionally with its prices per container and per case. Answers 201.
PUT /products/{id}Partial update.
POST /products/{id}/deactivateDeactivation. Idempotent.
POST /products/{id}/activateReactivation. Idempotent.
GET /products/{id}/categoriesCategories assigned to the product.
GET /products/{id}/stockCurrent stock, by warehouse. See below.
POST /products/{id}/stock/packAssembles loose containers into cases. See below.
POST /products/{id}/stock/unpackDisassembles cases into loose containers. See below.
EndpointQué hace
GET /productsListado paginado, sin los formatos de venta. search (nombre, estilo, código), complementaryOnly, page, pageSize, includeInactive.
GET /products/{id}Un producto con sus envases y cajas.
POST /productsCrea un producto, opcionalmente con sus precios por envase y por caja. Responde 201.
PUT /products/{id}Actualización parcial.
POST /products/{id}/deactivateBaja. Idempotente.
POST /products/{id}/activateReactivación. Idempotente.
GET /products/{id}/categoriesCategorías asignadas al producto.
GET /products/{id}/stockStock actual, por depósito. Ver más abajo.
POST /products/{id}/stock/packArma cajas a partir de envases sueltos. Ver más abajo.
POST /products/{id}/stock/unpackDesarma cajas en envases sueltos. Ver más abajo.

Sales formats: containers and casesFormatos de venta: envases y cajas

A product has one base price (priceWithoutTax) and, optionally, one price per format it is sold in. A container is an individual unit — a bottle, a can, a keg. A case groups several of them: a six-pack of 355 ml cans, a crate of twelve bottles. Send them in the same request that creates the product:

Un producto tiene un precio base (priceWithoutTax) y, opcionalmente, un precio por cada formato en el que se vende. Un envase es una unidad individual: una botella, una lata, un barril. Una caja agrupa varios: un six-pack de latas de 355 ml, un cajón de doce botellas. Se mandan en el mismo request que crea el producto:

POST /api/v1/products
{
  "style": "IPA",
  "name": "Hoppy Trails",
  "priceWithoutTax": 1200,
  "containers": [
    { "containerId": 3, "price": 1500, "unitCost": 620, "code": "IPA-500" },
    { "containerId": 7, "price": 9800, "unitCost": 4100, "code": "IPA-KEG20" }
  ],
  "cases": [
    { "caseId": 12, "price": 8200, "unitCost": 3600, "code": "IPA-SIXPACK" }
  ]
}

containerId comes from GET /api/v1/containers and caseId from GET /api/v1/cases. An id outside its catalog answers 400 invalid_reference naming the position, as in containers[1].containerId.

containerId sale de GET /api/v1/containers y caseId de GET /api/v1/cases. Un id fuera de su catálogo responde 400 invalid_reference nombrando la posición, como containers[1].containerId.

Sending a collection replaces it whole. A format you leave out of a containers array you did send is removed, and its price is lost. Omitting containers altogether keeps every format exactly as it is — so you never need to resend formats you are not changing. The same applies to cases and to categoryIds.

Mandar una colección la reemplaza entera. Un formato que quede afuera de un arreglo containers que sí envió se elimina, y su precio se pierde. Omitir containers del todo conserva cada formato tal cual está: así nunca tiene que reenviar formatos que no está cambiando. Lo mismo vale para cases y para categoryIds.

Validation rulesReglas de validación

  • style is required. It is the main part of the product's display name.
  • name is required when isComplementary is true, and must not match another active product.
  • A discount product (productTypeId pointing at the discount type) must have priceWithoutTax of zero or less: a positive one would add to the order instead of discounting it.
  • tracksStock can only be false on a complementary product. On a beer you brew it is ignored — brewed beer always has stock.
  • Removing a container or a case is rejected while the product appears in an order that has not been delivered yet: the order names that format, and it would be left pointing at nothing.
  • Deactivation is rejected while the product is still in play — kegs or containers holding it, batches or batch plans producing it, orders not yet delivered, or stock on hand, including stock of a mix pack that contains it. The message names which one.
  • style es obligatorio. Es la parte principal del nombre visible del producto.
  • name es obligatorio cuando isComplementary es true, y no puede coincidir con el de otro producto activo.
  • Un producto de bonificación (con productTypeId apuntando al tipo bonificación) tiene que tener priceWithoutTax cero o negativo: uno positivo sumaría al pedido en lugar de descontar.
  • tracksStock solo puede ser false en un producto complementario. En una cerveza propia se ignora: la cerveza que usted elabora siempre lleva stock.
  • Quitar un envase o una caja se rechaza mientras el producto aparezca en un pedido sin entregar: el pedido nombra ese formato y quedaría apuntando a nada.
  • La baja se rechaza mientras el producto siga en juego: barriles o envases que lo contengan, lotes o planificaciones que lo produzcan, pedidos sin entregar, o stock disponible — incluido el stock de un mix pack que lo contenga. El mensaje indica cuál.

Not in v1Fuera de v1

The flags of the external-user portal, and assigning price lists to customers. isMixPack is readable but not writable here: defining a mix pack has its own resource, /mix-packs.

Los flags del portal de usuarios externos, y asignar listas de precio a los clientes. isMixPack se puede leer pero no escribir acá: definir un mix pack tiene su propio recurso, /mix-packs.

Stock, by warehouseStock, por depósito

GET /products/{id}/stock requires the Stock module, not Products. It answers narrowed to the warehouses your integration user is allowed to use — same rule as /warehouses: a warehouse with stock the user cannot see is left out, not reported as zero.

GET /products/{id}/stock pide el módulo Stock, no Products. Responde limitado a los depósitos que su usuario de integración puede usar — misma regla que /warehouses: un depósito con stock que el usuario no puede ver queda afuera, no se informa en cero.

productKind (own, mixPack or complementary) decides which fields of each entry in byWarehouse carry a value: own sets containers and cases; the other two set quantity. A complementary product with tracksStock = false — or any product that does not carry physical stock, such as a discount or surcharge line — answers with an empty byWarehouse, not an error. minimumStock is not repeated here: read it from GET /products/{id}, where it applies regardless of productKind.

productKind (own, mixPack o complementary) decide qué campos de cada entrada de byWarehouse llevan valor: own completa containers y cases; los otros dos completan quantity. Un producto complementario con tracksStock = false —o cualquier producto que no lleve stock físico, como una bonificación o un recargo— responde con byWarehouse vacío, no con un error. minimumStock no se repite acá: se lee de GET /products/{id}, donde vale sin importar el productKind.

Assembling and disassembling casesArmado y desarmado de cajas

POST /products/{id}/stock/pack assembles loose containers into cases; POST /products/{id}/stock/unpack reverses it. Both take warehouseId, caseId and cases (how many). There is no containerId: the container comes from the case format itself (GET /api/v1/cases), so a mismatched pair can never be sent. Both answer with the product's updated stock in that warehouse, the same shape as GET /products/{id}/stock.

POST /products/{id}/stock/pack arma cajas a partir de envases sueltos; POST /products/{id}/stock/unpack hace lo inverso. Los dos piden warehouseId, caseId y cases (cuántas). No hay containerId: el envase sale del propio formato de caja (GET /api/v1/cases), así que nunca se puede mandar un par inconsistente. Los dos responden con el stock actualizado del producto en ese depósito, la misma forma que GET /products/{id}/stock.

⚠️ Neither endpoint targets a specific batch, invoice or delivery note. The application's own screen lets you pick one; the API instead consumes across all the stock your account has for that product and case in the warehouse, oldest-expiring-first (FEFO). The containers or cases it creates carry no batch attribution.

⚠️ Ninguno de los dos apunta a un lote, factura o remito puntual. La pantalla de la aplicación deja elegir uno; la API en cambio consume sobre todo el stock que su cuenta tiene de ese producto y esa caja en el depósito, empezando por el que vence antes (FEFO). Los envases o cajas que crea quedan sin atribución de lote.

Only own products support this — a mix pack or a complementary product answers 400. Disassembling a mix pack splits stock across several different products at once, which is not a per-product operation, so it is not part of /unpack and is not in v1.

Solo los productos own lo soportan: un mix pack o un producto complementario responde 400. Desarmar un mix pack reparte stock entre varios productos distintos a la vez, que no es una operación por producto, así que no forma parte de /unpack y no está en v1.

⚠ Not included: kegs or bulk beer in a tank⚠ No incluye: barriles ni cerveza a granel en tanque

Keg stock by warehouse belongs to the future kegs resource, not designed yet. Bulk beer still fermenting or maturing in a tank belongs to a future tanks/{id}/content sub-resource, not designed yet either. A product sold both packaged and kegged, or with an active batch in a tank, only shows its packaged and mix-pack stock here — the rest is a known gap until those resources exist.

El stock de barriles por depósito es del futuro recurso kegs, todavía sin diseñar. La cerveza a granel fermentando o madurando en un tanque es de un futuro sub-recurso tanks/{id}/content, también sin diseñar. Un producto que se vende envasado y embarrilado a la vez, o que tiene un lote activo en tanque, solo muestra acá su stock envasado y de mix-pack — el resto es un hueco conocido hasta que esos recursos existan.

Product categoriesCategorías de producto

EndpointWhat it does
GET /product-categoriesPaged listing. search (name), page, pageSize, includeInactive. This is also the catalog of a product's categoryIds.
GET /product-categories/{id}One category, active or not.
POST /product-categoriesCreates a category. Answers 201. name is required.
PUT /product-categories/{id}Partial update. active is read-only.
POST /product-categories/{id}/deactivateDeactivation. Idempotent. No check for products currently using this category.
POST /product-categories/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /product-categoriesListado paginado. search (nombre), page, pageSize, includeInactive. Es además el catálogo de categoryIds de un producto.
GET /product-categories/{id}Una categoría, activa o no.
POST /product-categoriesCrea una categoría. Responde 201. name es obligatorio.
PUT /product-categories/{id}Actualización parcial. active es de solo lectura.
POST /product-categories/{id}/deactivateBaja. Idempotente. No chequea productos que usen la categoría.
POST /product-categories/{id}/activateReactivación. Idempotente.

Validation rulesReglas de validación

  • name is required and must be unique among your account's categories, active or not.
  • hasAssociatedProducts is read-only, informational — it does not block /deactivate.
  • /deactivate has no check for products currently using the category — the web application itself has none either.
  • name es obligatorio y debe ser único entre las categorías de su cuenta, activas o no.
  • hasAssociatedProducts es de solo lectura, informativo — no bloquea /deactivate.
  • /deactivate no chequea productos que usen la categoría — la aplicación web tampoco lo hace.

Price listsListas de precios

EndpointWhat it does
GET /price-listsPaged listing, without prices. search (name), pointsListsOnly, page, pageSize, includeInactive.
GET /price-lists/{id}One list with all of its prices.
POST /price-listsCreates a list, optionally with its prices. Answers 201.
PUT /price-lists/{id}Partial update. See the note on items below — it does not behave like the other collections.
POST /price-lists/{id}/deactivateDeactivation. Idempotent.
POST /price-lists/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /price-listsListado paginado, sin los precios. search (nombre), pointsListsOnly, page, pageSize, includeInactive.
GET /price-lists/{id}Una lista con todos sus precios.
POST /price-listsCrea una lista, opcionalmente con sus precios. Responde 201.
PUT /price-lists/{id}Actualización parcial. Lea la nota sobre items: no se comporta como las demás colecciones.
POST /price-lists/{id}/deactivateBaja. Idempotente.
POST /price-lists/{id}/activateReactivación. Idempotente.

A list prices by percentage, by explicit price, or by bothUna lista trabaja por porcentaje, por precio explícito, o por los dos

percentage applies over the product's base price for everything the list does not price explicitly. items holds the explicit prices. A price is identified by the combination of product + container + case: only the product (the loose unit), product and container (the bottle), or product and case (the pack). Prices are always net of taxes; the taxes come from the product.

percentage se aplica sobre el precio base del producto para todo lo que la lista no tarifa explícitamente. items son los precios explícitos. Un precio se identifica por la combinación producto + envase + caja: solo producto (la unidad suelta), producto y envase (la botella), o producto y caja (el pack). Los precios siempre van sin impuestos; los impuestos salen del producto.

POST /api/v1/price-lists
{
  "name": "Mayorista",
  "percentage": 12.5,
  "items": [
    { "productId": 88, "containerId": 3, "priceWithoutTax": 1350.50 },
    { "productId": 88, "caseId": 12,     "priceWithoutTax": 7200 }
  ]
}

⚠ items is merged, not replaced⚠ items se fusiona, no se reemplaza

This is the one place in the API where sending a collection does not replace it. Each entry is matched by product, container and case: a match is updated, anything else is added, and prices you do not send are kept. An empty items array therefore changes nothing.

Es el único lugar de la API donde mandar una colección no la reemplaza. Cada entrada se busca por producto, envase y caja: la que coincide se actualiza, cualquier otra se agrega, y los precios que no manda se conservan. Un arreglo items vacío, entonces, no cambia nada.

It works that way because that is what the application itself does when it saves a list, and an API that deleted what the screen keeps would give the same operation two behaviours. Consequence: removing a price from a list is not possible in this version. Setting it to zero is, which is what the screen offers anyway.

Funciona así porque es lo que hace la aplicación al guardar una lista, y una API que borrara lo que la pantalla conserva le daría dos comportamientos a la misma operación. Consecuencia: sacar un precio de una lista no se puede en esta versión. Ponerlo en cero sí, que es lo que la pantalla ofrece de todos modos.

Validation rulesReglas de validación

  • name is required, and must not match another list of your account — including a deactivated one, because reactivating it would leave two lists with the same name.
  • percentage cannot exceed 9999.99, and no price can exceed 9999999999.99999: those are the limits of the columns.
  • isPointsList marks a list that prices in loyalty points instead of money. The two are not interchangeable: the customer's balance is counted in different units.
  • Omitting currencyId uses your account's currency.
  • name es obligatorio, y no puede coincidir con el de otra lista de su cuenta —incluida una dada de baja, porque reactivarla dejaría dos listas con el mismo nombre—.
  • percentage no puede pasar de 9999.99, y ningún precio puede pasar de 9999999999.99999: son los límites de las columnas.
  • isPointsList marca una lista que tarifa en puntos de fidelización en vez de dinero. No son intercambiables: el saldo del cliente se cuenta en unidades distintas.
  • Si omite currencyId se usa la moneda de su cuenta.

Not in v1Fuera de v1

Assigning a list to a customer — that is the customer's priceListId — bulk price changes, and removing a price from a list.

Asignarle una lista a un cliente —eso es el priceListId del cliente—, el cambio masivo de precios, y sacar un precio de una lista.

Mix packsMix packs

EndpointWhat it does
GET /mix-packsPaged listing, without contents. search, page, pageSize, includeInactive.
GET /mix-packs/{id}One mix pack with its contents.
POST /mix-packsDefines a mix pack. Answers 201. It has to carry something: send items, complementaryItems, or both.
PUT /mix-packs/{id}Partial update.
POST /mix-packs/{id}/deactivateDeactivation. Idempotent.
EndpointQué hace
GET /mix-packsListado paginado, sin la composición. search, page, pageSize, includeInactive.
GET /mix-packs/{id}Un mix pack con su composición.
POST /mix-packsDefine un mix pack. Responde 201. Tiene que llevar algo: mande items, complementaryItems, o los dos.
PUT /mix-packs/{id}Actualización parcial.
POST /mix-packs/{id}/deactivateBaja. Idempotente.

There is no /activate here, and it is not an oversight: the application has never had a way to reactivate a mix pack. Publishing one would be inventing an operation that does not exist.

Acá no hay /activate, y no es un olvido: la aplicación nunca tuvo forma de reactivar un mix pack. Publicar una sería inventar una operación que no existe.

Defining a pack is not assembling itDefinir un pack no es armarlo

This resource publishes the definition: which beers, in which containers, how many of each, plus any complementary products that come along — a glass, an opener. Producing units of the pack is a different operation: it takes containers out of the warehouse and has its own stock movements and traceability, which this version does not publish.

Este recurso publica la definición: qué cervezas, en qué envases, cuántas de cada una, más los complementarios que lo acompañan —un vaso, un destapador—. Producir unidades del pack es otra operación: saca envases del depósito y tiene sus propios movimientos de stock y trazabilidad, que esta versión no publica.

POST /api/v1/mix-packs
{
  "name": "Pack Degustacion",
  "priceWithoutTax": 7800,
  "caseId": 12,
  "items": [
    { "productId": 88, "containerId": 3, "quantity": 4 },
    { "productId": 91, "containerId": 3, "quantity": 2 }
  ],
  "complementaryItems": [
    { "complementaryProductId": 55, "quantity": 1 }
  ]
}

items and complementaryItems each replace their whole collection when sent, and keep the current one when omitted. productId comes from GET /api/v1/products: what a pack may carry is decided by having a container, not by your brewery producing it.

items y complementaryItems reemplazan su colección entera cuando se mandan, y conservan la actual cuando se omiten. productId sale de GET /api/v1/products: lo que un pack puede llevar lo decide tener envase, no que su cervecería lo produzca.

Validation rulesReglas de validación

  • name is required and must not match another product of your account — a mix pack is a product.
  • The pack has to carry something. An empty definition is rejected.
  • The pack's display description, its litres and its alcohol content are derived from what it carries: the application computes them, they are not fields you set. alcoholFree is reported, not written.
  • Deactivation is rejected while there are orders not yet finished carrying the pack, or units of it in stock: those units exist physically and would be left without a product.
  • name es obligatorio y no puede coincidir con el de otro producto de su cuenta: un mix pack es un producto.
  • El pack tiene que llevar algo. Una definición vacía se rechaza.
  • La descripción visible del pack, sus litros y su graduación se derivan de lo que lleva: los calcula la aplicación, no son campos que usted fije. alcoholFree se informa, no se escribe.
  • La baja se rechaza mientras haya pedidos sin finalizar con el pack, o unidades en stock: esas unidades existen físicamente y quedarían sin producto.

RecipesRecetas

EndpointWhat it does
GET /recipesPaged listing, without ingredients. search (name), producedProductId, page, pageSize, includeInactive.
GET /recipes/{id}One recipe with its ingredients and its task definitions.
POST /recipesCreates a recipe. Answers 201.
PUT /recipes/{id}Partial update.
POST /recipes/{id}/deactivateDeactivation. Idempotent.
POST /recipes/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /recipesListado paginado, sin los ingredientes. search (nombre), producedProductId, page, pageSize, includeInactive.
GET /recipes/{id}Una receta con sus ingredientes y sus definiciones de tarea.
POST /recipesCrea una receta. Responde 201.
PUT /recipes/{id}Actualización parcial.
POST /recipes/{id}/deactivateBaja. Idempotente.
POST /recipes/{id}/activateReactivación. Idempotente.

A recipe says what a batch of a given beer is made of, and which tasks that batch schedules. liters is the volume the recipe is written for — a batch scales the quantities from it. producedProductId comes from GET /api/v1/brewable-products: a recipe produces a beer your brewery makes, not any product you sell.

Una receta dice de qué está hecho un lote de una cerveza, y qué tareas programa ese lote. liters es el volumen para el que está escrita —el lote escala las cantidades desde ahí—. producedProductId sale de GET /api/v1/brewable-products: una receta produce una cerveza que su cervecería elabora, no cualquier producto que venda.

POST /api/v1/recipes
{
  "name": "Hoppy Trails v3",
  "producedProductId": 88,
  "liters": 1000,
  "originalGravity": 1055,
  "finalGravity": 1012,
  "ibu": 45,
  "abv": 6.2,
  "ingredients": [
    { "supplyId": 12, "useId": 4, "quantity": 3.5, "unitId": 1, "description": "Cascade" }
  ],
  "taskDefinitionIds": [5, 9]
}

⚠ Omitting a collection keeps it — sending an empty one wipes it⚠ Omitir una colección la conserva; mandarla vacía la borra

Omitting ingredients or taskDefinitionIds keeps what the recipe already has, so you never need to resend a composition you are not changing. Sending either one replaces it whole, and sending it empty leaves the recipe with none. Be deliberate: in a recipe this is a real deletion, not a deactivation — what you remove is gone.

Omitir ingredients o taskDefinitionIds conserva lo que la receta ya tiene, así que nunca necesita reenviar una composición que no está cambiando. Mandar cualquiera de las dos la reemplaza entera, y mandarla vacía deja la receta sin ninguna. Sea deliberado: en una receta esto es un borrado real, no una baja lógica — lo que saca, se pierde.

Whole numbers for OG, FG and IBUOG, FG e IBU van en números enteros

originalGravity, finalGravity and ibu are integers, because that is what the columns store. They are published that way rather than as decimals so the API does not promise a precision it cannot keep: 1048.5 would be stored as 1048 and the next GET would hand you back a different number than you sent.

originalGravity, finalGravity e ibu son enteros, porque es lo que guardan las columnas. Se publican así y no como decimales para que la API no prometa una precisión que no puede sostener: 1048.5 se guardaría como 1048 y el GET siguiente le devolvería un número distinto del que mandó.

Validation rulesReglas de validación

  • name is required and unique among your recipes.
  • producedProductId is required on create.
  • Each ingredient needs a supplyId and a quantity. Omitting supplyTypeId takes the kind the supply itself declares, which is what the application does; omitting description takes the supply's own name.
  • discountsStock decides whether brewing a batch takes the ingredient out of stock. Yeast is always false: the application manages it through its own containers.
  • style is reported, not written: it belongs to the product the recipe produces.
  • name es obligatorio y único entre sus recetas.
  • producedProductId es obligatorio en el alta.
  • Cada ingrediente necesita supplyId y quantity. Si omite supplyTypeId se toma el tipo que declara la propia materia prima, que es lo que hace la aplicación; si omite description se toma el nombre del insumo.
  • discountsStock decide si elaborar un lote descuenta el ingrediente del stock. La levadura siempre va en false: la aplicación la maneja con sus propios recipientes.
  • style se informa, no se escribe: es del producto que la receta produce.

SuppliesInsumos

EndpointWhat it does
GET /suppliesPaged listing. search (name, brand), supplyTypeId, page, pageSize, includeInactive. This is also the catalog of supplyId.
GET /supplies/{id}One supply, active or not.
POST /suppliesCreates a supply. Answers 201. name and supplyTypeId are required.
PUT /supplies/{id}Partial update.
POST /supplies/{id}/deactivateDeactivation. Idempotent. force=true goes ahead even when recipes use it.
POST /supplies/{id}/activateReactivation. Idempotent.
GET /supplies/{id}/stockStock on hand, overall and per warehouse.
POST /supplies/{id}/stock/adjustmentsManual entry or exit, relative to current stock. See below.
POST /supplies/{id}/stock/countsPhysical stock count, an absolute value. See below.
GET /supplies/{id}/convertible-unitsThe units a quantity of this supply may be sent in.
GET /supplies/{id}/batchesExternal lots: which lot numbers came in, and where they were used. Read-only.
GET /supplies/projectionProjected stock day by day. supplyTypeId required.
EndpointQué hace
GET /suppliesListado paginado. search (nombre, marca), supplyTypeId, page, pageSize, includeInactive. Es además el catálogo de supplyId.
GET /supplies/{id}Un insumo, activo o no.
POST /suppliesCrea un insumo. Responde 201. name y supplyTypeId son obligatorios.
PUT /supplies/{id}Actualización parcial.
POST /supplies/{id}/deactivateBaja. Idempotente. Con force=true baja igual aunque haya recetas que lo usen.
POST /supplies/{id}/activateReactivación. Idempotente.
GET /supplies/{id}/stockStock disponible, total y por depósito.
POST /supplies/{id}/stock/adjustmentsIngreso o egreso manual, relativo al stock actual. Ver más abajo.
POST /supplies/{id}/stock/countsControl de stock por conteo físico, un valor absoluto. Ver más abajo.
GET /supplies/{id}/convertible-unitsLas unidades en las que se puede mandar una cantidad de este insumo.
GET /supplies/{id}/batchesLotes externos: qué números de lote entraron y dónde se usaron. Solo lectura.
GET /supplies/projectionStock proyectado día por día. supplyTypeId obligatorio.

Some supplies belong to the system, not to youAlgunos insumos son del sistema, no suyos

The listing includes supplies that ship with the application and are shared by every account. You can use them — buy them, put them in a recipe — but you cannot change them: editing one would affect every other brewery. shared tells you which is which, and any write against one is rejected with a plain message.

El listado incluye insumos que vienen con la aplicación y son compartidos por todas las cuentas. Los puede usar —comprarlos, ponerlos en una receta— pero no modificar: editar uno afectaría a todas las demás cervecerías. shared le dice cuál es cuál, y cualquier escritura sobre uno se rechaza con un mensaje claro.

If your account is set up to use only its own supplies, the shared ones do not appear at all — neither here nor in the supplyId of a purchase.

Si su cuenta está configurada para usar solo insumos propios, los compartidos no aparecen en absoluto: ni acá ni en el supplyId de una compra.

The unit is the anchor of everything elseLa unidad es el ancla de todo lo demás

unitId is the unit the stock is counted in, and every purchase and every recipe converts to it. A quantity can only be sent in a unit that converts — kilos and grams do, litres and kilos do not — so read GET /api/v1/supplies/{id}/convertible-units before sending anything other than the base unit. That endpoint is narrower than /units on purpose.

unitId es la unidad en la que se cuenta el stock, y toda compra y toda receta se convierten a ella. Una cantidad solo se puede mandar en una unidad que convierta —kilos y gramos sí, litros y kilos no—, así que lea GET /api/v1/supplies/{id}/convertible-units antes de mandar algo distinto de la unidad base. Ese endpoint es más acotado que /units a propósito.

Manual adjustments and physical counts: delta vs. absoluteAjustes manuales y conteo físico: delta vs. absoluto

POST /supplies/{id}/stock/adjustments moves stock relative to what it is now: the sign of quantity decides the direction — positive enters, negative takes out. It is the manual counterpart of a purchase line that stocks a supply. POST /supplies/{id}/stock/counts instead replaces stock with the quantity you actually counted — an absolute value, never a delta — and is the counterpart of the application's physical stock count screen. They are two endpoints and not one with a mode flag on purpose: the fields that make sense for an adjustment (why you moved it) do not make sense for a count (what you found), and mixing them would let a request carry a field the other branch silently ignores.

POST /supplies/{id}/stock/adjustments mueve el stock relativo al que tiene ahora: el signo de quantity decide la dirección — positivo ingresa, negativo egresa. Es el equivalente manual de una línea de compra que ingresa un insumo. POST /supplies/{id}/stock/counts en cambio reemplaza el stock por la cantidad que efectivamente contó: un valor absoluto, nunca un delta, y es el equivalente de la pantalla de control de stock de la aplicación. Son dos endpoints y no uno con un flag mode a propósito: los campos que tienen sentido en un ajuste (por qué se movió) no tienen sentido en un conteo (qué se encontró), y mezclarlos dejaría que un request llevara un campo que la otra rama ignora en silencio.

Both take an optional unitId (defaults to the supply's own unit — see GET /supplies/{id}/convertible-units), an optional supplyWarehouseId (leave it out unless your account uses several supply warehouses), an optional movementDate in ISO 8601 (defaults to now), and an optional free-text note. Both answer with the supply's updated stock, the same shape as GET /supplies/{id}/stock. Neither answers 201: they are actions on an existing resource, not the creation of one with a GET of its own — same criterion as /products/{id}/stock/pack.

Los dos reciben un unitId opcional (por defecto, la unidad propia del insumo — ver GET /supplies/{id}/convertible-units), un supplyWarehouseId opcional (omítalo salvo que su cuenta use varios depósitos de insumos), una movementDate opcional en ISO 8601 (por defecto, ahora) y una note de texto libre opcional. Los dos responden con el stock actualizado del insumo, la misma forma que GET /supplies/{id}/stock. Ninguno responde 201: son acciones sobre un recurso existente, no el alta de uno con su propio GET — mismo criterio que /products/{id}/stock/pack.

⚠️ Both are rejected if movementDate is more than 30 days in the past, if the resulting quantity or stock would leave your account's supported range, or — when your account blocks negative stock — if it would take the supply below zero. The same 30-day limit applies to the application's own physical stock count screen and, since this checkpoint, to the bulk stock import from Excel as well.

⚠️ Los dos se rechazan si movementDate es más de 30 días en el pasado, si la cantidad o el stock resultante saldrían del rango que admite su cuenta, o —cuando su cuenta bloquea el stock negativo— si dejaría al insumo por debajo de cero. El mismo límite de 30 días aplica a la pantalla de control de stock de la aplicación y, desde este checkpoint, también a la importación masiva de stock por Excel.

Validation rulesReglas de validación

  • name is required and must not match another of your supplies.
  • supplyTypeId is required on create: there is no sensible default, and without it the supply would be saved pointing at nothing.
  • A supply of kind packaging must use the "unit" unit. Anything else is rejected.
  • Once the supply has stock movements, its name and unitId are frozen: the movements already recorded are expressed in that unit and under that name.
  • supplyTypeId is frozen too once there is stock, and it can never move to or from the kinds that have their own flow — packaging, kegging and yeast — with stock or without.
  • Deactivation is rejected while the supply is a related input of a product, and — unless you pass force=true — while any recipe still uses it. The message names them.
  • A supply that belongs to the system cannot be modified, deactivated or reactivated.
  • name es obligatorio y no puede coincidir con el de otro de sus insumos.
  • supplyTypeId es obligatorio en el alta: no hay default razonable, y sin él el insumo quedaría guardado apuntando a nada.
  • Un insumo de tipo envasado tiene que usar la unidad "unidad". Cualquier otra se rechaza.
  • Una vez que el insumo tiene movimientos de stock, su name y su unitId quedan congelados: los movimientos ya registrados están expresados en esa unidad y con ese nombre.
  • supplyTypeId también queda congelado si hay stock, y nunca puede pasar hacia/desde los tipos que tienen flujo propio —envasado, embarrilado y levadura—, con stock o sin stock.
  • La baja se rechaza si el insumo es insumo relacionado de un producto y —salvo que mande force=true— si alguna receta lo usa. El mensaje los nombra.
  • Un insumo del sistema no se puede modificar, ni dar de baja, ni reactivar.

External lots are read-only, and whyLos lotes externos son de solo lectura, y por qué

A lot number is recorded by buying the supply: send it in the externalLots field of a line of POST /api/v1/purchases. It is consumed by brewing a batch or running a packaging job. There is no separate way to create one — not in the API and not in the application — so /supplies/{id}/batches is the traceability view: which lots came in, on which purchase, and which batches and packaging runs used them.

Un número de lote se registra comprando el insumo: se manda en el campo externalLots de una línea de POST /api/v1/purchases. Se consume al cocinar un lote o al envasar. No hay otra forma de crear uno —ni por API ni en la aplicación—, así que /supplies/{id}/batches es la vista de trazabilidad: qué lotes entraron, en qué compra, y qué lotes de producción y envasados los usaron.

The projection, and its one catchLa proyección, y su única trampa

It starts today, takes current stock, subtracts what the planned batches will use on the day each is due to be brewed, and adds what is due to arrive on purchase orders. A negative value means the plan would run that supply out on that day. How many days it covers comes from your configuration.

Arranca hoy, toma el stock actual, resta lo que van a usar los lotes planificados el día en que se cocinan, y suma lo que está por llegar en órdenes de compra. Un valor negativo significa que el plan dejaría ese insumo en cero ese día. Cuántos días cubre sale de su configuración.

⚠ Every series comes back in the same unit — the one in unitId, which is the unit of the first supply of the list. That is what the application does, and it means a supply counted in litres appears converted when the first one is counted in kilos. Read unitId before reading the numbers. This is also the most expensive read published: it walks the planned batches, their recipes and the open purchase orders. Do not poll it.

⚠ Todas las series vienen en la misma unidad: la de unitId, que es la del primer insumo de la lista. Es lo que hace la aplicación, y significa que un insumo que se cuenta en litros aparece convertido si el primero se cuenta en kilos. Lea unitId antes de leer los números. Es además la lectura más costosa que se publica: recorre los lotes planificados, sus recetas y las órdenes de compra abiertas. No la consulte en loop.

Not in v1Fuera de v1

Stock movements of supplies — goods in, goods out, stock counts, write-offs and transfers between warehouses — and the bulk import from a spreadsheet. Stock changes today by buying (POST /purchases) and by brewing.

Los movimientos de stock de insumos —ingreso, egreso, control, desecho y movimientos entre depósitos— y la importación masiva desde planilla. Hoy el stock cambia comprando (POST /purchases) y cocinando.

WarehousesDepósitos

The places where you keep finished product, kegs and containers — plain warehouses and cold rooms alike. A supply warehouse is a different thing: see Supply warehouses.

Los lugares donde guarda producto terminado, barriles y envases — tanto depósitos comunes como cámaras de frío. Un depósito de insumos es otra cosa: vea Depósitos de insumos.

EndpointWhat it does
GET /warehousesPaged listing. search (name, code, city), page, pageSize, includeInactive. This is also the catalog of warehouseId for a purchase line. Narrowed to the warehouses your integration user is allowed to use.
GET /warehouses/{id}One warehouse, active or not. 404 if it exists but your integration user cannot use it.
POST /warehousesCreates a warehouse. Answers 201. name, code and warehouseTypeId are all required.
PUT /warehouses/{id}Partial update.
POST /warehouses/{id}/deactivateDeactivation. Idempotent. Rejects the account's main warehouse.
POST /warehouses/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /warehousesListado paginado. search (nombre, código, localidad), page, pageSize, includeInactive. Es además el catálogo de warehouseId de una línea de compra. Limitado a los depósitos que su usuario de integración puede usar.
GET /warehouses/{id}Un depósito, activo o no. 404 si existe pero su usuario de integración no puede usarlo.
POST /warehousesCrea un depósito. Responde 201. name, code y warehouseTypeId son todos obligatorios.
PUT /warehouses/{id}Actualización parcial.
POST /warehouses/{id}/deactivateBaja. Idempotente. Rechaza el depósito principal de la cuenta.
POST /warehouses/{id}/activateReactivación. Idempotente.

⚠ Narrowed to what your integration user can use⚠ Limitado a lo que su usuario de integración puede usar

If your account assigns warehouses to specific users, an integration user with assignments only sees those — both in the listing and by id. An integration user with no assignments sees every warehouse in the account, which is the normal case. This is the same set the warehouseId of a purchase line validates against: a warehouse the listing does not show is also rejected there.

Si su cuenta asigna depósitos a usuarios específicos, un usuario de integración con asignaciones solo ve esos — tanto en el listado como por id. Un usuario de integración sin asignaciones ve todos los depósitos de la cuenta, que es el caso normal. Es el mismo set contra el que se valida el warehouseId de una línea de compra: un depósito que el listado no muestra también se rechaza ahí.

Validation rulesReglas de validación

  • name, code and warehouseTypeId are required on create.
  • main is read-only: it marks the warehouse your account treats as its main one, and it is never set through the API, exactly as in the application.
  • On the main warehouse, warehouseTypeId cannot change — a cold room becoming a plain warehouse, or the other way around, changes where it shows up across the application.
  • The main warehouse cannot be deactivated.
  • latitude and longitude are the one exception to "null clears it": they are stored as numbers with 0 meaning "not set", so sending null resets them to 0.
  • Deactivating a warehouse does not move the stock recorded against it, and it permanently deletes which users were assigned to it — reactivating does not bring the assignments back. Both mirror the application.
  • name, code y warehouseTypeId son obligatorios al crear.
  • main es de solo lectura: marca el depósito que su cuenta trata como el principal, y nunca se fija por API, igual que en la aplicación.
  • En el depósito principal, warehouseTypeId no puede cambiar: que una cámara de frío pase a ser un depósito común, o al revés, cambia dónde aparece en toda la aplicación.
  • El depósito principal no se puede desactivar.
  • latitude y longitude son la única excepción a "null lo vacía": se guardan como números donde 0 significa "sin asignar", así que mandarlas en null las vuelve a 0.
  • Dar de baja un depósito no mueve el stock que tiene registrado, y elimina permanentemente los usuarios que tenía asignados: reactivarlo no los restaura. Las dos cosas son iguales a la aplicación.

Not in v1Fuera de v1

Movements between warehouses and the delivery notes they generate — that is the separate stock-movements resource. The users assigned to a warehouse. Logistics and distributor listings.

Los movimientos entre depósitos y los remitos que generan — eso es el recurso separado stock-movements. Los usuarios asignados a un depósito. Los listados de logística y distribuidora.

Supply warehousesDepósitos de insumos

EndpointWhat it does
GET /supply-warehousesPaged listing. search (name, code, city), page, pageSize, includeInactive. This is also the catalog of supplyWarehouseId.
GET /supply-warehouses/{id}One warehouse, active or not.
POST /supply-warehousesCreates a warehouse. Answers 201. name is required.
PUT /supply-warehouses/{id}Partial update.
POST /supply-warehouses/{id}/deactivateDeactivation. Idempotent.
POST /supply-warehouses/{id}/activateReactivation. Idempotent.
GET /supply-warehouses/{id}/suppliesThe supplies held there, with their stock in that warehouse.
POST /supply-warehouses/{id}/transfersTransfers one or more supplies from this warehouse (the {id}, the source) to another. Answers 201. This is the raw-material counterpart of Stock movements, as its own sub-resource — see the note there on why they are separate.
EndpointQué hace
GET /supply-warehousesListado paginado. search (nombre, código, localidad), page, pageSize, includeInactive. Es además el catálogo de supplyWarehouseId.
GET /supply-warehouses/{id}Un depósito, activo o no.
POST /supply-warehousesCrea un depósito. Responde 201. name es obligatorio.
PUT /supply-warehouses/{id}Actualización parcial.
POST /supply-warehouses/{id}/deactivateBaja. Idempotente.
POST /supply-warehouses/{id}/activateReactivación. Idempotente.
GET /supply-warehouses/{id}/suppliesLos insumos que hay ahí, con su stock en ese depósito.
POST /supply-warehouses/{id}/transfersTransfiere uno o más insumos desde este depósito (el {id}, el origen) a otro. Responde 201. Es la contraparte de materia prima de Movimientos de stock, como sub-recurso propio — ver ahí la nota de por qué son recursos separados.

⚠ The whole resource depends on a setting⚠ Todo el recurso depende de una configuración

Multiple supply warehouses are optional per brewery. Where the setting is off there is nothing to list and nowhere to put a warehouse id: the listing answers an empty page, reading one by id answers 404, and creating one is rejected. That is deliberate — a warehouse created through the API on an account without the feature would be a record nobody can see or manage from the application.

Los múltiples depósitos de insumos son opcionales por cervecería. Donde la configuración está apagada no hay nada que listar ni dónde poner un id de depósito: el listado responde una página vacía, leer uno por id responde 404, y crear uno se rechaza. Es deliberado: un depósito creado por API en una cuenta sin la funcionalidad sería un registro que nadie puede ver ni administrar desde la aplicación.

An empty listing is therefore a normal answer, not an error, and it is the same set the supplyWarehouseId of a purchase line validates against: where there are no warehouses, any id is rejected.

Un listado vacío es entonces una respuesta normal, no un error, y es el mismo set contra el que se valida el supplyWarehouseId de una línea de compra: donde no hay depósitos, cualquier id se rechaza.

Validation rulesReglas de validación

  • name is required.
  • latitude and longitude are the one exception to "null clears it": they are stored as numbers with 0 meaning "not set", so sending null resets them to 0.
  • Deactivating a warehouse does not move the stock recorded against it. That mirrors the application, which deactivates the warehouse and leaves its movements on record.
  • POST /transfers: the source ({id} in the route) must be active; the destination (toWarehouseId) is validated the same way, through the catalog. Every quantity must be positive, and each is rejected with 400 if the source does not currently hold enough — the transfer does not partially apply.
  • name es obligatorio.
  • latitude y longitude son la única excepción a "null lo vacía": se guardan como números donde 0 significa "sin asignar", así que mandarlas en null las vuelve a 0.
  • Dar de baja un depósito no mueve el stock que tiene registrado. Es lo mismo que hace la aplicación: lo desactiva y deja sus movimientos como están.
  • POST /transfers: el origen ({id} de la ruta) tiene que estar activo; el destino (toWarehouseId) se valida igual, por el catálogo. Cada quantity tiene que ser positiva, y se rechaza con 400 si el origen no tiene stock suficiente en ese momento — la transferencia no se aplica parcialmente.

Stock movementsMovimientos de stock

Transfers of product or packaging stock between two of your warehouses — the same operation as Warehouses § Not in v1. Its own resource, not a sub-resource of warehouses or products: a transfer always involves two warehouses and one or more products/containers/cases at once.

Transferencias de stock de producto o packaging entre dos de sus depósitos — la misma operación que quedó anotada en Depósitos § Fuera de v1. Es su propio recurso, no un sub-recurso de warehouses ni de products: una transferencia siempre involucra dos depósitos y uno o más productos/envases/cajas a la vez.

EndpointWhat it does
GET /stock-movementsPaged listing, most recent first. Filter with dateFrom, dateTo (ISO 8601) and warehouseId (matches either the source or the destination), plus page and pageSize. One line per product/container/case moved; lines from the same transfer share transferId.
POST /stock-movementsTransfers product or packaging stock from one warehouse to another. Answers 201 with the lines just created, sharing the same transferId. Consumes stock oldest-expiring-first (FEFO) across the whole source warehouse for each product and container/case — not a specific batch, invoice or delivery note. The stock it creates at the destination carries no batch attribution.
EndpointQué hace
GET /stock-movementsListado paginado, más reciente primero. Filtre con dateFrom, dateTo (ISO 8601) y warehouseId (coincide con origen o destino), más page y pageSize. Una línea por producto/envase/caja movido; las líneas de una misma transferencia comparten transferId.
POST /stock-movementsTransfiere stock de producto o packaging de un depósito a otro. Responde 201 con las líneas recién creadas, compartiendo el mismo transferId. Consume stock del que vence antes primero (FEFO) sobre todo el depósito de origen para cada producto y envase/caja — no un lote, factura o remito puntual. El stock que crea en el destino queda sin atribución de lote.

Not the sales reportNo es el informe de ventas

This is a new, narrow query over the delivery notes that a warehouse-to-warehouse transfer generates — not the existing stock movements report, which mixes invoice number and customer name into the same row as a warehouse movement. A delivery note from this endpoint never carries an order, an invoice number or a customer: those only exist on delivery notes tied to a sale, which this endpoint never returns.

Es una consulta nueva y acotada sobre los remitos que genera una transferencia entre depósitos — no el informe de movimientos de stock existente, que mezcla número de factura y nombre de cliente en la misma fila que un movimiento de depósito. Un remito de este endpoint nunca lleva pedido, número de factura ni cliente: eso solo existe en remitos atados a una venta, que este endpoint nunca devuelve.

Validation rulesReglas de validación

  • warehouseFromId, warehouseToId and every line's productId (plus containerId/caseId) are validated against the same catalogs a warehouse and a price list already validate against — both warehouses must be active, same as their own GET.
  • itemType is container, case or complementary; containerId is required when it is container, caseId when it is case.
  • Every line's quantity must be positive.
  • Rejected with 400 if a line's product/container/case does not currently hold enough stock in the source warehouse — the transfer does not partially apply.
  • The source and the destination may be the same warehouse: nothing currently rejects that.
  • warehouseFromId, warehouseToId y el productId de cada línea (más containerId/caseId) se validan contra los mismos catálogos que ya valida un depósito y una lista de precios — los dos depósitos tienen que estar activos, igual que su propio GET.
  • itemType es container, case o complementary; containerId es obligatorio cuando es container, caseId cuando es case.
  • El quantity de cada línea tiene que ser positivo.
  • Se rechaza con 400 si el producto/envase/caja de una línea no tiene stock suficiente en ese momento en el depósito de origen — la transferencia no se aplica parcialmente.
  • El origen y el destino pueden ser el mismo depósito: hoy nada lo rechaza.

Not in v1Fuera de v1

Kegs: a transfer that also moved kegs still shows here (and can still be created), just without its keg lines — movements between warehouses/customers aren't published yet on Kegs, only its master record. Mix packs: moving one splits stock between the pack and each of its components at once, which is not a single-line operation, so POST rejects itemType: "mixPack" (the GET can still show one, moved before this exclusion or from the application's own screen). The electronic dispatch guide (Chile): the application's own screen asks, after saving, whether to generate it; the server never does from here, that stays a web-only follow-up action. Raw materials: a transfer between raw material warehouses is a separate resource, see Raw material warehouses.

Barriles: una transferencia que también movió barriles igual aparece acá (y todavía se puede crear), solo que sin sus líneas de barril — los movimientos entre depósitos/clientes todavía no están publicados en Barriles, solo su maestro. Mix packs: moverlo reparte stock entre el pack y cada uno de sus componentes a la vez, que no es una operación de una sola línea, así que el POST rechaza itemType: "mixPack" (el GET sí puede mostrar uno, movido antes de esta exclusión o desde la pantalla de la aplicación). La guía de despacho electrónica (Chile): la pantalla de la aplicación pregunta, después de guardar, si generarla; el servidor nunca lo hace desde acá, eso queda como una acción de seguimiento solo-web. Materia prima: una transferencia entre depósitos de insumos es un recurso separado, ver Depósitos de insumos.

Stock valuationValorización de stock

How much your current finished-product stock is worth, at today's sale price — kegs, loose containers, cases, mix packs and complementary products. A computed view, not an entity with rows of its own: there is no {id}, no POST, no PUT.

Cuánto vale hoy su stock de producto terminado, al precio de venta corriente — barriles, envases sueltos, cajas, mix packs y productos complementarios. Es una vista calculada, no una entidad con filas propias: no tiene {id}, ni POST, ni PUT.

EndpointWhat it does
GET /stock-valuationThe current valuation, one line per product/format/warehouse combination with stock. Optional productId or containerId (not both) narrows it to one product or one loose container; includeZeroStock (default false) also lists formats the account sells but currently has none of. Not paginated: it returns your account's full valuation in one shot, same as the web report it's wired to.
EndpointQué hace
GET /stock-valuationLa valorización actual, una línea por combinación producto/formato/depósito con stock. productId o containerId opcionales (no los dos a la vez) la acotan a un producto o un envase suelto; includeZeroStock (por defecto false) suma también formatos que la cuenta vende pero de los que hoy no tiene stock. Sin paginar: devuelve la valorización completa de la cuenta de una sola vez, igual que el informe web del que sale.

Validation rulesReglas de validación

  • productId and containerId cannot be sent together — rejected with 400 business_rule. The underlying query filters by one entity at a time, the same restriction the web report it's wired to already has.
  • type is keg, container, case, mixPack or complementary — same vocabulary as itemType on Stock movements, plus keg (which that resource excludes on purpose).
  • A keg line is valued by liters (pricePerLiter × liters); every other line is valued by units (pricePerUnit × stock). total already carries the right one.
  • productId y containerId no se pueden mandar juntos — se rechaza con 400 business_rule. La consulta de base filtra por una sola entidad a la vez, la misma restricción que ya tiene el informe web del que sale.
  • type es keg, container, case, mixPack o complementary — el mismo vocabulario que itemType de Movimientos de stock, más keg (que ese recurso excluye a propósito).
  • Una línea keg se valoriza por litro (pricePerLiter × liters); cualquier otra se valoriza por unidad (pricePerUnit × stock). total ya trae el que corresponde.

Not in v1Fuera de v1

Valuation at production cost: this endpoint values stock at current sale price only — see Stock valuation (cost) for the cost-cascade variant. Per-warehouse / per-price-list breakdown: the web report that variant comes from generates one dynamic column per price list configured on the account, which is not a stable JSON shape — not exposed until that has its own design. Raw materials (supplies): different model — see Raw material valuation, its own resource. warehouseId: only warehouseName is available — the underlying query carries the warehouse's name, not its id.

Valorización a costo de producción: este endpoint valoriza solo a precio de venta corriente — ver Valorización de stock (costo) para la variante por cascada de costeo. Desglose por depósito/lista de precios: el informe web del que sale esa variante genera una columna dinámica por lista de precios configurada en la cuenta, que no es una forma de JSON estable — no se expone hasta que eso tenga su propio diseño. Insumos/materia prima: modelo distinto — ver Valorización de insumos, su propio recurso. warehouseId: solo hay warehouseName disponible — la consulta de base trae el nombre del depósito, no su id.

Stock valuation (cost)Valorización de stock (costo)

How much your current finished-product stock cost to make, not to sell — kegs, loose containers, cases, mix packs and complementary products, valued through the production costing cascade (lot costing first, falling back to the product's cost snapshot). Same domain as Costings (which manages the costings themselves, not this aggregated view of what stock is worth today). A computed view, not an entity with rows of its own: no {id}, no POST, no PUT.

Cuánto costó producir su stock actual de producto terminado, no cuánto vale venderlo — barriles, envases sueltos, cajas, mix packs y productos complementarios, valorizados con la cascada de costeo de producción (primero el costeo del lote, con respaldo en la foto de costo del producto). Mismo dominio que Costeos (que gestiona los costeos en sí, no esta vista agregada de cuánto vale el stock hoy). Es una vista calculada, no una entidad con filas propias: no tiene {id}, ni POST, ni PUT.

EndpointWhat it does
GET /stock-valuation-costThe current cost valuation, one line per product/format/warehouse combination with stock. Optional productId or containerId (not both) narrows it to one product or one loose container; includeZeroStock (default false) also lists formats the account sells but currently has none of. Not paginated: it returns your account's full valuation in one shot, same as the web report it's wired to.
EndpointQué hace
GET /stock-valuation-costLa valorización a costo actual, una línea por combinación producto/formato/depósito con stock. productId o containerId opcionales (no los dos a la vez) la acotan a un producto o un envase suelto; includeZeroStock (por defecto false) suma también formatos que la cuenta vende pero de los que hoy no tiene stock. Sin paginar: devuelve la valorización completa de la cuenta de una sola vez, igual que el informe web del que sale.

Validation rulesReglas de validación

  • productId and containerId cannot be sent together — rejected with 400 business_rule. The underlying query filters by one entity at a time, the same restriction the web report it's wired to already has.
  • type is keg, container, case, mixPack or complementary — same vocabulary as Stock valuation. No tank value in this version (see Not in v1, below).
  • A keg line is valued by liters (costPerLiter × liters); every other line is valued by units (costPerUnit × stock). total already carries the right one.
  • costOrigin declares which level of the costing cascade resolved the cost: lotCosting, imputedSupplies, productSnapshot, manuallySet (mix packs only, today), undetermined (cost is 0 because none could be resolved, not because it really is zero), or the two recipe-planning levels (recipeCosting, recipeCostingWithoutFixedCosts) used for cost-of-goods-sold estimates elsewhere in the system — declared here for completeness, though this endpoint's own queries never produce them.
  • preliminaryCosting is true when the lot costing behind a lotCosting line is a preliminary costing that the brewery's automatic batch costing generated on its own: supplies only, no fixed costs, so the line is worth less than it will be once the final costing is entered. It never changes costOrigin, and it is always false for breweries that do not use automatic batch costing.
  • productId y containerId no se pueden mandar juntos — se rechaza con 400 business_rule. La consulta de base filtra por una sola entidad a la vez, la misma restricción que ya tiene el informe web del que sale.
  • type es keg, container, case, mixPack o complementary — el mismo vocabulario que Valorización de stock. Sin valor tank en esta versión (ver Fuera de v1, abajo).
  • Una línea keg se valoriza por litro (costPerLiter × liters); cualquier otra se valoriza por unidad (costPerUnit × stock). total ya trae el que corresponde.
  • costOrigin declara qué nivel de la cascada de costeo resolvió el costo: lotCosting, imputedSupplies, productSnapshot, manuallySet (solo mix packs, hoy), undetermined (el costo es 0 porque no se pudo resolver ninguno, no porque realmente sea cero), o los dos niveles de costeo de receta (recipeCosting, recipeCostingWithoutFixedCosts) que se usan para estimaciones de costo de ventas en otra parte del sistema — declarados acá por completitud, aunque las consultas propias de este endpoint nunca los producen.
  • preliminaryCosting es true cuando el costeo del lote detrás de una línea lotCosting es un costeo preliminar que generó solo el autocosteo de lotes de la cervecería: solo insumos, sin costos fijos, así que la línea vale menos de lo que va a valer cuando se cargue el costeo definitivo. Nunca cambia costOrigin, y siempre es false en las cervecerías que no usan el autocosteo.

Not in v1Fuera de v1

Tanks: the query behind the web report's tank valuation (ProductoService.GetStockCosteadoTanque) returns exactly "which lot is in which tank, how many liters, at what cost" — the same data Tanks already excludes from its own contract, on purpose, as territory of batches/product-stock (undesigned). Publishing it here would route around that same exclusion through a different door; it's a candidate to add once that design lands, not before. Per-warehouse / per-price-list breakdown: same reason as Stock valuation. Raw materials (supplies): see Raw material valuation, its own resource. warehouseId: only warehouseName is available, same reason as the sale-price variant.

Tanques: la consulta detrás de la valorización de tanques del informe web (ProductoService.GetStockCosteadoTanque) devuelve exactamente "qué lote está en qué tanque, cuántos litros y a qué costo" — el mismo dato que Tanques ya excluye de su propio contrato, a propósito, por ser territorio de batches/product-stock (sin diseñar). Publicarlo acá sería sortear esa misma exclusión por otra puerta; es candidato a sumarse el día que ese diseño exista, no antes. Desglose por depósito/lista de precios: mismo motivo que Valorización de stock. Insumos/materia prima: ver Valorización de insumos, su propio recurso. warehouseId: solo hay warehouseName disponible, mismo motivo que la variante a precio de venta.

Raw material valuationValorización de insumos

How much your current raw material (supply) stock is worth. Sister of Stock valuation/Stock valuation (cost) (same pattern: no screen of its own, ReportsController off, wired directly to the tested service method behind the web report). A computed view, not an entity with rows of its own: no {id}, no POST, no PUT.

Cuánto vale su stock actual de insumos. Hermana de Valorización de stock/Valorización de stock (costo) (mismo patrón: sin pantalla propia, ReportsController apagado, wireado directo al método de servicio probado detrás del informe web). Es una vista calculada, no una entidad con filas propias: no tiene {id}, ni POST, ni PUT.

EndpointWhat it does
GET /raw-material-valuationThe current valuation, one line per supply with stock. Optional supplyId narrows it to one supply; asOf (yyyy-MM-dd, defaults to now) sets the valuation cutoff date; includeVat (default false) applies VAT to both cost figures. Not paginated: returns your account's full raw material stock in one shot, same as the web report it's wired to.
EndpointQué hace
GET /raw-material-valuationLa valorización actual, una línea por insumo con stock. supplyId opcional la acota a un insumo; asOf (yyyy-MM-dd, por defecto ahora) fija la fecha de corte; includeVat (por defecto false) aplica IVA a ambos costos. Sin paginar: devuelve el stock de insumos completo de la cuenta de una sola vez, igual que el informe web del que sale.

Validation rulesReglas de validación

  • There are two valuations per line, not one: costPerUnitLastPurchase (cost of the last purchase with a cost on record) and costPerUnitWeightedAverage (weighted average over the last 3 purchases). The web report this comes from never collapses them into one number — even though an account-level setting exists that picks one on a different screen — so neither does this endpoint: both are always returned.
  • costPerUnitLastPurchase falls back to manualCost when there is no purchase with a cost on record — same fallback the web report itself applies to this column. costPerUnitWeightedAverage does not get that fallback, same as the report.
  • totalLastPurchase/totalWeightedAverage are already computed server-side (stock × costPerUnit...).
  • manualCost is exposed on its own (unitCost of GET /supplies/{id}) so you can tell whether the fallback above happened.
  • costDate is when the cost behind costPerUnitLastPurchase was recorded — not the same as asOf, which is the cutoff you asked for.
  • Hay dos valorizaciones por línea, no una: costPerUnitLastPurchase (costo de la última compra con costo cargado) y costPerUnitWeightedAverage (precio ponderado de las últimas 3 compras). El informe web del que sale este dato nunca las colapsa en un solo número — aunque existe una configuración de cuenta que elige una en otra pantalla — así que este endpoint tampoco: siempre devuelve las dos.
  • costPerUnitLastPurchase recurre a manualCost cuando no hay ninguna compra con costo cargado — mismo respaldo que aplica el informe web a esta misma columna. costPerUnitWeightedAverage no tiene ese respaldo, igual que el informe.
  • totalLastPurchase/totalWeightedAverage ya vienen calculados del lado del servidor (stock × costPerUnit...).
  • manualCost se expone aparte (unitCost de GET /supplies/{id}) para poder saber si el respaldo de arriba ocurrió.
  • costDate es cuándo se registró el costo detrás de costPerUnitLastPurchase — no es lo mismo que asOf, que es el corte que usted pidió.

KegsBarriles

The master record of a keg — its code, capacity, connector, kind, where it's stored, and who currently has it — plus its movement history, transfers between two of your customers, releasing a reservation, stock in/out, loans and returns, and cleaning.

El maestro de un barril — su código, capacidad, conector, tipo, dónde está guardado y quién lo tiene ahora — más su historial de movimientos, traslados entre dos de sus clientes, la liberación de una reserva, ingreso/egreso de stock, préstamo y devolución, y limpieza.

EndpointWhat it does
GET /kegsPaged listing. search (code, serial number, supplier code), customerId, page, pageSize, includeInactive.
GET /kegs/{id}One keg, active or not.
GET /kegs/{id}/movementsThe keg's movement history: fills, empties, cleanings, transfers and more. includeInactive also includes movements later reverted.
POST /kegsCreates a keg. Answers 201. code and liters are required; kegTypeId defaults to DIN when omitted.
PUT /kegs/{id}Partial update. liters is rejected if the keg holds product or is at a customer.
POST /kegs/{id}/deactivateDeactivation. Idempotent.
POST /kegs/{id}/activateReactivation. Idempotent. Rejected with 400 on a starter-plan account over 100 active kegs.
POST /kegs/transfersTransfers one or more kegs, currently at a customer, to another of your customers. All must share the same source customer and point of sale. Requires the account's keg-transfer-between-customers feature.
POST /kegs/{id}/release-reservationReleases a keg set aside for an order, without moving it. Rejected if it isn't reserved for that order.
POST /kegs/{id}/emptyEmpties a keg: records its product left it, clears its contents. Always empties the whole keg; never credits liters back to any batch/tank.
POST /kegs/{id}/discardDiscards the product in a keg — a write-off, not a normal emptying.
POST /kegs/{id}/returnA customer returning a keg to you, full or empty. No electronic step, no current-account entries — see Not in v1.
POST /kegs/returns-to-supplierReturns one or more kegs to a supplier. No confirmation email step.
POST /kegs/cleanMarks one or more kegs clean, ready to be filled again. Each must currently be marked dirty. Optionally records supplies consumed (detergent, sanitizer) in the same call.
POST /kegs/undo-cleanUndoes the most recent cleaning of one or more kegs. No-op for a keg with no cleaning movement to undo.
EndpointQué hace
GET /kegsListado paginado. search (código, número de serie, código de proveedor), customerId, page, pageSize, includeInactive.
GET /kegs/{id}Un barril, activo o no.
GET /kegs/{id}/movementsEl historial de movimientos del barril: ingresos, egresos, limpiezas, traslados y más. includeInactive incluye también movimientos deshechos después.
POST /kegsCrea un barril. Responde 201. code y liters son obligatorios; kegTypeId por defecto es DIN si se omite.
PUT /kegs/{id}Actualización parcial. liters se rechaza si el barril tiene producto o está en un cliente.
POST /kegs/{id}/deactivateBaja. Idempotente.
POST /kegs/{id}/activateReactivación. Idempotente. Se rechaza con 400 en una cuenta plan starter que supere 100 barriles activos.
POST /kegs/transfersTransfiere uno o más barriles, hoy en un cliente, a otro de sus clientes. Todos tienen que compartir el mismo cliente y punto de venta de origen. Requiere la funcionalidad de traslado de barriles entre clientes de la cuenta.
POST /kegs/{id}/release-reservationLibera un barril reservado para un pedido, sin moverlo. Se rechaza si no está reservado para ese pedido.
POST /kegs/{id}/emptyVacía un barril: registra que su producto salió, limpia su contenido. Siempre vacía el barril entero; nunca acredita litros a ningún lote/tanque.
POST /kegs/{id}/discardDescarta el producto de un barril — un castigo de stock, no un vaciado normal.
POST /kegs/{id}/returnUn cliente devolviéndole un barril, lleno o vacío. Sin paso electrónico, sin asientos de cuenta corriente — ver Fuera de v1.
POST /kegs/returns-to-supplierDevuelve uno o más barriles a un proveedor. Sin el paso de mail de confirmación.
POST /kegs/cleanMarca uno o más barriles como limpios, listos para volver a llenarse. Cada uno tiene que estar hoy marcado sucio. Opcionalmente registra insumos consumidos (detergente, sanitizante) en el mismo llamado.
POST /kegs/undo-cleanDeshace la limpieza más reciente de uno o más barriles. Sin efecto si el barril no tiene ningún movimiento de limpieza para deshacer.

Validation rulesReglas de validación

  • code is required, unique among your kegs, at most 50 characters, and must contain at least one letter or digit and not contain ; or ñ — same rule as the application's screen, just without its "confirm anyway" dialog: an API caller gets a straight 400 instead.
  • connector is one of G, A, S, K, D, CO, CP, U, M — a fixed set, not a catalog endpoint.
  • supplierCode is required when supplierId is set.
  • liters must be positive on create; on update it's rejected once the keg holds product or is at a customer.
  • POST /transfers: kegIds must have at least one entry; all must currently be at the same customer and point of sale. destinationCustomerLocationId, when sent, must be one of the destination customer's own points of sale.
  • POST /release-reservation: orderId must match what the keg is actually reserved for.
  • POST /empty: rejected if the keg does not currently hold product, or is reserved for an order.
  • POST /{id}/return: date is required and rejected if it's in the future, before the keg left for its current customer, before the keg was created, or more than 180 days in the past. Rejected if the keg is reserved for an order.
  • POST /returns-to-supplier: kegs must have at least one entry. Rejected if any keg is reserved for an order.
  • POST /clean: kegIds must have at least one entry, and each keg must currently be marked dirty. When supplies is sent, each line's quantity must be positive; rejected under the same conditions as POST /supplies/{id}/stock/adjustments (retroactive beyond 30 days, resulting stock out of range, or negative stock on an account that blocks it).
  • POST /undo-clean: kegIds must have at least one entry.
  • code es obligatorio, único entre sus barriles, de hasta 50 caracteres, y tiene que tener al menos una letra o dígito y no contener ; ni ñ — misma regla que la pantalla de la aplicación, solo que sin su diálogo de "confirmar igual": quien llama a la API recibe un 400 directo.
  • connector es uno de G, A, S, K, D, CO, CP, U, M — un conjunto fijo, no un endpoint de catálogo.
  • supplierCode es obligatorio cuando supplierId está presente.
  • liters tiene que ser positivo al crear; al actualizar se rechaza una vez que el barril tiene producto o está en un cliente.
  • POST /transfers: kegIds tiene que tener al menos un elemento; todos tienen que estar hoy en el mismo cliente y punto de venta. destinationCustomerLocationId, cuando se manda, tiene que ser uno de los puntos de venta del cliente destino.
  • POST /release-reservation: orderId tiene que coincidir con lo que el barril tiene reservado realmente.
  • POST /empty: se rechaza si el barril no tiene producto actualmente, o está reservado para un pedido.
  • POST /{id}/return: date es obligatorio y se rechaza si es futuro, es anterior a cuándo el barril salió hacia su cliente actual, es anterior a cuándo se dio de alta el barril, o tiene más de 180 días. Se rechaza si el barril está reservado para un pedido.
  • POST /returns-to-supplier: kegs tiene que tener al menos un elemento. Se rechaza si algún barril está reservado para un pedido.
  • POST /clean: kegIds tiene que tener al menos un elemento, y cada barril tiene que estar hoy marcado sucio. Cuando se manda supplies, la quantity de cada línea tiene que ser positiva; se rechaza bajo las mismas condiciones que POST /supplies/{id}/stock/adjustments (retroactividad de más de 30 días, stock resultante fuera de rango, o stock negativo en una cuenta que lo bloquea).
  • POST /undo-clean: kegIds tiene que tener al menos un elemento.

Not in v1Fuera de v1

Filling an empty keg from a batch/tank: that is packaging in reverse, the same structural exclusion that keeps envasado out of the whole API. Delivering a keg directly to a customer without an order: it books stock leaving your account tied to a customer with no order or delivery note behind it, and whether that belongs in v1 is an open product question — it's why /transfers only moves kegs already at a customer to another one of your customers, never from your own stock straight to a first delivery. Kegging content between kegs (there's no /rack or similar endpoint). Undoing a return: reversing everything a return may have triggered downstream turned out to have many edge cases, and needs its own dedicated pass. Charging or crediting a return against an order's current-account balance: the application's own screen can, this API never does — a return here is always just the keg's own movement. The supplier-return confirmation email: same exclusion as the electronic dispatch guide of Stock movements. Transfers between your own warehouses (as opposed to between customers) aren't published either. The "traffic light" thresholds that color a keg by how long it's been at a customer (SetSemaforo/SetSemaforoDistribuidora) are account-wide display settings, not keg data — they fall under the not-yet-designed settings resource, not this one.

Llenar un barril vacío desde un lote/tanque: eso es envasado a la inversa, la misma exclusión estructural que deja el envasado fuera de toda la API. Entregar un barril directo a un cliente sin pedido: registra una salida de stock de la cuenta atada a un cliente sin ningún pedido o remito detrás, y si eso entra en v1 es una pregunta de producto abierta — por eso /transfers solo mueve barriles que YA están en un cliente hacia otro de sus clientes, nunca desde su propio stock directo a una primera entrega. Trasvasar contenido entre barriles (no hay un endpoint /rack ni similar). Deshacer una devolución: revertir todo lo que una devolución pudo haber disparado después resultó tener muchos casos borde, y necesita su propia pasada dedicada. Cobrar o acreditar una devolución contra el saldo de cuenta corriente de un pedido: la pantalla de la aplicación puede, esta API nunca lo hace — una devolución acá es siempre solo el movimiento del barril. El mail de confirmación de la devolución a proveedor: misma exclusión que la guía de despacho electrónica de Movimientos de stock. Traslados entre sus propios depósitos (a diferencia de entre clientes) tampoco están publicados. Los umbrales de "semáforo" que colorean un barril según cuánto hace que está en un cliente (SetSemaforo/SetSemaforoDistribuidora) son configuración de cuenta para la pantalla, no datos del barril — caen dentro del recurso settings, todavía sin diseñar, no en este.

Tap systemsChoperas

The master record of a tap system (dispenser) — its code, connector, kind, brand, net value, useful life and notes — plus delivering one to a customer, its return, and the delivery note (remito) history.

El maestro de un sistema de tiraje (chopera) — su código, conector, tipo, marca, valor neto, vida útil y notas — más la entrega a un cliente, su devolución, y el historial de remitos.

EndpointWhat it does
GET /tap-systemsPaged listing. search (code or name), page, pageSize, includeInactive.
GET /tap-systems/{id}One tap system, active or not.
POST /tap-systemsCreates a tap system. Answers 201. code is required.
PUT /tap-systems/{id}Partial update.
POST /tap-systems/{id}/deactivateDeactivation. Idempotent.
POST /tap-systems/{id}/activateReactivation. Idempotent.
POST /tap-systems/deliveriesDelivers one or more tap systems to a customer, for the first time. Only tap systems — never the other kind of asset the application lets you mix into the same delivery.
GET /tap-systems/deliveriesPaged listing of delivery notes. customerId, page, pageSize, includeInactive (also returns voided ones). Lines aren't included — get one by id for those.
GET /tap-systems/deliveries/{id}One delivery note, with its lines.
POST /tap-systems/deliveries/{id}/voidVoids a delivery note: reverts every tap system on it as if it were never delivered. Idempotent.
POST /tap-systems/returnsA customer returning one or more tap systems. Rejected if a tap system isn't currently at a customer.
EndpointQué hace
GET /tap-systemsListado paginado. search (código o nombre), page, pageSize, includeInactive.
GET /tap-systems/{id}Un sistema de tiraje, activo o no.
POST /tap-systemsCrea un sistema de tiraje. Responde 201. code es obligatorio.
PUT /tap-systems/{id}Actualización parcial.
POST /tap-systems/{id}/deactivateBaja. Idempotente.
POST /tap-systems/{id}/activateReactivación. Idempotente.
POST /tap-systems/deliveriesEntrega uno o más sistemas de tiraje a un cliente, por primera vez. Solo sistemas de tiraje — nunca el otro tipo de activo que la aplicación deja mezclar en la misma entrega.
GET /tap-systems/deliveriesListado paginado de remitos. customerId, page, pageSize, includeInactive (también devuelve los anulados). No incluye las líneas — pedir uno por id para eso.
GET /tap-systems/deliveries/{id}Un remito, con sus líneas.
POST /tap-systems/deliveries/{id}/voidAnula un remito: revierte cada sistema de tiraje como si nunca se hubiera entregado. Idempotente.
POST /tap-systems/returnsUn cliente devolviendo uno o más sistemas de tiraje. Se rechaza si algún sistema de tiraje no está hoy en un cliente.

Validation rulesReglas de validación

  • code is required on create, and unique among your tap systems.
  • connector is one of G, A, S, D, CO — a fixed set, not a catalog endpoint. D and CO are only valid on non-Argentina accounts.
  • usefulLife, when sent, must be ISO 8601.
  • POST /deliveries: tapSystemIds must have at least one entry and no duplicates. date is required and must be ISO 8601. Rejected if a tap system is currently at a customer. customerLocationId, when sent, must be one of the customer's own points of sale.
  • POST /returns: tapSystemIds must have at least one entry and no duplicates. Rejected if any tap system isn't currently at a customer.
  • code es obligatorio al crear, y único entre sus sistemas de tiraje.
  • connector es uno de G, A, S, D, CO — un conjunto fijo, no un endpoint de catálogo. D y CO solo son válidos en cuentas fuera de Argentina.
  • usefulLife, cuando se manda, tiene que ser ISO 8601.
  • POST /deliveries: tapSystemIds tiene que tener al menos un elemento y sin duplicados. date es obligatorio y tiene que ser ISO 8601. Se rechaza si algún sistema de tiraje ya está en un cliente. customerLocationId, cuando se manda, tiene que ser uno de los puntos de venta del cliente.
  • POST /returns: tapSystemIds tiene que tener al menos un elemento y sin duplicados. Se rechaza si algún sistema de tiraje no está hoy en un cliente.

Not in v1Fuera de v1

This resource is only the rows of the underlying table marked as an actual tap system — the same table also holds a different kind of asset, published separately as brewery-assets. POST /deliveries and /returns only accept tap systems, never that other asset type, even though the application's own screen lets you mix both in the same delivery or return — same reason a voided delivery note's lines only ever show the tap systems on it. A delivery tied to an order (CrearEntregaParaPedido) is excluded permanently — same E1 exclusion as orders everywhere else in this API. QR/tracking-code helpers for the barcode-scanning screens aren't published — same idiom already excluded for Kegs.

Este recurso es solo las filas de la tabla de base que son efectivamente un sistema de tiraje — la misma tabla guarda también otro tipo de activo, publicado aparte como brewery-assets. POST /deliveries y /returns solo aceptan sistemas de tiraje, nunca ese otro tipo de activo, aunque la pantalla de la aplicación deje mezclar los dos en la misma entrega o devolución — mismo motivo por el que las líneas de un remito anulado solo muestran los sistemas de tiraje que tenía. Una entrega atada a un pedido (CrearEntregaParaPedido) queda excluida permanentemente — misma exclusión E1 que pedidos en el resto de esta API. Los helpers de código QR/seguimiento para las pantallas de escaneo no están publicados — mismo idiom ya excluido para Barriles.

Brewery assetsActivos de cervecería

The master record of a brewery asset — reusable equipment other than a tap system, tracked the same way: code, name, address, phone, brand, net value, useful life and notes — plus delivering one to a customer, its return, and the delivery note (remito) history. Shares its underlying table and delivery mechanism with Tap systems, filtered to the other kind.

El maestro de un activo de cervecería — equipamiento reutilizable que no es un sistema de tiraje, trackeado igual: código, nombre, dirección, teléfono, marca, valor neto, vida útil y notas — más la entrega a un cliente, su devolución, y el historial de remitos. Comparte tabla y mecanismo de entrega con Choperas, filtrado al otro tipo.

EndpointWhat it does
GET /brewery-assetsPaged listing. search (code or name), customerId, page, pageSize, includeInactive.
GET /brewery-assets/{id}One brewery asset, active or not.
POST /brewery-assetsCreates a brewery asset. Answers 201. code is required.
PUT /brewery-assets/{id}Partial update.
POST /brewery-assets/{id}/deactivateDeactivation. Idempotent.
POST /brewery-assets/{id}/activateReactivation. Idempotent.
POST /brewery-assets/deliveriesDelivers one or more brewery assets to a customer, for the first time. Only this kind of asset — never tap systems or the complementary products the application lets you mix into the same delivery.
GET /brewery-assets/deliveriesPaged listing of delivery notes. customerId, page, pageSize, includeInactive (also returns voided ones). Lines aren't included — get one by id for those.
GET /brewery-assets/deliveries/{id}One delivery note, with its lines.
POST /brewery-assets/deliveries/{id}/voidVoids a delivery note: reverts every brewery asset on it as if it were never delivered. Idempotent.
POST /brewery-assets/returnsA customer returning one or more brewery assets. Rejected if an asset isn't currently at a customer.
EndpointQué hace
GET /brewery-assetsListado paginado. search (código o nombre), customerId, page, pageSize, includeInactive.
GET /brewery-assets/{id}Un activo, activo o no.
POST /brewery-assetsCrea un activo. Responde 201. code es obligatorio.
PUT /brewery-assets/{id}Actualización parcial.
POST /brewery-assets/{id}/deactivateBaja. Idempotente.
POST /brewery-assets/{id}/activateReactivación. Idempotente.
POST /brewery-assets/deliveriesEntrega uno o más activos de cerveceria a un cliente, por primera vez. Solo este tipo de activo — nunca sistemas de tiraje ni los productos complementarios que la aplicación deja mezclar en la misma entrega.
GET /brewery-assets/deliveriesListado paginado de remitos. customerId, page, pageSize, includeInactive (también devuelve los anulados). No incluye las líneas — pedir uno por id para eso.
GET /brewery-assets/deliveries/{id}Un remito, con sus líneas.
POST /brewery-assets/deliveries/{id}/voidAnula un remito: revierte cada activo como si nunca se hubiera entregado. Idempotente.
POST /brewery-assets/returnsUn cliente devolviendo uno o más activos de cerveceria. Se rechaza si algún activo no está hoy en un cliente.

Validation rulesReglas de validación

  • code is required on create, and unique among your brewery assets (shares the uniqueness check with tap-systems: the same code can't be used by either).
  • usefulLife, when sent, must be ISO 8601.
  • POST /deliveries: assetIds must have at least one entry and no duplicates. date is required and must be ISO 8601. Rejected if an asset is currently at a customer. customerLocationId, when sent, must be one of the customer's own points of sale.
  • POST /returns: assetIds must have at least one entry and no duplicates. Rejected if any asset isn't currently at a customer.
  • code es obligatorio al crear, y único entre sus activos de cerveceria (comparte el chequeo de unicidad con tap-systems: el mismo código no lo puede usar ninguno de los dos).
  • usefulLife, cuando se manda, tiene que ser ISO 8601.
  • POST /deliveries: assetIds tiene que tener al menos un elemento y sin duplicados. date es obligatorio y tiene que ser ISO 8601. Se rechaza si algún activo ya está en un cliente. customerLocationId, cuando se manda, tiene que ser uno de los puntos de venta del cliente.
  • POST /returns: assetIds tiene que tener al menos un elemento y sin duplicados. Se rechaza si algún activo no está hoy en un cliente.

Not in v1Fuera de v1

This resource is only the rows of the underlying table NOT marked as a tap system — see Tap systems for the other kind, and why both share the same table and delivery mechanism. connector, tapSystemTypeId and fullWithCo2 aren't in this DTO: they're tap-system-specific, and the application always clears them server-side for this kind of row. Complementary products (CO2 canisters, accessories) aren't this resource at all — they're a different underlying model (a product, not a coded asset); their stock is already readable at GET /products/{id}/stock (kind "complementary"), and delivering or returning them to a customer is a stock movement with no order behind it — the same open E1 question that already blocks Trasvasar/EgresoConCliente in Kegs, not a new one.

Este recurso es solo las filas de la tabla de base que NO son un sistema de tiraje — ver Choperas para el otro tipo, y por qué los dos comparten tabla y mecanismo de entrega. connector, tapSystemTypeId y fullWithCo2 no están en este DTO: son específicos de sistemas de tiraje, y la aplicación siempre los limpia server-side para este tipo de fila. Los productos complementarios (tubos de CO2, accesorios) no son este recurso en absoluto — son otro modelo de base (un producto, no un activo con código); su stock ya se puede leer en GET /products/{id}/stock (kind "complementary"), y entregarlos o devolverlos a un cliente es un movimiento de stock sin ningún pedido detrás — la misma pregunta abierta de E1 que ya bloquea Trasvasar/EgresoConCliente en Barriles, no una nueva.

TanksTanques

The master record of a tank: name, kind, wood (for a barrel), capacity, and its current status. GET /tanks is also the catalog of the tankId field of a batch or a task.

El maestro de un tanque: nombre, tipo, madera (para una barrica), capacidad, y su estado actual. GET /tanks es además el catálogo del campo tankId de un lote o una tarea.

EndpointWhat it does
GET /tanksPaged listing. search (name), page, pageSize, includeInactive.
GET /tanks/{id}One tank, active or not.
POST /tanksCreates a tank. Answers 201. name and tankTypeId are required.
PUT /tanks/{id}Partial update.
POST /tanks/{id}/deactivateDeactivation. Idempotent.
POST /tanks/{id}/activateReactivation. Idempotent.
EndpointQué hace
GET /tanksListado paginado. search (nombre), page, pageSize, includeInactive.
GET /tanks/{id}Un tanque, activo o no.
POST /tanksCrea un tanque. Responde 201. name y tankTypeId son obligatorios.
PUT /tanks/{id}Actualización parcial.
POST /tanks/{id}/deactivateBaja. Idempotente.
POST /tanks/{id}/activateReactivación. Idempotente.

Validation rulesReglas de validación

  • name is required, and unique among your tanks — active or not: you cannot reuse the name of a deactivated tank until it is renamed or reactivated.
  • tankTypeId is required on create; there is no sensible default.
  • Neither liters nor tankTypeId can change, and the tank cannot be deactivated, while it is assigned to a batch that has not finished.
  • name es obligatorio, y único entre sus tanques — activo o no: no puede reusar el nombre de un tanque desactivado hasta que se renombre o se reactive.
  • tankTypeId es obligatorio al crear; no hay un valor por defecto razonable.
  • Ni liters ni tankTypeId se pueden cambiar, y el tanque no se puede dar de baja, mientras esté asignado a un lote no finalizado.

Read-only fieldsCampos de solo lectura

status is one of empty, withContent, dirty, underMaintenance, cleaning, reserved. It is never set by this resource: moving a batch through its stages changes it automatically, and the rest is the (unpublished) maintenance module. A brand-new tank always starts empty.

status es uno de empty, withContent, dirty, underMaintenance, cleaning, reserved. Nunca lo escribe este recurso: mover un lote por sus etapas lo cambia automáticamente, y el resto es el módulo de mantenimiento (sin publicar). Un tanque recién creado siempre arranca empty.

Not in v1Fuera de v1

Moving a batch's content from one tank to another without changing its stage is an operation of a batch, not of this resource — not published yet, same as the rest of what batches does not cover. What a tank currently holds (which batch, how much) is not published either — same open gap already noted for kegs' tank-held bulk beer. Tank reservations for planned batches, the scheduling (Gantt) view, and pairing a tank with a Waisens hardware sensor are all excluded — the last one is a third-party hardware integration behind an account feature flag, with no catalog or business semantics of its own.

Mover el contenido de un lote de un tanque a otro sin cambiar de etapa es una operación de un lote, no de este recurso — todavía no publicada, igual que el resto de lo que lotes no cubre. Qué tiene hoy un tanque (qué lote, cuánto) tampoco está publicado — mismo hueco ya señalado para la cerveza a granel de barriles. Las reservas de tanque para lotes planificados, la vista de programación (Gantt), y emparejar un tanque con un sensor Waisens quedan afuera — esto último es una integración de hardware de terceros detrás de un feature flag de cuenta, sin catálogo ni semántica de negocio propia.

Batches, tasks and measurementsLotes, tareas y mediciones

EndpointWhat it does
GET /batchesLists your batches, newest first. Filter with search, stageId or unfinishedOnly. Tasks are not included.
GET /batches/{id}One batch, active or not.
POST /batchesCreates a batch. Answers 201. number and productId are required; the number must not match another active batch.
PUT /batches/{id}Partial update. Does not change the stage.
POST /batches/{id}/stageMoves the batch to another stage. This is the call that advances production. Send discountsStock: true when entering the brewing stage to discount the recipe's supplies.
GET /batches/{id}/suppliesWhat the batch consumed, one line per movement, with the supplier's own lot numbers. Not paginated.
POST /batches/{id}/deactivateDeactivates the batch, reversing what it put into stock and freeing its tank.
POST /batches/{id}/activateReactivates it.
GET /batches/{id}/tasksThe tasks of the batch, due day first. Not paginated.
POST /batches/{id}/tasks/{taskId}/completeMarks one task done, optionally recording a measurement.
POST /batches/{id}/tasks/{taskId}/reopenUndoes the completion.
GET /batches/{id}/measurementsThe measurements recorded on the batch, most recent first. Includes the ones recorded when completing a task.
GET /batches/{id}/measurements/{measurementId}One measurement, active or not.
POST /batches/{id}/measurementsRecords a measurement directly, without completing a task. measurementTypeId and value are required. Answers 201.
POST /batches/{id}/measurements/{measurementId}/deactivateDeactivates it. There is no PUT — to correct a measurement, deactivate it and record a new one.
GET /batches/{id}/extended-notesLong free-form HTML content. Empty (content: null) if none were ever saved.
PUT /batches/{id}/extended-notesSaves it. content absent leaves it unchanged; sent as null clears it.
GET /tasksLists standalone tasks. Filter with from, to and completed.
POST /tasksCreates a standalone task. taskDefinitionId and dueDate are required.
PUT /tasks/{id}Partial update.
POST /tasks/{id}/completeMarks it done. Who and when come from your token and the server clock.
POST /tasks/{id}/deactivateDeactivates it.
GET /task-definitionsLists the reusable task templates, yours and the shared ones.
POST /task-definitionsCreates one. name is required and must be unique among your active definitions.
PUT /task-definitions/{id}Partial update. A shared definition cannot be modified.
GET /measurementsLists standalone measurements — not tied to any batch — most recent first.
GET /measurements/{id}One standalone measurement, active or not.
POST /measurementsRecords one. measurementTypeId and value are required. Answers 201.
POST /measurements/{id}/deactivateDeactivates it.
GET /batches/{id}/wasteThe production losses recorded on the batch, most recent first. Includes losses recorded automatically while packaging or splitting it.
GET /batches/{id}/waste/{wasteId}One waste record.
POST /batches/{id}/wasteRecords a loss. stageId, wasteTypeId, liters and recordedOn are required. Answers 201.
EndpointQué hace
GET /batchesLista sus lotes, del más nuevo al más viejo. Filtre con search, stageId o unfinishedOnly. No incluye las tareas.
GET /batches/{id}Un lote, activo o no.
POST /batchesCrea un lote. Responde 201. number y productId son obligatorios; el número no puede coincidir con el de otro lote activo.
PUT /batches/{id}Actualización parcial. No cambia la etapa.
POST /batches/{id}/stageMueve el lote a otra etapa. Es la llamada que hace avanzar la producción. Mande discountsStock: true al entrar en cocción para descontar los insumos de la receta.
GET /batches/{id}/suppliesLo que el lote consumió, una línea por movimiento, con los números de lote del proveedor. Sin paginar.
POST /batches/{id}/deactivateDa de baja el lote, revirtiendo lo que ingresó a stock y liberando su tanque.
POST /batches/{id}/activateLo reactiva.
GET /batches/{id}/tasksLas tareas del lote, por día. Sin paginar.
POST /batches/{id}/tasks/{taskId}/completeMarca una tarea como hecha, con una medición opcional.
POST /batches/{id}/tasks/{taskId}/reopenDeshace el completado.
GET /batches/{id}/measurementsLas mediciones registradas en el lote, de la más reciente a la más vieja. Incluye las que se registraron al completar una tarea.
GET /batches/{id}/measurements/{measurementId}Una medición, activa o no.
POST /batches/{id}/measurementsRegistra una medición directamente, sin completar una tarea. measurementTypeId y value son obligatorios. Responde 201.
POST /batches/{id}/measurements/{measurementId}/deactivateLa da de baja. No hay PUT: para corregir una medición, se da de baja y se carga una nueva.
GET /batches/{id}/extended-notesContenido HTML largo. Vacío (content: null) si nunca se guardó.
PUT /batches/{id}/extended-notesLo guarda. content ausente lo conserva; enviado en null lo borra.
GET /tasksLista las tareas sueltas. Filtre con from, to y completed.
POST /tasksCrea una tarea suelta. taskDefinitionId y dueDate son obligatorios.
PUT /tasks/{id}Actualización parcial.
POST /tasks/{id}/completeLa marca como hecha. Quién y cuándo salen de su token y del reloj del servidor.
POST /tasks/{id}/deactivateLa da de baja.
GET /task-definitionsLista las plantillas de tarea reutilizables, las suyas y las compartidas.
POST /task-definitionsCrea una. name es obligatorio y único entre sus definiciones activas.
PUT /task-definitions/{id}Actualización parcial. Una definición compartida no se puede modificar.
GET /measurementsLista las mediciones sin lote, de la más reciente a la más vieja.
GET /measurements/{id}Una medición sin lote, activa o no.
POST /measurementsRegistra una. measurementTypeId y value son obligatorios. Responde 201.
POST /measurements/{id}/deactivateLa da de baja.
GET /batches/{id}/wasteLas mermas registradas en el lote, de la más reciente a la más vieja. Incluye las que se registran automáticamente al envasar o dividir el lote.
GET /batches/{id}/waste/{wasteId}Una merma.
POST /batches/{id}/wasteRegistra una merma. stageId, wasteTypeId, liters y recordedOn son obligatorios. Responde 201.

Three kinds of task, and why they are two resourcesTres clases de tarea, y por qué son dos recursos

A task definition (/task-definitions) is a template: "measure gravity", "clean the tank". It is not something to be done — it is the description of something that gets done over and over. Definitions marked isShared come with the system and every account uses them; you may use them but not modify them.

A standalone task (/tasks) is one thing to be done on one date, by someone, not tied to any batch.

A batch task (/batches/{id}/tasks) is generated together with the batch, from its recipe. You do not create these one at a time, which is why that route has no POST — you complete them and you reopen them.

Una definición de tarea (/task-definitions) es una plantilla: "medir densidad", "limpiar el tanque". No es algo que haya que hacer, es la descripción de algo que se hace una y otra vez. Las definiciones marcadas isShared vienen con el sistema y las usan todas las cuentas; usted puede usarlas pero no modificarlas.

Una tarea suelta (/tasks) es una cosa que hay que hacer en una fecha, por alguien, sin lote asociado.

Una tarea de lote (/batches/{id}/tasks) se genera junto con el lote, a partir de su receta. Estas no se crean de a una, y por eso esa ruta no tiene POST: se completan y se reabren.

Advancing a batchCómo avanza un lote

The stage is not a field you set with PUT. Moving a batch records the transition in its history, moves the product's stock, and reserves or frees the tank, so it has its own call:

POST /api/v1/batches/340/stage
{ "stageId": 3, "tankId": 5 }

A batch only moves forward, with one exception the application allows: from the filtering stage it may go back. From brewing it can only go to fermentation or straight to finished. A tank is required from fermentation onwards unless your account does not manage tanks, and a tank already holding another batch is rejected naming that batch.

La etapa no es un campo que se fije con PUT. Mover un lote registra la transición en su historial, mueve el stock del producto, y reserva o libera el tanque, así que tiene su propia llamada:

POST /api/v1/batches/340/stage
{ "stageId": 3, "tankId": 5 }

Un lote solo avanza, con una excepción que la aplicación permite: desde filtrado puede volver. Desde cocción solo puede ir a fermentación o directo a finalizado. El tanque es obligatorio a partir de fermentación salvo que su cuenta no administre tanques, y un tanque que ya tiene otro lote se rechaza nombrando ese lote.

Validation rulesReglas de validación

  • number is required and must not match another active batch. This applies to reactivation too: a batch whose number has been taken cannot be brought back until one of them is renumbered.
  • liters cannot be lowered by an update. Taking litres out of a batch is done through POST /batches/{id}/waste, which keeps the loss accounted for.
  • A finished batch cannot be updated, and its tasks cannot be reopened.
  • The product cannot be changed once the batch has been brewed, unless your account enables it.
  • Only a temperature may be reported as a negative measurement — whether recorded by completing a task or with POST /batches/{id}/measurements directly. A standalone measurement (POST /measurements) has no such restriction.
  • A task assigned to another user cannot be completed unless your integration user may see everyone's tasks.
  • The due date of a standalone task cannot be in the past. Today is accepted.
  • A waste record cannot be greater than the batch's current liters, and its recordedOn cannot be later than today. The batch must have reached the brewing stage.
  • number es obligatorio y no puede coincidir con el de otro lote activo. Vale también para la reactivación: un lote cuyo número fue tomado no se puede recuperar hasta que se renumere alguno de los dos.
  • liters no se puede bajar con una actualización. Sacarle litros a un lote se hace con POST /batches/{id}/waste, que deja la pérdida imputada.
  • Un lote finalizado no se puede actualizar, y sus tareas no se pueden reabrir.
  • El producto no se puede cambiar una vez que el lote pasó por cocción, salvo que su cuenta lo habilite.
  • Solo una temperatura puede informarse como medición negativa — ya sea registrada al completar una tarea o con POST /batches/{id}/measurements directamente. Una medición sin lote (POST /measurements) no tiene esa restricción.
  • Una tarea asignada a otro usuario no se puede completar, salvo que su usuario de integración pueda ver las tareas de todos.
  • La fecha de una tarea suelta no puede estar en el pasado. Hoy sí se acepta.
  • Una merma no puede ser mayor a los litros actuales del lote, y su recordedOn no puede ser posterior a hoy. El lote tiene que haber llegado a la etapa de cocción.

Read-only fields that look writableCampos que parecen escribibles y no lo son

Three fields of a batch are reported but never written, and sending them has no effect:

  • stageId — use POST /batches/{id}/stage.
  • date — the server stamps it on create and never changes it. The date that matters to production is brewDate.
  • discountsStock — it REPORTS whether the supplies were already taken out of stock. To make it happen, send discountsStock: true on POST /batches/{id}/stage. If this one were writable, a PUT that only changed the notes could silently move stock.

Completing a task does not move stock either, even when its definition says it should: the supplies a task consumes are a different sub-resource, not published in this version.

Tres campos del lote se informan pero nunca se escriben, y mandarlos no tiene efecto:

  • stageId — use POST /batches/{id}/stage.
  • date — la fija el servidor en el alta y no la cambia nunca. La fecha que importa para producción es brewDate.
  • discountsStock — INFORMA si los insumos ya salieron de stock. Para que salgan, mande discountsStock: true en POST /batches/{id}/stage. Si este fuera escribible, un PUT que sólo cambia las notas podría mover stock sin que se note.

Completar una tarea tampoco mueve stock, aunque su definición diga que debería: los insumos que consume una tarea son otro sub-recurso, no publicado en esta versión.

Not in v1Fuera de v1

Kegging, splitting and merging batches, reusable yeast and its harvests, tank planning and reservations, and the supplies a task consumes. Each needs its own resource with its own catalogs; none of them is required to record production and move a batch through its stages. Waste groups for sales projection (a resource unrelated to the waste recorded here, despite the name) are their own resource, not published yet.

Embarrilado, división y unión de lotes, levaduras reutilizables y sus cosechas, planificación y reservas de tanque, y los insumos que consume una tarea. Cada uno necesita su propio recurso con sus catálogos; ninguno hace falta para registrar producción y hacer avanzar un lote por sus etapas. Los grupos de merma para proyección de ventas (un recurso sin relación con la merma que se registra acá, pese al nombre) son su propio recurso, todavía no publicado.

CostingsCosteos

What it cost to produce a batch or a recipe — not to be confused with stock valuation (what your on-hand stock is worth today, not published in this version). Exactly one of batchId/recipeId is required; productId is resolved from whichever one you sent.

Cuánto costó producir un lote o una receta — no confundir con la valorización de stock (cuánto vale su stock hoy, todavía no publicada). Exactamente uno de batchId/recipeId es obligatorio; productId se resuelve a partir del que haya mandado.

EndpointWhat it does
GET /costingsPaged listing, most recent first. search (name), page, pageSize, includeInactive. Detail lines are not included.
GET /costings/{id}One costing, active or not, with its detail lines.
POST /costingsCreates a costing. Answers 201. detailLines is required, with at least one entry.
PUT /costings/{id}Partial update. detailLines absent leaves the lines untouched; present (even empty) replaces every line — but empty is rejected, same rule as create.
POST /costings/{id}/deactivateDeactivation. Idempotent.
POST /costings/{id}/activateReactivation. Idempotent.
GET /costings/{id}/historyEdit history, most recent first. Each entry reports whether it can be restored (hasSnapshot).
POST /costings/{id}/restoreRestores the costing to a previous version. Body: historyId, from the history listing. Reactivates the costing if it was inactive.
POST /costings/{id}/recalculateRecalculates one costing from the batch's current state: canonical liter base, per-litre cost, and the same propagation to the product a plain save does. Only on a finished batch.
GET /costings/recalculate-countImpact of a bulk recalculation from a date (from, required): how many costings would be recalculated and how many skipped.
POST /costings/recalculateBulk recalculation from a date (from, required), oldest first. Rejects the whole batch above a fixed limit — check recalculate-count first.
EndpointQué hace
GET /costingsListado paginado, del más reciente al más viejo. search (nombre), page, pageSize, includeInactive. No incluye las líneas de detalle.
GET /costings/{id}Un costeo, activo o no, con sus líneas de detalle.
POST /costingsCrea un costeo. Responde 201. detailLines es obligatorio, con al menos un elemento.
PUT /costings/{id}Actualización parcial. detailLines ausente conserva las líneas; presente (incluso vacío) reemplaza todas — pero vacío se rechaza, misma regla que al crear.
POST /costings/{id}/deactivateBaja. Idempotente.
POST /costings/{id}/activateReactivación. Idempotente.
GET /costings/{id}/historyHistorial de ediciones, del más reciente al más viejo. Cada entrada informa si se puede restaurar (hasSnapshot).
POST /costings/{id}/restoreRestaura el costeo a una versión anterior. Body: historyId, del listado de historial. Reactiva el costeo si estaba inactivo.
POST /costings/{id}/recalculateRecalcula un costeo con el estado actual del lote: base de litros canónica, costo por litro, y la misma propagación al producto que un guardado normal. Solo lotes finalizados.
GET /costings/recalculate-countImpacto de un recálculo masivo desde una fecha (from, obligatorio): cuántos costeos se recalcularían y cuántos se saltearían.
POST /costings/recalculateRecálculo masivo desde una fecha (from, obligatorio), del más viejo al más nuevo. Rechaza toda la tanda por encima de un límite fijo — consultar antes recalculate-count.

Validation rulesReglas de validación

  • Exactly one of batchId/recipeId is required.
  • detailLines must have at least one entry — a fixed or a variable cost.
  • A costing on a batch that has not reached the finished stage is rejected unless your account enables costing unfinished batches.
  • Es obligatorio exactamente uno de batchId/recipeId.
  • detailLines tiene que tener al menos un elemento — un costo fijo o variable.
  • Un costeo sobre un lote que no llegó a la etapa finalizado se rechaza salvo que su cuenta habilite costear lotes sin finalizar.

Preliminary and confirmed costingsCosteos preliminares y confirmados

  • preliminary (read-only) is true for a costing generated by the account's automatic lot costing and not yet confirmed. It has no fixed costs and does not update the product costs.
  • confirmedAt (read-only) is the date-time when a person confirmed a preliminary costing as final, on the same costing. It is null for any other costing. A confirmed costing is final: preliminary is false.
  • The history reports the confirmation as action: "confirmed".
  • Confirming is not published in v1: the application asks for it after an informed preview with warnings, and a single call would skip that step.
  • preliminary (solo lectura) es true en un costeo que generó el autocosteo de lotes de la cuenta y que todavía no se confirmó. No tiene costos fijos y no actualiza los costos del producto.
  • confirmedAt (solo lectura) es la fecha y hora en que una persona confirmó un costeo preliminar como definitivo, sobre el mismo costeo. Es null en cualquier otro costeo. Un costeo confirmado es definitivo: preliminary es false.
  • El historial informa la confirmación como action: "confirmed".
  • La confirmación no se publica en v1: la aplicación la pide después de una vista previa informada con advertencias, y una sola llamada salteária ese paso.

Not in v1Fuera de v1

The screen's suggestion assistant (deriving detail lines from a recipe's or a batch's raw materials, with packaging-litre reconciliation and weighted-average-cost logic) is not published — a consumer supplies its own detail lines. A detail line never references a packaging run (packaging-runs is out of v1, same E3 exclusion as elsewhere): a line created through this resource is always a raw material, an expense account, or a manually-typed cost, never a packaging cost. Creating or updating a costing here never touches a container's or a case's own cost — the conservative branch. recalculate and restore are a straight wire-through to the same operation the application's screen uses, so unlike create/update they do carry that side effect when the batch has packaging runs of its own, exactly like the screen.

El asistente de sugerencia de la pantalla (armar líneas de detalle a partir de los insumos de una receta o un lote, con reconciliación de litros de envasado y cálculo de precio ponderado) no está publicado — un consumidor arma sus propias líneas de detalle. Una línea nunca referencia un envasado (packaging-runs está fuera de v1, misma exclusión E3 que en el resto de la API): una línea creada por este recurso siempre es un insumo, una cuenta de egreso, o un costo cargado a mano, nunca un costo de envasado. Crear o actualizar un costeo acá nunca toca el costo propio de un envase o una caja — la rama conservadora. recalculate y restore son wiring directo a la misma operación que usa la pantalla de la aplicación, así que a diferencia de crear/actualizar sí arrastran ese efecto colateral cuando el lote tiene envasados propios, igual que la pantalla.

Waste groupsGrupos de merma

Groups of your own brewed products that share one expected waste percentage, used to project how many liters a planned brew will actually yield. Not related to batches/{id}/waste (the actual production losses recorded on a batch) or to /waste-types (the stages a loss can be attributed to) — despite the similar name, neither has any connection to this resource: this one groups products, not waste records or waste types.

Grupos de productos propios que comparten un mismo porcentaje de merma esperado, usados para proyectar cuántos litros netos rendirá una cocción planificada. Sin relación con batches/{id}/waste (las mermas reales registradas en un lote) ni con /waste-types (las etapas a las que se puede imputar una merma) — pese al nombre parecido, ninguno de los dos tiene conexión con este recurso: este agrupa productos, no registros ni tipos de merma.

EndpointWhat it does
GET /waste-groupsPaged listing. page, pageSize. productIds is not included — one extra query per row.
GET /waste-groups/{id}One group, with its product membership.
POST /waste-groupsCreates a group. Answers 201. name and wastePercentage are required; productIds is optional.
PUT /waste-groups/{id}Partial update. productIds absent leaves the membership untouched; present (even empty) replaces it entirely.
No deactivation. This is the only resource without one: a waste group is a grouping for a projection percentage, not a record with history. Deleting one is done in the application, which unlinks its products and removes the row cleanly.
EndpointQué hace
GET /waste-groupsListado paginado. page, pageSize. No incluye productIds — una consulta extra por fila.
GET /waste-groups/{id}Un grupo, con su membresía de productos.
POST /waste-groupsCrea un grupo. Responde 201. name y wastePercentage son obligatorios; productIds es opcional.
PUT /waste-groups/{id}Actualización parcial. productIds ausente conserva la membresía; presente (incluso vacío) la reemplaza entera.
No tiene baja. Es el único recurso sin ella: un grupo de merma es una agrupación para un porcentaje de proyección, no un registro con historial. Borrar uno se hace desde la aplicación, que desvincula sus productos y elimina la fila de forma limpia.

Validation rulesReglas de validación

  • name is required and must be unique among your active groups.
  • wastePercentage is required, between 0.01 and 100, and must be unique among your active groups.
  • A product already in another active group is rejected, naming the conflicting products.
  • name es obligatorio y único entre sus grupos activos.
  • wastePercentage es obligatorio, entre 0.01 y 100, y único entre sus grupos activos.
  • Un producto que ya está en otro grupo activo se rechaza, nombrando los productos en conflicto.

A soft delete the screen does not shareUna baja blanda que la pantalla no comparte

The application's own screen deletes a group physically — the only resource in this API where that is true. deactivate/activate use the record's own active column instead, same as every other resource here, so a group removed through this API keeps its history. The screen does not filter by that column today, so a group you deactivate here may still appear there until the screen is updated to respect it too.

La pantalla de la aplicación borra un grupo físicamente — el único recurso de esta API donde eso es cierto. deactivate/activate usan en cambio la columna active propia del registro, igual que el resto de los recursos, así que un grupo dado de baja por acá conserva su historial. La pantalla no filtra por esa columna hoy, así que un grupo desactivado por acá puede seguir apareciendo ahí hasta que la pantalla también la respete.

AccountCuenta

Your account — the brewery, distillery, cidery or distributor using this API. A singleton: there is exactly one per token, resolved from the token itself, so there is no id in the route and no list. id/country here match the same fields already returned by POST /auth/login.

Su cuenta — la cervecería, destilería, sidrería o distribuidora que usa esta API. Un singleton: hay exactamente uno por token, resuelto del propio token, así que no hay id en la ruta ni un listado. id/country acá coinciden con los mismos campos que ya devuelve POST /auth/login.

This is the identity/fiscal side of your account — operational account-wide configuration (invoice numbering, default notes, etc.) is a different, not-yet-published piece of the backlog. Never exposed here, in either direction: the API key that authenticates this very API, and the bank account used to pay your subscription to this platform — neither is a business field of your account.

Este es el lado identidad/fiscal de su cuenta — la configuración operativa de la cuenta (numeración de comprobantes, notas por defecto, etc.) es una pieza distinta del backlog, todavía sin publicar. Nunca expuestos acá, en ninguna dirección: la clave que autentica esta misma API, y la cuenta bancaria con la que se paga la suscripción a esta plataforma — ninguna de las dos es un dato de negocio de su cuenta.

EndpointWhat it does
GET /accountYour account.
PUT /accountPartial update. country, planId and logoUrl are read-only.
EndpointQué hace
GET /accountSu cuenta.
PUT /accountActualización parcial. country, planId y logoUrl son de solo lectura.

Validation rulesReglas de validación

  • legalName is required.
  • country is fixed at account creation — the platform shards some data by country, so changing it is an infrastructure migration, not a field update.
  • planId changes only through dedicated billing flows, never through this endpoint.
  • logoUrl is read-only in this version, same criterion as brands: there is no file-upload endpoint anywhere in this API yet.
  • If taxConditionId stops being Argentina's "Responsable Inscripto" while your account had VAT withholdings enabled, this also turns that setting off, same as the web application does — it is not reported back in the response.
  • legalName es obligatorio.
  • country queda fijo desde el alta de la cuenta — la plataforma parte algunos datos por país, así que cambiarlo es una migración de infraestructura, no una actualización de campo.
  • planId cambia solo por flujos de facturación dedicados, nunca por este endpoint.
  • logoUrl es de solo lectura en esta versión, mismo criterio que brands: no hay ningún endpoint de subida de archivos en esta API todavía.
  • Si taxConditionId deja de ser "Responsable Inscripto" (Argentina) mientras su cuenta tenía activadas las percepciones de IVA, esto también apaga esa configuración, igual que hace la aplicación web — no se informa en la respuesta.

MaintenancesMantenimientos

Requires the Maintenance add-on, and is not available on the Homebrewer plan. Without the add-on the answer is 403 addon_not_contracted; on Homebrewer, 403 plan_forbidden.

Requiere el addon de Mantenimiento, y no está disponible en el plan Homebrewer. Sin el addon la respuesta es 403 addon_not_contracted; en Homebrewer, 403 plan_forbidden.

Scheduled and performed maintenance/cleaning tasks on your tanks, kegs, tap systems and brewery assets. The underlying record has no explicit status column: status is calculated from startedAt/finishedAt, never stored as such. assetType/assetId replace the four separate, mutually-exclusive foreign keys the real record has (one per kind of asset) with a single pair.

Tareas de mantenimiento/limpieza, programadas o realizadas, sobre sus tanques, barriles, sistemas de tiraje y activos de fábrica. El registro real no tiene una columna de estado explícita: status se calcula a partir de startedAt/finishedAt, nunca se guarda como tal. assetType/assetId reemplazan las cuatro claves foráneas separadas y mutuamente excluyentes que tiene el registro real (una por tipo de activo) por un único par.

This entity is now complete, including the spare-parts sub-resource (which needed the separate spare-parts entity to publish first, so its sparePartId would reference a real resource, not just a catalog).

Esta entidad ya está completa, incluido el sub-recurso de repuestos (que necesitaba que la entidad separada spare-parts se publicara primero, para que su sparePartId referenciara un recurso real, no solo un catálogo).

EndpointWhat it does
GET /maintenancesPaginated list. Filters: search, assetType, assetId, status, from/to (event date range), includeInactive, recurring (lists ONLY templates instead of occurrences).
GET /maintenances/{id}A single maintenance, active or not — an occurrence or a template.
POST /maintenancesCreates a maintenance/cleaning occurrence ("pending", not started), or a recurring template if recurring: true.
POST /maintenances/{id}/startStarts a pending maintenance/cleaning. Not idempotent: 400 if already started or finished.
POST /maintenances/{id}/finishFinishes a started maintenance/cleaning, discounting the spare parts it used from stock. Not idempotent: 400 if not started yet or already finished.
POST /maintenances/{id}/rescheduleChanges the scheduled event date. No restriction on the current status.
POST /maintenances/{id}/recurGenerates the next occurrence of a recurring template. The occurrence is created already "started".
POST /maintenances/{id}/deactivateIdempotent. Blocked only if already finished.
POST /maintenances/{id}/activateIdempotent.
GET /maintenances/{id}/spare-partsThe spare part lines loaded, shown as-is regardless of status.
PUT /maintenances/{id}/spare-partsReplaces the whole set of lines. Blocked (400) on a finished or deactivated maintenance. Every quantity must be greater than zero (400 business_rule).
EndpointQué hace
GET /maintenancesListado paginado. Filtros: search, assetType, assetId, status, from/to (rango de fecha de evento), includeInactive, recurring (lista SOLO plantillas en vez de ocurrencias).
GET /maintenances/{id}Un mantenimiento, activo o no — una ocurrencia o una plantilla.
POST /maintenancesCrea una ocurrencia de mantenimiento/limpieza ("pending", sin iniciar), o una plantilla reiterativa si recurring: true.
POST /maintenances/{id}/startInicia un mantenimiento/limpieza pendiente. No idempotente: 400 si ya está iniciado o finalizado.
POST /maintenances/{id}/finishFinaliza un mantenimiento/limpieza iniciado, descontando de stock los repuestos usados. No idempotente: 400 si todavía no está iniciado o ya está finalizado.
POST /maintenances/{id}/rescheduleCambia la fecha de evento programada. Sin restricción por el estado actual.
POST /maintenances/{id}/recurGenera la próxima ocurrencia de una plantilla reiterativa. La ocurrencia se crea ya "started".
POST /maintenances/{id}/deactivateIdempotente. Bloqueado solo si ya está finalizado.
POST /maintenances/{id}/activateIdempotente.
GET /maintenances/{id}/spare-partsLas líneas de repuestos cargadas, tal cual estén, sin importar el estado.
PUT /maintenances/{id}/spare-partsReemplaza el set entero de líneas. Bloqueado (400) sobre un mantenimiento finalizado o desactivado. Cada quantity tiene que ser mayor a cero (400 business_rule).

Validation rulesReglas de validación

  • assetType (one of tank, keg, tapSystem, breweryAsset), assetId, category, type and eventDate are required on create. All four are read-only afterwards.
  • assetId must exist in the catalog named by assetType: /tanks, /kegs, /tap-systems or /brewery-assets.
  • category: 1 = maintenance, 2 = cleaning. type's meaning depends on it — if maintenance: 1 = preventive, 2 = corrective; if cleaning: 1 = acidic, 2 = alkaline, 3 = other.
  • notes can only be set at creation — there is no way to edit it afterwards in the web application either.
  • /start requires the maintenance to be "pending" — not already started or finished.
  • /finish requires it to be "started" — not "pending" (never started) nor already "finished". Calling it twice would discount spare-part stock twice, so it is deliberately not idempotent.
  • /reschedule requires a valid, non-empty eventDate. No restriction on the current status — same as the web application, which allows fixing a wrong scheduled date even after the maintenance started or finished.
  • Deactivating is blocked only when the maintenance is already finished (both started and finished) — one that was started but never finished can still be deactivated. All actions above are blocked (400) on a deactivated maintenance.
  • recurring: true on create requires recurrenceEvery (an integer > 0) and recurrencePeriod (one of days, months, years). Creates a template instead of a single occurrence — its own status stays "pending" forever, it never starts/finishes itself.
  • /recur only works on a maintenance with recurring: true — 400 otherwise. The new occurrence copies the template's asset/category/type/provider/notes, and is created already "started", same as the web application.
  • sparePartId and warehouseId in a spare-part line must exist in your account: /spare-parts and /warehouses respectively.
  • PUT .../spare-parts is blocked (400) on a finished maintenance — those lines are the actual record of what was discounted from stock at /finish, not an editable plan anymore.
  • assetType (uno de tank, keg, tapSystem, breweryAsset), assetId, category, type y eventDate son obligatorios en el alta. Los cuatro son de solo lectura después.
  • assetId debe existir en el catálogo que indica assetType: /tanks, /kegs, /tap-systems o /brewery-assets.
  • category: 1 = mantenimiento, 2 = limpieza. El significado de type depende de ella — si es mantenimiento: 1 = preventivo, 2 = correctivo; si es limpieza: 1 = ácida, 2 = alcalina, 3 = otro.
  • notes solo se puede fijar en el alta — tampoco hay forma de editarlo después en la aplicación web.
  • /start exige que el mantenimiento esté "pending" — no iniciado ni finalizado todavía.
  • /finish exige que esté "started" — ni "pending" (nunca iniciado) ni ya "finished". Llamarlo dos veces descontaría stock de repuestos dos veces, por eso es deliberadamente no idempotente.
  • /reschedule exige un eventDate válido y no vacío. Sin restricción por el estado actual — igual que la aplicación web, que permite corregir una fecha mal cargada incluso después de iniciado o finalizado el mantenimiento.
  • La desactivación se bloquea solo cuando el mantenimiento ya está finalizado (con inicio y fin), uno que fue iniciado pero nunca finalizado todavía se puede desactivar. Todas las acciones de arriba se bloquean (400) sobre un mantenimiento desactivado.
  • recurring: true en el alta exige recurrenceEvery (un entero > 0) y recurrencePeriod (uno de days, months, years). Crea una plantilla en vez de una ocurrencia única — su propio status queda "pending" para siempre, nunca se inicia/finaliza a sí misma.
  • /recur solo funciona sobre un mantenimiento con recurring: true — 400 en caso contrario. La nueva ocurrencia copia activo/categoría/tipo/proveedor/notas de la plantilla, y se crea ya "started", igual que la aplicación web.
  • sparePartId y warehouseId de una línea de repuesto deben existir en su cuenta: /spare-parts y /warehouses respectivamente.
  • PUT .../spare-parts se bloquea (400) sobre un mantenimiento finalizado — esas líneas son el registro real de qué se descontó de stock en /finish, ya no un plan editable.

Spare partsRepuestos

Requires the Maintenance add-on, and is not available on the Homebrewer plan — spare parts are part of Maintenance. Without the add-on the answer is 403 addon_not_contracted; on Homebrewer, 403 plan_forbidden.

Requiere el addon de Mantenimiento, y no está disponible en el plan Homebrewer — los repuestos son parte de Mantenimiento. Sin el addon la respuesta es 403 addon_not_contracted; en Homebrewer, 403 plan_forbidden.

Spare parts used in equipment maintenance. This resource has no foreign keys of its own — unlike most catalogs in this API, there is nothing here to validate against another resource.

Repuestos usados en el mantenimiento de equipos. Este recurso no tiene ninguna clave foránea propia — a diferencia de la mayoría de los catálogos de esta API, no hay nada acá que validar contra otro recurso.

This entity is now complete, including stock, its manual movements and its history.

Esta entidad ya está completa, incluidos el stock, sus movimientos manuales y su histórico.

EndpointWhat it does
GET /spare-partsPaginated list. Filters: search (code/name), includeInactive. With the defaults, this is exactly the catalog of sparePartId used by a purchase line and a supplier item mapping. Without the Maintenance add-on it answers 403, but a purchase line and a mapping still accept a sparePartId.
GET /spare-parts/{id}A single spare part, active or not.
POST /spare-partsCreates a spare part. Only name is required.
PUT /spare-parts/{id}Partial update.
POST /spare-parts/{id}/deactivateIdempotent. No business rule blocks it — same as the web application.
POST /spare-parts/{id}/activateIdempotent.
GET /spare-parts/{id}/stockStock on hand, overall and per warehouse.
POST /spare-parts/{id}/stock/adjustmentsManual stock movement. The sign of quantity decides the direction.
POST /spare-parts/{id}/stock/transfersMoves stock from one warehouse to another.
GET /spare-parts/{id}/movementsPaginated stock movement history, most recent first. Filter: warehouseId.
EndpointQué hace
GET /spare-partsListado paginado. Filtros: search (código/nombre), includeInactive. Con los valores por defecto, es exactamente el catálogo de sparePartId que usan una línea de compra y un mapeo de ítem de proveedor. Sin el addon de Mantenimiento responde 403, pero una línea de compra y un mapeo siguen aceptando un sparePartId.
GET /spare-parts/{id}Un repuesto, activo o no.
POST /spare-partsCrea un repuesto. Solo name es obligatorio.
PUT /spare-parts/{id}Actualización parcial.
POST /spare-parts/{id}/deactivateIdempotente. Ninguna regla de negocio lo bloquea — igual que la aplicación web.
POST /spare-parts/{id}/activateIdempotente.
GET /spare-parts/{id}/stockStock disponible, total y por depósito.
POST /spare-parts/{id}/stock/adjustmentsMovimiento manual de stock. El signo de quantity decide la dirección.
POST /spare-parts/{id}/stock/transfersMueve stock de un depósito a otro.
GET /spare-parts/{id}/movementsHistórico paginado de movimientos, más reciente primero. Filtro: warehouseId.

Validation rulesReglas de validación

  • name is required. description, up to 250 characters if present. code and minimumStock are free-form, with no uniqueness enforced on code.
  • There is no check here for existing stock or maintenances referencing a spare part before deactivating it — the web application itself has none either.
  • stock is deliberately not part of this DTO: it is not a real stored value on this resource, it is exposed by GET .../stock instead.
  • warehouseId, fromWarehouseId and toWarehouseId must exist in your account: /warehouses.
  • POST .../stock/transfers: quantity must be greater than zero (decimals are allowed), and toWarehouseId must be different from fromWarehouseId. Either case answers 400 business_rule. Both legs of the transfer are recorded together or not at all.
  • POST .../stock/transfers: the origin warehouse must have enough stock. A transfer of more than its current stock answers 400 business_rule, always, like /supplies transfers.
  • POST .../stock/adjustments: quantity cannot be zero (400 business_rule); its sign decides the direction. Unlike /supplies/{id}/stock/adjustments, there is no cap on quantity and no 30-day retroactivity limit. The resulting stock may go negative, unless the account has turned on the setting that blocks negative spare part stock: then an exit that would leave the warehouse below zero answers 400 business_rule. That setting does not apply to transfers.
  • name es obligatorio. description, hasta 250 caracteres si se manda. code y minimumStock son de texto/número libre, sin unicidad exigida sobre code.
  • No hay ningún chequeo de stock o mantenimientos que referencien un repuesto antes de desactivarlo — la aplicación web tampoco lo tiene.
  • stock deliberadamente no es parte de este DTO: no es un valor realmente almacenado en este recurso, se expone con GET .../stock.
  • warehouseId, fromWarehouseId y toWarehouseId deben existir en su cuenta: /warehouses.
  • POST .../stock/transfers: quantity tiene que ser mayor a cero (se aceptan decimales) y toWarehouseId tiene que ser distinto de fromWarehouseId. Cualquiera de los dos casos responde 400 business_rule. Las dos patas del traslado se graban juntas o ninguna.
  • POST .../stock/transfers: el depósito de origen tiene que tener stock suficiente. Un traslado de más de lo que tiene responde 400 business_rule, siempre, igual que los traslados de /supplies.
  • POST .../stock/adjustments: quantity no puede ser cero (400 business_rule); el signo decide la dirección. A diferencia de /supplies/{id}/stock/adjustments, no hay tope de cantidad ni límite de retroactividad de 30 días. El stock resultante puede quedar en negativo, salvo que la cuenta haya prendido la configuración que bloquea el stock negativo de repuestos: ahí un egreso que deje el depósito bajo cero responde 400 business_rule. Esa configuración no aplica a los traslados.

Event categoriesCategorías de evento

Categories used to classify a calendar event — see Calendar events for the events themselves.

Categorías usadas para clasificar un evento de agenda — ver Eventos de agenda para los eventos en sí.

EndpointWhat it does
GET /event-categoriesPaginated list. Filters: search (name), includeInactive. Includes both your own categories and the global ones the platform uses to reflect due dates from other domains.
GET /event-categories/{id}A single category, active or not, own or global.
POST /event-categoriesCreates a category. Only name is required. Always creates one of your own — there is no way to create a global category through this endpoint.
PUT /event-categories/{id}Partial update. 404 for a global id.
POST /event-categories/{id}/deactivateIdempotent. Blocked (400) for a global category, or one with at least one calendar event currently using it.
POST /event-categories/{id}/activateIdempotent.
EndpointQué hace
GET /event-categoriesListado paginado. Filtros: search (nombre), includeInactive. Incluye tanto sus propias categorías como las globales que usa la plataforma para reflejar vencimientos de otros dominios.
GET /event-categories/{id}Una categoría, activa o no, propia o global.
POST /event-categoriesCrea una categoría. Solo name es obligatorio. Siempre crea una propia — no hay forma de crear una global con este endpoint.
PUT /event-categories/{id}Actualización parcial. 404 para un id global.
POST /event-categories/{id}/deactivateIdempotente. Bloqueado (400) para una categoría global, o una con al menos un evento de agenda que la use actualmente.
POST /event-categories/{id}/activateIdempotente.

Validation rulesReglas de validación

  • name is required and must be unique among your account's categories (including the global ones), active or not.
  • color is optional. When a calendar event that uses this category does not send its own color, it takes this category's instead.
  • isGlobal, hasAssociatedEvents and active are read-only.
  • name es obligatorio y debe ser único entre las categorías de su cuenta (incluidas las globales), activa o no.
  • color es opcional. Cuando un evento de agenda que usa esta categoría no manda su propio color, toma el de esta categoría.
  • isGlobal, hasAssociatedEvents y active son de solo lectura.

Calendar eventsEventos de agenda

Manually-created calendar events — the web application's "Agregar Evento" button. The web's agenda screen is a read-only aggregator of 7 heterogeneous sources (batches, tasks, cookings, plannings, recurring maintenances, and this entity's own rows) flattened only to paint a calendar widget; this resource is deliberately narrower than that screen. An event reflecting a purchase, check, cash register or bank account due date, or a maintenance's recurring template, is entirely out of scope here — neither read nor write — because those already belong (or will belong) to their own resource. Recurring event templates are /calendar-events/recurring, below.

Eventos de agenda creados a mano — el botón "Agregar Evento" de la aplicación web. La pantalla de agenda web es un agregador de solo lectura de 7 fuentes heterogéneas (lotes, tareas, cocciones, planificaciones, mantenimientos reiterativos y las filas propias de esta entidad) aplanadas solo para pintar un widget de calendario; este recurso es deliberadamente más angosto que esa pantalla. Un evento que refleja un vencimiento de compra, cheque, caja o cuenta bancaria, o la plantilla reiterativa de un mantenimiento, queda completamente fuera de este recurso — ni lectura ni escritura — porque esos ya pertenecen (o van a pertenecer) a su propio recurso. Las plantillas reiterativas son /calendar-events/recurring, más abajo.

EndpointWhat it does
GET /calendar-eventsPaginated list. Filters: from/to (yyyy-MM-dd, inclusive), categoryId, search (description), includeInactive.
GET /calendar-events/{id}A single event, active or not.
POST /calendar-eventsCreates an event. categoryId and eventDate are required.
PUT /calendar-events/{id}Partial update.
POST /calendar-events/{id}/deactivateIdempotent. Blocked (400) once another domain has applied (paid/collected against) this event.
POST /calendar-events/{id}/activateIdempotent.
EndpointQué hace
GET /calendar-eventsListado paginado. Filtros: from/to (yyyy-MM-dd, inclusive), categoryId, search (descripción), includeInactive.
GET /calendar-events/{id}Un evento, activo o no.
POST /calendar-eventsCrea un evento. categoryId y eventDate son obligatorios.
PUT /calendar-events/{id}Actualización parcial.
POST /calendar-events/{id}/deactivateIdempotente. Bloqueado (400) una vez que otro dominio aplicó (pagó/cobró contra) este evento.
POST /calendar-events/{id}/activateIdempotente.

Validation rulesReglas de validación

  • categoryId is required and must be an active id from /event-categories, own or global.
  • eventDate is required, date only (no time), yyyy-MM-dd.
  • description is optional, up to 200 characters if present.
  • color is optional. When not sent on create, the event takes its category's color instead. This resource always returns the value actually stored — it does not reproduce the two hardcoded color overrides the calendar widget paints for a paid Vencimiento/Entrega event, that is UI-only rendering.
  • applied is read-only: other domains set it when they pay/collect against an event, which never happens for one created through this resource (nothing outside this resource links to it).
  • categoryId es obligatorio y debe ser un id activo de /event-categories, propio o global.
  • eventDate es obligatoria, solo fecha (sin hora), yyyy-MM-dd.
  • description es opcional, hasta 200 caracteres si se manda.
  • color es opcional. Cuando no se manda al crear, el evento toma el color de su categoría. Este recurso siempre devuelve el valor realmente almacenado — no reproduce los dos overrides de color hardcodeados que pinta el widget de calendario para un evento Vencimiento/Entrega pagado, eso es renderizado de UI, no dato almacenado.
  • applied es de solo lectura: otros dominios lo setean al pagar/cobrar contra un evento, algo que nunca pasa para uno creado con este recurso (nada fuera de este recurso lo referencia).

Recurring templatesPlantillas reiterativas

Recurring calendar event templates, also scoped to "sueltas" — a template that belongs to a maintenance is entirely out of scope here (neither read nor write), since it already publishes its own recurrence through maintenances' recurring/recurrenceEvery/recurrencePeriod fields.

Plantillas reiterativas de eventos de agenda, también acotadas a "sueltas" — una plantilla que pertenece a un mantenimiento queda completamente fuera de este recurso (ni lectura ni escritura), porque ya publica su propia recurrencia a través de los campos recurring/recurrenceEvery/recurrencePeriod de maintenances.

EndpointWhat it does
GET /calendar-events/recurringPaginated list. Filters: search (title/description), includeInactive.
GET /calendar-events/recurring/{id}A single template, active or not.
POST /calendar-events/recurringCreates a template. eventDate, every and period are required.
PUT /calendar-events/recurring/{id}Partial update.
POST /calendar-events/recurring/{id}/deactivateIdempotent. No business rule blocks it — same as the web application.
POST /calendar-events/recurring/{id}/activateIdempotent.
POST /calendar-events/recurring/{id}/exclude-dateExcludes one occurrence date (body: { "date": "yyyy-MM-dd" }). Idempotent. There is no endpoint to remove an already-excluded date — same as the web application.
EndpointQué hace
GET /calendar-events/recurringListado paginado. Filtros: search (título/descripción), includeInactive.
GET /calendar-events/recurring/{id}Una plantilla, activa o no.
POST /calendar-events/recurringCrea una plantilla. eventDate, every y period son obligatorios.
PUT /calendar-events/recurring/{id}Actualización parcial.
POST /calendar-events/recurring/{id}/deactivateIdempotente. Ninguna regla de negocio lo bloquea — igual que la aplicación web.
POST /calendar-events/recurring/{id}/activateIdempotente.
POST /calendar-events/recurring/{id}/exclude-dateExcluye una fecha de ocurrencia (body: { "date": "yyyy-MM-dd" }). Idempotente. No hay endpoint para quitar una fecha ya excluida — igual que la aplicación web.

Validation rulesReglas de validación

  • eventDate is required, date only (no time), yyyy-MM-dd — date of the first occurrence.
  • every is required and must be greater than 0.
  • period is required and must be one of: days, months, years.
  • title, description and color are optional, no length limit enforced here — the web application has none either.
  • excludedDates and active are read-only.
  • eventDate es obligatoria, solo fecha (sin hora), yyyy-MM-dd — fecha de la primera ocurrencia.
  • every es obligatorio y debe ser mayor a 0.
  • period es obligatorio y debe ser uno de: days, months, years.
  • title, description y color son opcionales, sin límite de longitud exigido acá — la aplicación web tampoco lo tiene.
  • excludedDates y active son de solo lectura.

NotificationsNotificaciones

Notifications visible to your account: platform-wide announcements, account-wide ones, and ones aimed at your own integration user specifically. Read-only in this version — the web application lets any logged-in user create a notification with no authorization check at all (no module, nothing forcing who it targets), a pre-existing authorization gap that is not multiplied towards external integrators without a product decision first.

Notificaciones visibles para su cuenta: anuncios de toda la plataforma, de toda la cuenta, y dirigidas puntualmente a su usuario de integración. Solo lectura en esta versión — la aplicación web permite que cualquier usuario logueado cree una notificación sin ningún chequeo de autorización (sin módulo, nada que fuerce a quién apunta), un hueco de autorización preexistente que no se multiplica hacia integradores externos sin una decisión de producto primero.

EndpointWhat it does
GET /notificationsPaginated list. Filter: includeInactive. Includes platform-wide notifications, ones for your whole account, and ones aimed at you specifically.
EndpointQué hace
GET /notificationsListado paginado. Filtro: includeInactive. Incluye notificaciones de toda la plataforma, de toda su cuenta, y dirigidas puntualmente a usted.

Validation rulesReglas de validación

  • scope is global (every account on the platform), account (every user of your account) or user (only you) — computed server-side, never a raw account or user id from someone else.
  • There is no "unread" concept: the web application tracks that on the client (it remembers the last id it saw), there is no column or table for it on the server — this resource cannot expose what does not exist.
  • scope es global (toda la plataforma), account (toda su cuenta) o user (solo usted) — calculado del lado del servidor, nunca un id crudo de otra cuenta o usuario.
  • No existe un concepto de "no leída": la aplicación web lo trackea del lado del cliente (recuerda el último id que vio), no hay columna ni tabla para eso en el servidor — este recurso no puede exponer algo que no existe.

LeadsLeads

Sales leads — prospective customers captured before they become a real customer. This entity is still being built: the master record, its point actions, comments, converting a lead to a customer and its own days-of-inactivity setting are published so far. There is no generic PUT on the lead itself — the web application has none either, only specific actions after creation, each its own endpoint below. There is already a separate channel to create leads in bulk from ad platforms (Facebook/Meta Lead Ads and similar): a legacy, account-apiKey-authenticated webhook, not this JWT-based API — POST here is for one lead at a time instead.

Leads de venta — potenciales clientes capturados antes de convertirse en un cliente real. Esta entidad todavía está en construcción: por ahora se publicó el maestro, sus acciones puntuales, los comentarios, la conversión a cliente y su propia configuración de días de inactividad. No hay PUT genérico sobre el lead en sí — la aplicación web tampoco lo tiene, solo acciones específicas después de crear un lead, cada una su propio endpoint abajo. Ya existe un canal aparte para crear leads en lote desde plataformas de publicidad (Facebook/Meta Lead Ads y similares): un webhook legado autenticado con apiKey de cuenta, no esta API basada en JWT — el POST de acá es para un lead a la vez.

EndpointWhat it does
GET /leadsPaginated list. Filters: status (active/inactive/converted), salesRepId.
GET /leads/{id}A single lead.
POST /leadsCreates a lead. At least one of name, phone or email is required.
POST /leads/{id}/assign-sales-repAssigns (or, with an empty body, unassigns) the sales rep handling the lead.
POST /leads/{id}/set-inactiveSets or clears the manual-inactive flag. { "inactive": true|false }.
POST /leads/{id}/next-contactSchedules the next follow-up date, or clears it with an empty body. { "date": "yyyy-MM-dd" }.
POST /leads/{id}/register-contactRegisters that a sales rep contacted the lead. { "date": "yyyy-MM-dd" }, omit for now.
GET /leads/{id}/commentsPaginated list of comments logged against the lead, newest first.
POST /leads/{id}/commentsLogs a comment. { "text": "..." }, required. Also updates lastContactedAt to now.
POST /leads/{id}/convertConverts the lead into a customer. { "customerTypeId": ..., "categoryId": ... }, both optional. Fails with 400 if already converted.
GET /leads/settingsYour (the integration user's own) inactivity threshold in days.
PUT /leads/settingsSets it. { "inactiveAfterDays": 0..3650 }, required.
EndpointQué hace
GET /leadsListado paginado. Filtros: status (active/inactive/converted), salesRepId.
GET /leads/{id}Un lead.
POST /leadsCrea un lead. Al menos uno de name, phone o email es obligatorio.
POST /leads/{id}/assign-sales-repAsigna (o, con un body vacío, desasigna) el vendedor a cargo del lead.
POST /leads/{id}/set-inactiveMarca o quita la bandera manual de inactivo. { "inactive": true|false }.
POST /leads/{id}/next-contactAgenda el próximo contacto, o lo borra con un body vacío. { "date": "yyyy-MM-dd" }.
POST /leads/{id}/register-contactRegistra que un vendedor contactó al lead. { "date": "yyyy-MM-dd" }, omítalo para usar ahora.
GET /leads/{id}/commentsListado paginado de comentarios del lead, más recientes primero.
POST /leads/{id}/commentsRegistra un comentario. { "text": "..." }, obligatorio. También actualiza lastContactedAt a ahora.
POST /leads/{id}/convertConvierte el lead en cliente. { "customerTypeId": ..., "categoryId": ... }, ambos opcionales. Falla con 400 si ya estaba convertido.
GET /leads/settingsSu propio umbral de inactividad en días (por usuario, no por cuenta).
PUT /leads/settingsLo establece. { "inactiveAfterDays": 0..3650 }, obligatorio.

Validation rulesReglas de validación

  • At least one of name, phone or email is required on create.
  • source defaults to "Manual" when omitted on create.
  • salesRepId (on create and on /assign-sales-rep) must be an id from /sales-reps, the same catalog customers uses for the same field.
  • isInactive is computed: true when the lead is not converted and either inactiveManual is set or too many days passed since the last contact (your own threshold, per integration user — see GET/PUT /leads/settings).
  • contactedAt, lastContactedAt, nextContactAt, inactiveManual, isInactive, daysSinceLastContact, lastNote, customerId, convertedAt and active are all read-only through POST /leads — each changes only through its own action above (or not at all yet, for customerId/convertedAt).
  • text is required and non-empty on POST /leads/{id}/comments.
  • customerTypeId and categoryId (on /convert) must be ids from /customer-types and /customer-categories respectively — the same catalogs customers itself uses. A lead already converted cannot be converted again (400).
  • inactiveAfterDays (on PUT /leads/settings) is required and must be between 0 and 3650.
  • Al menos uno de name, phone o email es obligatorio al crear.
  • source toma "Manual" por defecto si no se manda al crear.
  • salesRepId (al crear y en /assign-sales-rep) debe ser un id de /sales-reps, el mismo catálogo que usa customers para el mismo campo.
  • isInactive es calculado: verdadero cuando el lead no está convertido y o bien inactiveManual está marcado o pasaron demasiados días desde el último contacto (su propio umbral, por usuario de integración — ver GET/PUT /leads/settings).
  • contactedAt, lastContactedAt, nextContactAt, inactiveManual, isInactive, daysSinceLastContact, lastNote, customerId, convertedAt y active son todos de solo lectura vía POST /leads — cada uno cambia solo con su propia acción de arriba (o todavía no cambia, para customerId/ convertedAt).
  • text es obligatorio y no vacío en POST /leads/{id}/comments.
  • customerTypeId y categoryId (en /convert) deben ser ids de /customer-types y /customer-categories respectivamente — los mismos catálogos que usa customers. Un lead ya convertido no puede volver a convertirse (400).
  • inactiveAfterDays (en PUT /leads/settings) es obligatorio y debe estar entre 0 y 3650.

AuditAuditoría

The change log of your account — who changed what type of record, and when. Metadata only for now: the actual before/after values of each change (previousJson/newJson) are not published yet — the underlying log is transversal to the whole application and stores an unfiltered snapshot of whatever entity changed, including fields this API deliberately hides elsewhere (e.g. a user's password hash). Publishing that raw diff needs a separate decision first.

El registro de cambios de su cuenta — quién cambió qué tipo de registro, y cuándo. Solo metadatos por ahora: los valores concretos de antes/después de cada cambio (previousJson/newJson) todavía no están publicados — el registro subyacente es transversal a toda la aplicación y guarda una foto sin filtrar de cualquier entidad que haya cambiado, incluidos campos que esta API ya oculta deliberadamente en otro lado (por ejemplo, el hash de contraseña de un usuario). Publicar ese diff crudo necesita antes una decisión aparte.

EndpointWhat it does
GET /auditPaginated list. dateFrom/dateTo required (ISO 8601, at most 365 days apart). Filters: entityType (e.g. Cliente), userId.
EndpointQué hace
GET /auditListado paginado. dateFrom/dateTo obligatorios (ISO 8601, a lo sumo 365 días de diferencia). Filtros: entityType (p.ej. Cliente), userId.

Validation rulesReglas de validación

  • dateFrom and dateTo are both required; dateFrom must not be after dateTo, and the range between them must not exceed 365 days.
  • entityType is the internal name of an entity type (e.g. Cliente, Producto) — free text, not a catalog: it is not a foreign key reference.
  • dateFrom y dateTo son ambos obligatorios; dateFrom no puede ser posterior a dateTo, y el rango entre ambos no puede superar los 365 días.
  • entityType es el nombre interno de un tipo de entidad (p.ej. Cliente, Producto) — texto libre, no un catálogo: no es una referencia a otro recurso.

FilesArchivos

File attachments — upload a file and tag it against any entity type/id of your own. This entity is still being built: upload, read and delete are published so far — making a file publicly downloadable (bypassing your account entirely) is not, yet, pending a security decision. No module gates this — same as the web application itself, which requires nothing beyond being logged in. entityType/entityId are free text, not a foreign key: this API never validates that the referenced record exists or belongs to your account — reading, downloading and deleting a file are all scoped to your account regardless of what you tagged it with.

Archivos adjuntos — suba un archivo y etíquetelo contra cualquier tipo de entidad/id propio. Esta entidad todavía está en construcción: por ahora se publicó subir, leer y eliminar — hacer un archivo público (sin ningún control de cuenta) todavía no, pendiente de una decisión de seguridad. Ningún módulo gatea esto — igual que la aplicación web, que no pide nada más que estar logueado. entityType/entityId son texto libre, no una referencia a otro recurso: esta API nunca valida que el registro referido exista o le pertenezca — leer, descargar y eliminar un archivo quedan siempre acotados a su cuenta sin importar con qué los haya etiquetado.

EndpointWhat it does
POST /filesUploads a file. Multipart form: file required, entityType/entityId/fileType/description optional. Max 20 MB.
GET /files/{id}A file's metadata.
GET /files/{id}/contentThe file's raw content, with its original content type and name.
POST /files/{id}/deactivateDeletes the file. Irreversible — the content is removed from storage, there is no /activate.
EndpointQué hace
POST /filesSube un archivo. Form multipart: file obligatorio, entityType/entityId/fileType/description opcionales. Máximo 20 MB.
GET /files/{id}Metadatos de un archivo.
GET /files/{id}/contentEl contenido crudo del archivo, con su content type y nombre originales.
POST /files/{id}/deactivateElimina el archivo. Irreversible — el contenido se borra del storage, no hay /activate.

Validation rulesReglas de validación

  • file is required on POST /files and must not be empty. Max size: 20 MB.
  • entityType/entityId/fileType/description are all free text — no catalog, no foreign key check.
  • file es obligatorio en POST /files y no puede estar vacío. Tamaño máximo: 20 MB.
  • entityType/entityId/fileType/description son todos texto libre — sin catálogo, sin chequeo de referencia.

InvitationsInvitaciones

Invitations for a customer to access their own portal account. Accepting an invitation is not published — the customer clicks an emailed link, sees a web page and sets their own password; there is no reasonable way to expose that anonymous, browser-only flow through a server-to-server JWT. POST here sends the real email. The API does not enforce the invitation limit: sending more invitations than limit is not blocked. GET /invitations/quota reports the count for informational purposes.

Invitaciones para que un cliente acceda a su propia cuenta de portal. Aceptar una invitación no está publicado — el cliente hace click en un link emailado, ve una página web y define su propia contraseña; no hay forma razonable de exponer ese flujo anónimo de navegador a través de un JWT servidor a servidor. El POST de acá envía el email real. La API no aplica el límite de invitaciones: enviar más invitaciones que limit no se bloquea. GET /invitations/quota informa el conteo a título informativo.

EndpointWhat it does
POST /invitationsInvites a customer to their portal account. customerId/email required, franchise/canViewStock optional.
GET /invitations/quotaHow many invitations your account has sent, and its configured limit. Informational only.
EndpointQué hace
POST /invitationsInvita a un cliente a su cuenta de portal. customerId/email obligatorios, franchise/canViewStock opcionales.
GET /invitations/quotaCuántas invitaciones envió su cuenta, y su límite configurado. Solo informativo.

Validation rulesReglas de validación

  • customerId and email are both required on POST /invitations.
  • customerId must be an id from /customers.
  • email is rejected (400) if it is already associated with managing a different customer, or if this customer already had a linked account that was deactivated (it must be reactivated instead of re-invited — not published through this API).
  • customerId y email son ambos obligatorios en POST /invitations.
  • customerId debe ser un id de /customers.
  • email se rechaza (400) si ya está asociado a gestionar otro cliente, o si este cliente ya tuvo una cuenta vinculada que fue dada de baja (debe reactivarse en vez de volver a invitar — no publicado por esta API).

External usersUsuarios externos

Customers' links to their own portal accounts in your account. This is the per-account link (UsuarioExternoCliente), not the customer's global login identity: the login's own credentials (password, reset token) are a separate concept this API never exposes. Creating a link happens only through /invitations — the customer must accept it first, an anonymous browser-only flow not published here either. No module gates this — same as the web application itself, which requires the Duenio role for everything except reactivating (Administracion).

Vínculos de clientes a su propia cuenta de portal en su cuenta. Este es el vínculo por cuenta (UsuarioExternoCliente), no la identidad global de login del cliente: las credenciales del login (contraseña, token de reset) son un concepto aparte que esta API nunca expone. Crear un vínculo sucede sólo a través de /invitations — el cliente debe aceptarla primero, otro flujo anónimo de navegador tampoco publicado acá. Ningún módulo gatea esto — igual que la aplicación web, que pide el rol Duenio para todo salvo reactivar (Administracion).

EndpointWhat it does
GET /external-usersPaginated list. includeInactive optional, defaults to false.
GET /external-users/{id}A single external user link.
PUT /external-users/{id}Partial update of the 7 permission flags, absolute values (never a toggle — a retried request never inverts a flag twice). customerId, email and active are read-only here.
POST /external-users/{id}/deactivateDeactivates the link. Idempotent.
POST /external-users/{id}/activateReactivates the link. Idempotent. Fails with 400 if another active link already exists for the same login. Requires Administracion, not Duenio.
EndpointQué hace
GET /external-usersListado paginado. includeInactive opcional, por defecto false.
GET /external-users/{id}Un vínculo de usuario externo.
PUT /external-users/{id}Actualización parcial de los 7 flags de permiso, con valores absolutos (nunca un toggle — un reintento nunca invierte un flag dos veces). customerId, email y active son de solo lectura acá.
POST /external-users/{id}/deactivateDesactiva el vínculo. Idempotente.
POST /external-users/{id}/activateReactiva el vínculo. Idempotente. Falla con 400 si ya existe otro vínculo activo para el mismo login. Requiere Administracion, no Duenio.

Portal productsProductos del portal

Which of your products are published to the customer portal, and in which presentations. Despite the resource name, this is configuration per account, not per external user: what you set here applies to every customer who logs in to your portal. Do not confuse it with /external-users, which is the per-customer link and its permission flags. The only customer-specific dimension is enabledForCategoryList, which applies price list 3 only to customers in the category configured for your account.

Qué productos suyos están publicados en el portal de clientes, y en qué presentaciones. A pesar del nombre del recurso, esto es configuración por cuenta, no por usuario externo: lo que configure acá aplica a todos los clientes que entren a su portal. No lo confunda con /external-users, que es el vínculo por cliente y sus flags de permiso. La única dimensión por cliente es enabledForCategoryList, que aplica la lista de precios 3 sólo a los clientes de la categoría configurada en su cuenta.

Each product carries a presentations collection with one entry per way it is sold: the product itself (kind: "product", the only one mix packs and complementary products have), each keg volume (keg, see /keg-volumes), each container (container, see /containers) and each case (case, see /cases). A presentation is published when it has a price list assigned, which is what enabled reports — the price list ids themselves are not part of this contract: they come from your account's configuration, so every row stays consistent with every other.

Cada producto trae una colección presentations con una entrada por cada forma en que se vende: el producto en sí (kind: "product", la única que tienen los mixpacks y los complementarios), cada litraje de barril (keg, ver /keg-volumes), cada envase (container, ver /containers) y cada caja (case, ver /cases). Una presentación está publicada cuando tiene lista de precios asignada, que es lo que informa enabled — los ids de lista no son parte de este contrato: salen de la configuración de su cuenta, así que todas las filas quedan consistentes entre sí.

The whole resource is gated by the account setting that enables portal product assignment. With it off, every action here answers 404: for that account the resource simply does not exist, and a 403 would suggest the integration user is missing a permission instead.

In the history, previousValue and newValue are human-readable text, in the language of whoever made the change — they are what the web screen shows, stored as text when the change happened. Do not parse them: read the current state from the resource itself. Minimum purchase quantities and stock checks are not logged; neither are they in the web application.

portalStock is the stock available to portal customers for a presentation, and comes back in every GET of this resource. A null means it has never been set, which is not the same as having been set to zero. Only stock checks are published — the increases and decreases that portal orders produce are written by the ordering flow, which this API does not expose.

On the presentations endpoint, send only the entries you want to change — the ones you leave out keep their values. This is the one collection in this API that is not replaced whole, and the reason is that you cannot create or delete a presentation: the set is fixed by the product itself, so "leave it out" and "delete it" could never be the same request. An entry with none of the three keys is the product-level presentation, and there you may only set minimumPurchaseQuantity: publishing it is what PUT /external-user-products/{productId} does, because in the web application that switch always cascades.

Todo el recurso está gateado por la configuración de cuenta que habilita la asignación de productos al portal. Con esa configuración apagada, todas las acciones responden 404: para esa cuenta el recurso simplemente no existe, y un 403 sugeriría que al usuario de integración le falta un permiso.

En el historial, previousValue y newValue son texto para leer, en el idioma de quien hizo el cambio: es lo que muestra la pantalla web, guardado como texto en el momento del cambio. No los parsee: el estado actual se lee del propio recurso. Los mínimos de compra y los controles de stock no se registran en el historial; tampoco lo hace la aplicación web.

portalStock es el stock disponible en el portal para una presentación, y viene en todos los GET de este recurso. Un null significa que nunca se fijó, que no es lo mismo que haberlo fijado en cero. Sólo se publican los controles de stock: los ingresos y egresos que generan los pedidos del portal los escribe el flujo de pedidos, que esta API no expone.

En el endpoint de presentaciones, mande sólo las entradas que quiera cambiar: las que deje afuera conservan sus valores. Es la única colección de esta API que no se reemplaza entera, y el motivo es que una presentación no se puede crear ni borrar: el conjunto lo fija el propio producto, así que "no mandarla" y "borrarla" nunca podrían ser el mismo request. Una entrada sin ninguna de las tres claves es la presentación del producto, y ahí sólo puede fijar minimumPurchaseQuantity: publicarla es lo que hace PUT /external-user-products/{productId}, porque en la aplicación web ese interruptor siempre cascadea.

EndpointWhat it does
GET /external-user-productsPaginated list of your products with their presentations. onlyEnabled optional, defaults to false (all of them).
GET /external-user-products/{productId}One product's portal configuration. 404 if the product does not exist in your account or cannot be published to the portal.
PUT /external-user-products/{productId}Publishes or unpublishes the whole product, with enabled and enabledForCategoryList. Partial update: a flag you do not send keeps its value. Cascades to every presentation of the product. 400 if your account has no portal price list configured, because enabling would then do nothing.
PUT /external-user-products/{productId}/presentationsChanges individual presentations without touching the rest: enabled, enabledForCategoryList and minimumPurchaseQuantity per entry. Send only the ones you want to change. Identify each by exactly one of litres, containerId or caseId.
POST /external-user-products/{productId}/stockRecords a stock check: sets portalStock to an absolute value for each presentation you send. Read the current values from any GET of this resource. Needs portal stock enabled for your account, otherwise 404.
GET /external-user-products/historyPaginated log of who published or unpublished what, most recent first. Optional productId and userId filters.
GET /external-user-products/price-listsWhich price lists the portal publishes against: priceListId1, priceListId2, priceListId3 and restrictedToCustomerCategoryId. Read-only — see the rules below.
EndpointQué hace
GET /external-user-productsListado paginado de sus productos con sus presentaciones. onlyEnabled opcional, por defecto false (todos).
GET /external-user-products/{productId}La configuración de portal de un producto. 404 si el producto no existe en su cuenta o no es publicable en el portal.
PUT /external-user-products/{productId}Publica o despublica el producto entero, con enabled y enabledForCategoryList. Actualización parcial: un flag que no mande conserva su valor. Cascadea a todas las presentaciones del producto. 400 si su cuenta no tiene lista de precios de portal configurada, porque publicar no haría nada.
PUT /external-user-products/{productId}/presentationsCambia presentaciones sueltas sin tocar el resto: enabled, enabledForCategoryList y minimumPurchaseQuantity por entrada. Mande sólo las que quiera cambiar. Identifique cada una por exactamente uno de litres, containerId o caseId.
POST /external-user-products/{productId}/stockRegistra un control de stock: fija portalStock a un valor absoluto para cada presentación que mande. Los valores actuales se leen de cualquier GET de este recurso. Necesita el stock de portal habilitado en su cuenta; si no, 404.
GET /external-user-products/historyLog paginado de quién publicó o despublicó qué, lo más reciente primero. Filtros opcionales productId y userId.
GET /external-user-products/price-listsContra qué listas de precio publica el portal: priceListId1, priceListId2, priceListId3 y restrictedToCustomerCategoryId. Solo lectura — ver las reglas más abajo.

Validation rulesReglas de validación

  • /price-lists is READ-ONLY. Changing which lists the portal uses is a web-only operation on purpose: the action that changes them does not only write those four settings, it also rewrites — in one pass, with no preview and no way back — the price list assigned to every product already published on the portal. Enabling and disabling products and presentations one by one is published instead, and covers the common case.
  • A null id means that slot is not configured. A slot is never reported as 0, which would be indistinguishable from a real list id.
  • /price-lists es de SOLO LECTURA. Cambiar contra qué listas publica el portal es una operación solo de la web, a propósito: la acción que las cambia no escribe solo esas cuatro claves, también reescribe —de una, sin vista previa y sin vuelta atrás— la lista de precio asignada a todos los productos ya publicados en el portal. En su lugar está publicado prender y apagar productos y presentaciones de a uno, que cubre el caso común.
  • Un id en null significa que ese lugar no está configurado. Nunca se informa 0, que no se distinguiría de un id de lista real.

Distributor purchasesCompras de distribuidora

What a distributor receives from a supplier: kegs, containers, cases and mix packs, with the stock movements and the supplier's current account entry the purchase produced. Do not confuse it with /purchases, the general purchase of supplies, nor with /keg-purchase-orders, the order placed before the goods arrive — a purchase here may fulfil one, and then carries its kegPurchaseOrderId.

Lo que una distribuidora recibe de un proveedor: barriles, envases, cajas y mixpacks, con los movimientos de stock y el asiento en la cuenta corriente del proveedor que la compra generó. No lo confunda con /purchases, la compra general de insumos, ni con /keg-purchase-orders, la orden que se emite antes de que llegue la mercadería — una compra de acá puede cumplir una, y entonces lleva su kegPurchaseOrderId.

Each purchase carries a lines collection, one entry per item bought. kind says what it was — keg, container, case or mixPack — following the same vocabulary the rest of this API uses for a product's presentations. Only a keg line carries code and supplierCode: those identify one physical keg, which is why a purchase of kegs has one line per keg instead of a single line with a quantity.

Cada compra trae una colección lines, una entrada por cosa comprada. kind dice qué fue — keg, container, case o mixPack —, con el mismo vocabulario que el resto de esta API usa para las presentaciones de un producto. Sólo una línea keg trae code y supplierCode: identifican un barril físico, y por eso una compra de barriles tiene una línea por barril en vez de una sola con cantidad.

When you record a purchase, a keg is rejected if it is already registered to a different supplier, if it is currently at a customer — return it first — or if it is already in stock with a product. The web application checks these while you type; here they run inside the call, so a purchase is either recorded whole or not at all. Voiding has its own two guards: a purchase cannot be voided while one of its kegs is at a customer, nor when the container, case or mix pack stock it created has already been used. Importing purchases from a spreadsheet stays out of v1 on purpose — it is a browser flow (upload, preview the errors in a grid, confirm) and the POST covers the same server-to-server need. Every amount is in the purchase's own currencyId; this API never converts currencies.

Al registrar una compra, un barril se rechaza si ya está registrado para otro proveedor, si está en poder de un cliente —hay que devolverlo primero— o si ya está en stock con un producto. La aplicación web chequea esto mientras usted tipea; acá corre dentro de la llamada, así que una compra se registra entera o no se registra. La anulación tiene sus propias dos guardas: no se puede anular una compra mientras uno de sus barriles esté en un cliente, ni cuando el stock de envases, cajas o mixpacks que generó ya fue utilizado. El alta por planilla queda fuera de v1 a propósito — es un flujo de navegador (subir el archivo, previsualizar los errores en una grilla, confirmar) y el POST cubre la misma necesidad server-to-server. Todos los importes están en el currencyId de la propia compra; esta API nunca convierte monedas.

EndpointWhat it does
GET /distributor-purchasesPaged listing, most recent first, with the lines of each purchase. includeInactive optional, defaults to false.
GET /distributor-purchases/{purchaseId}One purchase with its lines. A cancelled purchase is still readable; its active is false.
POST /distributor-purchasesRecords a purchase. Answers 201. This moves stock: in one transaction it brings the goods into warehouseId, posts the total to the supplier's current account and advances the keg purchase order you referenced.
POST /distributor-purchases/{purchaseId}/cancelVoids the purchase, reversing everything it created and giving the delivered quantities back to the keg purchase order. Idempotent. The record is never deleted.
EndpointQué hace
GET /distributor-purchasesListado paginado, del más reciente al más viejo, con las líneas de cada compra. includeInactive opcional, por defecto false.
GET /distributor-purchases/{purchaseId}Una compra con sus líneas. Una compra anulada se sigue pudiendo leer; su active es false.
POST /distributor-purchasesRegistra una compra. Responde 201. Mueve stock: en una sola transacción ingresa la mercadería a warehouseId, asienta el total en la cuenta corriente del proveedor y avanza la orden de compra de barriles que haya referenciado.
POST /distributor-purchases/{purchaseId}/cancelAnula la compra, revirtiendo todo lo que generó y devolviéndole las cantidades entregadas a la orden de compra. Idempotente. El registro nunca se borra.

Distributor servicesServicios de distribuidora

What a distributor does on a supplier's behalf, and how it gets paid for it. A service is a name plus a set of tiers: from this many litres a month onwards, the distributor is paid this much per litre and this much commission on what it collected. The settlement picks the highest tier whose litresPerMonth is at or below what was actually moved in the period, prorated to 30 days.

Lo que hace una distribuidora por cuenta de un proveedor, y cómo se le paga. Un servicio es un nombre más un conjunto de niveles: a partir de tantos litros por mes, se le paga tanto por litro y tanta comisión sobre lo que cobró. La liquidación elige el nivel más alto cuyo litresPerMonth no supere lo que efectivamente se movió en el período, prorrateado a 30 días.

Every action here needs the Duenio role on top of the Distributor module. That is the web application's own gate: its service screens refuse outright to a user who is not the owner. Ask whoever administers your account to grant that role to the integration user, or these endpoints answer 403.

Todas las acciones de acá necesitan el rol Duenio además del módulo Distribuidora. Es el gate de la propia aplicación web: sus pantallas de servicios se niegan directamente a un usuario que no sea el dueño. Pedí a quien administre su cuenta que le dé ese rol al usuario de integración, o estos endpoints responden 403.

Assignments belong to a supplier, which is why they hang off /assignments/{supplierId} and why the supplier is not a field of each entry. The collection is replaced whole: anything you leave out is deactivated, and an empty array clears them all. An entry you send with an id is kept exactly as it is — its customer and service are not updated. To change an assignment, leave the old one out and send a new entry without an id. That is how the web screen works, and this API does not paper over it: an update that silently did nothing would be worse than a rule you can read.

Las asignaciones son de un proveedor, por eso cuelgan de /assignments/{supplierId} y por eso el proveedor no es un campo de cada entrada. La colección se reemplaza entera: lo que deje afuera se da de baja, y un arreglo vacío las borra todas. Una entrada que mande con id se conserva tal cual — su cliente y su servicio no se actualizan. Para cambiar una asignación, deje afuera la vieja y mande una nueva sin id. Así funciona la pantalla web, y esta API no lo disimula: una actualización que en silencio no hiciera nada sería peor que una regla que se pueda leer.

Settlements are read-only here. A run settles every supplier at once — it issues a delivery note and books a debt in each supplier's current account — so running one, and undoing one, are not published. What you can read is what was settled: the runs, and each run broken down supplier by supplier. description is human-readable text written when the run happened, in the language of whoever ran it; do not parse it.

Las liquidaciones acá son de solo lectura. Una corrida liquida a todos los proveedores de una —emite un remito y asienta deuda en la cuenta corriente de cada uno—, así que correr una, y deshacerla, no están publicados. Lo que sí se puede leer es lo que se liquidó: las corridas, y cada corrida abierta proveedor por proveedor. description es texto para leer, escrito en el momento de la corrida y en el idioma de quien la corrió; no lo parsee.

There is no way to remove a service: the web application only creates and edits them, and a service is referenced by its assignments and by every settlement already issued.

No hay forma de eliminar un servicio: la aplicación web sólo los crea y los edita, y un servicio está referenciado por sus asignaciones y por cada liquidación ya emitida.

EndpointWhat it does
GET /distributor-servicesPaged listing by name, with the tiers of each service.
GET /distributor-services/{serviceId}One service with its tiers.
POST /distributor-servicesCreates a service. Answers 201. name is required and unique within your account.
PUT /distributor-services/{serviceId}Partial update. levels absent leaves the tiers untouched; present replaces the whole collection — an entry with an id is updated, one without is created, one you leave out is deactivated.
GET /distributor-services/assignments/{supplierId}Which services this supplier's customers receive.
PUT /distributor-services/assignments/{supplierId}Replaces the supplier's whole set of assignments. An empty array clears them all.
GET /distributor-services/settlementsPaged listing of settlement runs, most recent first. Each entry is a run's totals across every supplier, and its date identifies it.
GET /distributor-services/settlements/{date}Breaks one run down supplier by supplier. 404 if there was no run on that date.
EndpointQué hace
GET /distributor-servicesListado paginado por nombre, con los niveles de cada servicio.
GET /distributor-services/{serviceId}Un servicio con sus niveles.
POST /distributor-servicesCrea un servicio. Responde 201. name es obligatorio y único dentro de su cuenta.
PUT /distributor-services/{serviceId}Actualización parcial. levels ausente conserva los niveles; presente reemplaza toda la colección — una entrada con id se actualiza, una sin id se crea, y una que deje afuera se da de baja.
GET /distributor-services/assignments/{supplierId}Qué servicios reciben los clientes de ese proveedor.
PUT /distributor-services/assignments/{supplierId}Reemplaza todo el conjunto de asignaciones del proveedor. Un arreglo vacío las borra todas.
GET /distributor-services/settlementsListado paginado de corridas de liquidación, de la más reciente a la más vieja. Cada entrada son los totales de una corrida sobre todos los proveedores, y su date es lo que la identifica.
GET /distributor-services/settlements/{date}Abre una corrida proveedor por proveedor. 404 si no hubo corrida esa fecha.

Payment ordersÓrdenes de pago

The voucher left behind by an outgoing payment. Read-only, and that is structural rather than a gap: a payment order is never created on its own. The application creates it inside the same database transaction that records the payment — either a cash register movement or a bank account movement. Recording that movement is what would create the order, and it is not available in this version. Printing the order is not available either: this API does not render documents.

El comprobante que queda de un pago realizado. Solo lectura, y no es un faltante sino algo estructural: una orden de pago nunca se crea sola. La aplicación la genera dentro de la misma transacción que registra el pago — sea un movimiento de caja o uno de cuenta bancaria. Registrar ese movimiento es lo que crearía la orden, y no está disponible en esta versión. Imprimir la orden tampoco: esta API no genera documentos.

EndpointWhat it does
GET /payment-ordersPaginated list, newest first. Filters: supplierId, from/to (ISO 8601, both optional).
GET /payment-orders/{paymentOrderId}A single payment order.
EndpointQué hace
GET /payment-ordersListado paginado, de la más nueva a la más vieja. Filtros: supplierId, from/to (ISO 8601, los dos opcionales).
GET /payment-orders/{paymentOrderId}Una orden de pago.

What you should know before using itLo que conviene saber antes de usarlo

  • amount is negative. The application stores an outgoing payment as a negative figure and this API reports the stored value rather than flipping it, so summing a period gives a negative total. Measured over the whole production database on 2026-09-21: 161,184 orders negative, 652 exactly zero, 11 positive.
  • origin tells you where the payment was recorded — cashRegister or bankAccount — and originMovementId is the id of that movement, which you can read through /cash-registers/{id}/movements or /bank-accounts/{id}/movements.
  • origin can be null. A small number of orders outlive the movement that produced it (about 110 across the whole production database). They are still listed, with origin and originMovementId null, because hiding them would silently change your totals.
  • supplierId can be null, and that is normal: roughly half of all orders are payments not recorded against a supplier account.
  • description is written by the application when the payment is recorded and is in Spanish, like the rows of a report. It is generated content, not a UI label.
  • There is no /deactivate or /activate: nothing in the application deactivates a payment order — the movement is deactivated and the order stays.
  • amount viene negativo. La aplicación guarda un egreso como número negativo y esta API publica el valor guardado sin darlo vuelta, así que sumar un período da un total negativo. Medido sobre toda la base de producción el 2026-09-21: 161.184 órdenes negativas, 652 en cero y 11 positivas.
  • origin dice dónde se registró el pago — cashRegister o bankAccount — y originMovementId es el id de ese movimiento, que puede leer por /cash-registers/{id}/movements o /bank-accounts/{id}/movements.
  • origin puede venir en null. Unas pocas órdenes sobreviven al movimiento que las generó (unas 110 en toda la base de producción). Se listan igual, con origin y originMovementId nulos, porque ocultarlas cambiaría sus totales en silencio.
  • supplierId puede venir en null, y es normal: alrededor de la mitad de las órdenes son pagos que no se registraron contra una cuenta de proveedor.
  • description la escribe la aplicación al registrar el pago y está en español, igual que las filas de un informe. Es contenido generado, no una etiqueta de interfaz.
  • No hay /deactivate ni /activate: nada en la aplicación desactiva una orden de pago — se desactiva el movimiento y la orden queda.

ReceiptsRecibos

Returnable packagingEnvases retornables

Which crate or bottle formats come back. This resource is the definition only: which container format is returnable, its brand and colour, and which supply backs its stock. Moving returnables around — assembling and breaking down crates — is not here: that lives in the bottling side of the application and stays out of this version, the same boundary that keeps mix-pack assembly out.

Creating one can create a supply. If your account has no supply named after the container yet, the application provisions one, because without it there is no returnable stock to count. Its id comes back as supplyId and is readable at /supplies.

Qué formatos de cajón o botella vuelven. Este recurso es solo la definición: qué formato de envase es retornable, su marca y su color, y qué insumo respalda su stock. La circulación —armar y desarmar cajas retornables— no está acá: vive del lado de envasado y queda fuera de esta versión, el mismo límite que deja afuera el armado de mix-packs.

Crear una puede crear un insumo. Si su cuenta todavía no tiene un insumo con el nombre del envase, la aplicación lo provisiona, porque sin él no hay stock de retornables que contar. Su id vuelve como supplyId y se lee en /supplies.

EndpointWhat it does
GET /returnable-packagingPaged listing. search (name, brand, colour), includeInactive, page, pageSize.
GET /returnable-packaging/{id}One definition, active or not.
POST /returnable-packagingCreates a definition. name and containerId are required. Answers 201. May provision a supply.
PUT /returnable-packaging/{id}Partial update. supplyId and active are read-only.
EndpointQué hace
GET /returnable-packagingListado paginado. search (nombre, marca, color), includeInactive, page, pageSize.
GET /returnable-packaging/{id}Una definición, activa o no.
POST /returnable-packagingCrea una definición. name y containerId son obligatorios. Responde 201. Puede provisionar un insumo.
PUT /returnable-packaging/{id}Actualización parcial. supplyId y active son de solo lectura.

Validation rulesReglas de validación

  • containerId is the same field the rest of this API calls containerId — the format catalog at /containers. It is not a separate "packaging" catalog.
  • supplyId is assigned on creation only. An update never reassigns the backing supply.
  • active is read-only: deactivating a definition stays a web-only operation in this version.
  • containerId es el mismo campo que el resto de esta API llama containerId — el catálogo de formatos de /containers. No es un catálogo de "packaging" aparte.
  • supplyId se asigna solo al crear. Una actualización nunca reasigna el insumo de respaldo.
  • active es de solo lectura: dar de baja una definición sigue siendo una operación solo de la web en esta versión.

CollectionsCobranzas

Money received from a customer, in one or more ways at once. Read-only in this version. A collection is not "a cash movement with another name": it is a composite operation that, in one transaction, issues a receipt with its own number, walks a list of payments against different destinations (a cash register, a bank account, a cheque), writes the customer's current account, and — when vouchers are sent — settles orders. That last part is out of scope, and recording the rest through this API is a separate decision that has not been taken.

Collections pending approval are listed. The web application's own listing cannot show them, because it joins the receipt and a pending collection has none yet; it uses a separate screen. Hiding them here would mean an integrator records a collection, gets a 200, and then cannot find it.

Dinero recibido de un cliente, de una o varias formas a la vez. Solo lectura en esta versión. Una cobranza no es «un movimiento de caja con otro nombre»: es una operación compuesta que, en una sola transacción, emite un recibo con número propio, recorre una lista de cobros contra distintos destinos (una caja, una cuenta bancaria, un cheque), escribe la cuenta corriente del cliente y —cuando se mandan comprobantes— salda pedidos. Esa última parte está fuera de alcance, y registrar el resto por esta API es una decisión aparte que todavía no se tomó.

Las cobranzas pendientes de aprobación SÍ se listan. El listado de la aplicación web no las puede mostrar, porque hace join con el recibo y una cobranza pendiente todavía no tiene; usa una pantalla aparte. Esconderlas acá significaría que un integrador registra una cobranza, recibe un 200 y después no la encuentra.

EndpointWhat it does
GET /collectionsPaged listing, most recent first. from, to (YYYY-MM-DD), customerId, approved, page, pageSize. Without the movements.
GET /collections/{id}One collection WITH the ids of the cash, bank and cheque movements it produced.
POST /collectionsRecords money received from a customer, into one or more destinations at once. date, customerId, chartOfAccountId and at least one payments entry are required. Answers 201 with the collection and its movement ids.
EndpointQué hace
GET /collectionsListado paginado, más recientes primero. from, to (YYYY-MM-DD), customerId, approved, page, pageSize. Sin los movimientos.
GET /collections/{id}Una cobranza CON los ids de los movimientos de caja, banco y cheques que generó.
POST /collectionsRegistra dinero recibido de un cliente, contra uno o varios destinos a la vez. date, customerId, chartOfAccountId y al menos un payments son obligatorios. Responde 201 con la cobranza y los ids de sus movimientos.

Validation rulesReglas de validación

  • approved and receiptId move together: the receipt is issued when the collection is approved. Accounts that do not use the approval flow get both at once.
  • The movement ids come only from GET /collections/{id}. A collection can pay into several destinations at once, so returning them in a page would multiply rows and the total would stop matching.
  • orderId can be read with GET /orders/{id} (orders are read-only).
  • The serialised grid state the underlying record carries is not published: it is screen state, not a contract.

Recording a collectionRegistrar una cobranza

  • Each entry of payments needs a destination: cash_register (with cashRegisterId) or bank_account (with bankAccountId AND bankPaymentTypeId). The total of the collection is the sum of the amounts; it is not sent separately.
  • bankPaymentTypeId is required on a bank payment and not optional: the column it feeds has a foreign key, and leaving it out used to reach the database as a zero and fail there.
  • Sending checkNumber creates a cheque and links it to the collection. It then needs bankId, checkIssueDate and checkDueDate. The cheque is readable afterwards at GET /checks.
  • All dates are ISO 8601 (YYYY-MM-DD), including the cheque's.
  • All or nothing. If any payment is rejected — a closed cash register, a cheque without its bank — nothing is written, not even the receipt.
  • It never settles orders, whatever you send. The customer's current account is credited; which orders that pays is not decided here. No electronic receipt, no withholdings, no credit notes either.
  • Two destinations the web offers are NOT available here, and the reason is measured (collections since 2026-06-01): the main cash register, 9% of use, because the web shows it only to users holding a specific permission and the integration user holds every permission the API declares; and the pure current-account entry, 0.5%, because no money moves and the collection would come back with no movements at all. What is offered covers 90% of real use.
  • Cada entrada de payments necesita un destination: cash_register (con cashRegisterId) o bank_account (con bankAccountId Y bankPaymentTypeId). El total de la cobranza es la suma de los importes; no se manda aparte.
  • bankPaymentTypeId es obligatorio en un cobro bancario y no opcional: la columna que alimenta tiene una clave foránea, y omitirlo llegaba a la base como un cero y rompía ahí.
  • Mandar checkNumber crea un cheque y lo liga a la cobranza. Entonces hacen falta bankId, checkIssueDate y checkDueDate. El cheque queda después en GET /checks.
  • Todas las fechas son ISO 8601 (YYYY-MM-DD), también las del cheque.
  • Todo o nada. Si un cobro se rechaza —una caja cerrada, un cheque sin su banco— no se escribe nada, ni siquiera el recibo.
  • Nunca salda pedidos, mande lo que mande. Se acredita la cuenta corriente del cliente; qué pedidos paga eso no se decide acá. Tampoco emite comprobante electrónico, ni toma retenciones, ni notas de crédito.
  • Dos destinos que la web ofrece NO están acá, y el motivo está medido (cobranzas desde el 2026-06-01): la caja grande, 9% del uso, porque la web la muestra sólo a usuarios con un permiso puntual y el usuario de integración tiene todos los permisos que la API declara; y el asiento manual en cuenta corriente, 0,5%, porque no se mueve dinero a ningún lado y la cobranza volvería sin ningún movimiento. Lo que sí se ofrece cubre el 90% del uso real.
  • approved y receiptId se mueven juntos: el recibo se emite cuando la cobranza se aprueba. Las cuentas que no usan el circuito de aprobación reciben los dos de una.
  • Los ids de los movimientos salen únicamente de GET /collections/{id}. Una cobranza puede pagar contra varios destinos a la vez, así que devolverlos en una página multiplicaría filas y el total dejaría de coincidir.
  • orderId se puede leer con GET /orders/{id} (los pedidos son de solo lectura).
  • El estado serializado de la grilla que guarda el registro no se publica: es estado de pantalla, no un contrato.

OrdersPedidos

Sales orders, from the moment they are entered — before any delivery note exists. Built for dashboards that follow what each sales rep sold this week. Read-only. Creating, editing, approving, changing the status of, delivering and invoicing an order are done in the application: the API reads, it never writes an order.

Los pedidos de venta, desde que se cargan — antes de que exista un remito. Pensado para tableros que siguen lo que vendió cada vendedor en la semana. Solo lectura. Crear, editar, aprobar, cambiar de estado, entregar y facturar un pedido se hace desde la aplicación: la API lee, nunca escribe un pedido.

EndpointWhat it does
GET /ordersPaged listing, most recent first (order date, then id). Without the items. Rate limit cost 2.
GET /orders/{id}One order WITH its items, discounts and taxes. Cost 1. 404 if it is not in your account.
GET /order-statusesThe statuses an order can be in.
GET /reasons/order-discountThe discount reasons of an item.
EndpointQué hace
GET /ordersListado paginado, más recientes primero (fecha del pedido, luego id). Sin los ítems. Costo 2.
GET /orders/{id}Un pedido CON sus ítems, bonificaciones e impuestos. Costo 1. 404 si no es de su cuenta.
GET /order-statusesLos estados en que puede estar un pedido.
GET /reasons/order-discountLos motivos de bonificación de un ítem.

Filters of the listingFiltros del listado

ParameterDefaultBehaviour
from, tono limitOrder date, YYYY-MM-DD or ISO 8601. to includes that whole day. from later than to answers 400 invalid_range
customerId—Orders of one customer
salesRepId—The sales rep recorded on the order, not the customer's current one
statusId—A value of /order-statuses; anything else answers 400 invalid_reference
includeQuotesfalseQuotes are left out unless you ask for them
includeCounterSalesfalseCounter sales are left out unless you ask for them
includeInactivefalseWith true, cancelled orders come too, with active: false
page, pageSize1, 50pageSize is capped at 200
ParámetroDefaultComportamiento
from, tosin límiteFecha del pedido, YYYY-MM-DD o ISO 8601. to incluye todo ese día. from posterior a to responde 400 invalid_range
customerId—Los pedidos de un cliente
salesRepId—El vendedor grabado en el pedido, no el vendedor actual del cliente
statusId—Un valor de /order-statuses; cualquier otro responde 400 invalid_reference
includeQuotesfalseLas cotizaciones quedan afuera salvo que las pida
includeCounterSalesfalseLas ventas de mostrador quedan afuera salvo que las pida
includeInactivefalseCon true vienen también los pedidos anulados, con active: false
page, pageSize1, 50pageSize tiene tope 200

Taxes and roundingImpuestos y redondeo

  • On the order, taxes = vat + internalTaxes + vatPerception (up to rounding of a cent) and total = totalWithoutTax + taxes. On the items of orders entered after May 2026 the same holds.
  • vat is plain VAT. The VAT perception (Argentina) travels apart in vatPerception and is included in taxes and in total. Elsewhere it is 0.
  • Items of orders entered up to May 2026 are published as they were stored, and may not meet the invariant: vat can be 0 with the VAT included in taxes, and vatPerception can come filled in without being added to the item's taxes or total. On those items total = totalWithoutTax + taxes still holds. The order's own amounts are right in every case: for a historical read, take VAT and totals from the order, not from its items.
  • internalTaxes are the country's excise taxes: Argentine internal taxes, Chilean ILA, Mexican IEPS, Peruvian ISC.
  • The order's amounts are authoritative: they are the ones that reach the current account and the invoice. In currencies without decimals (Chilean peso) the order is rounded to whole units and its items keep decimals, so the sum of the items can differ from the order by a few units. Never recompute the order from its items.
  • The tax rate is not published: read the amounts, do not recompute them.
  • En el pedido, taxes = vat + internalTaxes + vatPerception (al centavo) y total = totalWithoutTax + taxes. En los ítems de los pedidos cargados después de mayo de 2026 vale lo mismo.
  • vat es el IVA puro. La percepción de IVA (Argentina) viaja aparte en vatPerception y está incluida en taxes y en total. Fuera de Argentina es 0.
  • Los ítems de pedidos cargados hasta mayo de 2026 se publican como quedaron guardados y pueden no cumplir la invariante: vat puede venir en 0 con el IVA incluido en taxes, y vatPerception puede venir con valor sin estar sumada en el taxes ni en el total del ítem. En esos ítems total = totalWithoutTax + taxes sigue valiendo. Los importes del pedido están bien en todos los casos: para una lectura histórica, tome el IVA y los totales del pedido, no de sus ítems.
  • internalTaxes son los impuestos específicos del país: impuestos internos en Argentina, ILA en Chile, IEPS en México, ISC en Perú.
  • Los importes del pedido son los que valen: son los que van a la cuenta corriente y a la factura. En monedas sin decimales (peso chileno) el pedido se redondea a unidades enteras y los ítems conservan decimales, así que la suma de los ítems puede diferir del pedido en unas pocas unidades. Nunca recalcule el pedido desde sus ítems.
  • La alícuota no se publica: lea los importes, no los recalcule.

Validation rulesReglas de validación

  • The items come only from GET /orders/{id}; in the listing items is null. An order with no lines answers items: [].
  • A discount line has isDiscount: true, a zero quantity and negative amounts. When it discounts one item, discountedItemId points to it; a discount over the whole order has no discountedItemId.
  • Being a quote, waiting for approval and being cancelled are not statuses: they come as isQuote, pendingApproval and active.
  • A cancelled order is still returned by GET /orders/{id}, with active: false and its deletionReasonId (catalog /reasons/order-deletion). Cancelling switches its items off, so it comes back with items: [].
  • salesRepId refers to /sales-reps, which lists only active sales reps: an old order can point to one that is no longer listed.
  • currencyId null means the currency of your account. pointOfSaleId is the customer's branch (/customers/{id}/points-of-sale), not a counter sale.
  • Internal notes, payment status, address, phone and the public link token are not published.
  • Los ítems salen únicamente de GET /orders/{id}; en el listado items es null. Un pedido sin líneas responde items: [].
  • Una línea de bonificación tiene isDiscount: true, quantity en cero e importes negativos. Si bonifica un ítem, discountedItemId lo apunta; una bonificación sobre todo el pedido no tiene discountedItemId.
  • Ser cotización, estar pendiente de aprobación y estar anulado no son estados: vienen como isQuote, pendingApproval y active.
  • Un pedido anulado sigue saliendo por GET /orders/{id}, con active: false y su deletionReasonId (catálogo /reasons/order-deletion). Anular apaga sus ítems, así que vuelve con items: [].
  • salesRepId apunta a /sales-reps, que lista solo vendedores activos: un pedido viejo puede traer uno que ya no figura.
  • currencyId nulo significa la moneda de su cuenta. pointOfSaleId es la sucursal del cliente (/customers/{id}/points-of-sale), no una venta de mostrador.
  • Las notas internas, el estado de pago, la dirección, el teléfono y el token del link público no se publican.

Keeping a dashboard in syncCómo mantener un tablero sincronizado

An order does not record when it was last modified, so there is no modified since filter. Use a window: every few minutes, ask GET /orders?from=<start of the open window>&pageSize=200 — for example, the last two or three weeks —, page to the end and replace the whole window on your side. An edited order brings its new values; a cancelled one disappears (or comes with active: false if you ask includeInactive=true).

  • An order's date can be adjusted afterwards from the application: leave margin at the start of the window.
  • Rate limit: 2 per page of the listing, 1 per detail. Ask for the detail only of the orders whose total, statusId or totalLiters changed since your last pass.

Un pedido no guarda cuándo se modificó por última vez, así que no hay filtro modificado desde. Use una ventana: cada pocos minutos, pida GET /orders?from=<inicio de la ventana abierta>&pageSize=200 — por ejemplo, las últimas dos o tres semanas —, pagine hasta el final y reemplace la ventana entera de su lado. Un pedido editado trae sus valores nuevos; uno anulado desaparece (o viene con active: false si pide includeInactive=true).

  • La fecha de un pedido se puede ajustar después desde la aplicación: deje margen al inicio de la ventana.
  • Rate limit: 2 por página del listado, 1 por detalle. Pida el detalle solo de los pedidos cuyo total, statusId o totalLiters cambió desde su última pasada.

Delivery notesRemitos

What physically left, and to whom. Read-only in this version. That is not caution, it is where the two ways of creating a delivery note lead: measured in production on 2026-09-21, 2,099,425 of 2,160,909 delivery notes (97.2 %) belong to an order, so issuing one means issuing it for an order, which is out of scope; and the remaining 2.8 % come mostly from the supplier-commission settlement, which is out of scope too. There is no third path an integrator should be able to use.

Not to be confused with dispatch rounds, which are a different thing and also out of scope. A note with neither customerId nor supplierId is a transfer between warehouses — a real and common case, 42,622 of them in production.

Qué salió físicamente, y hacia quién. Solo lectura en esta versión. No es prudencia, es adónde llevan los dos caminos de alta que existen: medido en producción el 2026-09-21, 2.099.425 de 2.160.909 remitos (97,2 %) pertenecen a un pedido, así que emitir uno significa emitirlo para un pedido, que está fuera de alcance; y el 2,8 % restante sale mayormente de la liquidación de comisiones a proveedores, que también lo está. No queda una tercera vía que un integrador deba poder usar.

No confundir con las hojas de ruta, que son otra cosa y también están fuera de alcance. Un remito sin customerId ni supplierId es una transferencia entre depósitos — un caso real y frecuente, 42.622 en producción.

EndpointWhat it does
GET /delivery-notesPaged listing, most recent first. from, to (YYYY-MM-DD), customerId, supplierId, page, pageSize. Without the items.
GET /delivery-notes/{id}One delivery note WITH its items.
EndpointQué hace
GET /delivery-notesListado paginado, más recientes primero. from, to (YYYY-MM-DD), customerId, supplierId, page, pageSize. Sin los ítems.
GET /delivery-notes/{id}Un remito CON sus ítems.

Validation rulesReglas de validación

  • The items come only from GET /delivery-notes/{id}. A note has several lines, so returning them inside a page would multiply rows and the total would stop matching.
  • orderId is the order the note fulfils: read it with GET /orders/{id}.
  • A line points at exactly one of productId / supplyId / kegId. description is always there, so a consumer that resolves no ids still knows what went out.
  • The signed proof of delivery (signature, name, coordinates) and the public link token are not published: they are the mobile app's delivery evidence, not integration data.
  • Los ítems salen únicamente de GET /delivery-notes/{id}. Un remito tiene varias líneas, así que devolverlas dentro de una página multiplicaría filas y el total dejaría de coincidir.
  • orderId es el pedido que el remito cumple: se lee con GET /orders/{id}.
  • Una línea apunta a exactamente uno de productId / supplyId / kegId. La description va siempre, para que un consumidor que no resuelva ningún id igual sepa qué salió.
  • La prueba de entrega firmada (firma, aclaración, coordenadas) y el token del link público no se publican: son la evidencia de entrega de la app, no datos de integración.

The voucher left behind by an incoming payment. Read-only, for the same structural reason as payment orders: a receipt is never created on its own — the application creates it inside the same transaction that records the collection. The electronic receipt and the PDF are out of scope.

El comprobante que queda de un cobro. Solo lectura, por la misma razón estructural que las órdenes de pago: un recibo nunca se crea solo — la aplicación lo genera dentro de la misma transacción que registra la cobranza. El recibo electrónico y el PDF quedan fuera de alcance.

EndpointWhat it does
GET /receiptsPaginated list, newest first. Filters: customerId, supplierId, from/to (ISO 8601), includeInactive.
GET /receipts/{receiptId}A single receipt, with the movements it covers.
EndpointQué hace
GET /receiptsListado paginado, del más nuevo al más viejo. Filtros: customerId, supplierId, from/to (ISO 8601), includeInactive.
GET /receipts/{receiptId}Un recibo, con los movimientos que cubre.

What you should know before using itLo que conviene saber antes de usarlo

  • A receipt can cover more than one movement. That is why cashMovementIds and bankMovementIds are returned only by GET /receipts/{receiptId} and are always null in the list: resolving them there would multiply rows and break paging.
  • Exactly one of customerId/supplierId is populated. Almost every receipt is issued to a customer; receipts against a supplier are rare.
  • amount is normally positive — unlike a payment order, which is stored negative. A small number are negative (12,727 of 823,931 across the whole production database on 2026-09-21); those are corrections, not a different kind of receipt.
  • Receipts do get deactivated (unlike payment orders), so active is real information. By default only active ones are listed; pass includeInactive=true for the rest.
  • description is written by the application and is in Spanish, like the rows of a report.
  • Un recibo puede cubrir más de un movimiento. Por eso cashMovementIds y bankMovementIds se devuelven solo en GET /receipts/{receiptId} y vienen siempre en null en el listado: resolverlos ahí multiplicaría filas y rompería la paginación.
  • Viene exactamente uno de customerId/supplierId. Casi todos los recibos son a un cliente; los emitidos contra un proveedor son raros.
  • amount es normalmente positivo — al revés que una orden de pago, que se guarda negativa. Unos pocos son negativos (12.727 de 823.931 en toda la base de producción al 2026-09-21): son correcciones, no otro tipo de recibo.
  • Los recibos sí se desactivan (a diferencia de las órdenes de pago), así que active es información real. Por defecto solo se listan los activos; pase includeInactive=true para traer el resto.
  • description la escribe la aplicación y está en español, igual que las filas de un informe.

DebtorsDeudores

The customers of your account that owe money, with their debt broken down by age. A calculated view, not a stored entity: read-only, nothing here can be written.

Los clientes de su cuenta que deben plata, con su deuda desglosada por antigüedad. Es una vista calculada, no una entidad guardada: solo lectura, acá no se escribe nada.

EndpointWhat it does
GET /debtorsPaginated list, largest debt first. Filters: asOf (ISO 8601, defaults to now), customerTypeId, includeZeroBalance (default false).
EndpointQué hace
GET /debtorsListado paginado, de mayor a menor deuda. Filtros: asOf (ISO 8601, por defecto ahora), customerTypeId, includeZeroBalance (por defecto false).

What you should know before using itLo que conviene saber antes de usarlo

  • Every page costs the whole computation. Paging bounds the response, not the work behind it: the underlying query walks every active customer of your account and its current account, orders and kegs. That is why this endpoint has a rate-limit cost of 40, the highest of the API. Fetch it and cache it — do not poll it page by page in a loop.
  • Only customerId is published. The customer's name, sales rep, category and payment terms are not repeated here: read them from /customers/{customerId}, which is the one source that stays current.
  • The six aging buckets add up to balance: 1–14, 15–29, 30–44, 45–59, 60–89 and 90+ days.
  • deliveryNoteBalance is the part of the balance that was delivered on a delivery note and is not invoiced yet; invoicedBalance is the rest. The two add up to balance.
  • By default only customers with a positive balance are returned. Pass includeZeroBalance=true to get the rest as well.
  • Cada página cuesta el cálculo entero. Paginar acota la respuesta, no el trabajo que hay detrás: la consulta recorre todos los clientes activos de su cuenta con su cuenta corriente, sus pedidos y sus barriles. Por eso este endpoint tiene un costo de rate limit de 40, el más alto de la API. Tráigalo y cachelo — no lo consulte página por página en un bucle.
  • Solo se publica customerId. El nombre del cliente, su vendedor, su categoría y sus condiciones de pago no se repiten acá: léalos de /customers/{customerId}, que es la única fuente que queda al día.
  • Los seis tramos de antigüedad suman balance: 1–14, 15–29, 30–44, 45–59, 60–89 y 90+ días.
  • deliveryNoteBalance es la parte del saldo entregada con remito y todavía no facturada; invoicedBalance es el resto. Las dos suman balance.
  • Por defecto solo salen los clientes con saldo positivo. Pase includeZeroBalance=true para traer también el resto.

CatalogsCatálogos

Several fields of a customer take their value from a closed list. Read the list, let the user pick, send the value. None of these lists is enumerated in the specification, because none of them is the same for everyone: some depend on your account's country, the rest are your own data. If a catalog answers an empty array, there is nothing to choose from — leave the field unset.

Varios campos de un cliente toman su valor de una lista cerrada. Lea la lista, deje elegir al usuario, mande el valor. Ninguna de estas listas se enumera en la especificación porque ninguna es igual para todos: algunas dependen del país de su cuenta y el resto son datos suyos. Si un catálogo responde un arreglo vacío, no hay nada para elegir: deje el campo sin asignar.

CatalogFills the fieldWhat it depends on
GET /tax-conditionstaxConditionIdYour account's country
GET /provincesprovinceIdYour account's country — province, state or region
GET /payment-termspaymentTermsIdYour account's country
GET /currenciescurrencyIdYour account. null means your default currency
GET /customer-typescustomerTypeIdYour account — standard types plus the ones you defined. Full CRUD, see Customer types
GET /price-listspriceListIdYour account. null means the default list
GET /sales-repssalesRepIdYour account — active users with a sales role
GET /logistics-providerslogisticsProviderIdYour account. Empty if you do not use them
GET /customer-categoriescategoryId assigned via /customers/{customerId}/categoriesYour account. Full CRUD, see Customer categories
CatálogoCompleta el campoDe qué depende
GET /tax-conditionstaxConditionIdEl país de su cuenta
GET /provincesprovinceIdEl país de su cuenta — provincia, estado o región
GET /payment-termspaymentTermsIdEl país de su cuenta
GET /currenciescurrencyIdSu cuenta. null es su moneda por defecto
GET /customer-typescustomerTypeIdSu cuenta — los tipos estándar más los que usted definió. CRUD completo, ver Tipos de cliente
GET /price-listspriceListIdSu cuenta. null es la lista por defecto
GET /sales-repssalesRepIdSu cuenta — usuarios activos con rol de venta
GET /logistics-providerslogisticsProviderIdSu cuenta. Vacío si no los usa
GET /customer-categoriescategoryId asignado vía /customers/{customerId}/categoriesSu cuenta. CRUD completo, ver Categorías de cliente

Catalogs for suppliers, purchases, products and production

Catálogos de proveedores, compras, productos y producción

Same shape and same rule as the ones above: read the list, let the user pick, send the id. Several are shared with the customer — /currencies, /provinces and /tax-conditions fill the equivalent fields of a supplier.

Misma forma y misma regla que los de arriba: lea la lista, deje elegir al usuario, mande el id. Varios se comparten con el cliente: /currencies, /provinces y /tax-conditions completan los campos equivalentes de un proveedor.

CatalogFills the fieldWhat it depends on
GET /supplier-typessupplierTypeId of a supplierFixed set. Only the logistics type can be a customer's logistics provider
GET /supplier-categoriescategoryId of a supplierYour account
GET /expense-accountsdefaultAccountId of a supplier, accountId of a purchaseYour account — expense and mixed accounts only
GET /purchase-typespurchaseTypeId of a purchaseFixed set: purchase, or credit note
GET /voucher-typesvoucherTypeId of a purchaseThe tax rules of your country. Includes retired types, which the application also still offers
GET /payment-typespaymentTypeId of a purchaseFixed set
GET /unitsunitId of a purchase lineFixed set. Must be convertible to the supply's base unit
GET /complementary-productscomplementaryProductId of a purchase lineYour account. The only products a purchase can stock
GET /purchasable-servicesserviceId of a purchase lineYour account. Administered at Services
GET /spare-partssparePartId of a purchase lineYour account. Administered at Spare parts. It is the listing endpoint, not a separate catalog
GET /warehouseswarehouseId of a purchase lineYour account, narrowed to what your integration user may use. It is the listing endpoint, not a separate catalog
GET /supplierssupplierId of a purchase or of a productYour account. It is the listing endpoint, not a separate catalog
GET /product-typesproductTypeId of a productFixed set
GET /product-categoriescategoryIds of a productYour account — standard categories plus yours
GET /containerscontainerId of a product's container priceYour account — standard containers plus your returnables
GET /casescaseId of a product's case priceYour account — standard cases plus yours
GET /production-stagesstageId of a batchFixed set: planned, brewing, fermenting, maturing, filtering, finished
GET /brewable-productsproducedProductId of a batch or of a recipeYour account — only what your brewery makes itself, so narrower than /products
GET /tankstankId of a batch or of a taskYour account — every active tank, free or not
GET /recipesrecipeId of a batchYour account
GET /measurement-typesmeasurementTypeId of a task or of a completionFixed set. Only a temperature may be negative
GET /task-definitionstaskDefinitionId of a task, parentTaskId of a definitionYour account plus the shared definitions. It is also a full resource
GET /usersassignedUserId of a taskYour account — id and name only, never e-mail or role
GET /raw-material-typessupplyTypeId of a recipe ingredientFixed set: malt, hops, yeast, adjuncts
GET /raw-material-usesuseId of a recipe ingredientFixed set: mash, boil, whirlpool, dry hopping
GET /productsproductId of a price and of a mix pack itemYour account. It is the listing endpoint, not a separate catalog
CatálogoCompleta el campoDe qué depende
GET /supplier-typessupplierTypeId de un proveedorSet fijo. Solo el tipo logística puede ser proveedor de logística de un cliente
GET /supplier-categoriescategoryId de un proveedorSu cuenta
GET /expense-accountsdefaultAccountId de un proveedor, accountId de una compraSu cuenta — solo cuentas de egreso y mixtas
GET /purchase-typespurchaseTypeId de una compraSet fijo: compra, o nota de crédito
GET /voucher-typesvoucherTypeId de una compraLas reglas fiscales de su país. Incluye los dados de baja, que la aplicación también sigue ofreciendo
GET /payment-typespaymentTypeId de una compraSet fijo
GET /unitsunitId de una línea de compraSet fijo. Tiene que ser convertible a la unidad base del insumo
GET /complementary-productscomplementaryProductId de una línea de compraSu cuenta. Son los únicos productos que una compra puede ingresar a stock
GET /purchasable-servicesserviceId de una línea de compraSu cuenta. Administrado en Servicios
GET /spare-partssparePartId de una línea de compraSu cuenta. Administrado en Repuestos. Es el endpoint de listado, no un catálogo aparte
GET /warehouseswarehouseId de una línea de compraSu cuenta, limitado a lo que su usuario de integración puede usar. Es el endpoint de listado, no un catálogo aparte
GET /supplierssupplierId de una compra o de un productoSu cuenta. Es el endpoint de listado, no un catálogo aparte
GET /product-typesproductTypeId de un productoSet fijo
GET /product-categoriescategoryIds de un productoSu cuenta — las categorías estándar más las suyas
GET /containerscontainerId del precio por envase de un productoSu cuenta — los envases estándar más sus retornables
GET /casescaseId del precio por caja de un productoSu cuenta — las cajas estándar más las suyas
GET /production-stagesstageId de un loteSet fijo: planificado, cocción, fermentación, maduración, filtrado, finalizado
GET /brewable-productsproducedProductId de un lote o de una recetaSu cuenta — solo lo que su cervecería produce, así que es más acotado que /products
GET /tankstankId de un lote o de una tareaSu cuenta — todos los tanques activos, libres u ocupados
GET /recipesrecipeId de un loteSu cuenta
GET /measurement-typesmeasurementTypeId de una tarea o de un completadoSet fijo. Solo una temperatura puede ser negativa
GET /task-definitionstaskDefinitionId de una tarea, parentTaskId de una definiciónSu cuenta más las definiciones compartidas. Es también un recurso completo
GET /usersassignedUserId de una tareaSu cuenta — solo id y nombre, nunca mail ni rol
GET /raw-material-typessupplyTypeId de un ingrediente de recetaSet fijo: malta, lúpulo, levadura, adjuntos
GET /raw-material-usesuseId de un ingrediente de recetaSet fijo: macerado, hervor, whirlpool, dry hopping
GET /productsproductId de un precio y de un ítem de mix packSu cuenta. Es el endpoint de listado, no un catálogo aparte

Catalogs published ahead of their resource

Catálogos publicados antes que su recurso

These are readable now, but the resources that consume them — orders, invoices, collections, stock, kegs — are not in this version. They are here so you can map your own identifiers against ours before those endpoints exist, and so that nothing changes underneath you when they arrive: the list you read today is the list the write will validate against.

Estos se pueden leer ya, pero los recursos que los consumen —pedidos, facturas, cobranzas, stock, barriles— no están en esta versión. Están para que pueda mapear sus identificadores contra los nuestros antes de que existan esos endpoints, y para que nada cambie abajo suyo cuando lleguen: la lista que lee hoy es la lista contra la que va a validar la escritura.

Two notes worth reading before you cache any of them. ilaCode on a product accepts free text today and is not checked against /ila-types — treat that catalog as guidance, not as an enforced set. And /keg-volumes is the only one here that is your own data rather than a system table, which is why it is the only one that asks for a module.

Dos advertencias antes de cachear cualquiera de estos. El ilaCode de un producto hoy acepta texto libre y no se valida contra /ila-types: ese catálogo es orientativo, no un set exigido. Y /keg-volumes es el único de esta lista que son datos suyos y no una tabla del sistema, y por eso es el único que pide módulo.

CatalogFills the fieldWhat it depends on
GET /sales-taxesthe tax fields of an order or an invoiceYour country. The rate is not published — the system computes each amount
GET /purchase-taxesthe tax fields of a purchaseYour country. A different set from /sales-taxes
GET /perceptionsthe perception fields of a purchase or an invoiceYour country. Perceptions are part of the document total
GET /ila-typesilaCode of a productChile only, and on what your account sells. Keyed by code
GET /keg-typeskegTypeId of a kegFixed set
GET /keg-volumesthe volume of a kegYour account's configuration. Keyed by code, always in invariant format
GET /tap-system-typestapSystemTypeId of a tap systemFixed set
GET /reasons/keg-returnthe return reason of a kegYour account: two reasons are only offered to distributors
GET /reasons/order-deletionthe reason of an order cancellationFixed set
GET /reasons/order-discountthe reason of a discounted order line (discountReasonId of an order item)Fixed set. Required in Mexico, Chile and Costa Rica
GET /order-statusesstatusId of an order, and its filterFixed set: pending, in process, ready to deliver, delivered
GET /stock-movement-typesthe type of a stock movementFixed set: goods in, goods out, stock count, write-off
GET /warehouse-typeswarehouseTypeId of a warehouseFixed set: cold room or warehouse
GET /waste-typeswasteTypeId of a recorded lossFixed set
GET /tank-typestankTypeId of a tankFixed set
GET /wood-typeswoodTypeId of a barrel tankFixed set
GET /banksbankId of a bank account or a chequeYour country. Real bank names, not translated
GET /bank-account-typesbankAccountTypeId of a bank accountFixed set: current or savings
GET /bank-payment-typespaymentTypeId of a bank movementFixed set. A subset of /payment-types
GET /bank-movement-typestypeId of a bank movementFixed set: income or expense
GET /account-categoriesexpenseCategoryId of a chart-of-accounts entryYour account. Read-only: account categories have their own CRUD in the web application, not published as a resource here
GET /check-statusesthe status of a chequeFixed set: in portfolio, handed over, cashed, deleted
GET /check-kindsthe kind of a chequeFixed set: your own, or a third party's
GET /withholding-typeswithholdingTypeId of a collectionYour country. Empty where withholdings do not exist
GET /rolesthe roles of a userFixed set, the same for every account
CatálogoCompleta el campoDe qué depende
GET /sales-taxeslos impuestos de un pedido o una facturaSu país. La alícuota no se publica: el importe lo calcula el sistema
GET /purchase-taxeslos impuestos de una compraSu país. Es un set distinto de /sales-taxes
GET /perceptionslas percepciones de una compra o una facturaSu país. Las percepciones están dentro del total del comprobante
GET /ila-typesilaCode de un productoSolo Chile, y de qué vende su cuenta. Va por código
GET /keg-typeskegTypeId de un barrilSet fijo
GET /keg-volumesel volumen de un barrilLa configuración de su cuenta. Va por código, siempre en formato invariante
GET /tap-system-typestapSystemTypeId de una choperaSet fijo
GET /reasons/keg-returnel motivo de devolución de un barrilSu cuenta: dos motivos se ofrecen solo a distribuidoras
GET /reasons/order-deletionel motivo de anulación de un pedidoSet fijo
GET /reasons/order-discountel motivo de bonificación de una línea (discountReasonId de un ítem de pedido)Set fijo. Obligatorio en México, Chile y Costa Rica
GET /order-statusesstatusId de un pedido, y su filtroSet fijo: pendiente, en proceso, listo para entregar, entregado
GET /stock-movement-typesel tipo de un movimiento de stockSet fijo: ingreso, egreso, control, desecho
GET /warehouse-typeswarehouseTypeId de un depósitoSet fijo: cámara o depósito
GET /waste-typeswasteTypeId de una mermaSet fijo
GET /tank-typestankTypeId de un tanqueSet fijo
GET /wood-typeswoodTypeId de un tanque de barricaSet fijo
GET /banksbankId de una cuenta bancaria o un chequeSu país. Son nombres reales de banco: no se traducen
GET /bank-account-typesbankAccountTypeId de una cuenta bancariaSet fijo: cuenta corriente o caja de ahorro
GET /bank-payment-typespaymentTypeId de un movimiento bancarioSet fijo. Es un subconjunto de /payment-types
GET /bank-movement-typestypeId de un movimiento bancarioSet fijo: ingreso o egreso
GET /account-categoriesexpenseCategoryId de una cuenta del plan de cuentasSu cuenta. Solo lectura: las categorías de cuenta tienen su propio CRUD en la aplicación web, no se publican como recurso acá
GET /check-statusesel estado de un chequeSet fijo: en cartera, entregado, cobrado, eliminado
GET /check-kindsel origen de un chequeSet fijo: propios o de terceros
GET /withholding-typeswithholdingTypeId de una cobranzaSu país. Vacío donde la figura no existe
GET /roleslos roles de un usuarioSet fijo, igual para todas las cuentas

Fiscal catalogs, by country

Catálogos fiscales, según el país

These come from the tax authority, so their key is a code (code, text) and not a number — send it exactly as returned, leading zeros included. Outside their country they answer with an empty array, because the field does not apply there.

Estos vienen del organismo fiscal, así que su clave es un código (code, texto) y no un número: mándelo tal cual, con los ceros a la izquierda incluidos. Fuera de su país responden un arreglo vacío, porque el campo no aplica.

CatalogFills the fieldCountry
GET /tax-systemstaxSystemMexico — tax regime
GET /invoice-usesinvoiceUseMexico — CFDI use
GET /payment-formspaymentFormMexico — SAT payment form
GET /payment-methodspaymentMethodMexico — SAT payment method
GET /dispatch-typesdispatchTypeChile — dispatch notes
CatálogoCompleta el campoPaís
GET /tax-systemstaxSystemMéxico — régimen fiscal
GET /invoice-usesinvoiceUseMéxico — uso del CFDI
GET /payment-formspaymentFormMéxico — forma de pago SAT
GET /payment-methodspaymentMethodMéxico — método de pago SAT
GET /dispatch-typesdispatchTypeChile — guías de despacho

Do not confuse paymentForm with paymentTermsId: the first is the tax authority's code, the second is the commercial terms you agreed with the customer.

No confunda paymentForm con paymentTermsId: el primero es el código del organismo fiscal, el segundo es la condición comercial que usted acordó con el cliente.

All of them answer with the same shape, so one function in your code handles every catalog: an array of { "id": <number>, "name": <string> }, or { "code": <string>, "name": <string> } for the fiscal ones. Send the id or the code; name is there for you to display.

Todos responden con la misma forma, así que una sola función de su código resuelve cualquier catálogo: un arreglo de { "id": <número>, "name": <texto> }, o { "code": <texto>, "name": <texto> } en los fiscales. Mande el id o el code; name está para que usted lo muestre.

An id that is not in its catalog is rejected with 400 invalid_reference, and the message names both the field and the catalog to read. So a price list belonging to another account, or a province of another country, never gets written.

Un id que no esté en su catálogo se rechaza con 400 invalid_reference, y el mensaje indica el campo y el catálogo que hay que leer. Así, una lista de precios de otra cuenta o una provincia de otro país nunca llegan a escribirse.

Cache them: these lists change rarely — country reference data changes when the tax rules do, and the rest when you edit them in the application. Refetching them on every write is wasted rate limit.

Cachelos: estas listas cambian poco — las de referencia del país cuando cambian las reglas fiscales, y las suyas cuando usted las edita en la aplicación. Volver a pedirlas en cada escritura es gastar límite de tasa al pedo.

AI agents (MCP)Agentes de IA (MCP)

If you are connecting an AI agent rather than writing code, this account also speaks the Model Context Protocol. Point your MCP client at:

https://<your-host>/mcp
Authorization: Bearer <apiKey>

Same API key as POST /api/v1/auth/login — there is nothing extra to request. The transport is Streamable HTTP; the legacy SSE endpoints are also served for older clients.

Connecting from Claude (OAuth)

Claude's native connectors (web, desktop and mobile) cannot send a fixed header, so this server also speaks OAuth 2.1. In Claude, go to Settings › Connectors › Add custom connector, enter https://<your-host>/mcp and leave the client ID and secret empty. Claude discovers the authorization server on its own, registers itself, and opens a page where you paste the account's API key once. From then on Claude holds short-lived tokens, never the key.

  • Discovery follows RFC 9728 and RFC 8414: /.well-known/oauth-protected-resource/mcp and /.well-known/oauth-authorization-server. Dynamic client registration (RFC 7591) and PKCE with S256 are supported and required, respectively.
  • The account needs API access enabled, exactly as for POST /api/v1/auth/login: the authorization page runs that same login.
  • Rotating the API key disconnects Claude. The authorization is bound to the key that was pasted; if the account's key changes, the next request is rejected and the user has to connect again.

It exposes 18 tools covering the same customer operations documented above: searching, reading, creating and updating customers, their points of sale and their contacts, plus the catalogs. Writes included — an agent is a client like any other.

It is the same API underneath. Every request the agent makes goes through /api/v1, so the permissions, the rate limits, the validation rules and the audit trail are exactly the ones described on this page. Nothing is relaxed because the caller is an agent.

Two things worth knowing before you wire it up:

  • The API key never reaches the model. Your MCP client sends it in the header; the model sees tool names, arguments and results. Revoking access means rotating the key, not asking the agent to forget it.
  • Writes are real and immediate. They are auditable and reversible — /deactivate undoes an unwanted customer — but there is no preview step. If you want a human to confirm before each write, that is a setting in your MCP client, not here.

You do not need MCP to use this API. If you are writing an integration, the REST endpoints above are the contract, and they are not going anywhere.

Si lo que va a conectar es un agente de IA en vez de escribir código, esta cuenta también habla Model Context Protocol. Apunte su cliente MCP a:

https://<su-host>/mcp
Authorization: Bearer <apiKey>

La misma API key de POST /api/v1/auth/login: no hay nada extra que pedir. El transporte es Streamable HTTP; también se sirven los endpoints SSE antiguos para clientes viejos.

Conectarse desde Claude (OAuth)

Los conectores nativos de Claude (web, desktop y mobile) no pueden mandar una cabecera fija, así que este servidor también habla OAuth 2.1. En Claude, vaya a Settings › Connectors › Add custom connector, ingrese https://<su-host>/mcp y deje vacíos el client ID y el secret. Claude descubre solo el servidor de autorización, se registra y abre una página donde se pega una vez la API key de la cuenta. Desde ahí Claude guarda tokens de vida corta, nunca la clave.

  • El descubrimiento sigue RFC 9728 y RFC 8414: /.well-known/oauth-protected-resource/mcp y /.well-known/oauth-authorization-server. Se soporta el registro dinámico de clientes (RFC 7591) y PKCE con S256 es obligatorio.
  • La cuenta necesita el acceso por API habilitado, igual que para POST /api/v1/auth/login: la página de autorización hace ese mismo login.
  • Rotar la API key desconecta a Claude. La autorización queda atada a la clave que se pegó; si la clave de la cuenta cambia, el próximo pedido se rechaza y hay que volver a conectar.

Expone 18 herramientas que cubren las mismas operaciones de clientes documentadas arriba: buscar, leer, crear y modificar clientes, sus puntos de venta y sus contactos, más los catálogos. Escrituras incluidas — un agente es un cliente como cualquier otro.

Por debajo es la misma API. Cada pedido del agente pasa por /api/v1, así que los permisos, los límites de uso, las reglas de validación y la auditoría son exactamente los de esta página. No se afloja nada porque quien llama sea un agente.

Dos cosas que conviene saber antes de conectarlo:

  • La API key nunca llega al modelo. Su cliente MCP la manda en la cabecera; el modelo ve nombres de herramientas, argumentos y respuestas. Revocar el acceso es rotar la clave, no pedirle al agente que la olvide.
  • Las escrituras son reales e inmediatas. Quedan auditadas y son reversibles —/deactivate deshace un cliente que no iba— pero no hay paso de vista previa. Si quiere que una persona confirme cada escritura, eso se configura en su cliente MCP, no acá.

No hace falta MCP para usar esta API. Si está escribiendo una integración, los endpoints REST de arriba son el contrato, y no se van a ningún lado.